@epilot/spark-ui 0.31.1 → 0.32.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.
- package/dist/button-CT39v1M3.d.cts +52 -0
- package/dist/button-i1Bgbw4p.d.ts +52 -0
- package/dist/cn-DzRH6EW_.d.cts +4 -0
- package/dist/cn-DzRH6EW_.d.ts +4 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.cjs +1 -1
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/attachment.cjs +2 -2
- package/dist/components/attachment.d.cts +4 -4
- package/dist/components/attachment.d.ts +4 -4
- package/dist/components/attachment.js +2 -2
- package/dist/components/autocomplete.cjs +11 -16
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.d.cts +4 -10
- package/dist/components/autocomplete.d.ts +4 -10
- package/dist/components/autocomplete.js +12 -17
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.cjs +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/box.cjs +2 -2
- package/dist/components/box.cjs.map +1 -1
- package/dist/components/box.js +3 -3
- package/dist/components/box.js.map +1 -1
- package/dist/components/breadcrumbs.cjs +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/bubble.cjs +2 -2
- package/dist/components/bubble.d.cts +2 -2
- package/dist/components/bubble.d.ts +2 -2
- package/dist/components/bubble.js +2 -2
- package/dist/components/button-group.cjs +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.cjs +13 -30
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +3 -36
- package/dist/components/button.d.ts +3 -36
- package/dist/components/button.js +13 -30
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.cjs +32 -4
- package/dist/components/calendar.cjs.map +1 -1
- package/dist/components/calendar.d.cts +2 -2
- package/dist/components/calendar.d.ts +2 -2
- package/dist/components/calendar.js +34 -6
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.d.cts +1 -1
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/callout.js +1 -1
- package/dist/components/card.cjs +6 -5
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +9 -8
- package/dist/components/card.d.ts +9 -8
- package/dist/components/card.js +7 -6
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-card.cjs +162 -65
- package/dist/components/checkbox-card.cjs.map +1 -1
- package/dist/components/checkbox-card.d.cts +38 -18
- package/dist/components/checkbox-card.d.ts +38 -18
- package/dist/components/checkbox-card.js +160 -66
- package/dist/components/checkbox-card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.cjs +5 -18
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +6 -19
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.cjs +5 -3
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.js +6 -4
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/dialog.cjs +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropzone.cjs +224 -0
- package/dist/components/dropzone.cjs.map +1 -0
- package/dist/components/dropzone.d.cts +66 -0
- package/dist/components/dropzone.d.ts +66 -0
- package/dist/components/dropzone.js +215 -0
- package/dist/components/dropzone.js.map +1 -0
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.cts +1 -1
- package/dist/components/empty-state.d.ts +1 -1
- package/dist/components/empty-state.js +1 -1
- package/dist/components/entity-card.cjs +1 -1
- package/dist/components/entity-card.js +1 -1
- package/dist/components/field.cjs +69 -11
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.d.cts +16 -3
- package/dist/components/field.d.ts +16 -3
- package/dist/components/field.js +68 -11
- package/dist/components/field.js.map +1 -1
- package/dist/components/hero-metric.cjs +1 -1
- package/dist/components/hero-metric.js +1 -1
- package/dist/components/image-carousel.cjs +183 -0
- package/dist/components/image-carousel.cjs.map +1 -0
- package/dist/components/image-carousel.d.cts +54 -0
- package/dist/components/image-carousel.d.ts +54 -0
- package/dist/components/image-carousel.js +174 -0
- package/dist/components/image-carousel.js.map +1 -0
- package/dist/components/info-block.cjs +1 -1
- package/dist/components/info-block.js +1 -1
- package/dist/components/input-date-time.cjs +16 -202
- package/dist/components/input-date-time.cjs.map +1 -1
- package/dist/components/input-date-time.d.cts +14 -31
- package/dist/components/input-date-time.d.ts +14 -31
- package/dist/components/input-date-time.js +15 -202
- package/dist/components/input-date-time.js.map +1 -1
- package/dist/components/input-date.cjs +14 -146
- package/dist/components/input-date.cjs.map +1 -1
- package/dist/components/input-date.d.cts +11 -19
- package/dist/components/input-date.d.ts +11 -19
- package/dist/components/input-date.js +13 -146
- package/dist/components/input-date.js.map +1 -1
- package/dist/components/input-group.cjs +6 -5
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +2 -30
- package/dist/components/input-group.d.ts +2 -30
- package/dist/components/input-group.js +5 -4
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +3 -3
- package/dist/components/input-otp.cjs.map +1 -1
- package/dist/components/input-otp.js +3 -3
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.cjs +4 -2
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +2 -12
- package/dist/components/input.d.ts +2 -12
- package/dist/components/input.js +4 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/line-chart.cjs +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/list.cjs +2 -2
- package/dist/components/list.js +2 -2
- package/dist/components/marker.cjs +2 -2
- package/dist/components/marker.d.cts +1 -1
- package/dist/components/marker.d.ts +1 -1
- package/dist/components/marker.js +2 -2
- package/dist/components/message-scroller.cjs +1 -1
- package/dist/components/message-scroller.d.cts +1 -1
- package/dist/components/message-scroller.d.ts +1 -1
- package/dist/components/message-scroller.js +1 -1
- package/dist/components/page-header.cjs +1 -1
- package/dist/components/page-header.d.cts +2 -2
- package/dist/components/page-header.d.ts +2 -2
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.cjs +124 -0
- package/dist/components/pagination.cjs.map +1 -0
- package/dist/components/pagination.d.cts +42 -0
- package/dist/components/pagination.d.ts +42 -0
- package/dist/components/pagination.js +115 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/period-tabs.cjs +1 -1
- package/dist/components/period-tabs.d.cts +1 -1
- package/dist/components/period-tabs.d.ts +1 -1
- package/dist/components/period-tabs.js +1 -1
- package/dist/components/pill.cjs +34 -33
- package/dist/components/pill.cjs.map +1 -1
- package/dist/components/pill.d.cts +19 -12
- package/dist/components/pill.d.ts +19 -12
- package/dist/components/pill.js +35 -35
- package/dist/components/pill.js.map +1 -1
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.cts +2 -29
- package/dist/components/popover.d.ts +2 -29
- package/dist/components/popover.js +1 -1
- package/dist/components/power-history-chart.cjs +1 -1
- package/dist/components/power-history-chart.js +1 -1
- package/dist/components/power-network.cjs +1 -1
- package/dist/components/power-network.js +1 -1
- package/dist/components/progress.cjs +126 -13
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +19 -10
- package/dist/components/progress.d.ts +19 -10
- package/dist/components/progress.js +126 -15
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-card-group.cjs +142 -70
- package/dist/components/radio-card-group.cjs.map +1 -1
- package/dist/components/radio-card-group.d.cts +37 -15
- package/dist/components/radio-card-group.d.ts +37 -15
- package/dist/components/radio-card-group.js +140 -71
- package/dist/components/radio-card-group.js.map +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/schedule-list.cjs +1 -1
- package/dist/components/schedule-list.js +1 -1
- package/dist/components/select.cjs +15 -7
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +1 -0
- package/dist/components/select.d.ts +1 -0
- package/dist/components/select.js +16 -8
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/step-indicator.cjs +128 -0
- package/dist/components/step-indicator.cjs.map +1 -0
- package/dist/components/step-indicator.d.cts +25 -0
- package/dist/components/step-indicator.d.ts +25 -0
- package/dist/components/step-indicator.js +124 -0
- package/dist/components/step-indicator.js.map +1 -0
- package/dist/components/stepper.cjs +3 -2
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +1 -2
- package/dist/components/stepper.d.ts +1 -2
- package/dist/components/stepper.js +3 -2
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch-group.cjs +1 -1
- package/dist/components/switch-group.js +1 -1
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +3 -3
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.cjs +8 -2
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +8 -2
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/theme.cjs +1 -1
- package/dist/components/theme.js +1 -1
- package/dist/components/time-picker.cjs +3 -38
- package/dist/components/time-picker.cjs.map +1 -1
- package/dist/components/time-picker.js +1 -36
- package/dist/components/time-picker.js.map +1 -1
- package/dist/components/toast.cjs +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle.d.cts +1 -1
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/tooltip.cjs +3 -2
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +3 -2
- package/dist/components/tooltip.d.ts +3 -2
- package/dist/components/tooltip.js +3 -2
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/trace.cjs +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/hooks/use-isomorphic-layout-effect.cjs +9 -0
- package/dist/hooks/use-isomorphic-layout-effect.cjs.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.cts +9 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +9 -0
- package/dist/hooks/use-isomorphic-layout-effect.js +8 -0
- package/dist/hooks/use-isomorphic-layout-effect.js.map +1 -0
- package/dist/input-BZFPU-j4.d.cts +14 -0
- package/dist/input-group-5lh67qyY.d.cts +32 -0
- package/dist/input-group-Bc9_sPPN.d.ts +32 -0
- package/dist/input-zB3zmz9J.d.ts +14 -0
- package/dist/lib/accent-theme.cjs +46 -22
- package/dist/lib/accent-theme.cjs.map +1 -1
- package/dist/lib/accent-theme.js +26 -1
- package/dist/lib/accent-theme.js.map +1 -1
- package/dist/lib/calendar-field.cjs +11 -0
- package/dist/lib/calendar-field.cjs.map +1 -0
- package/dist/lib/calendar-field.d.cts +18 -0
- package/dist/lib/calendar-field.d.ts +18 -0
- package/dist/lib/calendar-field.js +8 -0
- package/dist/lib/calendar-field.js.map +1 -0
- package/dist/lib/calendar-lists.cjs +86 -97
- package/dist/lib/calendar-lists.cjs.map +1 -1
- package/dist/lib/calendar-lists.d.cts +30 -2
- package/dist/lib/calendar-lists.d.ts +30 -2
- package/dist/lib/calendar-lists.js +85 -97
- package/dist/lib/calendar-lists.js.map +1 -1
- package/dist/lib/card-control.cjs +18 -0
- package/dist/lib/card-control.cjs.map +1 -0
- package/dist/lib/card-control.d.cts +10 -0
- package/dist/lib/card-control.d.ts +10 -0
- package/dist/lib/card-control.js +17 -0
- package/dist/lib/card-control.js.map +1 -0
- package/dist/lib/checkbox-box.cjs +30 -0
- package/dist/lib/checkbox-box.cjs.map +1 -0
- package/dist/lib/checkbox-box.d.cts +13 -0
- package/dist/lib/checkbox-box.d.ts +13 -0
- package/dist/lib/checkbox-box.js +27 -0
- package/dist/lib/checkbox-box.js.map +1 -0
- package/dist/lib/container-chrome.cjs +8 -1
- package/dist/lib/container-chrome.cjs.map +1 -1
- package/dist/lib/container-chrome.d.cts +4 -2
- package/dist/lib/container-chrome.d.ts +4 -2
- package/dist/lib/container-chrome.js +8 -2
- package/dist/lib/container-chrome.js.map +1 -1
- package/dist/lib/date-field-input.cjs +121 -0
- package/dist/lib/date-field-input.cjs.map +1 -0
- package/dist/lib/date-field-input.d.cts +14 -0
- package/dist/lib/date-field-input.d.ts +14 -0
- package/dist/lib/date-field-input.js +118 -0
- package/dist/lib/date-field-input.js.map +1 -0
- package/dist/lib/date-field-time-list.cjs +81 -0
- package/dist/lib/date-field-time-list.cjs.map +1 -0
- package/dist/lib/date-field-time-list.d.cts +18 -0
- package/dist/lib/date-field-time-list.d.ts +18 -0
- package/dist/lib/date-field-time-list.js +77 -0
- package/dist/lib/date-field-time-list.js.map +1 -0
- package/dist/lib/date-field.cjs +183 -0
- package/dist/lib/date-field.cjs.map +1 -0
- package/dist/lib/date-field.d.cts +76 -0
- package/dist/lib/date-field.d.ts +76 -0
- package/dist/lib/date-field.js +177 -0
- package/dist/lib/date-field.js.map +1 -0
- package/dist/lib/date-time-mask.cjs +148 -102
- package/dist/lib/date-time-mask.cjs.map +1 -1
- package/dist/lib/date-time-mask.d.cts +21 -3
- package/dist/lib/date-time-mask.d.ts +21 -3
- package/dist/lib/date-time-mask.js +142 -103
- package/dist/lib/date-time-mask.js.map +1 -1
- package/dist/lib/generate-radix-colors.cjs +64 -5
- package/dist/lib/generate-radix-colors.cjs.map +1 -1
- package/dist/lib/generate-radix-colors.js +61 -1
- package/dist/lib/generate-radix-colors.js.map +1 -1
- package/dist/lib/input-box-variants.cjs +6 -4
- package/dist/lib/input-box-variants.cjs.map +1 -1
- package/dist/lib/input-box-variants.d.cts +3 -2
- package/dist/lib/input-box-variants.d.ts +3 -2
- package/dist/lib/input-box-variants.js +6 -5
- package/dist/lib/input-box-variants.js.map +1 -1
- package/dist/lib/mask-hint.cjs +15 -0
- package/dist/lib/mask-hint.cjs.map +1 -0
- package/dist/lib/mask-hint.d.cts +10 -0
- package/dist/lib/mask-hint.d.ts +10 -0
- package/dist/lib/mask-hint.js +14 -0
- package/dist/lib/mask-hint.js.map +1 -0
- package/dist/lib/option-list.cjs +71 -0
- package/dist/lib/option-list.cjs.map +1 -0
- package/dist/lib/option-list.d.cts +4 -0
- package/dist/lib/option-list.d.ts +4 -0
- package/dist/lib/option-list.js +67 -0
- package/dist/lib/option-list.js.map +1 -0
- package/dist/lib/time-grid.cjs +34 -0
- package/dist/lib/time-grid.cjs.map +1 -0
- package/dist/lib/time-grid.d.cts +9 -0
- package/dist/lib/time-grid.d.ts +9 -0
- package/dist/lib/time-grid.js +31 -0
- package/dist/lib/time-grid.js.map +1 -0
- package/dist/lib/toggle-group-context.d.cts +1 -1
- package/dist/lib/toggle-group-context.d.ts +1 -1
- package/dist/option-list-CxhR_DGq.d.cts +34 -0
- package/dist/option-list-CxhR_DGq.d.ts +34 -0
- package/dist/popover-DmcqNOkO.d.cts +31 -0
- package/dist/popover-DmcqNOkO.d.ts +31 -0
- package/dist/styles/spark-default.css +21 -0
- package/dist/styles/theme.css +9 -2
- package/dist/utils/cn.d.cts +1 -1
- package/dist/utils/cn.d.ts +1 -1
- package/package.json +3 -3
- package/dist/calendar-lists-CTby2kR5.d.cts +0 -27
- package/dist/calendar-lists-DoloqsCN.d.ts +0 -27
- package/dist/lib/calendar-day-button.cjs +0 -23
- package/dist/lib/calendar-day-button.cjs.map +0 -1
- package/dist/lib/calendar-day-button.d.cts +0 -14
- package/dist/lib/calendar-day-button.d.ts +0 -14
- package/dist/lib/calendar-day-button.js +0 -20
- package/dist/lib/calendar-day-button.js.map +0 -1
- package/dist/lib/input-date-parts.cjs +0 -155
- package/dist/lib/input-date-parts.cjs.map +0 -1
- package/dist/lib/input-date-parts.d.cts +0 -53
- package/dist/lib/input-date-parts.d.ts +0 -53
- package/dist/lib/input-date-parts.js +0 -148
- package/dist/lib/input-date-parts.js.map +0 -1
- package/dist/lib/scroll-within.cjs +0 -27
- package/dist/lib/scroll-within.cjs.map +0 -1
- package/dist/lib/scroll-within.d.cts +0 -14
- package/dist/lib/scroll-within.d.ts +0 -14
- package/dist/lib/scroll-within.js +0 -25
- package/dist/lib/scroll-within.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn } from "../utils/cn.js";
|
|
4
|
+
import { ScrollBar } from "../components/scroll-area.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
8
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
9
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
10
|
+
//#region src/lib/option-list.tsx
|
|
11
|
+
const ACTIVE_ITEM = "data-composite-item-active";
|
|
12
|
+
const OptionListContext = React$1.createContext({
|
|
13
|
+
autoFocus: false,
|
|
14
|
+
tabStop: void 0
|
|
15
|
+
});
|
|
16
|
+
function OptionList({ autoFocus = false, children, className, "data-slot": slot = "option-list", fallbackValue, onPick, value, ...props }) {
|
|
17
|
+
const context = React$1.useMemo(() => ({
|
|
18
|
+
autoFocus,
|
|
19
|
+
tabStop: value ?? fallbackValue
|
|
20
|
+
}), [
|
|
21
|
+
autoFocus,
|
|
22
|
+
fallbackValue,
|
|
23
|
+
value
|
|
24
|
+
]);
|
|
25
|
+
return /* @__PURE__ */ jsxs(ScrollArea.Root, {
|
|
26
|
+
className: cn("relative min-h-0", className),
|
|
27
|
+
"data-slot": slot,
|
|
28
|
+
children: [/* @__PURE__ */ jsx(OptionListContext.Provider, {
|
|
29
|
+
value: context,
|
|
30
|
+
children: /* @__PURE__ */ jsx(ToggleGroup, {
|
|
31
|
+
...props,
|
|
32
|
+
className: "absolute inset-0 flex flex-col gap-0.5 overscroll-contain p-2 outline-hidden",
|
|
33
|
+
loopFocus: false,
|
|
34
|
+
onValueChange: (next) => {
|
|
35
|
+
const picked = next[0] ?? value;
|
|
36
|
+
if (picked !== void 0) onPick(picked);
|
|
37
|
+
},
|
|
38
|
+
orientation: "vertical",
|
|
39
|
+
render: /* @__PURE__ */ jsx(ScrollArea.Viewport, {}),
|
|
40
|
+
tabIndex: -1,
|
|
41
|
+
value: value === void 0 ? [] : [value],
|
|
42
|
+
children
|
|
43
|
+
})
|
|
44
|
+
}), /* @__PURE__ */ jsx(ScrollBar, {})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function Option({ className, children, value, ...props }) {
|
|
48
|
+
const { autoFocus, tabStop } = React$1.useContext(OptionListContext);
|
|
49
|
+
const ref = React$1.useRef(null);
|
|
50
|
+
const isTabStop = value === tabStop;
|
|
51
|
+
React$1.useEffect(() => {
|
|
52
|
+
if (autoFocus && isTabStop) ref.current?.focus({ preventScroll: true });
|
|
53
|
+
}, [autoFocus, isTabStop]);
|
|
54
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
55
|
+
...props,
|
|
56
|
+
[ACTIVE_ITEM]: isTabStop ? "" : void 0,
|
|
57
|
+
className: cn("group/option flex shrink-0 cursor-pointer items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm text-gray hover:bg-gray-a3 focus-visible:focus-outline disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent data-pressed:bg-(--spark-style-bg,var(--color-primary)) data-pressed:text-(--spark-style-fg,var(--color-primary-foreground)) data-pressed:hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))", className),
|
|
58
|
+
"data-slot": "option",
|
|
59
|
+
ref,
|
|
60
|
+
value,
|
|
61
|
+
children
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Option, OptionList };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=option-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-list.js","names":["React","ScrollAreaPrimitive"],"sources":["../../src/lib/option-list.tsx"],"sourcesContent":["'use client'\n\nimport { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area'\nimport { Toggle } from '@base-ui/react/toggle'\nimport { ToggleGroup } from '@base-ui/react/toggle-group'\nimport * as React from 'react'\nimport { ScrollBar } from '../components/scroll-area'\nimport { cn } from '../utils/cn'\n\nconst ACTIVE_ITEM = 'data-composite-item-active'\n\nconst OptionListContext = React.createContext<{\n autoFocus: boolean\n tabStop: string | undefined\n}>({ autoFocus: false, tabStop: undefined })\n\nexport type OptionListProps = Omit<\n React.ComponentProps<'div'>,\n 'defaultValue' | 'onChange'\n> & {\n autoFocus?: boolean\n 'data-slot'?: string\n fallbackValue?: string\n onPick: (value: string) => void\n value: string | undefined\n}\n\nexport function OptionList({\n autoFocus = false,\n children,\n className,\n 'data-slot': slot = 'option-list',\n fallbackValue,\n onPick,\n value,\n ...props\n}: OptionListProps) {\n const context = React.useMemo(\n () => ({ autoFocus, tabStop: value ?? fallbackValue }),\n [autoFocus, fallbackValue, value],\n )\n return (\n <ScrollAreaPrimitive.Root\n className={cn('relative min-h-0', className)}\n data-slot={slot}\n >\n <OptionListContext.Provider value={context}>\n <ToggleGroup\n {...props}\n className=\"absolute inset-0 flex flex-col gap-0.5 overscroll-contain p-2 outline-hidden\"\n loopFocus={false}\n onValueChange={(next) => {\n const picked = next[0] ?? value\n if (picked !== undefined) onPick(picked)\n }}\n orientation=\"vertical\"\n render={<ScrollAreaPrimitive.Viewport />}\n tabIndex={-1}\n value={value === undefined ? [] : [value]}\n >\n {children}\n </ToggleGroup>\n </OptionListContext.Provider>\n <ScrollBar />\n </ScrollAreaPrimitive.Root>\n )\n}\n\nexport function Option({\n className,\n children,\n value,\n ...props\n}: Omit<React.ComponentProps<typeof Toggle>, 'value'> & { value: string }) {\n const { autoFocus, tabStop } = React.useContext(OptionListContext)\n const ref = React.useRef<HTMLButtonElement>(null)\n const isTabStop = value === tabStop\n React.useEffect(() => {\n if (autoFocus && isTabStop) ref.current?.focus({ preventScroll: true })\n }, [autoFocus, isTabStop])\n return (\n <Toggle\n {...props}\n {...{ [ACTIVE_ITEM]: isTabStop ? '' : undefined }}\n className={cn(\n 'group/option flex shrink-0 cursor-pointer items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm text-gray hover:bg-gray-a3 focus-visible:focus-outline disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent data-pressed:bg-(--spark-style-bg,var(--color-primary)) data-pressed:text-(--spark-style-fg,var(--color-primary-foreground)) data-pressed:hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))',\n className,\n )}\n data-slot=\"option\"\n ref={ref}\n value={value}\n >\n {children}\n </Toggle>\n )\n}\n"],"mappings":";;;;;;;;;;AASA,MAAM,cAAc;AAEpB,MAAM,oBAAoBA,QAAM,cAG7B;CAAE,WAAW;CAAO,SAAS,KAAA;AAAU,CAAC;AAa3C,SAAgB,WAAW,EACzB,YAAY,OACZ,UACA,WACA,aAAa,OAAO,eACpB,eACA,QACA,OACA,GAAG,SACe;CAClB,MAAM,UAAUA,QAAM,eACb;EAAE;EAAW,SAAS,SAAS;CAAc,IACpD;EAAC;EAAW;EAAe;CAAK,CAClC;CACA,OACE,qBAACC,WAAoB,MAArB;EACE,WAAW,GAAG,oBAAoB,SAAS;EAC3C,aAAW;YAFb,CAIE,oBAAC,kBAAkB,UAAnB;GAA4B,OAAO;aACjC,oBAAC,aAAD;IACE,GAAI;IACJ,WAAU;IACV,WAAW;IACX,gBAAgB,SAAS;KACvB,MAAM,SAAS,KAAK,MAAM;KAC1B,IAAI,WAAW,KAAA,GAAW,OAAO,MAAM;IACzC;IACA,aAAY;IACZ,QAAQ,oBAACA,WAAoB,UAArB,CAA+B,CAAA;IACvC,UAAU;IACV,OAAO,UAAU,KAAA,IAAY,CAAC,IAAI,CAAC,KAAK;IAEvC;GACU,CAAA;EACa,CAAA,GAC5B,oBAAC,WAAD,CAAY,CAAA,CACY;;AAE9B;AAEA,SAAgB,OAAO,EACrB,WACA,UACA,OACA,GAAG,SACsE;CACzE,MAAM,EAAE,WAAW,YAAYD,QAAM,WAAW,iBAAiB;CACjE,MAAM,MAAMA,QAAM,OAA0B,IAAI;CAChD,MAAM,YAAY,UAAU;CAC5B,QAAM,gBAAgB;EACpB,IAAI,aAAa,WAAW,IAAI,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC;CACxE,GAAG,CAAC,WAAW,SAAS,CAAC;CACzB,OACE,oBAAC,QAAD;EACE,GAAI;GACG,cAAc,YAAY,KAAK,KAAA;EACtC,WAAW,GACT,qbACA,SACF;EACA,aAAU;EACL;EACE;EAEN;CACK,CAAA;AAEZ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region src/lib/time-grid.ts
|
|
4
|
+
const MINUTES_PER_DAY = 1440;
|
|
5
|
+
const toMinutes = (value) => {
|
|
6
|
+
const match = /^(\d{1,2}):(\d{2})/.exec(value);
|
|
7
|
+
return match ? Number(match[1]) * 60 + Number(match[2]) : void 0;
|
|
8
|
+
};
|
|
9
|
+
const toTime = (minutes) => `${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}`;
|
|
10
|
+
const lastOnGrid = (stepMinutes) => Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes;
|
|
11
|
+
function stepGridValue(value, step, direction) {
|
|
12
|
+
const stepMinutes = Math.floor(step / 60);
|
|
13
|
+
if (stepMinutes <= 1) return value;
|
|
14
|
+
const base = toMinutes(value) ?? 0;
|
|
15
|
+
const next = direction === 1 ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes;
|
|
16
|
+
return toTime(Math.max(0, Math.min(next, lastOnGrid(stepMinutes))));
|
|
17
|
+
}
|
|
18
|
+
function snapToNearestStep(value, step) {
|
|
19
|
+
const stepMinutes = Math.floor(step / 60);
|
|
20
|
+
if (stepMinutes <= 1) return value;
|
|
21
|
+
const total = toMinutes(value);
|
|
22
|
+
if (total === void 0 || total % stepMinutes === 0) return value;
|
|
23
|
+
return toTime(Math.min(Math.round(total / stepMinutes) * stepMinutes, lastOnGrid(stepMinutes)));
|
|
24
|
+
}
|
|
25
|
+
function timesOnGrid(step) {
|
|
26
|
+
const stepMinutes = Math.max(1, Math.floor(step / 60));
|
|
27
|
+
return Array.from({ length: Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) + 1 }, (_, index) => toTime(index * stepMinutes));
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.snapToNearestStep = snapToNearestStep;
|
|
31
|
+
exports.stepGridValue = stepGridValue;
|
|
32
|
+
exports.timesOnGrid = timesOnGrid;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=time-grid.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-grid.cjs","names":[],"sources":["../../src/lib/time-grid.ts"],"sourcesContent":["const MINUTES_PER_DAY = 24 * 60\n\nconst toMinutes = (value: string) => {\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n return match ? Number(match[1]) * 60 + Number(match[2]) : undefined\n}\n\nconst toTime = (minutes: number) =>\n `${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`\n\nconst lastOnGrid = (stepMinutes: number) =>\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n\nexport function stepGridValue(\n value: string,\n step: number,\n direction: 1 | -1,\n): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const base = toMinutes(value) ?? 0\n const next =\n direction === 1\n ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes\n : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes\n return toTime(Math.max(0, Math.min(next, lastOnGrid(stepMinutes))))\n}\n\nexport function snapToNearestStep(value: string, step: number): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const total = toMinutes(value)\n if (total === undefined || total % stepMinutes === 0) return value\n return toTime(\n Math.min(\n Math.round(total / stepMinutes) * stepMinutes,\n lastOnGrid(stepMinutes),\n ),\n )\n}\n\nexport function timesOnGrid(step: number): string[] {\n const stepMinutes = Math.max(1, Math.floor(step / 60))\n return Array.from(\n { length: Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) + 1 },\n (_, index) => toTime(index * stepMinutes),\n )\n}\n"],"mappings":";;;AAAA,MAAM,kBAAkB;AAExB,MAAM,aAAa,UAAkB;CACnC,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,OAAO,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAK,OAAO,MAAM,EAAE,IAAI,KAAA;AAC5D;AAEA,MAAM,UAAU,YACd,GAAG,OAAO,KAAK,MAAM,UAAU,EAAE,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,UAAU,EAAE,EAAE,SAAS,GAAG,GAAG;AAE9F,MAAM,cAAc,gBAClB,KAAK,OAAO,kBAAkB,KAAK,WAAW,IAAI;AAEpD,SAAgB,cACd,OACA,MACA,WACQ;CACR,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,OAAO,UAAU,KAAK,KAAK;CACjC,MAAM,OACJ,cAAc,IACV,KAAK,MAAM,OAAO,WAAW,IAAI,cAAc,cAC/C,KAAK,KAAK,OAAO,WAAW,IAAI,cAAc;CACpD,OAAO,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,WAAW,WAAW,CAAC,CAAC,CAAC;AACpE;AAEA,SAAgB,kBAAkB,OAAe,MAAsB;CACrE,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,QAAQ,UAAU,KAAK;CAC7B,IAAI,UAAU,KAAA,KAAa,QAAQ,gBAAgB,GAAG,OAAO;CAC7D,OAAO,OACL,KAAK,IACH,KAAK,MAAM,QAAQ,WAAW,IAAI,aAClC,WAAW,WAAW,CACxB,CACF;AACF;AAEA,SAAgB,YAAY,MAAwB;CAClD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,EAAE,CAAC;CACrD,OAAO,MAAM,KACX,EAAE,QAAQ,KAAK,OAAO,kBAAkB,KAAK,WAAW,IAAI,EAAE,IAC7D,GAAG,UAAU,OAAO,QAAQ,WAAW,CAC1C;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/time-grid.d.ts
|
|
4
|
+
declare function stepGridValue(value: string, step: number, direction: 1 | -1): string;
|
|
5
|
+
declare function snapToNearestStep(value: string, step: number): string;
|
|
6
|
+
declare function timesOnGrid(step: number): string[];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { snapToNearestStep, stepGridValue, timesOnGrid };
|
|
9
|
+
//# sourceMappingURL=time-grid.d.cts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/time-grid.d.ts
|
|
4
|
+
declare function stepGridValue(value: string, step: number, direction: 1 | -1): string;
|
|
5
|
+
declare function snapToNearestStep(value: string, step: number): string;
|
|
6
|
+
declare function timesOnGrid(step: number): string[];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { snapToNearestStep, stepGridValue, timesOnGrid };
|
|
9
|
+
//# sourceMappingURL=time-grid.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/time-grid.ts
|
|
3
|
+
const MINUTES_PER_DAY = 1440;
|
|
4
|
+
const toMinutes = (value) => {
|
|
5
|
+
const match = /^(\d{1,2}):(\d{2})/.exec(value);
|
|
6
|
+
return match ? Number(match[1]) * 60 + Number(match[2]) : void 0;
|
|
7
|
+
};
|
|
8
|
+
const toTime = (minutes) => `${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}`;
|
|
9
|
+
const lastOnGrid = (stepMinutes) => Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes;
|
|
10
|
+
function stepGridValue(value, step, direction) {
|
|
11
|
+
const stepMinutes = Math.floor(step / 60);
|
|
12
|
+
if (stepMinutes <= 1) return value;
|
|
13
|
+
const base = toMinutes(value) ?? 0;
|
|
14
|
+
const next = direction === 1 ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes;
|
|
15
|
+
return toTime(Math.max(0, Math.min(next, lastOnGrid(stepMinutes))));
|
|
16
|
+
}
|
|
17
|
+
function snapToNearestStep(value, step) {
|
|
18
|
+
const stepMinutes = Math.floor(step / 60);
|
|
19
|
+
if (stepMinutes <= 1) return value;
|
|
20
|
+
const total = toMinutes(value);
|
|
21
|
+
if (total === void 0 || total % stepMinutes === 0) return value;
|
|
22
|
+
return toTime(Math.min(Math.round(total / stepMinutes) * stepMinutes, lastOnGrid(stepMinutes)));
|
|
23
|
+
}
|
|
24
|
+
function timesOnGrid(step) {
|
|
25
|
+
const stepMinutes = Math.max(1, Math.floor(step / 60));
|
|
26
|
+
return Array.from({ length: Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) + 1 }, (_, index) => toTime(index * stepMinutes));
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { snapToNearestStep, stepGridValue, timesOnGrid };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=time-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-grid.js","names":[],"sources":["../../src/lib/time-grid.ts"],"sourcesContent":["const MINUTES_PER_DAY = 24 * 60\n\nconst toMinutes = (value: string) => {\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n return match ? Number(match[1]) * 60 + Number(match[2]) : undefined\n}\n\nconst toTime = (minutes: number) =>\n `${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`\n\nconst lastOnGrid = (stepMinutes: number) =>\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n\nexport function stepGridValue(\n value: string,\n step: number,\n direction: 1 | -1,\n): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const base = toMinutes(value) ?? 0\n const next =\n direction === 1\n ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes\n : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes\n return toTime(Math.max(0, Math.min(next, lastOnGrid(stepMinutes))))\n}\n\nexport function snapToNearestStep(value: string, step: number): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const total = toMinutes(value)\n if (total === undefined || total % stepMinutes === 0) return value\n return toTime(\n Math.min(\n Math.round(total / stepMinutes) * stepMinutes,\n lastOnGrid(stepMinutes),\n ),\n )\n}\n\nexport function timesOnGrid(step: number): string[] {\n const stepMinutes = Math.max(1, Math.floor(step / 60))\n return Array.from(\n { length: Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) + 1 },\n (_, index) => toTime(index * stepMinutes),\n )\n}\n"],"mappings":";;AAAA,MAAM,kBAAkB;AAExB,MAAM,aAAa,UAAkB;CACnC,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,OAAO,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAK,OAAO,MAAM,EAAE,IAAI,KAAA;AAC5D;AAEA,MAAM,UAAU,YACd,GAAG,OAAO,KAAK,MAAM,UAAU,EAAE,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,UAAU,EAAE,EAAE,SAAS,GAAG,GAAG;AAE9F,MAAM,cAAc,gBAClB,KAAK,OAAO,kBAAkB,KAAK,WAAW,IAAI;AAEpD,SAAgB,cACd,OACA,MACA,WACQ;CACR,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,OAAO,UAAU,KAAK,KAAK;CACjC,MAAM,OACJ,cAAc,IACV,KAAK,MAAM,OAAO,WAAW,IAAI,cAAc,cAC/C,KAAK,KAAK,OAAO,WAAW,IAAI,cAAc;CACpD,OAAO,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,WAAW,WAAW,CAAC,CAAC,CAAC;AACpE;AAEA,SAAgB,kBAAkB,OAAe,MAAsB;CACrE,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,QAAQ,UAAU,KAAK;CAC7B,IAAI,UAAU,KAAA,KAAa,QAAQ,gBAAgB,GAAG,OAAO;CAC7D,OAAO,OACL,KAAK,IACH,KAAK,MAAM,QAAQ,WAAW,IAAI,aAClC,WAAW,WAAW,CACxB,CACF;AACF;AAEA,SAAgB,YAAY,MAAwB;CAClD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,EAAE,CAAC;CACrD,OAAO,MAAM,KACX,EAAE,QAAQ,KAAK,OAAO,kBAAkB,KAAK,WAAW,IAAI,EAAE,IAC7D,GAAG,UAAU,OAAO,QAAQ,WAAW,CAC1C;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { n as SparkButtonColor } from "../theme-types-CHl-L2F-.cjs";
|
|
4
|
-
import { ButtonProps } from "../
|
|
4
|
+
import { r as ButtonProps } from "../button-CT39v1M3.cjs";
|
|
5
5
|
import { ToggleStyle } from "../components/toggle.cjs";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { n as SparkButtonColor } from "../theme-types-CHl-L2F-.js";
|
|
4
|
-
import { ButtonProps } from "../
|
|
4
|
+
import { r as ButtonProps } from "../button-i1Bgbw4p.js";
|
|
5
5
|
import { ToggleStyle } from "../components/toggle.js";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
7
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
|
|
6
|
+
//#region src/lib/option-list.d.ts
|
|
7
|
+
type OptionListProps = Omit<React$1.ComponentProps<'div'>, 'defaultValue' | 'onChange'> & {
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
'data-slot'?: string;
|
|
10
|
+
fallbackValue?: string;
|
|
11
|
+
onPick: (value: string) => void;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function OptionList({
|
|
15
|
+
autoFocus,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
'data-slot': slot,
|
|
19
|
+
fallbackValue,
|
|
20
|
+
onPick,
|
|
21
|
+
value,
|
|
22
|
+
...props
|
|
23
|
+
}: OptionListProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function Option({
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
value,
|
|
28
|
+
...props
|
|
29
|
+
}: Omit<React$1.ComponentProps<typeof Toggle>, 'value'> & {
|
|
30
|
+
value: string;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { OptionList as n, OptionListProps as r, Option as t };
|
|
34
|
+
//# sourceMappingURL=option-list-CxhR_DGq.d.cts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
|
|
6
|
+
//#region src/lib/option-list.d.ts
|
|
7
|
+
type OptionListProps = Omit<React$1.ComponentProps<'div'>, 'defaultValue' | 'onChange'> & {
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
'data-slot'?: string;
|
|
10
|
+
fallbackValue?: string;
|
|
11
|
+
onPick: (value: string) => void;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function OptionList({
|
|
15
|
+
autoFocus,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
'data-slot': slot,
|
|
19
|
+
fallbackValue,
|
|
20
|
+
onPick,
|
|
21
|
+
value,
|
|
22
|
+
...props
|
|
23
|
+
}: OptionListProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function Option({
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
value,
|
|
28
|
+
...props
|
|
29
|
+
}: Omit<React$1.ComponentProps<typeof Toggle>, 'value'> & {
|
|
30
|
+
value: string;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { OptionList as n, OptionListProps as r, Option as t };
|
|
34
|
+
//# sourceMappingURL=option-list-CxhR_DGq.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { Popover } from "@base-ui/react/popover";
|
|
6
|
+
|
|
7
|
+
//#region src/components/popover.d.ts
|
|
8
|
+
declare function Popover$1(props: React$1.ComponentProps<typeof Popover.Root>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function PopoverTrigger(props: React$1.ComponentProps<typeof Popover.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function PopoverClose(props: React$1.ComponentProps<typeof Popover.Close>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** Anchors the popover to this element instead of the trigger. Pass `render` to
|
|
12
|
+
* wrap an existing element (was radix `asChild`). */
|
|
13
|
+
declare function PopoverAnchor({
|
|
14
|
+
render,
|
|
15
|
+
...props
|
|
16
|
+
}: useRender.ComponentProps<'div'>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
17
|
+
type PopoverContentProps = React$1.ComponentProps<typeof Popover.Popup> & Pick<Popover.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'anchor' | 'collisionAvoidance'> & Pick<Popover.Portal.Props, 'container'>;
|
|
18
|
+
declare function PopoverContent({
|
|
19
|
+
className,
|
|
20
|
+
align,
|
|
21
|
+
sideOffset,
|
|
22
|
+
side,
|
|
23
|
+
alignOffset,
|
|
24
|
+
anchor,
|
|
25
|
+
collisionAvoidance,
|
|
26
|
+
container,
|
|
27
|
+
...props
|
|
28
|
+
}: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PopoverTrigger as a, PopoverContent as i, PopoverAnchor as n, PopoverClose as r, Popover$1 as t };
|
|
31
|
+
//# sourceMappingURL=popover-DmcqNOkO.d.cts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { Popover } from "@base-ui/react/popover";
|
|
6
|
+
|
|
7
|
+
//#region src/components/popover.d.ts
|
|
8
|
+
declare function Popover$1(props: React$1.ComponentProps<typeof Popover.Root>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function PopoverTrigger(props: React$1.ComponentProps<typeof Popover.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function PopoverClose(props: React$1.ComponentProps<typeof Popover.Close>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** Anchors the popover to this element instead of the trigger. Pass `render` to
|
|
12
|
+
* wrap an existing element (was radix `asChild`). */
|
|
13
|
+
declare function PopoverAnchor({
|
|
14
|
+
render,
|
|
15
|
+
...props
|
|
16
|
+
}: useRender.ComponentProps<'div'>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
17
|
+
type PopoverContentProps = React$1.ComponentProps<typeof Popover.Popup> & Pick<Popover.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'anchor' | 'collisionAvoidance'> & Pick<Popover.Portal.Props, 'container'>;
|
|
18
|
+
declare function PopoverContent({
|
|
19
|
+
className,
|
|
20
|
+
align,
|
|
21
|
+
sideOffset,
|
|
22
|
+
side,
|
|
23
|
+
alignOffset,
|
|
24
|
+
anchor,
|
|
25
|
+
collisionAvoidance,
|
|
26
|
+
container,
|
|
27
|
+
...props
|
|
28
|
+
}: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PopoverTrigger as a, PopoverContent as i, PopoverAnchor as n, PopoverClose as r, Popover$1 as t };
|
|
31
|
+
//# sourceMappingURL=popover-DmcqNOkO.d.ts.map
|
|
@@ -1319,6 +1319,27 @@
|
|
|
1319
1319
|
--spark-card-c-contrast: var(--spark-contrast);
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
+
/* Feedback card colours (Card `color` only, not a Theme knob): the same six slots on the green and orange scales. */
|
|
1323
|
+
[data-card-color='success'],
|
|
1324
|
+
:where([data-card-color='success'] .spark-theme) {
|
|
1325
|
+
--spark-card-c-soft: var(--green-a3);
|
|
1326
|
+
--spark-card-c-soft-hover: var(--green-a4);
|
|
1327
|
+
--spark-card-c-surface: var(--green-2);
|
|
1328
|
+
--spark-card-c-border: var(--green-a6);
|
|
1329
|
+
--spark-card-c-solid: var(--green-9);
|
|
1330
|
+
--spark-card-c-contrast: var(--green-contrast, #fff);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
[data-card-color='warning'],
|
|
1334
|
+
:where([data-card-color='warning'] .spark-theme) {
|
|
1335
|
+
--spark-card-c-soft: var(--orange-a3);
|
|
1336
|
+
--spark-card-c-soft-hover: var(--orange-a4);
|
|
1337
|
+
--spark-card-c-surface: var(--orange-2);
|
|
1338
|
+
--spark-card-c-border: var(--orange-a6);
|
|
1339
|
+
--spark-card-c-solid: var(--orange-9);
|
|
1340
|
+
--spark-card-c-contrast: var(--orange-contrast, #fff);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1322
1343
|
/* An explicit neutral card opts out of an inherited accent card colour: initial drops each slot to its neutral fallback. */
|
|
1323
1344
|
[data-card-color='neutral'],
|
|
1324
1345
|
:where([data-card-color='neutral'] .spark-theme) {
|
package/dist/styles/theme.css
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@custom-variant dark (&:where(.dark, .dark *, .dark-theme, .dark-theme *));
|
|
10
10
|
|
|
11
11
|
@custom-variant field-floated {
|
|
12
|
-
[data-slot='field']:is(
|
|
12
|
+
[data-slot='field']:has(> [data-slot='field-label']:not(.sr-only)):is(
|
|
13
13
|
:focus-within,
|
|
14
14
|
:has(
|
|
15
15
|
:is([data-slot='input'], [data-slot='textarea']):not(:placeholder-shown)
|
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
@custom-variant field-unlabeled {
|
|
37
|
+
[data-slot='field']:not(:has(> [data-slot='field-label']:not(.sr-only))) & {
|
|
38
|
+
@slot;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
@theme static {
|
|
37
43
|
--ease-enter: cubic-bezier(0.19, 1, 0.22, 1);
|
|
38
44
|
--ease-move: cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
@@ -543,6 +549,7 @@
|
|
|
543
549
|
--color-input-active: var(--spark-a8);
|
|
544
550
|
--color-input-valid: var(--green-a7);
|
|
545
551
|
--color-input-invalid: var(--red-a7);
|
|
552
|
+
--color-input-warning: var(--orange-a8);
|
|
546
553
|
--color-input-disabled: var(--neutral-a8);
|
|
547
554
|
}
|
|
548
555
|
|
|
@@ -762,5 +769,5 @@
|
|
|
762
769
|
'bg-{input-base,input-base-hover,dropdown-base,dropdown-item-hover}'
|
|
763
770
|
);
|
|
764
771
|
@source inline(
|
|
765
|
-
'border-{input,input-active,input-valid,input-invalid,input-disabled}'
|
|
772
|
+
'border-{input,input-active,input-valid,input-invalid,input-warning,input-disabled}'
|
|
766
773
|
);
|
package/dist/utils/cn.d.cts
CHANGED
package/dist/utils/cn.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/spark-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "React UI component library from Spark SDK",
|
|
5
5
|
"homepage": "https://spark-ui.epilot.io/docs/ui",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"class-variance-authority": "^0.7.1",
|
|
82
82
|
"cn": "^0.4.0",
|
|
83
83
|
"colorjs.io": "^0.5.2",
|
|
84
|
-
"ictus": "^1.
|
|
84
|
+
"ictus": "^1.2.0",
|
|
85
85
|
"vaul": "^1.1.2",
|
|
86
|
-
"@epilot/spark-icons": "^0.0
|
|
86
|
+
"@epilot/spark-icons": "^0.1.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@stryker-mutator/core": "^10.0.0",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { MonthCaptionProps, MonthGridProps } from "@daypicker/react";
|
|
5
|
-
|
|
6
|
-
//#region src/lib/calendar-lists.d.ts
|
|
7
|
-
type CalendarListLabels = {
|
|
8
|
-
nextYear: string;
|
|
9
|
-
previousYear: string;
|
|
10
|
-
};
|
|
11
|
-
declare function MonthCaption({
|
|
12
|
-
calendarMonth,
|
|
13
|
-
className,
|
|
14
|
-
displayIndex: _,
|
|
15
|
-
...props
|
|
16
|
-
}: MonthCaptionProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
declare function MonthGrid(props: MonthGridProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare function CalendarListsProvider({
|
|
19
|
-
children,
|
|
20
|
-
labels
|
|
21
|
-
}: {
|
|
22
|
-
children: React$1.ReactNode;
|
|
23
|
-
labels: CalendarListLabels;
|
|
24
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { MonthGrid as i, CalendarListsProvider as n, MonthCaption as r, CalendarListLabels as t };
|
|
27
|
-
//# sourceMappingURL=calendar-lists-CTby2kR5.d.cts.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { MonthCaptionProps, MonthGridProps } from "@daypicker/react";
|
|
5
|
-
|
|
6
|
-
//#region src/lib/calendar-lists.d.ts
|
|
7
|
-
type CalendarListLabels = {
|
|
8
|
-
nextYear: string;
|
|
9
|
-
previousYear: string;
|
|
10
|
-
};
|
|
11
|
-
declare function MonthCaption({
|
|
12
|
-
calendarMonth,
|
|
13
|
-
className,
|
|
14
|
-
displayIndex: _,
|
|
15
|
-
...props
|
|
16
|
-
}: MonthCaptionProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
declare function MonthGrid$1(props: MonthGridProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare function CalendarListsProvider({
|
|
19
|
-
children,
|
|
20
|
-
labels
|
|
21
|
-
}: {
|
|
22
|
-
children: React$1.ReactNode;
|
|
23
|
-
labels: CalendarListLabels;
|
|
24
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { MonthGrid$1 as i, CalendarListsProvider as n, MonthCaption as r, CalendarListLabels as t };
|
|
27
|
-
//# sourceMappingURL=calendar-lists-DoloqsCN.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_chunk = require("../chunk-DY84GLCh.cjs");
|
|
5
|
-
let react = require("react");
|
|
6
|
-
react = require_chunk.__toESM(react);
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
//#region src/lib/calendar-day-button.tsx
|
|
9
|
-
/** DayPicker's day button, minus the page scroll when it takes focus. */
|
|
10
|
-
function ScrollFreeDayButton({ day: _day, modifiers, ...props }) {
|
|
11
|
-
const ref = react.useRef(null);
|
|
12
|
-
react.useEffect(() => {
|
|
13
|
-
if (modifiers.focused) ref.current?.focus({ preventScroll: true });
|
|
14
|
-
}, [modifiers.focused]);
|
|
15
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
16
|
-
ref,
|
|
17
|
-
...props
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
exports.ScrollFreeDayButton = ScrollFreeDayButton;
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=calendar-day-button.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-day-button.cjs","names":["React"],"sources":["../../src/lib/calendar-day-button.tsx"],"sourcesContent":["'use client'\n\nimport type { DayButtonProps } from '@daypicker/react'\nimport * as React from 'react'\n\n/** DayPicker's day button, minus the page scroll when it takes focus. */\nexport function ScrollFreeDayButton({\n day: _day,\n modifiers,\n ...props\n}: DayButtonProps) {\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus({ preventScroll: true })\n }, [modifiers.focused])\n return <button ref={ref} {...props} />\n}\n"],"mappings":";;;;;;;;;AAMA,SAAgB,oBAAoB,EAClC,KAAK,MACL,WACA,GAAG,SACc;CACjB,MAAM,MAAMA,MAAM,OAA0B,IAAI;CAChD,MAAM,gBAAgB;EACpB,IAAI,UAAU,SAAS,IAAI,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC;CACnE,GAAG,CAAC,UAAU,OAAO,CAAC;CACtB,OAAO,iBAAA,GAAA,kBAAA,KAAC,UAAD;EAAa;EAAK,GAAI;CAAQ,CAAA;AACvC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { DayButtonProps } from "@daypicker/react";
|
|
4
|
-
|
|
5
|
-
//#region src/lib/calendar-day-button.d.ts
|
|
6
|
-
/** DayPicker's day button, minus the page scroll when it takes focus. */
|
|
7
|
-
declare function ScrollFreeDayButton({
|
|
8
|
-
day: _day,
|
|
9
|
-
modifiers,
|
|
10
|
-
...props
|
|
11
|
-
}: DayButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { ScrollFreeDayButton };
|
|
14
|
-
//# sourceMappingURL=calendar-day-button.d.cts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { DayButtonProps } from "@daypicker/react";
|
|
4
|
-
|
|
5
|
-
//#region src/lib/calendar-day-button.d.ts
|
|
6
|
-
/** DayPicker's day button, minus the page scroll when it takes focus. */
|
|
7
|
-
declare function ScrollFreeDayButton({
|
|
8
|
-
day: _day,
|
|
9
|
-
modifiers,
|
|
10
|
-
...props
|
|
11
|
-
}: DayButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { ScrollFreeDayButton };
|
|
14
|
-
//# sourceMappingURL=calendar-day-button.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/lib/calendar-day-button.tsx
|
|
6
|
-
/** DayPicker's day button, minus the page scroll when it takes focus. */
|
|
7
|
-
function ScrollFreeDayButton({ day: _day, modifiers, ...props }) {
|
|
8
|
-
const ref = React$1.useRef(null);
|
|
9
|
-
React$1.useEffect(() => {
|
|
10
|
-
if (modifiers.focused) ref.current?.focus({ preventScroll: true });
|
|
11
|
-
}, [modifiers.focused]);
|
|
12
|
-
return /* @__PURE__ */ jsx("button", {
|
|
13
|
-
ref,
|
|
14
|
-
...props
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { ScrollFreeDayButton };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=calendar-day-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-day-button.js","names":["React"],"sources":["../../src/lib/calendar-day-button.tsx"],"sourcesContent":["'use client'\n\nimport type { DayButtonProps } from '@daypicker/react'\nimport * as React from 'react'\n\n/** DayPicker's day button, minus the page scroll when it takes focus. */\nexport function ScrollFreeDayButton({\n day: _day,\n modifiers,\n ...props\n}: DayButtonProps) {\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus({ preventScroll: true })\n }, [modifiers.focused])\n return <button ref={ref} {...props} />\n}\n"],"mappings":";;;;;;AAMA,SAAgB,oBAAoB,EAClC,KAAK,MACL,WACA,GAAG,SACc;CACjB,MAAM,MAAMA,QAAM,OAA0B,IAAI;CAChD,QAAM,gBAAgB;EACpB,IAAI,UAAU,SAAS,IAAI,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC;CACnE,GAAG,CAAC,UAAU,OAAO,CAAC;CACtB,OAAO,oBAAC,UAAD;EAAa;EAAK,GAAI;CAAQ,CAAA;AACvC"}
|