@spark-ui/components 10.22.1 → 11.0.1

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 (143) hide show
  1. package/package.json +5 -5
  2. package/dist/DialogTrigger-woU7vsJi.d.ts +0 -142
  3. package/dist/Input-N8AWWSmt.d.ts +0 -41
  4. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
  5. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +0 -19
  6. package/dist/accordion/index.d.ts +0 -73
  7. package/dist/accordion/index.js +0 -325
  8. package/dist/accordion/index.js.map +0 -1
  9. package/dist/alert-dialog/index.d.ts +0 -119
  10. package/dist/alert-dialog/index.js +0 -1554
  11. package/dist/alert-dialog/index.js.map +0 -1
  12. package/dist/avatar/index.d.ts +0 -66
  13. package/dist/avatar/index.js +0 -1303
  14. package/dist/avatar/index.js.map +0 -1
  15. package/dist/badge/index.d.ts +0 -47
  16. package/dist/badge/index.js +0 -122
  17. package/dist/badge/index.js.map +0 -1
  18. package/dist/breadcrumb/index.d.ts +0 -64
  19. package/dist/breadcrumb/index.js +0 -327
  20. package/dist/breadcrumb/index.js.map +0 -1
  21. package/dist/button/index.d.ts +0 -41
  22. package/dist/button/index.js +0 -935
  23. package/dist/button/index.js.map +0 -1
  24. package/dist/card/index.d.ts +0 -61
  25. package/dist/card/index.js +0 -502
  26. package/dist/card/index.js.map +0 -1
  27. package/dist/carousel/index.d.ts +0 -261
  28. package/dist/carousel/index.js +0 -1801
  29. package/dist/carousel/index.js.map +0 -1
  30. package/dist/checkbox/index.d.ts +0 -120
  31. package/dist/checkbox/index.js +0 -511
  32. package/dist/checkbox/index.js.map +0 -1
  33. package/dist/chip/index.d.ts +0 -97
  34. package/dist/chip/index.js +0 -908
  35. package/dist/chip/index.js.map +0 -1
  36. package/dist/collapsible/index.d.ts +0 -43
  37. package/dist/collapsible/index.js +0 -109
  38. package/dist/collapsible/index.js.map +0 -1
  39. package/dist/combobox/index.d.ts +0 -287
  40. package/dist/combobox/index.js +0 -2588
  41. package/dist/combobox/index.js.map +0 -1
  42. package/dist/dialog/index.d.ts +0 -33
  43. package/dist/dialog/index.js +0 -1389
  44. package/dist/dialog/index.js.map +0 -1
  45. package/dist/divider/index.d.ts +0 -61
  46. package/dist/divider/index.js +0 -224
  47. package/dist/divider/index.js.map +0 -1
  48. package/dist/drawer/index.d.ts +0 -152
  49. package/dist/drawer/index.js +0 -1400
  50. package/dist/drawer/index.js.map +0 -1
  51. package/dist/dropdown/index.d.ts +0 -233
  52. package/dist/dropdown/index.js +0 -2051
  53. package/dist/dropdown/index.js.map +0 -1
  54. package/dist/form-field/index.d.ts +0 -186
  55. package/dist/form-field/index.js +0 -553
  56. package/dist/form-field/index.js.map +0 -1
  57. package/dist/icon/index.d.ts +0 -28
  58. package/dist/icon/index.js +0 -127
  59. package/dist/icon/index.js.map +0 -1
  60. package/dist/icon-button/index.d.ts +0 -16
  61. package/dist/icon-button/index.js +0 -980
  62. package/dist/icon-button/index.js.map +0 -1
  63. package/dist/input/index.d.ts +0 -78
  64. package/dist/input/index.js +0 -724
  65. package/dist/input/index.js.map +0 -1
  66. package/dist/kbd/index.d.ts +0 -9
  67. package/dist/kbd/index.js +0 -47
  68. package/dist/kbd/index.js.map +0 -1
  69. package/dist/label/index.d.ts +0 -11
  70. package/dist/label/index.js +0 -78
  71. package/dist/label/index.js.map +0 -1
  72. package/dist/link-box/index.d.ts +0 -34
  73. package/dist/link-box/index.js +0 -92
  74. package/dist/link-box/index.js.map +0 -1
  75. package/dist/pagination/index.d.ts +0 -143
  76. package/dist/pagination/index.js +0 -1353
  77. package/dist/pagination/index.js.map +0 -1
  78. package/dist/popover/index.d.ts +0 -93
  79. package/dist/popover/index.js +0 -1339
  80. package/dist/popover/index.js.map +0 -1
  81. package/dist/portal/index.d.ts +0 -13
  82. package/dist/portal/index.js +0 -37
  83. package/dist/portal/index.js.map +0 -1
  84. package/dist/progress/index.d.ts +0 -48
  85. package/dist/progress/index.js +0 -223
  86. package/dist/progress/index.js.map +0 -1
  87. package/dist/progress-tracker/index.d.ts +0 -80
  88. package/dist/progress-tracker/index.js +0 -571
  89. package/dist/progress-tracker/index.js.map +0 -1
  90. package/dist/radio-group/index.d.ts +0 -100
  91. package/dist/radio-group/index.js +0 -318
  92. package/dist/radio-group/index.js.map +0 -1
  93. package/dist/rating/index.d.ts +0 -78
  94. package/dist/rating/index.js +0 -363
  95. package/dist/rating/index.js.map +0 -1
  96. package/dist/scrolling-list/index.d.ts +0 -118
  97. package/dist/scrolling-list/index.js +0 -1426
  98. package/dist/scrolling-list/index.js.map +0 -1
  99. package/dist/segmented-gauge/index.d.ts +0 -100
  100. package/dist/segmented-gauge/index.js +0 -277
  101. package/dist/segmented-gauge/index.js.map +0 -1
  102. package/dist/select/index.d.ts +0 -167
  103. package/dist/select/index.js +0 -581
  104. package/dist/select/index.js.map +0 -1
  105. package/dist/skeleton/index.d.ts +0 -67
  106. package/dist/skeleton/index.js +0 -206
  107. package/dist/skeleton/index.js.map +0 -1
  108. package/dist/slider/index.d.ts +0 -97
  109. package/dist/slider/index.js +0 -220
  110. package/dist/slider/index.js.map +0 -1
  111. package/dist/slot/index.d.ts +0 -16
  112. package/dist/slot/index.js +0 -51
  113. package/dist/slot/index.js.map +0 -1
  114. package/dist/snackbar/index.d.ts +0 -158
  115. package/dist/snackbar/index.js +0 -1756
  116. package/dist/snackbar/index.js.map +0 -1
  117. package/dist/spinner/index.d.ts +0 -21
  118. package/dist/spinner/index.js +0 -139
  119. package/dist/spinner/index.js.map +0 -1
  120. package/dist/stepper/index.d.ts +0 -81
  121. package/dist/stepper/index.js +0 -1847
  122. package/dist/stepper/index.js.map +0 -1
  123. package/dist/switch/index.d.ts +0 -64
  124. package/dist/switch/index.js +0 -327
  125. package/dist/switch/index.js.map +0 -1
  126. package/dist/tabs/index.d.ts +0 -103
  127. package/dist/tabs/index.js +0 -1376
  128. package/dist/tabs/index.js.map +0 -1
  129. package/dist/tag/index.d.ts +0 -29
  130. package/dist/tag/index.js +0 -283
  131. package/dist/tag/index.js.map +0 -1
  132. package/dist/text-link/index.d.ts +0 -20
  133. package/dist/text-link/index.js +0 -100
  134. package/dist/text-link/index.js.map +0 -1
  135. package/dist/textarea/index.d.ts +0 -57
  136. package/dist/textarea/index.js +0 -797
  137. package/dist/textarea/index.js.map +0 -1
  138. package/dist/toast/index.d.ts +0 -56
  139. package/dist/toast/index.js +0 -1412
  140. package/dist/toast/index.js.map +0 -1
  141. package/dist/visually-hidden/index.d.ts +0 -16
  142. package/dist/visually-hidden/index.js +0 -67
  143. package/dist/visually-hidden/index.js.map +0 -1
