@konstructio/ui 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (105) hide show
  1. package/dist/{Combination-b348x__d.js → Combination-Cvr3uETz.js} +102 -102
  2. package/dist/DatePicker.css +1 -0
  3. package/dist/{Modal-i7eolhYH.js → Modal-DXYBiafI.js} +3 -3
  4. package/dist/components/Alert/Alert.js +1 -1
  5. package/dist/components/AlertDialog/AlertDialog.js +55 -41
  6. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  7. package/dist/components/AlertDialog/components/index.js +1 -1
  8. package/dist/components/Badge/Badge.js +14 -14
  9. package/dist/components/Badge/Badge.variants.js +18 -17
  10. package/dist/components/Breadcrumb/Breadcrumb.js +43 -52
  11. package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
  12. package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
  13. package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
  14. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  15. package/dist/components/Button/Button.js +30 -26
  16. package/dist/components/Button/Button.variants.js +115 -28
  17. package/dist/components/Checkbox/Checkbox.js +297 -187
  18. package/dist/components/Checkbox/Checkbox.variants.js +12 -15
  19. package/dist/components/Command/Command.js +2 -2
  20. package/dist/components/Command/components/Command.js +1 -1
  21. package/dist/components/Command/components/CommandEmpty.js +1 -1
  22. package/dist/components/Command/components/CommandGroup.js +1 -1
  23. package/dist/components/Command/components/CommandInput.js +1 -1
  24. package/dist/components/Command/components/CommandItem.js +1 -1
  25. package/dist/components/Command/components/CommandList.js +1 -1
  26. package/dist/components/Command/components/CommandSeparator.js +1 -1
  27. package/dist/components/Command/components/DialogContent.js +1 -1
  28. package/dist/components/Command/components/DialogOverlay.js +1 -1
  29. package/dist/components/Datepicker/DatePicker.js +2711 -0
  30. package/dist/components/Datepicker/DatePicker.variants.js +5 -0
  31. package/dist/components/Dropdown/components/List/List.js +49 -17
  32. package/dist/components/Dropdown/components/ListItem/ListItem.js +21 -17
  33. package/dist/components/Dropdown/components/Wrapper.js +64 -59
  34. package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
  35. package/dist/components/Input/Input.js +106 -137
  36. package/dist/components/Input/Input.variants.js +15 -13
  37. package/dist/components/Loading/Loading.js +2 -2
  38. package/dist/components/Modal/Modal.js +2 -2
  39. package/dist/components/Modal/components/Body/Body.js +1 -1
  40. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  41. package/dist/components/Modal/components/Header/Header.js +1 -1
  42. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  43. package/dist/components/Modal/components/index.js +1 -1
  44. package/dist/components/NumberInput/NumberInput.js +1 -1
  45. package/dist/components/Radio/Radio.variants.js +14 -12
  46. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  47. package/dist/components/Range/Range.js +1 -1
  48. package/dist/components/Slider/Slider.js +1 -1
  49. package/dist/components/Switch/Switch.js +141 -126
  50. package/dist/components/Tabs/Tabs.js +24 -0
  51. package/dist/components/Tabs/Tabs.variants.js +58 -0
  52. package/dist/components/Tabs/components/Content.js +19 -0
  53. package/dist/components/Tabs/components/List.js +20 -0
  54. package/dist/components/Tabs/components/Trigger.js +26 -0
  55. package/dist/components/Tag/Tag.js +1 -1
  56. package/dist/components/TimePicker/TimePicker.js +8 -0
  57. package/dist/components/TimePicker/TimePicker.variants.js +62 -0
  58. package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
  59. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
  60. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
  61. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +102 -0
  62. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
  63. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
  64. package/dist/components/TimePicker/components/index.js +4 -0
  65. package/dist/components/TimePicker/contexts/index.js +8 -0
  66. package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
  67. package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
  68. package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
  69. package/dist/components/TimePicker/utils/index.js +6 -0
  70. package/dist/components/Toast/Toast.js +37 -35
  71. package/dist/components/Tooltip/Tooltip.js +1 -1
  72. package/dist/components/Typography/Typography.js +14 -16
  73. package/dist/components/index.js +72 -66
  74. package/dist/createLucideIcon-vyksFS6P.js +94 -0
  75. package/dist/index--EmNlyHx.js +31 -0
  76. package/dist/{index-DvFiic6N.js → index-1RDo-S_f.js} +96 -102
  77. package/dist/{index-Bk324h27.js → index-B5MIi2tR.js} +6 -5
  78. package/dist/{index-g-TFwd6Y.js → index-BCGvACM9.js} +2 -1
  79. package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
  80. package/dist/index-BdMNhZnh.js +9 -0
  81. package/dist/{index-AM3avohj.js → index-BuxebbOg.js} +3 -3
  82. package/dist/index-BvCZBMfr.js +432 -0
  83. package/dist/index-Cq1I1cG9.js +129 -0
  84. package/dist/index-Cs8Lv8Wj.js +13 -0
  85. package/dist/index-CvfCCTEO.js +323 -0
  86. package/dist/{index-dRxIWVBr.js → index-Cz09twLl.js} +6 -5
  87. package/dist/{index-YaQrdkGE.js → index-DNRcvRTB.js} +31 -30
  88. package/dist/{index-G_6jG4Qc.js → index-Dm-ooN_M.js} +18 -18
  89. package/dist/index-DwYXX2sM.js +13 -0
  90. package/dist/{index-D9BbbgUq.js → index-rUBNhTeF.js} +2 -2
  91. package/dist/index.d.ts +75 -13
  92. package/dist/index.js +78 -72
  93. package/dist/package.json +37 -34
  94. package/dist/styles.css +1 -1
  95. package/dist/ui/civo-theme.css +263 -0
  96. package/dist/ui/kubefirst-theme.css +1 -1
  97. package/dist/ui/theme.css +11 -0
  98. package/dist/useBreadcrumb-DMERrNkJ.js +1280 -0
  99. package/dist/utils/index.js +3 -3
  100. package/package.json +37 -34
  101. package/dist/createLucideIcon-CoF3ywd5.js +0 -89
  102. package/dist/index-BOx5P4tS.js +0 -423
  103. package/dist/index-CWKdynYu.js +0 -32
  104. package/dist/index-bYyfdsls.js +0 -118
  105. package/dist/useBreadcrumb-BsIeMoR1.js +0 -1279
