@serendie/ui 3.2.1 → 3.2.2-dev.202604270058

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/client.js +35 -32
  2. package/dist/components/BottomNavigation/BottomNavigation.js +12 -11
  3. package/dist/components/DataTable/table/BodyCell.js +3 -2
  4. package/dist/components/DataTable/table/HeaderCell.js +13 -12
  5. package/dist/components/DataTable/table/Root.js +5 -4
  6. package/dist/components/Slider/Slider.d.ts +47 -0
  7. package/dist/components/Slider/Slider.js +232 -0
  8. package/dist/components/Slider/index.d.ts +1 -0
  9. package/dist/components/Slider/index.js +5 -0
  10. package/dist/components/Tabs/TabItem.js +12 -11
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +39 -36
  13. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-context.js +5 -0
  14. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-control.js +16 -0
  15. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-dragging-indicator.js +18 -0
  16. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-hidden-input.js +17 -0
  17. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-label.js +16 -0
  18. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-marker-group.js +16 -0
  19. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-marker.js +17 -0
  20. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-range.js +16 -0
  21. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-root-provider.js +20 -0
  22. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-root.js +46 -0
  23. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-thumb.js +21 -0
  24. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-track.js +16 -0
  25. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider-value-text.js +17 -0
  26. package/dist/node_modules/@ark-ui/react/dist/components/slider/slider.js +32 -0
  27. package/dist/node_modules/@ark-ui/react/dist/components/slider/use-slider-context.js +10 -0
  28. package/dist/node_modules/@ark-ui/react/dist/components/slider/use-slider-thumb-props-context.js +10 -0
  29. package/dist/node_modules/@ark-ui/react/dist/components/slider/use-slider.js +19 -0
  30. package/dist/node_modules/@zag-js/dom-query/dist/event.js +36 -31
  31. package/dist/node_modules/@zag-js/dom-query/dist/form.js +31 -21
  32. package/dist/node_modules/@zag-js/dom-query/dist/pointer-move.js +29 -0
  33. package/dist/node_modules/@zag-js/slider/dist/slider.anatomy.js +17 -0
  34. package/dist/node_modules/@zag-js/slider/dist/slider.connect.js +272 -0
  35. package/dist/node_modules/@zag-js/slider/dist/slider.dom.js +88 -0
  36. package/dist/node_modules/@zag-js/slider/dist/slider.machine.js +309 -0
  37. package/dist/node_modules/@zag-js/slider/dist/slider.style.js +119 -0
  38. package/dist/node_modules/@zag-js/slider/dist/slider.utils.js +105 -0
  39. package/dist/node_modules/@zag-js/utils/dist/number.js +63 -8
  40. package/dist/node_modules/@zag-js/utils/dist/object.js +17 -8
  41. package/dist/styles.css +1 -1
  42. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { SerendiePreset as r } from "./preset.js";
2
2
  import { ThemeContext as a, resolveTheme as m, useThemeContext as p } from "./theme/ThemeContext.js";
3
- import { useSystemColorScheme as i } from "./theme/useSystemColorScheme.js";
3
+ import { useSystemColorScheme as x } from "./theme/useSystemColorScheme.js";
4
4
  import { ColorSchemeScript as s, getColorSchemeScript as f } from "./theme/initColorScheme.js";
5
- import { formatDateByLang as l, getTranslations as d, useTranslations as h } from "./i18n/index.js";
5
+ import { formatDateByLang as l, getTranslations as d, useTranslations as S } from "./i18n/index.js";
6
6
  import { Accordion as C } from "./components/Accordion/Accordion.js";
7
7
  import { AccordionGroup as B } from "./components/Accordion/AccordionGroup.js";
8
8
  import { Avatar as y, AvatarStyle as T } from "./components/Avatar/Avatar.js";