@@ -1,363 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/rating/index.ts
21
- var rating_exports = {};
22
- __export(rating_exports, {
23
- Rating: () => Rating
24
- });
25
- module.exports = __toCommonJS(rating_exports);
26
-
27
- // src/rating/Rating.tsx
28
- var import_use_combined_state = require("@spark-ui/hooks/use-combined-state");
29
- var import_class_variance_authority4 = require("class-variance-authority");
30
- var import_react3 = require("react");
31
-
32
- // src/rating/RatingStar.tsx
33
- var import_StarFill = require("@spark-ui/icons/StarFill");
34
- var import_StarOutline = require("@spark-ui/icons/StarOutline");
35
- var import_class_variance_authority3 = require("class-variance-authority");
36
-
37
- // src/icon/Icon.tsx
38
- var import_react2 = require("react");
39
-
40
- // src/slot/Slot.tsx
41
- var import_radix_ui = require("radix-ui");
42
- var import_react = require("react");
43
- var import_jsx_runtime = require("react/jsx-runtime");
44
- var Slottable = import_radix_ui.Slot.Slottable;
45
- var Slot = ({ ref, ...props }) => {
46
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
47
- };
48
-
49
- // src/visually-hidden/VisuallyHidden.tsx
50
- var import_jsx_runtime2 = require("react/jsx-runtime");
51
- var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
52
- const Component = asChild ? Slot : "span";
53
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
54
- Component,
55
- {
56
- ...props,
57
- ref,
58
- style: {
59
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
60
- position: "absolute",
61
- border: 0,
62
- width: 1,
63
- height: 1,
64
- padding: 0,
65
- margin: -1,
66
- overflow: "hidden",
67
- clip: "rect(0, 0, 0, 0)",
68
- whiteSpace: "nowrap",
69
- wordWrap: "normal",
70
- ...props.style
71
- }
72
- }
73
- );
74
- };
75
- VisuallyHidden.displayName = "VisuallyHidden";
76
-
77
- // src/icon/Icon.styles.tsx
78
- var import_internal_utils = require("@spark-ui/internal-utils");
79
- var import_class_variance_authority = require("class-variance-authority");
80
- var iconStyles = (0, import_class_variance_authority.cva)(["fill-current shrink-0"], {
81
- variants: {
82
- /**
83
- * Color scheme of the icon.
84
- */
85
- intent: (0, import_internal_utils.makeVariants)({
86
- current: ["text-current"],
87
- main: ["text-main"],
88
- support: ["text-support"],
89
- accent: ["text-accent"],
90
- basic: ["text-basic"],
91
- success: ["text-success"],
92
- alert: ["text-alert"],
93
- error: ["text-error"],
94
- info: ["text-info"],
95
- neutral: ["text-neutral"]
96
- }),
97
- /**
98
- * Sets the size of the icon.
99
- */
100
- size: (0, import_internal_utils.makeVariants)({
101
- current: ["u-current-font-size"],
102
- sm: ["w-sz-16", "h-sz-16"],
103
- md: ["w-sz-24", "h-sz-24"],
104
- lg: ["w-sz-32", "h-sz-32"],
105
- xl: ["w-sz-40", "h-sz-40"]
106
- })
107
- }
108
- });
109
-
110
- // src/icon/Icon.tsx
111
- var import_jsx_runtime3 = require("react/jsx-runtime");
112
- var Icon = ({
113
- label,
114
- className,
115
- size = "current",
116
- intent = "current",
117
- children,
118
- ...others
119
- }) => {
120
- const child = import_react2.Children.only(children);
121
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
122
- (0, import_react2.cloneElement)(child, {
123
- className: iconStyles({ className, size, intent }),
124
- "data-spark-component": "icon",
125
- "aria-hidden": "true",
126
- focusable: "false",
127
- ...others
128
- }),
129
- label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VisuallyHidden, { children: label })
130
- ] });
131
- };
132
- Icon.displayName = "Icon";
133
-
134
- // src/rating/RatingStar.styles.ts
135
- var import_class_variance_authority2 = require("class-variance-authority");
136
- var emptyRemainingStarsOnHoverClass = (0, import_class_variance_authority2.cx)("[&_>_div]:peer-hover:w-0!");
137
- var ratingStarStyles = (0, import_class_variance_authority2.cva)(
138
- ["peer", "after:inset-0", "group", "relative", "after:block after:absolute"],
139
- {
140
- variants: {
141
- disabled: {
142
- true: "opacity-dim-3",
143
- false: ""
144
- },
145
- readOnly: {
146
- true: "",
147
- false: ""
148
- },
149
- gap: {
150
- sm: ["after:w-[calc(100%+(var(--spacing-sm)))]", "last-of-type:after:content-none"],
151
- md: ["after:w-[calc(100%+(var(--spacing-md)))]", "last-of-type:after:content-none"]
152
- }
153
- },
154
- compoundVariants: [
155
- {
156
- readOnly: false,
157
- disabled: false,
158
- className: (0, import_class_variance_authority2.cx)(emptyRemainingStarsOnHoverClass, "cursor-pointer")
159
- }
160
- ],
161
- defaultVariants: {
162
- disabled: false,
163
- readOnly: false,
164
- gap: "sm"
165
- }
166
- }
167
- );
168
- var ratingStarIconStyles = (0, import_class_variance_authority2.cva)("", {
169
- variants: {
170
- size: {
171
- sm: "text-caption-link",
172
- md: "text-body-1",
173
- lg: "text-display-1"
174
- },
175
- design: {
176
- filled: [
177
- "text-main-variant",
178
- "group-[[data-part=star][data-hovered]]:text-main-variant-hovered"
179
- ],
180
- outlined: ["text-on-surface/dim-3"]
181
- }
182
- }
183
- });
184
-
185
- // src/rating/RatingStar.tsx
186
- var import_jsx_runtime4 = require("react/jsx-runtime");
187
- var RatingStar = ({
188
- value,
189
- size,
190
- disabled,
191
- readOnly,
192
- onClick,
193
- onMouseEnter,
194
- ref: forwardedRef
195
- }) => {
196
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
197
- "div",
198
- {
199
- "data-spark-component": "rating-star",
200
- ref: forwardedRef,
201
- onMouseEnter,
202
- className: ratingStarStyles({
203
- gap: size === "lg" ? "md" : "sm",
204
- disabled,
205
- readOnly
206
- }),
207
- "data-part": "star",
208
- onClick,
209
- children: [
210
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
211
- "div",
212
- {
213
- className: (0, import_class_variance_authority3.cx)(
214
- "z-raised absolute overflow-hidden",
215
- "group-[[data-part=star][data-hovered]]:overflow-visible"
216
- ),
217
- style: { width: value * 100 + "%" },
218
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
219
- Icon,
220
- {
221
- className: ratingStarIconStyles({
222
- size,
223
- design: "filled"
224
- }),
225
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_StarFill.StarFill, {})
226
- }
227
- )
228
- }
229
- ),
230
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { className: ratingStarIconStyles({ size, design: "outlined" }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_StarOutline.StarOutline, {}) })
231
- ]
232
- }
233
- );
234
- };
235
-
236
- // src/rating/utils.ts
237
- function getNearestHalfDecimal(num) {
238
- return Math.round(num / 0.5) * 0.5;
239
- }
240
- function getStarValue({ value, index }) {
241
- if (value === void 0) return 0;
242
- const starPosition = index + 1;
243
- const formattedValue = getNearestHalfDecimal(value);
244
- if (Math.ceil(formattedValue) < starPosition) return 0;
245
- return formattedValue >= starPosition ? 1 : 0.5;
246
- }
247
- function splitAt(arr, index) {
248
- const prev = arr.slice(0, index);
249
- const next = arr.slice(index);
250
- return [prev, next];
251
- }
252
-
253
- // src/rating/Rating.tsx
254
- var import_jsx_runtime5 = require("react/jsx-runtime");
255
- var Rating = ({
256
- defaultValue,
257
- value: propValue,
258
- onValueChange,
259
- size = "md",
260
- disabled,
261
- readOnly,
262
- name,
263
- id,
264
- "aria-label": ariaLabel,
265
- ref,
266
- ...rest
267
- }) => {
268
- const inputRef = (0, import_react3.useRef)(null);
269
- const starRefList = (0, import_react3.useRef)([]);
270
- const [value, setRatingValue] = (0, import_use_combined_state.useCombinedState)(propValue, defaultValue, onValueChange);
271
- const valueRef = (0, import_react3.useRef)(value);
272
- const isInteractive = !(disabled || readOnly);
273
- function onStarClick(index) {
274
- if (!inputRef.current) return;
275
- setRatingValue(index + 1);
276
- valueRef.current = index + 1;
277
- inputRef.current.focus();
278
- inputRef.current.setAttribute("data-clicked", "");
279
- }
280
- function onInputChange(event) {
281
- if (valueRef.current === Number(event.target.value) || Number(event.target.value) === 0) {
282
- return;
283
- }
284
- valueRef.current = Number(event.target.value);
285
- setRatingValue(Number(event.target.value));
286
- }
287
- function onStarMouseEnter({ currentTarget }) {
288
- const currentStarIndex = starRefList.current.findIndex((star) => star === currentTarget);
289
- const [previousStars, followingStars] = splitAt(starRefList.current, currentStarIndex + 1);
290
- previousStars.forEach((star) => star.setAttribute("data-hovered", ""));
291
- followingStars.forEach((star) => star.removeAttribute("data-hovered"));
292
- }
293
- const handleStarRef = (0, import_react3.useCallback)((elm) => {
294
- if (!elm) return;
295
- starRefList.current.push(elm);
296
- }, []);
297
- function resetDataPartInputAttr() {
298
- inputRef.current?.removeAttribute("data-clicked");
299
- }
300
- function resetDataPartStarAttr() {
301
- starRefList.current.forEach((star) => star.removeAttribute("data-hovered"));
302
- }
303
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
304
- "div",
305
- {
306
- className: "relative inline-flex",
307
- ref,
308
- "data-spark-component": "rating",
309
- ...rest,
310
- onMouseLeave: resetDataPartStarAttr,
311
- children: [
312
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
313
- "input",
314
- {
315
- name,
316
- id,
317
- "aria-label": ariaLabel,
318
- ref: inputRef,
319
- "data-part": "input",
320
- className: "peer absolute inset-0 opacity-0",
321
- type: "range",
322
- min: "0",
323
- max: "5",
324
- step: readOnly ? 0.5 : 1,
325
- disabled,
326
- readOnly,
327
- value: getNearestHalfDecimal(value ?? 0),
328
- onChange: (event) => isInteractive && onInputChange(event),
329
- onBlur: resetDataPartInputAttr
330
- }
331
- ),
332
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
333
- "div",
334
- {
335
- className: (0, import_class_variance_authority4.cx)(
336
- size === "lg" ? "gap-x-md" : "gap-x-sm",
337
- "flex",
338
- "peer-focus-visible:u-outline peer-[[data-part=input][data-clicked]]:shadow-none"
339
- ),
340
- children: Array.from({ length: 5 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
341
- RatingStar,
342
- {
343
- disabled,
344
- readOnly,
345
- size,
346
- onClick: () => isInteractive && onStarClick(index),
347
- onMouseEnter: (event) => isInteractive && onStarMouseEnter(event),
348
- ref: handleStarRef,
349
- value: getStarValue({ index, value })
350
- },
351
- index
352
- ))
353
- }
354
- )
355
- ]
356
- }
357
- );
358
- };
359
- // Annotate the CommonJS export names for ESM import in node:
360
- 0 && (module.exports = {
361
- Rating
362
- });
363
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/rating/index.ts","../../src/rating/Rating.tsx","../../src/rating/RatingStar.tsx","../../src/icon/Icon.tsx","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/rating/RatingStar.styles.ts","../../src/rating/utils.ts"],"sourcesContent":["export { Rating, type RatingProps } from './Rating'\n","import { useCombinedState } from '@spark-ui/hooks/use-combined-state'\nimport { cx } from 'class-variance-authority'\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n type MouseEvent,\n type PropsWithChildren,\n useCallback,\n useRef,\n} from 'react'\n\nimport { RatingStar, type RatingStarProps } from './RatingStar'\nimport { getNearestHalfDecimal, getStarValue, splitAt } from './utils'\n\nexport interface RatingProps extends PropsWithChildren<ComponentPropsWithRef<'div'>> {\n /**\n * Use the `defaultValue` prop to set the default value of the input, on a from 0 to 5.\n *\n * Use this when you want to use it in an uncontrolled manner\n */\n defaultValue?: number\n /**\n * The value is the number of the rating selected, on a scale from 0 to 5.\n *\n * Use this when you want to use it in a controlled manner,\n * in conjunction with the `onValueChange` prop\n */\n value?: number\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: number) => void\n /**\n * Sets the component as interactive or not.\n * @default undefined\n */\n readOnly?: boolean\n /**\n * When `true`, prevents the user from interacting.\n * @default false\n */\n disabled?: boolean\n /**\n * Sets the size of the stars.\n * @default 'md'\n */\n size?: RatingStarProps['size']\n /**\n * Name of the underlying input.\n * @default undefined\n */\n name?: string\n /**\n * id of the underlying input.\n * @default undefined\n */\n id?: string\n /**\n * aria-label of the underlying input.\n * @default undefined\n */\n 'aria-label': string\n}\n\nexport const Rating = ({\n defaultValue,\n value: propValue,\n onValueChange,\n size = 'md',\n disabled,\n readOnly,\n name,\n id,\n 'aria-label': ariaLabel,\n ref,\n ...rest\n}: RatingProps) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const starRefList = useRef<HTMLDivElement[]>([])\n\n const [value, setRatingValue] = useCombinedState(propValue, defaultValue, onValueChange)\n\n const valueRef = useRef(value)\n const isInteractive = !(disabled || readOnly)\n\n function onStarClick(index: number) {\n if (!inputRef.current) return\n\n setRatingValue(index + 1)\n valueRef.current = index + 1\n\n inputRef.current.focus()\n inputRef.current.setAttribute('data-clicked', '')\n }\n\n function onInputChange(event: ChangeEvent<HTMLInputElement>) {\n // 1. Avoiding unnecessary calls to onValueChange prop if value doesn't change\n // 2. Preventing value to be resetted to 0\n if (valueRef.current === Number(event.target.value) || Number(event.target.value) === 0) {\n return\n }\n valueRef.current = Number(event.target.value)\n\n setRatingValue(Number(event.target.value))\n }\n\n function onStarMouseEnter({ currentTarget }: MouseEvent<HTMLDivElement>) {\n const currentStarIndex = starRefList.current.findIndex(star => star === currentTarget)\n\n const [previousStars, followingStars] = splitAt(starRefList.current, currentStarIndex + 1)\n\n previousStars.forEach(star => star.setAttribute('data-hovered', ''))\n followingStars.forEach(star => star.removeAttribute('data-hovered'))\n }\n\n const handleStarRef = useCallback((elm: HTMLDivElement | null) => {\n if (!elm) return\n starRefList.current.push(elm)\n }, [])\n\n function resetDataPartInputAttr() {\n inputRef.current?.removeAttribute('data-clicked')\n }\n\n function resetDataPartStarAttr() {\n starRefList.current.forEach(star => star.removeAttribute('data-hovered'))\n }\n\n return (\n <div\n className=\"relative inline-flex\"\n ref={ref}\n data-spark-component=\"rating\"\n {...rest}\n onMouseLeave={resetDataPartStarAttr}\n >\n <input\n name={name}\n id={id}\n aria-label={ariaLabel}\n ref={inputRef}\n data-part=\"input\"\n className=\"peer absolute inset-0 opacity-0\"\n type=\"range\"\n min=\"0\"\n max=\"5\"\n step={readOnly ? 0.5 : 1}\n disabled={disabled}\n readOnly={readOnly}\n value={getNearestHalfDecimal(value ?? 0)}\n onChange={event => isInteractive && onInputChange(event)}\n onBlur={resetDataPartInputAttr}\n />\n <div\n className={cx(\n size === 'lg' ? 'gap-x-md' : 'gap-x-sm',\n 'flex',\n 'peer-focus-visible:u-outline peer-[[data-part=input][data-clicked]]:shadow-none'\n )}\n >\n {Array.from({ length: 5 }).map((_, index) => (\n <RatingStar\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n onClick={() => isInteractive && onStarClick(index)}\n onMouseEnter={event => isInteractive && onStarMouseEnter(event)}\n ref={handleStarRef}\n key={index}\n value={getStarValue({ index, value })}\n />\n ))}\n </div>\n </div>\n )\n}\n","import { StarFill } from '@spark-ui/icons/StarFill'\nimport { StarOutline } from '@spark-ui/icons/StarOutline'\nimport { cx } from 'class-variance-authority'\nimport { type MouseEvent, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport {\n ratingStarIconStyles,\n type RatingStarIconStylesProps,\n ratingStarStyles,\n type RatingStarstylesProps,\n} from './RatingStar.styles'\nimport type { StarValue } from './types'\n\nexport interface RatingStarProps extends RatingStarstylesProps, RatingStarIconStylesProps {\n value: StarValue\n onClick?: (event: MouseEvent<HTMLDivElement>) => void\n onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void\n ref?: Ref<HTMLDivElement>\n}\n\nexport const RatingStar = ({\n value,\n size,\n disabled,\n readOnly,\n onClick,\n onMouseEnter,\n ref: forwardedRef,\n}: RatingStarProps) => {\n return (\n <div\n data-spark-component=\"rating-star\"\n ref={forwardedRef}\n onMouseEnter={onMouseEnter}\n className={ratingStarStyles({\n gap: size === 'lg' ? 'md' : 'sm',\n disabled,\n readOnly,\n })}\n data-part=\"star\"\n onClick={onClick}\n >\n <div\n className={cx(\n 'z-raised absolute overflow-hidden',\n 'group-[[data-part=star][data-hovered]]:overflow-visible'\n )}\n style={{ width: value * 100 + '%' }}\n >\n <Icon\n className={ratingStarIconStyles({\n size,\n design: 'filled',\n })}\n >\n <StarFill />\n </Icon>\n </div>\n\n <Icon className={ratingStarIconStyles({ size, design: 'outlined' })}>\n <StarOutline />\n </Icon>\n </div>\n )\n}\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cva, cx, VariantProps } from 'class-variance-authority'\n\nconst emptyRemainingStarsOnHoverClass = cx('[&_>_div]:peer-hover:w-0!')\n\nconst ratingStarStyles = cva(\n ['peer', 'after:inset-0', 'group', 'relative', 'after:block after:absolute'],\n {\n variants: {\n disabled: {\n true: 'opacity-dim-3',\n false: '',\n },\n readOnly: {\n true: '',\n false: '',\n },\n gap: {\n sm: ['after:w-[calc(100%+(var(--spacing-sm)))]', 'last-of-type:after:content-none'],\n md: ['after:w-[calc(100%+(var(--spacing-md)))]', 'last-of-type:after:content-none'],\n },\n },\n compoundVariants: [\n {\n readOnly: false,\n disabled: false,\n className: cx(emptyRemainingStarsOnHoverClass, 'cursor-pointer'),\n },\n ],\n defaultVariants: {\n disabled: false,\n readOnly: false,\n gap: 'sm',\n },\n }\n)\n\nconst ratingStarIconStyles = cva('', {\n variants: {\n size: {\n sm: 'text-caption-link',\n md: 'text-body-1',\n lg: 'text-display-1',\n },\n design: {\n filled: [\n 'text-main-variant',\n 'group-[[data-part=star][data-hovered]]:text-main-variant-hovered',\n ],\n outlined: ['text-on-surface/dim-3'],\n },\n },\n})\n\ntype RatingStarstylesProps = Omit<VariantProps<typeof ratingStarStyles>, 'gap'>\ntype RatingStarIconStylesProps = Omit<VariantProps<typeof ratingStarIconStyles>, 'design'>\n\nexport { ratingStarStyles, ratingStarIconStyles }\nexport type { RatingStarstylesProps, RatingStarIconStylesProps }\n","import { type StarValue } from './types'\n\nfunction getNearestHalfDecimal(num: number): number {\n return Math.round(num / 0.5) * 0.5\n}\n\nfunction getStarValue({ value, index }: { value?: number; index: number }): StarValue {\n if (value === undefined) return 0\n\n const starPosition = index + 1\n const formattedValue = getNearestHalfDecimal(value)\n\n if (Math.ceil(formattedValue) < starPosition) return 0\n\n return formattedValue >= starPosition ? 1 : 0.5\n}\n\nfunction splitAt<T>(arr: T[], index: number): [T[], T[]] {\n const prev = arr.slice(0, index)\n const next = arr.slice(index)\n\n return [prev, next]\n}\n\nexport { getNearestHalfDecimal, getStarValue, splitAt }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gCAAiC;AACjC,IAAAA,mCAAmB;AACnB,IAAAC,gBAOO;;;ACTP,sBAAyB;AACzB,yBAA4B;AAC5B,IAAAC,mCAAmB;;;ACFnB,IAAAC,gBAA0F;;;ACA1F,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK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YAEP,CACD;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_class_variance_authority","import_react","import_class_variance_authority","import_react","RadixSlot","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime"]}
@@ -1,118 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentPropsWithRef, ReactNode, ComponentPropsWithoutRef } from 'react';
3
- import { IconButtonProps } from '../icon-button/index.js';
4
- import '../button/index.js';
5
- import 'class-variance-authority/types';
6
- import 'class-variance-authority';
7
-
8
- type SnapType = 'mandatory' | 'proximity' | 'none';
9
- type ScrollBehavior = 'smooth' | 'instant';
10
- type SnapStop = 'normal' | 'always';
11
- interface Props$2 extends ComponentPropsWithRef<'div'> {
12
- /**
13
- * CSS scroll snap behavior.
14
- * - `mandatory` to force snapping on each "page".
15
- * - `proximity` to force snapping only when scroll position is near the edge of a "page". Behavior can change depending on each browser.
16
- * - `none` to disabled scroll snapping.
17
- */
18
- snapType?: SnapType;
19
- /**
20
- * Defines whether or not the scroll container is allowed to "pass over" possible snap positions.
21
- */
22
- snapStop?: SnapStop;
23
- scrollBehavior?: ScrollBehavior;
24
- /**
25
- * Add a fade effect to indicate content overflow.
26
- */
27
- withFade?: boolean;
28
- children?: ReactNode;
29
- /**
30
- * When `true`, allow previous and next buttons to be used when reaching the edges of the list.
31
- */
32
- loop?: boolean;
33
- /**
34
- * Space (in pixels) between items.
35
- */
36
- gap?: number;
37
- /**
38
- * Offset (in pixels) of the left of the optimal viewing region of the list.
39
- */
40
- scrollPadding?: number;
41
- className?: string;
42
- }
43
- declare const ScrollingList$1: {
44
- ({ snapType, snapStop, scrollBehavior, loop, gap, withFade, scrollPadding, children, className, ...rest }: Props$2): react_jsx_runtime.JSX.Element;
45
- displayName: string;
46
- };
47
-
48
- interface ScrollingListControls extends ComponentPropsWithoutRef<'div'> {
49
- /**
50
- * Visibility behavior of the control buttons:
51
- * - `always`: buttons are always visible.
52
- * - `hover`: buttons only appear on hover.
53
- *
54
- * a11y: `hover` is dangerous for accessibility as it disabled controls for touch screen users.
55
- * When using it, you must provide an alternative control outside of the list to replace them.
56
- */
57
- visibility?: 'hover' | 'always';
58
- children: ReactNode;
59
- }
60
- declare const ScrollingListControls: {
61
- ({ children, visibility, className, ...rest }: ScrollingListControls): react_jsx_runtime.JSX.Element;
62
- displayName: string;
63
- };
64
-
65
- interface ScrollingListItemProps extends ComponentPropsWithoutRef<'div'> {
66
- /**
67
- * Change the default rendered element for the one passed as a child, merging their props and behavior.
68
- */
69
- asChild?: boolean;
70
- children?: ReactNode;
71
- /**
72
- * DO NOT USE. This prop is automatically managed by the parent ScrollingList.ListItems
73
- */
74
- index?: number;
75
- className?: string;
76
- }
77
- declare const ScrollingListItem: {
78
- ({ asChild, children, index, className, ...rest }: ScrollingListItemProps): react_jsx_runtime.JSX.Element;
79
- displayName: string;
80
- };
81
-
82
- interface Props$1 extends ComponentPropsWithRef<'div'> {
83
- children?: ReactNode;
84
- className?: string;
85
- }
86
- declare const ScrollingListItems: {
87
- ({ children, ref, className, ...rest }: Props$1): react_jsx_runtime.JSX.Element;
88
- displayName: string;
89
- };
90
-
91
- declare const ScrollingListNextButton: {
92
- ({ "aria-label": ariaLabel, ...rest }: IconButtonProps): react_jsx_runtime.JSX.Element;
93
- displayName: string;
94
- };
95
-
96
- declare const ScrollingListPrevButton: {
97
- ({ "aria-label": ariaLabel, ...rest }: IconButtonProps): react_jsx_runtime.JSX.Element;
98
- displayName: string;
99
- };
100
-
101
- interface Props extends ComponentPropsWithoutRef<'button'> {
102
- children: string;
103
- }
104
- declare const ScrollingListSkipButton: {
105
- ({ children, ...rest }: Props): react_jsx_runtime.JSX.Element;
106
- displayName: string;
107
- };
108
-
109
- declare const ScrollingList: typeof ScrollingList$1 & {
110
- Controls: typeof ScrollingListControls;
111
- NextButton: typeof ScrollingListNextButton;
112
- PrevButton: typeof ScrollingListPrevButton;
113
- Item: typeof ScrollingListItem;
114
- Items: typeof ScrollingListItems;
115
- SkipButton: typeof ScrollingListSkipButton;
116
- };
117
-
118
- export { ScrollingList };