@@ -963,21 +963,21 @@ const f = (e) => {
963
963
  * @see https://tailwindcss.com/docs/height
964
964
  */
965
965
  h: [{
966
- h: ["screen", ...R()]
966
+ h: ["screen", "lh", ...R()]
967
967
  }],
968
968
  /**
969
969
  * Min-Height
970
970
  * @see https://tailwindcss.com/docs/min-height
971
971
  */
972
972
  "min-h": [{
973
- "min-h": ["screen", "none", ...R()]
973
+ "min-h": ["screen", "lh", "none", ...R()]
974
974
  }],
975
975
  /**
976
976
  * Max-Height
977
977
  * @see https://tailwindcss.com/docs/max-height
978
978
  */
979
979
  "max-h": [{
980
- "max-h": ["screen", ...R()]
980
+ "max-h": ["screen", "lh", ...R()]
981
981
  }],
982
982
  // ------------------
983
983
  // --- Typography ---
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.0-alpha.2",
5
+ "version": "0.1.0-alpha.4",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -55,23 +55,26 @@
55
55
  "test:watch": "vitest dev"
56
56
  },
57
57
  "dependencies": {
58
- "@radix-ui/react-alert-dialog": "^1.1.7",
59
- "@radix-ui/react-checkbox": "^1.1.5",
60
- "@radix-ui/react-dialog": "^1.1.7",
61
- "@radix-ui/react-slider": "^1.2.4",
62
- "@radix-ui/react-slot": "^1.2.0",
63
- "@radix-ui/react-switch": "^1.1.4",
64
- "@radix-ui/react-toast": "^1.2.7",
65
- "@radix-ui/react-visually-hidden": "^1.1.3",
58
+ "@radix-ui/react-alert-dialog": "^1.1.14",
59
+ "@radix-ui/react-checkbox": "^1.3.2",
60
+ "@radix-ui/react-dialog": "^1.1.14",
61
+ "@radix-ui/react-slider": "^1.3.5",
62
+ "@radix-ui/react-slot": "^1.2.3",
63
+ "@radix-ui/react-switch": "^1.2.5",
64
+ "@radix-ui/react-toast": "^1.2.14",
65
+ "@radix-ui/react-tabs": "^1.1.12",
66
+ "@radix-ui/react-visually-hidden": "^1.2.3",
66
67
  "class-variance-authority": "^0.7.1",
67
68
  "clsx": "^2.1.1",
68
69
  "cmdk": "^1.1.1",
70
+ "countries-and-timezones": "^3.8.0",
69
71
  "js-cookie": "^3.0.5",
70
- "lucide-react": "^0.488.0",
72
+ "lucide-react": "^0.511.0",
73
+ "react-day-picker": "^9.7.0",
71
74
  "react-feather": "^2.0.10",
72
75
  "react-focus-lock": "^2.13.6",
73
- "react-remove-scroll": "^2.6.3",
74
- "tailwind-merge": "^3.2.0"
76
+ "react-remove-scroll": "^2.7.0",
77
+ "tailwind-merge": "^3.3.0"
75
78
  },