@@ -16,10 +16,10 @@ import { compactChartMargin as q, defaultChartMargin as z, getChartColor as E, g
16
16
  import { CheckBox as Z, CheckBoxStyle as _, checkboxCheckedIconCss as $, checkboxIconCss as oo, checkboxUncheckedIconCss as eo } from "./components/CheckBox/CheckBox.js";
17
17
  import { ChoiceBox as to, ChoiceBoxStyle as ao } from "./components/ChoiceBox/ChoiceBox.js";
18
18
  import { DashboardWidget as po } from "./components/DashboardWidget/DashboardWidget.js";
19
- import { DataTable as io } from "./components/DataTable/index.js";
19
+ import { DataTable as xo } from "./components/DataTable/index.js";
20
20
  import { DatePicker as so } from "./components/DatePicker/DatePicker.js";
21
21
  import { Divider as co, DividerStyle as lo } from "./components/Divider/Divider.js";
22
- import { Drawer as So } from "./components/Drawer/Drawer.js";
22
+ import { Drawer as ho } from "./components/Drawer/Drawer.js";
23
23
  import { DropdownMenu as go, DropdownMenuStyle as Bo } from "./components/DropdownMenu/DropdownMenu.js";
24
24
  import { IconButton as yo, IconButtonStyle as To } from "./components/IconButton/IconButton.js";
25
25
  import { List as Po } from "./components/List/List.js";
@@ -34,17 +34,18 @@ import { RadioButton as Eo, RadioButtonStyle as Ho, radioCheckedIconCss as Jo, r
34
34
  import { RadioGroup as Vo } from "./components/RadioButton/RadioGroup.js";
35
35
  import { Search as Yo, SearchStyle as Zo } from "./components/Search/Search.js";
36
36
  import { Select as $o, SelectStyle as oe } from "./components/Select/Select.js";
37
- import { Switch as re, SwitchStyle as te } from "./components/Switch/Switch.js";
38
- import { Tabs as me, TabsStyle as pe } from "./components/Tabs/Tabs.js";
39
- import { TabItem as ie, TabItemStyle as ne } from "./components/Tabs/TabItem.js";
40
- import { TextArea as fe } from "./components/TextArea/TextArea.js";
41
- import { TextField as le } from "./components/TextField/TextField.js";
42
- import { Toast as he, ToastStyle as Se, toaster as Ce } from "./components/Toast/Toast.js";
43
- import { Tooltip as Be } from "./components/Tooltip/Tooltip.js";
44
- import { TopAppBar as ye } from "./components/TopAppBar/TopAppBar.js";
45
- import { DataTableComponent as Ie } from "./components/DataTable/DataTableComponent.js";
46
- import { LanguageProvider as De, SerendieProvider as be } from "./i18n/provider.js";
47
- import { parse as ve } from "./node_modules/@zag-js/date-picker/dist/date-picker.parse.js";
37
+ import { Slider as re, SliderStyle as te } from "./components/Slider/Slider.js";
38
+ import { Switch as me, SwitchStyle as pe } from "./components/Switch/Switch.js";
39
+ import { Tabs as xe, TabsStyle as ne } from "./components/Tabs/Tabs.js";
40
+ import { TabItem as fe, TabItemStyle as ce } from "./components/Tabs/TabItem.js";
41
+ import { TextArea as de } from "./components/TextArea/TextArea.js";
42
+ import { TextField as he } from "./components/TextField/TextField.js";
43
+ import { Toast as ge, ToastStyle as Be, toaster as ue } from "./components/Toast/Toast.js";
44
+ import { Tooltip as Te } from "./components/Tooltip/Tooltip.js";
45
+ import { TopAppBar as Pe } from "./components/TopAppBar/TopAppBar.js";
46
+ import { DataTableComponent as be } from "./components/DataTable/DataTableComponent.js";
47
+ import { LanguageProvider as ve, SerendieProvider as Me } from "./i18n/provider.js";
48
+ import { parse as Ae } from "./node_modules/@zag-js/date-picker/dist/date-picker.parse.js";
48
49
  export {
49
50
  C as Accordion,
50
51
  B as AccordionGroup,
@@ -65,17 +66,17 @@ export {
65
66
  ao as ChoiceBoxStyle,
66
67
  s as ColorSchemeScript,
67
68
  po as DashboardWidget,
68
- io as DataTable,
69
- Ie as DataTableComponent,
69
+ xo as DataTable,
70
+ be as DataTableComponent,
70
71
  so as DatePicker,
71
72
  co as Divider,
72
73
  lo as DividerStyle,
73
- So as Drawer,
74
+ ho as Drawer,
74
75
  go as DropdownMenu,
75
76
  Bo as DropdownMenuStyle,
76
77
  yo as IconButton,
77
78
  To as IconButtonStyle,
78
- De as LanguageProvider,
79
+ ve as LanguageProvider,
79
80
  Po as List,
80
81
  bo as ListItem,
81
82
  ko as ListItemStyle,
@@ -95,20 +96,22 @@ export {
95
96
  oe as SelectStyle,
96
97
  W as SerendieChartTheme,
97
98
  r as SerendiePreset,
98
- be as SerendieProvider,
99
- re as Switch,
100
- te as SwitchStyle,
101
- ie as TabItem,
102
- ne as TabItemStyle,
103
- me as Tabs,
104
- pe as TabsStyle,
105
- fe as TextArea,
106
- le as TextField,
99
+ Me as SerendieProvider,
100
+ re as Slider,
101
+ te as SliderStyle,
102
+ me as Switch,
103
+ pe as SwitchStyle,
104
+ fe as TabItem,
105
+ ce as TabItemStyle,
106
+ xe as Tabs,
107
+ ne as TabsStyle,
108
+ de as TextArea,
109
+ he as TextField,
107
110
  a as ThemeContext,
108
- he as Toast,
109
- Se as ToastStyle,
110
- Be as Tooltip,
111
- ye as TopAppBar,
111
+ ge as Toast,
112
+ Be as ToastStyle,
113
+ Te as Tooltip,
114
+ Pe as TopAppBar,
112
115
  $ as checkboxCheckedIconCss,
113
116
  oo as checkboxIconCss,
114
117
  eo as checkboxUncheckedIconCss,
@@ -120,18 +123,18 @@ export {
120
123
  f as getColorSchemeScript,
121
124
  d as getTranslations,
122
125
  J as legendChartMargin,
123
- ve as parseDate,
126
+ Ae as parseDate,
124
127
  Jo as radioCheckedIconCss,
125
128
  Ko as radioIconCss,
126
129
  Oo as radioUncheckedIconCss,
127
130
  m as resolveTheme,
128
131
  K as spaciousChartMargin,
129
- Ce as toaster,
132
+ ue as toaster,
130
133
  O as useBarChartProps,
131
134
  Q as useChartProps,
132
135
  V as useLineChartProps,
133
136
  X as usePieChartProps,
134
- i as useSystemColorScheme,
137
+ x as useSystemColorScheme,
135
138
  p as useThemeContext,
136
- h as useTranslations
139
+ S as useTranslations
137
140
  };
@@ -0,0 +1,5 @@
1
+ import { useSliderContext as r } from "./use-slider-context.js";
2
+ var o = (e) => e.children(r());
3
+ export {
4
+ o as SliderContext
5
+ };
@@ -0,0 +1,16 @@
1
+ import { ark as t } from "../factory.js";
2
+ import { useSliderContext as m } from "./use-slider-context.js";
3
+ import { forwardRef as i } from "react";
4
+ import { jsx as p } from "react/jsx-runtime";
5
+ import { mergeProps as d } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var f = i((r, o) => {
7
+ const e = d(m().getControlProps(), r);
8
+ return /* @__PURE__ */ p(t.div, {
9
+ ...e,
10
+ ref: o
11
+ });
12
+ });
13
+ f.displayName = "SliderControl";
14
+ export {
15
+ f as SliderControl
16
+ };
@@ -0,0 +1,18 @@
1
+ import { ark as m } from "../factory.js";
2
+ import { useSliderContext as n } from "./use-slider-context.js";
3
+ import { useSliderThumbPropsContext as d } from "./use-slider-thumb-props-context.js";
4
+ import { forwardRef as a } from "react";
5
+ import { jsx as g } from "react/jsx-runtime";
6
+ import { mergeProps as s } from "../../../../../@zag-js/core/dist/merge-props.js";
7
+ var p = a((r, i) => {
8
+ const o = n(), { index: e } = d(), t = s(o.getDraggingIndicatorProps({ index: e }), r);
9
+ return /* @__PURE__ */ g(m.span, {
10
+ ...t,
11
+ ref: i,
12
+ children: r.children || o.getThumbValue(e)
13
+ });
14
+ });
15
+ p.displayName = "SliderDraggingIndicator";
16
+ export {
17
+ p as SliderDraggingIndicator
18
+ };
@@ -0,0 +1,17 @@
1
+ import { ark as p } from "../factory.js";
2
+ import { useSliderContext as i } from "./use-slider-context.js";
3
+ import { useSliderThumbPropsContext as d } from "./use-slider-thumb-props-context.js";
4
+ import { forwardRef as n } from "react";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import { mergeProps as u } from "../../../../../@zag-js/core/dist/merge-props.js";
7
+ var f = n((r, o) => {
8
+ const e = i(), t = d(), m = u(e.getHiddenInputProps(t), r);
9
+ return /* @__PURE__ */ s(p.input, {
10
+ ...m,
11
+ ref: o
12
+ });
13
+ });
14
+ f.displayName = "SliderHiddenInput";
15
+ export {
16
+ f as SliderHiddenInput
17
+ };
@@ -0,0 +1,16 @@
1
+ import { ark as m } from "../factory.js";
2
+ import { useSliderContext as t } from "./use-slider-context.js";
3
+ import { forwardRef as p } from "react";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ import { mergeProps as i } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var l = p((r, e) => {
7
+ const o = i(t().getLabelProps(), r);
8
+ return /* @__PURE__ */ a(m.label, {
9
+ ...o,
10
+ ref: e
11
+ });
12
+ });
13
+ l.displayName = "SliderLabel";
14
+ export {
15
+ l as SliderLabel
16
+ };
@@ -0,0 +1,16 @@
1
+ import { ark as m } from "../factory.js";
2
+ import { useSliderContext as p } from "./use-slider-context.js";
3
+ import { forwardRef as t } from "react";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ import { mergeProps as a } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var d = t((r, o) => {
7
+ const e = a(p().getMarkerGroupProps(), r);
8
+ return /* @__PURE__ */ i(m.div, {
9
+ ...e,
10
+ ref: o
11
+ });
12
+ });
13
+ d.displayName = "SliderMarkerGroup";
14
+ export {
15
+ d as SliderMarkerGroup
16
+ };
@@ -0,0 +1,17 @@
1
+ import { createSplitProps as t } from "../../utils/create-split-props.js";
2
+ import { ark as a } from "../factory.js";
3
+ import { useSliderContext as s } from "./use-slider-context.js";
4
+ import { forwardRef as i } from "react";
5
+ import { jsx as l } from "react/jsx-runtime";
6
+ import { mergeProps as f } from "../../../../../@zag-js/core/dist/merge-props.js";
7
+ var P = t(), d = i((r, o) => {
8
+ const [e, p] = P(r, ["value"]), m = f(s().getMarkerProps(e), p);
9
+ return /* @__PURE__ */ l(a.span, {
10
+ ...m,
11
+ ref: o
12
+ });
13
+ });
14
+ d.displayName = "SliderMarker";
15
+ export {
16
+ d as SliderMarker
17
+ };
@@ -0,0 +1,16 @@
1
+ import { ark as m } from "../factory.js";
2
+ import { useSliderContext as t } from "./use-slider-context.js";
3
+ import { forwardRef as i } from "react";
4
+ import { jsx as p } from "react/jsx-runtime";
5
+ import { mergeProps as a } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var d = i((r, e) => {
7
+ const o = a(t().getRangeProps(), r);
8
+ return /* @__PURE__ */ p(m.div, {
9
+ ...o,
10
+ ref: e
11
+ });
12
+ });
13
+ d.displayName = "SliderRange";
14
+ export {
15
+ d as SliderRange
16
+ };
@@ -0,0 +1,20 @@
1
+ import { createSplitProps as m } from "../../utils/create-split-props.js";
2
+ import { ark as d } from "../factory.js";
3
+ import { SliderProvider as l } from "./use-slider-context.js";
4
+ import { forwardRef as s } from "react";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ import { mergeProps as a } from "../../../../../@zag-js/core/dist/merge-props.js";
7
+ var v = m(), P = s((e, i) => {
8
+ const [{ value: r }, t] = v(e, ["value"]), p = a(r.getRootProps(), t);
9
+ return /* @__PURE__ */ o(l, {
10
+ value: r,
11
+ children: /* @__PURE__ */ o(d.div, {
12
+ ...p,
13
+ ref: i
14
+ })
15
+ });
16
+ });
17
+ P.displayName = "SliderRootProvider";
18
+ export {
19
+ P as SliderRootProvider
20
+ };
@@ -0,0 +1,46 @@
1
+ import { createSplitProps as m } from "../../utils/create-split-props.js";
2
+ import { ark as n } from "../factory.js";
3
+ import { SliderProvider as s } from "./use-slider-context.js";
4
+ import { useSlider as d } from "./use-slider.js";
5
+ import { forwardRef as p } from "react";
6
+ import { jsx as e } from "react/jsx-runtime";
7
+ import { mergeProps as u } from "../../../../../@zag-js/core/dist/merge-props.js";
8
+ var f = m(), g = p((o, i) => {
9
+ const [a, t] = f(o, [
10
+ "aria-label",
11
+ "aria-labelledby",
12
+ "defaultValue",
13
+ "disabled",
14
+ "form",
15
+ "getAriaValueText",
16
+ "id",
17
+ "ids",
18
+ "invalid",
19
+ "max",
20
+ "min",
21
+ "minStepsBetweenThumbs",
22
+ "name",
23
+ "onFocusChange",
24
+ "onValueChange",
25
+ "onValueChangeEnd",
26
+ "orientation",
27
+ "origin",
28
+ "readOnly",
29
+ "step",
30
+ "thumbAlignment",
31
+ "thumbCollisionBehavior",
32
+ "thumbSize",
33
+ "value"
34
+ ]), r = d(a), l = u(r.getRootProps(), t);
35
+ return /* @__PURE__ */ e(s, {
36
+ value: r,
37
+ children: /* @__PURE__ */ e(n.div, {
38
+ ...l,
39
+ ref: i
40
+ })
41
+ });
42
+ });
43
+ g.displayName = "SliderRoot";
44
+ export {
45
+ g as SliderRoot
46
+ };
@@ -0,0 +1,21 @@
1
+ import { createSplitProps as t } from "../../utils/create-split-props.js";
2
+ import { ark as s } from "../factory.js";
3
+ import { useSliderContext as d } from "./use-slider-context.js";
4
+ import { SliderThumbPropsProvider as l } from "./use-slider-thumb-props-context.js";
5
+ import { forwardRef as a } from "react";
6
+ import { jsx as o } from "react/jsx-runtime";
7
+ import { mergeProps as f } from "../../../../../@zag-js/core/dist/merge-props.js";
8
+ var u = t(), P = a((m, e) => {
9
+ const [r, p] = u(m, ["index", "name"]), i = f(d().getThumbProps(r), p);
10
+ return /* @__PURE__ */ o(l, {
11
+ value: r,
12
+ children: /* @__PURE__ */ o(s.div, {
13
+ ...i,
14
+ ref: e
15
+ })
16
+ });
17
+ });
18
+ P.displayName = "SliderThumb";
19
+ export {
20
+ P as SliderThumb
21
+ };
@@ -0,0 +1,16 @@
1
+ import { ark as m } from "../factory.js";
2
+ import { useSliderContext as t } from "./use-slider-context.js";
3
+ import { forwardRef as i } from "react";
4
+ import { jsx as p } from "react/jsx-runtime";
5
+ import { mergeProps as a } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var d = i((r, o) => {
7
+ const e = a(t().getTrackProps(), r);
8
+ return /* @__PURE__ */ p(m.div, {
9
+ ...e,
10
+ ref: o
11
+ });
12
+ });
13
+ d.displayName = "SliderTrack";
14
+ export {
15
+ d as SliderTrack
16
+ };
@@ -0,0 +1,17 @@
1
+ import { ark as s } from "../factory.js";
2
+ import { useSliderContext as l } from "./use-slider-context.js";
3
+ import { forwardRef as p } from "react";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ import { mergeProps as d } from "../../../../../@zag-js/core/dist/merge-props.js";
6
+ var n = p((e, o) => {
7
+ const { children: t, ...i } = e, r = l(), m = d(r.getValueTextProps(), i);
8
+ return /* @__PURE__ */ a(s.span, {
9
+ ...m,
10
+ ref: o,
11
+ children: t || r.value.join(", ")
12
+ });
13
+ });
14
+ n.displayName = "SliderValueText";
15
+ export {
16
+ n as SliderValueText
17
+ };
@@ -0,0 +1,32 @@
1
+ import { __exportAll as r } from "../../_virtual/_rolldown/runtime.js";
2
+ import { SliderContext as o } from "./slider-context.js";
3
+ import { SliderControl as i } from "./slider-control.js";
4
+ import { SliderDraggingIndicator as e } from "./slider-dragging-indicator.js";
5
+ import { SliderHiddenInput as t } from "./slider-hidden-input.js";
6
+ import { SliderLabel as m } from "./slider-label.js";
7
+ import { SliderMarker as d } from "./slider-marker.js";
8
+ import { SliderMarkerGroup as l } from "./slider-marker-group.js";
9
+ import { SliderRange as p } from "./slider-range.js";
10
+ import { SliderRoot as a } from "./slider-root.js";
11
+ import { SliderRootProvider as f } from "./slider-root-provider.js";
12
+ import { SliderThumb as n } from "./slider-thumb.js";
13
+ import { SliderTrack as S } from "./slider-track.js";
14
+ import { SliderValueText as g } from "./slider-value-text.js";
15
+ var D = /* @__PURE__ */ r({
16
+ Context: () => o,
17
+ Control: () => i,
18
+ DraggingIndicator: () => e,
19
+ HiddenInput: () => t,
20
+ Label: () => m,
21
+ Marker: () => d,
22
+ MarkerGroup: () => l,
23
+ Range: () => p,
24
+ Root: () => a,
25
+ RootProvider: () => f,
26
+ Thumb: () => n,
27
+ Track: () => S,
28
+ ValueText: () => g
29
+ });
30
+ export {
31
+ D as slider_exports
32
+ };
@@ -0,0 +1,10 @@
1
+ import { createContext as e } from "../../utils/create-context.js";
2
+ var [t, o] = e({
3
+ name: "SliderContext",
4
+ hookName: "useSliderContext",
5
+ providerName: "<SliderProvider />"
6
+ });
7
+ export {
8
+ t as SliderProvider,
9
+ o as useSliderContext
10
+ };
@@ -0,0 +1,10 @@
1
+ import { createContext as e } from "../../utils/create-context.js";
2
+ var [o, t] = e({
3
+ name: "SliderThumbPropsContext",
4
+ hookName: "useSliderThumbPropsContext",
5
+ providerName: "<SliderThumbPropsProvider />"
6
+ });
7
+ export {
8
+ o as SliderThumbPropsProvider,
9
+ t as useSliderThumbPropsContext
10
+ };
@@ -0,0 +1,19 @@
1
+ import { useEnvironmentContext as i } from "../../providers/environment/use-environment-context.js";
2
+ import { useLocaleContext as s } from "../../providers/locale/use-locale-context.js";
3
+ import { useId as c } from "react";
4
+ import { useMachine as p } from "../../../../../@zag-js/react/dist/machine.js";
5
+ import { normalizeProps as f } from "../../../../../@zag-js/react/dist/normalize-props.js";
6
+ import { machine as a } from "../../../../../@zag-js/slider/dist/slider.machine.js";
7
+ import { connect as u } from "../../../../../@zag-js/slider/dist/slider.connect.js";
8
+ var g = (o) => {
9
+ const r = c(), { getRootNode: t } = i(), { dir: e } = s(), m = {
10
+ id: r,
11
+ dir: e,
12
+ getRootNode: t,
13
+ ...o
14
+ }, n = p(a, m);
15
+ return u(n, f);
16
+ };
17
+ export {
18
+ g as useSlider
19
+ };
@@ -1,37 +1,37 @@
1
1
  import { isAndroid as s, isMac as u } from "./platform.js";
2
- function c(t) {
3
- var r, n, i;
4
- return ((r = t.composedPath) == null ? void 0 : r.call(t)) ?? ((i = (n = t.nativeEvent) == null ? void 0 : n.composedPath) == null ? void 0 : i.call(n));
2
+ function a(t) {
3
+ var r, e, i;
4
+ return ((r = t.composedPath) == null ? void 0 : r.call(t)) ?? ((i = (e = t.nativeEvent) == null ? void 0 : e.composedPath) == null ? void 0 : i.call(e));
5
5
  }
6
- function g(t) {
7
- const r = c(t);
6
+ function h(t) {
7
+ const r = a(t);
8
8
  return (r == null ? void 0 : r[0]) ?? t.target;
9
9
  }
10
- function h(t) {
10
+ function w(t) {
11
11
  const r = t.currentTarget;
12
12
  if (!r || !r.matches("a[href], button[type='submit'], input[type='submit']")) return !1;
13
- const i = t.button === 1, e = a(t);
14
- return i || e;
13
+ const i = t.button === 1, n = c(t);
14
+ return i || n;
15
15
  }
16
16
  function E(t) {
17
17
  const r = t.currentTarget;
18
18
  if (!r) return !1;
19
- const n = r.localName;
20
- return t.altKey ? n === "a" || n === "button" && r.type === "submit" || n === "input" && r.type === "submit" : !1;
19
+ const e = r.localName;
20
+ return t.altKey ? e === "a" || e === "button" && r.type === "submit" || e === "input" && r.type === "submit" : !1;
21
21
  }
22
22
  function d(t) {
23
23
  return y(t).isComposing || t.keyCode === 229;
24
24
  }
25
- function a(t) {
25
+ function c(t) {
26
26
  return u() ? t.metaKey : t.ctrlKey;
27
27
  }
28
- function K(t) {
28
+ function k(t) {
29
29
  return t.key.length === 1 && !t.ctrlKey && !t.metaKey;
30
30
  }
31
31
  function b(t) {
32
32
  return t.pointerType === "" && t.isTrusted ? !0 : s() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
33
33
  }
34
- var w = (t) => t.button === 0, C = (t) => t.button === 2 || u() && t.ctrlKey && t.button === 0, k = (t) => t.ctrlKey || t.altKey || t.metaKey, l = (t) => "touches" in t && t.touches.length > 0, f = {
34
+ var A = (t) => t.button === 0, C = (t) => t.button === 2 || u() && t.ctrlKey && t.button === 0, T = (t) => t.ctrlKey || t.altKey || t.metaKey, l = (t) => "touches" in t && t.touches.length > 0, f = {
35
35
  Up: "ArrowUp",
36
36
  Down: "ArrowDown",
37
37
  Esc: "Escape",
@@ -44,37 +44,42 @@ var w = (t) => t.button === 0, C = (t) => t.button === 2 || u() && t.ctrlKey &&
44
44
  ArrowRight: "ArrowLeft"
45
45
  };
46
46
  function v(t, r = {}) {
47
- const { dir: n = "ltr", orientation: i = "horizontal" } = r;
48
- let e = t.key;
49
- return e = f[e] ?? e, n === "rtl" && i === "horizontal" && e in o && (e = o[e]), e;
47
+ const { dir: e = "ltr", orientation: i = "horizontal" } = r;
48
+ let n = t.key;
49
+ return n = f[n] ?? n, e === "rtl" && i === "horizontal" && n in o && (n = o[n]), n;
50
50
  }
51
51
  function y(t) {
52
52
  return t.nativeEvent ?? t;
53
53
  }
54
- function T(t, r = "client") {
55
- const n = l(t) ? t.touches[0] || t.changedTouches[0] : t;
56
- return { x: n[`${r}X`], y: n[`${r}Y`] };
54
+ var p = /* @__PURE__ */ new Set(["PageUp", "PageDown"]), g = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
55
+ function L(t) {
56
+ return t.ctrlKey || t.metaKey ? 0.1 : p.has(t.key) || t.shiftKey && g.has(t.key) ? 10 : 1;
57
+ }
58
+ function M(t, r = "client") {
59
+ const e = l(t) ? t.touches[0] || t.changedTouches[0] : t;
60
+ return { x: e[`${r}X`], y: e[`${r}Y`] };
57
61
  }
58
- var A = (t, r, n, i) => {
59
- const e = typeof t == "function" ? t() : t;
60
- return e == null || e.addEventListener(r, n, i), () => {
61
- e == null || e.removeEventListener(r, n, i);
62
+ var P = (t, r, e, i) => {
63
+ const n = typeof t == "function" ? t() : t;
64
+ return n == null || n.addEventListener(r, e, i), () => {
65
+ n == null || n.removeEventListener(r, e, i);
62
66
  };
63
67
  };
64
68
  export {
65
- A as addDomEvent,
69
+ P as addDomEvent,
66
70
  v as getEventKey,
67
- T as getEventPoint,
68
- g as getEventTarget,
71
+ M as getEventPoint,
72
+ L as getEventStep,
73
+ h as getEventTarget,
69
74
  y as getNativeEvent,
70
75
  d as isComposingEvent,
71
76
  C as isContextMenuEvent,
72
- a as isCtrlOrMetaKey,
77
+ c as isCtrlOrMetaKey,
73
78
  E as isDownloadingEvent,
74
- w as isLeftClick,
75
- k as isModifierKey,
76
- h as isOpeningInNewTab,
77
- K as isPrintableKey,
79
+ A as isLeftClick,
80
+ T as isModifierKey,
81
+ w as isOpeningInNewTab,
82
+ k as isPrintableKey,
78
83
  l as isTouchEvent,
79
84
  b as isVirtualClick
80
85
  };