Skip to content

Commit

Permalink
chore: rename range slider control
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Oct 16, 2023
1 parent 13293fe commit 13078e3
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/next-ts/pages/range-slider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as slider from "@zag-js/slider"
import { normalizeProps, useMachine } from "@zag-js/react"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import serialize from "form-serialize"
import { useId } from "react"
import { StateVisualizer } from "../components/state-visualizer"
import { Toolbar } from "../components/toolbar"
import { useControls } from "../hooks/use-controls"

export default function Page() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/next-ts/pages/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { normalizeProps, useMachine } from "@zag-js/react"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import * as slider from "@zag-js/slider"
import serialize from "form-serialize"
import { useId } from "react"
Expand All @@ -8,7 +8,7 @@ import { Toolbar } from "../components/toolbar"
import { useControls } from "../hooks/use-controls"

export default function Page() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-ts/pages/range-slider.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import * as slider from "@zag-js/slider"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import { normalizeProps, useMachine } from "@zag-js/vue"
import serialize from "form-serialize"
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)
const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-ts/pages/slider.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import * as slider from "@zag-js/slider"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import serialize from "form-serialize"
import { normalizeProps, useMachine } from "@zag-js/vue"
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)
const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/solid-ts/src/pages/range-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as slider from "@zag-js/slider"
import { normalizeProps, useMachine } from "@zag-js/solid"
import serialize from "form-serialize"
import { createMemo, For, createUniqueId } from "solid-js"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import { StateVisualizer } from "../components/state-visualizer"
import { Toolbar } from "../components/toolbar"
import { useControls } from "../hooks/use-controls"

export default function Page() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/solid-ts/src/pages/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as slider from "@zag-js/slider"
import { normalizeProps, useMachine } from "@zag-js/solid"
import serialize from "form-serialize"
import { For, createMemo, createUniqueId } from "solid-js"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import { StateVisualizer } from "../components/state-visualizer"
import { Toolbar } from "../components/toolbar"
import { useControls } from "../hooks/use-controls"

export default function Page() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(slider.machine({ id: createUniqueId(), value: [0] }), {
context: controls.context,
Expand Down
4 changes: 2 additions & 2 deletions examples/vue-ts/src/pages/range-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as slider from "@zag-js/slider"
import { normalizeProps, useMachine } from "@zag-js/vue"
import serialize from "form-serialize"
import { computed, defineComponent, h, Fragment } from "vue"
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import { StateVisualizer } from "../components/state-visualizer"
import { useControls } from "../hooks/use-controls"

Expand All @@ -11,7 +11,7 @@ import { Toolbar } from "../components/toolbar"
export default defineComponent({
name: "RangeSlider",
setup() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(
slider.machine({
Expand Down
4 changes: 2 additions & 2 deletions examples/vue-ts/src/pages/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { rangeSliderControls } from "@zag-js/shared"
import { sliderControls } from "@zag-js/shared"
import * as slider from "@zag-js/slider"
import { normalizeProps, useMachine } from "@zag-js/vue"
import serialize from "form-serialize"
Expand All @@ -11,7 +11,7 @@ import { Toolbar } from "../components/toolbar"
export default defineComponent({
name: "Slider",
setup() {
const controls = useControls(rangeSliderControls)
const controls = useControls(sliderControls)

const [state, send] = useMachine(
slider.machine({
Expand Down
2 changes: 1 addition & 1 deletion shared/src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const radioControls = defineControls({
readOnly: { type: "boolean", defaultValue: false },
})

export const rangeSliderControls = defineControls({
export const sliderControls = defineControls({
disabled: { type: "boolean", defaultValue: false },
readOnly: { type: "boolean", defaultValue: false },
orientation: { type: "select", options: ["horizontal", "vertical"] as const, defaultValue: "horizontal" },
Expand Down

0 comments on commit 13078e3

Please sign in to comment.