76
79
  "peerDependencies": {
77
80
  "@types/react": "*",
@@ -103,34 +106,34 @@
103
106
  },
104
107
  "devDependencies": {
105
108
  "@rollup/plugin-alias": "^5.1.1",
106
- "@storybook/addon-docs": "^8.6.12",
107
- "@storybook/addon-essentials": "^8.6.12",
108
- "@storybook/addon-interactions": "^8.6.12",
109
- "@storybook/addon-links": "^8.6.12",
109
+ "@storybook/addon-docs": "^8.6.14",
110
+ "@storybook/addon-essentials": "^8.6.14",
111
+ "@storybook/addon-interactions": "^8.6.14",
112
+ "@storybook/addon-links": "^8.6.14",
110
113
  "@storybook/addon-styling-webpack": "^1.0.1",
111
- "@storybook/blocks": "^8.6.12",
112
- "@storybook/react": "^8.6.12",
113
- "@storybook/react-vite": "^8.6.12",
114
- "@storybook/test": "^8.6.12",
115
- "@tailwindcss/vite": "^4.1.4",
114
+ "@storybook/blocks": "^8.6.14",
115
+ "@storybook/react": "^8.6.14",
116
+ "@storybook/react-vite": "^8.6.14",
117
+ "@storybook/test": "^8.6.14",
118
+ "@tailwindcss/vite": "^4.1.7",
116
119
  "@testing-library/jest-dom": "^6.6.3",
117
120
  "@testing-library/react": "^16.3.0",
118
121
  "@testing-library/user-event": "^14.6.1",
119
122
  "@types/jest-axe": "^3.5.9",
120
123
  "@types/js-cookie": "^3.0.6",
121
- "@types/lodash": "^4.17.16",
122
- "@types/react": "^19.1.2",
123
- "@types/react-dom": "^19.1.2",
124
- "@typescript-eslint/eslint-plugin": "^8.29.1",
125
- "@typescript-eslint/parser": "^8.29.1",
126
- "@vitejs/plugin-react": "^4.3.4",
127
- "@vitest/coverage-v8": "^3.1.1",
124
+ "@types/lodash": "^4.17.17",
125
+ "@types/react": "^19.1.5",
126
+ "@types/react-dom": "^19.1.5",
127
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
128
+ "@typescript-eslint/parser": "^8.32.1",
129
+ "@vitejs/plugin-react": "^4.4.1",
130
+ "@vitest/coverage-v8": "^3.1.4",
128
131
  "autoprefixer": "^10.4.21",
129
132
  "eslint": "^8.57.0",
130
133
  "eslint-plugin-react-hooks": "^4.6.2",
131
134
  "eslint-plugin-react-refresh": "^0.4.7",
132
135
  "eslint-plugin-storybook": "^0.9.0",
133
- "glob": "^11.0.1",
136
+ "glob": "^11.0.2",
134
137
  "husky": "^9.1.7",
135
138
  "jest-axe": "^10.0.0",
136
139
  "jsdom": "^26.1.0",
@@ -138,15 +141,15 @@
138
141
  "postcss": "^8.5.3",
139
142
  "prettier": "^3.5.3",
140
143
  "rimraf": "^6.0.1",
141
- "storybook": "^8.6.12",
142
- "tailwindcss": "^4.1.4",
144
+ "storybook": "^8.6.14",
145
+ "tailwindcss": "^4.1.7",
143
146
  "ts-node": "^10.9.2",
144
147
  "typescript": "^5.8.3",
145
- "vite": "^6.2.6",
146
- "vite-plugin-dts": "^4.5.3",
148
+ "vite": "^6.3.5",
149
+ "vite-plugin-dts": "^4.5.4",
147
150
  "vite-plugin-lib-inject-css": "^2.2.2",
148
151
  "vite-plugin-svgr": "^4.3.0",
149
152
  "vite-tsconfig-paths": "^5.1.4",
150
- "vitest": "^3.1.1"
153
+ "vitest": "^3.1.4"
151
154
  }
152
155
  }
@@ -1,89 +0,0 @@
1
- import { forwardRef as i, createElement as n } from "react";
2
- /**
3
- * @license lucide-react v0.488.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const w = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), g = (e) => e.replace(
9
- /^([A-Z])|[\s-_]+(\w)/g,
10
- (t, r, o) => o ? o.toUpperCase() : r.toLowerCase()
11
- ), c = (e) => {
12
- const t = g(e);
13
- return t.charAt(0).toUpperCase() + t.slice(1);
14
- }, l = (...e) => e.filter((t, r, o) => !!t && t.trim() !== "" && o.indexOf(t) === r).join(" ").trim();
15
- /**
16
- * @license lucide-react v0.488.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- var h = {
22
- xmlns: "http://www.w3.org/2000/svg",
23
- width: 24,
24
- height: 24,
25
- viewBox: "0 0 24 24",
26
- fill: "none",
27
- stroke: "currentColor",
28
- strokeWidth: 2,
29
- strokeLinecap: "round",
30
- strokeLinejoin: "round"
31
- };
32
- /**
33
- * @license lucide-react v0.488.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */
38
- const f = i(
39
- ({
40
- color: e = "currentColor",
41
- size: t = 24,
42
- strokeWidth: r = 2,
43
- absoluteStrokeWidth: o,
44
- className: a = "",
45
- children: s,
46
- iconNode: u,
47
- ...m
48
- }, C) => n(
49
- "svg",
50
- {
51
- ref: C,
52
- ...h,
53
- width: t,
54
- height: t,
55
- stroke: e,
56
- strokeWidth: o ? Number(r) * 24 / Number(t) : r,
57
- className: l("lucide", a),
58
- ...m
59
- },
60
- [
61
- ...u.map(([p, d]) => n(p, d)),
62
- ...Array.isArray(s) ? s : [s]
63
- ]
64
- )
65
- );
66
- /**
67
- * @license lucide-react v0.488.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */
72
- const b = (e, t) => {
73
- const r = i(
74
- ({ className: o, ...a }, s) => n(f, {
75
- ref: s,
76
- iconNode: t,
77
- className: l(
78
- `lucide-${w(c(e))}`,
79
- `lucide-${e}`,
80
- o
81
- ),
82
- ...a
83
- })
84
- );
85
- return r.displayName = c(e), r;
86
- };
87
- export {
88
- b as c
89
- };
@@ -1,423 +0,0 @@
1
- import * as d from "react";
2
- import { a as ae, c as ce, b as _ } from "./index-bYyfdsls.js";
3
- import { u as K } from "./index-Bk324h27.js";
4
- import { a as le, u as de } from "./index-Bry5AFQ2.js";
5
- import { P as T } from "./index-g-TFwd6Y.js";
6
- import { c as ue } from "./index-D9BbbgUq.js";
7
- import { jsx as g, jsxs as fe } from "react/jsx-runtime";
8
- function $(e, [t, n]) {
9
- return Math.min(n, Math.max(t, e));
10
- }
11
- var me = d.createContext(void 0);
12
- function pe(e) {
13
- const t = d.useContext(me);
14
- return e || t || "ltr";
15
- }
16
- var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
17
- "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
18
- "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
19
- "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
20
- "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
21
- }, M = "Slider", [N, he, Se] = ue(M), [W, ke] = ce(M, [
22
- Se
23
- ]), [ge, B] = W(M), q = d.forwardRef(
24
- (e, t) => {
25
- const {
26
- name: n,
27
- min: o = 0,
28
- max: i = 100,
29
- step: c = 1,
30
- orientation: r = "horizontal",
31
- disabled: a = !1,
32
- minStepsBetweenThumbs: l = 0,
33
- defaultValue: m = [o],
34
- value: x,
35
- onValueChange: s = () => {
36
- },
37
- onValueCommit: u = () => {
38
- },
39
- inverted: v = !1,
40
- form: P,
41
- ...S
42
- } = e, p = d.useRef(/* @__PURE__ */ new Set()), f = d.useRef(0), w = r === "horizontal" ? ve : we, [h = [], A] = ae({
43
- prop: x,
44
- defaultProp: m,
45
- onChange: (b) => {
46
- var C;
47
- (C = [...p.current][f.current]) == null || C.focus(), s(b);
48
- }
49
- }), k = d.useRef(h);
50
- function H(b) {
51
- const R = ye(h, b);
52
- I(b, R);
53
- }
54
- function ie(b) {
55
- I(b, f.current);
56
- }
57
- function se() {
58
- const b = k.current[f.current];
59
- h[f.current] !== b && u(h);
60
- }
61
- function I(b, R, { commit: C } = { commit: !1 }) {
62
- const U = _e(c), z = Me(Math.round((b - o) / c) * c + o, U), V = $(z, [o, i]);
63
- A((E = []) => {
64
- const y = Pe(E, V, R);
65
- if (Ee(y, l * c)) {
66
- f.current = y.indexOf(V);
67
- const Y = String(y) !== String(E);
68
- return Y && C && u(y), Y ? y : E;
69
- } else
70
- return E;
71
- });
72
- }
73
- return /* @__PURE__ */ g(
74
- ge,
75
- {
76
- scope: e.__scopeSlider,
77
- name: n,
78
- disabled: a,
79
- min: o,
80
- max: i,
81
- valueIndexToChangeRef: f,
82
- thumbs: p.current,
83
- values: h,
84
- orientation: r,
85
- form: P,
86
- children: /* @__PURE__ */ g(N.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(N.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
87
- w,
88
- {
89
- "aria-disabled": a,
90
- "data-disabled": a ? "" : void 0,
91
- ...S,
92
- ref: t,
93
- onPointerDown: _(S.onPointerDown, () => {
94
- a || (k.current = h);
95
- }),
96
- min: o,
97
- max: i,
98
- inverted: v,
99
- onSlideStart: a ? void 0 : H,
100
- onSlideMove: a ? void 0 : ie,
101
- onSlideEnd: a ? void 0 : se,
102
- onHomeKeyDown: () => !a && I(o, 0, { commit: !0 }),
103
- onEndKeyDown: () => !a && I(i, h.length - 1, { commit: !0 }),
104
- onStepKeyDown: ({ event: b, direction: R }) => {
105
- if (!a) {
106
- const z = j.includes(b.key) || b.shiftKey && X.includes(b.key) ? 10 : 1, V = f.current, E = h[V], y = c * z * R;
107
- I(E + y, V, { commit: !0 });
108
- }
109
- }
110
- }
111
- ) }) })
112
- }
113
- );
114
- }
115
- );
116
- q.displayName = M;
117
- var [J, Q] = W(M, {
118
- startEdge: "left",
119
- endEdge: "right",
120
- size: "width",
121
- direction: 1
122
- }), ve = d.forwardRef(
123
- (e, t) => {
124
- const {
125
- min: n,
126
- max: o,
127
- dir: i,
128
- inverted: c,
129
- onSlideStart: r,
130
- onSlideMove: a,
131
- onSlideEnd: l,
132
- onStepKeyDown: m,
133
- ...x
134
- } = e, [s, u] = d.useState(null), v = K(t, (w) => u(w)), P = d.useRef(void 0), S = pe(i), p = S === "ltr", f = p && !c || !p && c;
135
- function D(w) {
136
- const h = P.current || s.getBoundingClientRect(), A = [0, h.width], H = F(A, f ? [n, o] : [o, n]);
137
- return P.current = h, H(w - h.left);
138
- }
139
- return /* @__PURE__ */ g(
140
- J,
141
- {
142
- scope: e.__scopeSlider,
143
- startEdge: f ? "left" : "right",
144
- endEdge: f ? "right" : "left",
145
- direction: f ? 1 : -1,
146
- size: "width",
147
- children: /* @__PURE__ */ g(
148
- Z,
149
- {
150
- dir: S,
151
- "data-orientation": "horizontal",
152
- ...x,
153
- ref: v,
154
- style: {
155
- ...x.style,
156
- "--radix-slider-thumb-transform": "translateX(-50%)"
157
- },
158
- onSlideStart: (w) => {
159
- const h = D(w.clientX);
160
- r == null || r(h);
161
- },
162
- onSlideMove: (w) => {
163
- const h = D(w.clientX);
164
- a == null || a(h);
165
- },
166
- onSlideEnd: () => {
167
- P.current = void 0, l == null || l();
168
- },
169
- onStepKeyDown: (w) => {
170
- const A = G[f ? "from-left" : "from-right"].includes(w.key);
171
- m == null || m({ event: w, direction: A ? -1 : 1 });
172
- }
173
- }
174
- )
175
- }
176
- );
177
- }
178
- ), we = d.forwardRef(
179
- (e, t) => {
180
- const {
181
- min: n,
182
- max: o,
183
- inverted: i,
184
- onSlideStart: c,
185
- onSlideMove: r,
186
- onSlideEnd: a,
187
- onStepKeyDown: l,
188
- ...m
189
- } = e, x = d.useRef(null), s = K(t, x), u = d.useRef(void 0), v = !i;
190
- function P(S) {
191
- const p = u.current || x.current.getBoundingClientRect(), f = [0, p.height], w = F(f, v ? [o, n] : [n, o]);
192
- return u.current = p, w(S - p.top);
193
- }
194
- return /* @__PURE__ */ g(
195
- J,
196
- {
197
- scope: e.__scopeSlider,
198
- startEdge: v ? "bottom" : "top",
199
- endEdge: v ? "top" : "bottom",
200
- size: "height",
201
- direction: v ? 1 : -1,
202
- children: /* @__PURE__ */ g(
203
- Z,
204
- {
205
- "data-orientation": "vertical",
206
- ...m,
207
- ref: s,
208
- style: {
209
- ...m.style,
210
- "--radix-slider-thumb-transform": "translateY(50%)"
211
- },
212
- onSlideStart: (S) => {
213
- const p = P(S.clientY);
214
- c == null || c(p);
215
- },
216
- onSlideMove: (S) => {
217
- const p = P(S.clientY);
218
- r == null || r(p);
219
- },
220
- onSlideEnd: () => {
221
- u.current = void 0, a == null || a();
222
- },
223
- onStepKeyDown: (S) => {
224
- const f = G[v ? "from-bottom" : "from-top"].includes(S.key);
225
- l == null || l({ event: S, direction: f ? -1 : 1 });
226
- }
227
- }
228
- )
229
- }
230
- );
231
- }
232
- ), Z = d.forwardRef(
233
- (e, t) => {
234
- const {
235
- __scopeSlider: n,
236
- onSlideStart: o,
237
- onSlideMove: i,
238
- onSlideEnd: c,
239
- onHomeKeyDown: r,
240
- onEndKeyDown: a,
241
- onStepKeyDown: l,
242
- ...m
243
- } = e, x = B(M, n);
244
- return /* @__PURE__ */ g(
245
- T.span,
246
- {
247
- ...m,
248
- ref: t,
249
- onKeyDown: _(e.onKeyDown, (s) => {
250
- s.key === "Home" ? (r(s), s.preventDefault()) : s.key === "End" ? (a(s), s.preventDefault()) : j.concat(X).includes(s.key) && (l(s), s.preventDefault());
251
- }),
252
- onPointerDown: _(e.onPointerDown, (s) => {
253
- const u = s.target;
254
- u.setPointerCapture(s.pointerId), s.preventDefault(), x.thumbs.has(u) ? u.focus() : o(s);
255
- }),
256
- onPointerMove: _(e.onPointerMove, (s) => {
257
- s.target.hasPointerCapture(s.pointerId) && i(s);
258
- }),
259
- onPointerUp: _(e.onPointerUp, (s) => {
260
- const u = s.target;
261
- u.hasPointerCapture(s.pointerId) && (u.releasePointerCapture(s.pointerId), c(s));
262
- })
263
- }
264
- );
265
- }
266
- ), ee = "SliderTrack", te = d.forwardRef(
267
- (e, t) => {
268
- const { __scopeSlider: n, ...o } = e, i = B(ee, n);
269
- return /* @__PURE__ */ g(
270
- T.span,
271
- {
272
- "data-disabled": i.disabled ? "" : void 0,
273
- "data-orientation": i.orientation,
274
- ...o,
275
- ref: t
276
- }
277
- );
278
- }
279
- );
280
- te.displayName = ee;
281
- var O = "SliderRange", ne = d.forwardRef(
282
- (e, t) => {
283
- const { __scopeSlider: n, ...o } = e, i = B(O, n), c = Q(O, n), r = d.useRef(null), a = K(t, r), l = i.values.length, m = i.values.map(
284
- (u) => re(u, i.min, i.max)
285
- ), x = l > 1 ? Math.min(...m) : 0, s = 100 - Math.max(...m);
286
- return /* @__PURE__ */ g(
287
- T.span,
288
- {
289
- "data-orientation": i.orientation,
290
- "data-disabled": i.disabled ? "" : void 0,
291
- ...o,
292
- ref: a,
293
- style: {
294
- ...e.style,
295
- [c.startEdge]: x + "%",
296
- [c.endEdge]: s + "%"
297
- }
298
- }
299
- );
300
- }
301
- );
302
- ne.displayName = O;
303
- var L = "SliderThumb", oe = d.forwardRef(
304
- (e, t) => {
305
- const n = he(e.__scopeSlider), [o, i] = d.useState(null), c = K(t, (a) => i(a)), r = d.useMemo(
306
- () => o ? n().findIndex((a) => a.ref.current === o) : -1,
307
- [n, o]
308
- );
309
- return /* @__PURE__ */ g(be, { ...e, ref: c, index: r });
310
- }
311
- ), be = d.forwardRef(
312
- (e, t) => {
313
- const { __scopeSlider: n, index: o, name: i, ...c } = e, r = B(L, n), a = Q(L, n), [l, m] = d.useState(null), x = K(t, (D) => m(D)), s = l ? r.form || !!l.closest("form") : !0, u = le(l), v = r.values[o], P = v === void 0 ? 0 : re(v, r.min, r.max), S = Re(o, r.values.length), p = u == null ? void 0 : u[a.size], f = p ? De(p, P, a.direction) : 0;
314
- return d.useEffect(() => {
315
- if (l)
316
- return r.thumbs.add(l), () => {
317
- r.thumbs.delete(l);
318
- };
319
- }, [l, r.thumbs]), /* @__PURE__ */ fe(
320
- "span",
321
- {
322
- style: {
323
- transform: "var(--radix-slider-thumb-transform)",
324
- position: "absolute",
325
- [a.startEdge]: `calc(${P}% + ${f}px)`
326
- },
327
- children: [
328
- /* @__PURE__ */ g(N.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
329
- T.span,
330
- {
331
- role: "slider",
332
- "aria-label": e["aria-label"] || S,
333
- "aria-valuemin": r.min,
334
- "aria-valuenow": v,
335
- "aria-valuemax": r.max,
336
- "aria-orientation": r.orientation,
337
- "data-orientation": r.orientation,
338
- "data-disabled": r.disabled ? "" : void 0,
339
- tabIndex: r.disabled ? void 0 : 0,
340
- ...c,
341
- ref: x,
342
- style: v === void 0 ? { display: "none" } : e.style,
343
- onFocus: _(e.onFocus, () => {
344
- r.valueIndexToChangeRef.current = o;
345
- })
346
- }
347
- ) }),
348
- s && /* @__PURE__ */ g(
349
- xe,
350
- {
351
- name: i ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
352
- form: r.form,
353
- value: v
354
- },
355
- o
356
- )
357
- ]
358
- }
359
- );
360
- }
361
- );
362
- oe.displayName = L;
363
- var xe = (e) => {
364
- const { value: t, ...n } = e, o = d.useRef(null), i = de(t);
365
- return d.useEffect(() => {
366
- const c = o.current, r = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(r, "value").set;
367
- if (i !== t && l) {
368
- const m = new Event("input", { bubbles: !0 });
369
- l.call(c, t), c.dispatchEvent(m);
370
- }
371
- }, [i, t]), /* @__PURE__ */ g("input", { style: { display: "none" }, ...n, ref: o, defaultValue: t });
372
- };
373
- function Pe(e = [], t, n) {
374
- const o = [...e];
375
- return o[n] = t, o.sort((i, c) => i - c);
376
- }
377
- function re(e, t, n) {
378
- const c = 100 / (n - t) * (e - t);
379
- return $(c, [0, 100]);
380
- }
381
- function Re(e, t) {
382
- return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
383
- }
384
- function ye(e, t) {
385
- if (e.length === 1) return 0;
386
- const n = e.map((i) => Math.abs(i - t)), o = Math.min(...n);
387
- return n.indexOf(o);
388
- }
389
- function De(e, t, n) {
390
- const o = e / 2, c = F([0, 50], [0, o]);
391
- return (o - c(t) * n) * n;
392
- }
393
- function Ce(e) {
394
- return e.slice(0, -1).map((t, n) => e[n + 1] - t);
395
- }
396
- function Ee(e, t) {
397
- if (t > 0) {
398
- const n = Ce(e);
399
- return Math.min(...n) >= t;
400
- }
401
- return !0;
402
- }
403
- function F(e, t) {
404
- return (n) => {
405
- if (e[0] === e[1] || t[0] === t[1]) return t[0];
406
- const o = (t[1] - t[0]) / (e[1] - e[0]);
407
- return t[0] + o * (n - e[0]);
408
- };
409
- }
410
- function _e(e) {
411
- return (String(e).split(".")[1] || "").length;
412
- }
413
- function Me(e, t) {
414
- const n = Math.pow(10, t);
415
- return Math.round(e * n) / n;
416
- }
417
- var He = q, ze = te, Ne = ne, Oe = oe;
418
- export {
419
- He as R,
420
- ze as T,
421
- Ne as a,
422
- Oe as b
423
- };
@@ -1,32 +0,0 @@
1
- import * as e from "react";
2
- import { P as o } from "./index-g-TFwd6Y.js";
3
- import { jsx as t } from "react/jsx-runtime";
4
- var d = "VisuallyHidden", a = e.forwardRef(
5
- (r, i) => /* @__PURE__ */ t(
6
- o.span,
7
- {
8
- ...r,
9
- ref: i,
10
- style: {
11
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
12
- position: "absolute",
13
- border: 0,
14
- width: 1,
15
- height: 1,
16
- padding: 0,
17
- margin: -1,
18
- overflow: "hidden",
19
- clip: "rect(0, 0, 0, 0)",
20
- whiteSpace: "nowrap",
21
- wordWrap: "normal",
22
- ...r.style
23
- }
24
- }
25
- )
26
- );
27
- a.displayName = d;
28
- var m = a;
29
- export {
30
- m as R,
31
- a as V
32
- };