@exsto/ds 0.0.0-stage → 0.0.1-rc.10
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/LICENSE +202 -0
- package/README.md +165 -2
- package/dist/chunks/date-range-picker-CWVcHgy2.js +204 -0
- package/dist/chunks/date-range-picker-CWVcHgy2.js.map +1 -0
- package/dist/chunks/input-syWxjY2U.js +172 -0
- package/dist/chunks/input-syWxjY2U.js.map +1 -0
- package/dist/chunks/toggle-CVnIkJVC.js +484 -0
- package/dist/chunks/toggle-CVnIkJVC.js.map +1 -0
- package/dist/date-picker.js +345 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/ds/src/date-picker.d.ts +9 -0
- package/dist/ds/src/index.d.ts +7 -0
- package/dist/ds/src/rich-text-editor.d.ts +8 -0
- package/dist/index.js +4512 -0
- package/dist/index.js.map +1 -0
- package/dist/rich-text-editor.js +905 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/styles.css +8167 -0
- package/dist/styles.css.d.ts +2 -0
- package/dist/theme/src/index.d.ts +4 -0
- package/dist/theme.css +308 -0
- package/dist/theme.css.d.ts +2 -0
- package/dist/ui/src/components/edyn/animated-number/animated-number.d.ts +30 -0
- package/dist/ui/src/components/edyn/animated-number/animated-number.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/animated-number/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/audio-player/audio-player.d.ts +30 -0
- package/dist/ui/src/components/edyn/audio-player/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/date-picker/date-picker.d.ts +76 -0
- package/dist/ui/src/components/edyn/date-picker/date-picker.state.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/date-picker/date-text.d.ts +40 -0
- package/dist/ui/src/components/edyn/date-picker/date-text.test.d.ts +1 -0
- package/dist/ui/src/components/edyn/date-picker/index.d.ts +2 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.d.ts +28 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/date-range-picker/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/initials-avatar/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.d.ts +54 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.test.d.ts +10 -0
- package/dist/ui/src/components/edyn/multi-select/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.d.ts +106 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/progress-line/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.d.ts +23 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/rich-text-content/allow-list.d.ts +11 -0
- package/dist/ui/src/components/edyn/rich-text-content/index.d.ts +2 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.d.ts +22 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.test.d.ts +8 -0
- package/dist/ui/src/components/edyn/rich-text-editor/extensions.d.ts +18 -0
- package/dist/ui/src/components/edyn/rich-text-editor/index.d.ts +3 -0
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.d.ts +17 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.d.ts +53 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.test.d.ts +6 -0
- package/dist/ui/src/components/edyn/rich-text-editor/serialize.d.ts +13 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.d.ts +19 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.test.d.ts +11 -0
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.d.ts +20 -0
- package/dist/ui/src/components/edyn/rich-text-editor/types.d.ts +68 -0
- package/dist/ui/src/components/edyn/video-player/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/video-player/video-player.d.ts +55 -0
- package/dist/ui/src/components/forwarded-props.test.d.ts +8 -0
- package/dist/ui/src/components/ui/accordion/accordion.behavior.test.d.ts +13 -0
- package/dist/ui/src/components/ui/accordion/accordion.d.ts +28 -0
- package/dist/ui/src/components/ui/accordion/index.d.ts +1 -0
- package/dist/ui/src/components/ui/alert/alert.d.ts +10 -0
- package/dist/ui/src/components/ui/alert/index.d.ts +1 -0
- package/dist/ui/src/components/ui/alert-dialog/alert-dialog.d.ts +17 -0
- package/dist/ui/src/components/ui/alert-dialog/index.d.ts +1 -0
- package/dist/ui/src/components/ui/aspect-ratio/aspect-ratio.d.ts +3 -0
- package/dist/ui/src/components/ui/aspect-ratio/index.d.ts +1 -0
- package/dist/ui/src/components/ui/attachment/attachment.d.ts +23 -0
- package/dist/ui/src/components/ui/attachment/index.d.ts +1 -0
- package/dist/ui/src/components/ui/avatar/avatar.d.ts +10 -0
- package/dist/ui/src/components/ui/avatar/index.d.ts +1 -0
- package/dist/ui/src/components/ui/badge/badge.d.ts +7 -0
- package/dist/ui/src/components/ui/badge/index.d.ts +1 -0
- package/dist/ui/src/components/ui/breadcrumb/breadcrumb.d.ts +9 -0
- package/dist/ui/src/components/ui/breadcrumb/index.d.ts +1 -0
- package/dist/ui/src/components/ui/bubble/bubble.d.ts +16 -0
- package/dist/ui/src/components/ui/bubble/index.d.ts +1 -0
- package/dist/ui/src/components/ui/button/button.behavior.test.d.ts +8 -0
- package/dist/ui/src/components/ui/button/button.d.ts +7 -0
- package/dist/ui/src/components/ui/button/index.d.ts +1 -0
- package/dist/ui/src/components/ui/button-group/button-group.d.ts +12 -0
- package/dist/ui/src/components/ui/button-group/index.d.ts +1 -0
- package/dist/ui/src/components/ui/calendar/calendar.d.ts +9 -0
- package/dist/ui/src/components/ui/calendar/index.d.ts +1 -0
- package/dist/ui/src/components/ui/card/card.d.ts +10 -0
- package/dist/ui/src/components/ui/card/index.d.ts +1 -0
- package/dist/ui/src/components/ui/carousel/carousel.d.ts +28 -0
- package/dist/ui/src/components/ui/carousel/index.d.ts +3 -0
- package/dist/ui/src/components/ui/chart/chart.d.ts +44 -0
- package/dist/ui/src/components/ui/chart/index.d.ts +3 -0
- package/dist/ui/src/components/ui/checkbox/checkbox.d.ts +2 -0
- package/dist/ui/src/components/ui/checkbox/index.d.ts +1 -0
- package/dist/ui/src/components/ui/collapsible/collapsible.d.ts +4 -0
- package/dist/ui/src/components/ui/collapsible/index.d.ts +1 -0
- package/dist/ui/src/components/ui/combobox/combobox.d.ts +15 -0
- package/dist/ui/src/components/ui/combobox/index.d.ts +1 -0
- package/dist/ui/src/components/ui/command/command.d.ts +34 -0
- package/dist/ui/src/components/ui/command/index.d.ts +1 -0
- package/dist/ui/src/components/ui/context-menu/context-menu.d.ts +28 -0
- package/dist/ui/src/components/ui/context-menu/index.d.ts +1 -0
- package/dist/ui/src/components/ui/dialog/dialog.d.ts +16 -0
- package/dist/ui/src/components/ui/dialog/index.d.ts +1 -0
- package/dist/ui/src/components/ui/direction/direction.d.ts +1 -0
- package/dist/ui/src/components/ui/direction/index.d.ts +1 -0
- package/dist/ui/src/components/ui/drawer/drawer.d.ts +15 -0
- package/dist/ui/src/components/ui/drawer/index.d.ts +1 -0
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.d.ts +39 -0
- package/dist/ui/src/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/ui/src/components/ui/empty/empty.d.ts +11 -0
- package/dist/ui/src/components/ui/empty/index.d.ts +1 -0
- package/dist/ui/src/components/ui/field/field.d.ts +5 -0
- package/dist/ui/src/components/ui/field/index.d.ts +1 -0
- package/dist/ui/src/components/ui/hover-card/hover-card.d.ts +4 -0
- package/dist/ui/src/components/ui/hover-card/index.d.ts +1 -0
- package/dist/ui/src/components/ui/indicator/index.d.ts +1 -0
- package/dist/ui/src/components/ui/indicator/indicator.d.ts +10 -0
- package/dist/ui/src/components/ui/input/index.d.ts +1 -0
- package/dist/ui/src/components/ui/input/input.d.ts +2 -0
- package/dist/ui/src/components/ui/input-group/index.d.ts +1 -0
- package/dist/ui/src/components/ui/input-group/input-group.d.ts +26 -0
- package/dist/ui/src/components/ui/input-otp/index.d.ts +1 -0
- package/dist/ui/src/components/ui/input-otp/input-otp.d.ts +10 -0
- package/dist/ui/src/components/ui/item/index.d.ts +1 -0
- package/dist/ui/src/components/ui/item/item.d.ts +22 -0
- package/dist/ui/src/components/ui/kbd/index.d.ts +1 -0
- package/dist/ui/src/components/ui/kbd/kbd.d.ts +2 -0
- package/dist/ui/src/components/ui/label/index.d.ts +1 -0
- package/dist/ui/src/components/ui/label/label.d.ts +2 -0
- package/dist/ui/src/components/ui/marker/index.d.ts +1 -0
- package/dist/ui/src/components/ui/marker/marker.d.ts +9 -0
- package/dist/ui/src/components/ui/menubar/index.d.ts +1 -0
- package/dist/ui/src/components/ui/menubar/menubar.d.ts +28 -0
- package/dist/ui/src/components/ui/message/index.d.ts +1 -0
- package/dist/ui/src/components/ui/message/message.d.ts +9 -0
- package/dist/ui/src/components/ui/message-scroller/index.d.ts +1 -0
- package/dist/ui/src/components/ui/message-scroller/message-scroller.d.ts +10 -0
- package/dist/ui/src/components/ui/native-select/index.d.ts +1 -0
- package/dist/ui/src/components/ui/native-select/native-select.d.ts +8 -0
- package/dist/ui/src/components/ui/navigation-menu/index.d.ts +1 -0
- package/dist/ui/src/components/ui/navigation-menu/navigation-menu.d.ts +10 -0
- package/dist/ui/src/components/ui/pagination/index.d.ts +1 -0
- package/dist/ui/src/components/ui/pagination/pagination.behavior.test.d.ts +1 -0
- package/dist/ui/src/components/ui/pagination/pagination.d.ts +18 -0
- package/dist/ui/src/components/ui/pagination/pagination.test.d.ts +1 -0
- package/dist/ui/src/components/ui/popover/index.d.ts +1 -0
- package/dist/ui/src/components/ui/popover/popover.d.ts +8 -0
- package/dist/ui/src/components/ui/progress/index.d.ts +1 -0
- package/dist/ui/src/components/ui/progress/progress.behavior.test.d.ts +8 -0
- package/dist/ui/src/components/ui/progress/progress.d.ts +47 -0
- package/dist/ui/src/components/ui/questionnaire/index.d.ts +1 -0
- package/dist/ui/src/components/ui/questionnaire/questionnaire.d.ts +18 -0
- package/dist/ui/src/components/ui/radio-group/index.d.ts +1 -0
- package/dist/ui/src/components/ui/radio-group/radio-group.d.ts +10 -0
- package/dist/ui/src/components/ui/resizable/index.d.ts +1 -0
- package/dist/ui/src/components/ui/resizable/resizable.d.ts +6 -0
- package/dist/ui/src/components/ui/scroll-area/index.d.ts +1 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.behavior.test.d.ts +12 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.d.ts +85 -0
- package/dist/ui/src/components/ui/select/index.d.ts +1 -0
- package/dist/ui/src/components/ui/select/select.d.ts +17 -0
- package/dist/ui/src/components/ui/separator/index.d.ts +1 -0
- package/dist/ui/src/components/ui/separator/separator.behavior.test.d.ts +14 -0
- package/dist/ui/src/components/ui/separator/separator.d.ts +16 -0
- package/dist/ui/src/components/ui/sheet/index.d.ts +1 -0
- package/dist/ui/src/components/ui/sheet/sheet.d.ts +13 -0
- package/dist/ui/src/components/ui/sidebar/index.d.ts +1 -0
- package/dist/ui/src/components/ui/sidebar/sidebar.d.ts +63 -0
- package/dist/ui/src/components/ui/skeleton/index.d.ts +1 -0
- package/dist/ui/src/components/ui/skeleton/skeleton.d.ts +1 -0
- package/dist/ui/src/components/ui/slider/index.d.ts +1 -0
- package/dist/ui/src/components/ui/slider/slider.d.ts +17 -0
- package/dist/ui/src/components/ui/spinner/index.d.ts +1 -0
- package/dist/ui/src/components/ui/spinner/spinner.d.ts +5 -0
- package/dist/ui/src/components/ui/switch/index.d.ts +1 -0
- package/dist/ui/src/components/ui/switch/switch.d.ts +4 -0
- package/dist/ui/src/components/ui/table/index.d.ts +1 -0
- package/dist/ui/src/components/ui/table/table.behavior.test.d.ts +9 -0
- package/dist/ui/src/components/ui/table/table.d.ts +9 -0
- package/dist/ui/src/components/ui/tabs/index.d.ts +1 -0
- package/dist/ui/src/components/ui/tabs/tabs.behavior.test.d.ts +21 -0
- package/dist/ui/src/components/ui/tabs/tabs.d.ts +36 -0
- package/dist/ui/src/components/ui/textarea/index.d.ts +1 -0
- package/dist/ui/src/components/ui/textarea/textarea.d.ts +2 -0
- package/dist/ui/src/components/ui/toast/index.d.ts +1 -0
- package/dist/ui/src/components/ui/toast/toast.d.ts +15 -0
- package/dist/ui/src/components/ui/toggle/index.d.ts +1 -0
- package/dist/ui/src/components/ui/toggle/toggle.d.ts +8 -0
- package/dist/ui/src/components/ui/toggle-group/index.d.ts +1 -0
- package/dist/ui/src/components/ui/toggle-group/toggle-group.d.ts +7 -0
- package/dist/ui/src/components/ui/tooltip/index.d.ts +1 -0
- package/dist/ui/src/components/ui/tooltip/tooltip.d.ts +5 -0
- package/dist/ui/src/hooks/use-media-player.d.ts +29 -0
- package/dist/ui/src/hooks/use-merged-refs.d.ts +4 -0
- package/dist/ui/src/hooks/use-mobile.d.ts +1 -0
- package/dist/ui/src/index.d.ts +74 -0
- package/dist/ui/src/lib/first-weekday.d.ts +6 -0
- package/dist/ui/src/lib/first-weekday.test.d.ts +1 -0
- package/dist/ui/src/lib/focus-ring.test.d.ts +8 -0
- package/dist/ui/src/lib/popup-list.d.ts +47 -0
- package/dist/ui/src/lib/popup-list.test.d.ts +10 -0
- package/dist/ui/src/lib/utils.d.ts +13 -0
- package/package.json +95 -4
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { isValidElement } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@base-ui/react/button";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { Popover } from "@base-ui/react/popover";
|
|
8
|
+
import { Input } from "@base-ui/react/input";
|
|
9
|
+
//#region ../ui/src/lib/utils.ts
|
|
10
|
+
var cn = (...inputs) => twMerge(clsx(inputs));
|
|
11
|
+
/**
|
|
12
|
+
* Normalise a size prop to a CSS length.
|
|
13
|
+
*
|
|
14
|
+
* Bare numbers become px, which is also what a bare numeric *string* means: an
|
|
15
|
+
* element attribute arrives as a string, so `width="480"` and `width={480}` have
|
|
16
|
+
* to land on the same value. Anything with a unit, a percentage or a keyword
|
|
17
|
+
* passes through untouched.
|
|
18
|
+
*/
|
|
19
|
+
var cssLength = (value) => {
|
|
20
|
+
if (value == null || value === "") return;
|
|
21
|
+
if (typeof value === "number") return Number.isFinite(value) ? `${value}px` : void 0;
|
|
22
|
+
return /^-?\d*\.?\d+$/.test(value.trim()) ? `${value.trim()}px` : value;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../ui/src/components/ui/button/button.tsx
|
|
26
|
+
/**
|
|
27
|
+
* The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's
|
|
28
|
+
* data-disabled, or aria-disabled on a link), in the dark theme too, where the variants set their own fill. Ghost and link
|
|
29
|
+
* have no fill to begin with and are given none: a grey box would turn a link into a button.
|
|
30
|
+
*/
|
|
31
|
+
var DISABLED_FILL = "disabled:bg-muted data-disabled:bg-muted aria-disabled:bg-muted dark:disabled:bg-muted dark:data-disabled:bg-muted dark:aria-disabled:bg-muted";
|
|
32
|
+
var buttonVariants = cva("group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all motion-reduce:transition-none motion-reduce:transform-none outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:border-transparent disabled:text-foreground/60 disabled:shadow-none disabled:focus-visible:ring-0 dark:disabled:border-transparent data-link-disabled:pointer-events-none data-link-disabled:focus-visible:ring-0 data-disabled:border-transparent data-disabled:text-foreground/60 data-disabled:shadow-none dark:data-disabled:border-transparent aria-disabled:border-transparent aria-disabled:text-foreground/60 aria-disabled:shadow-none dark:aria-disabled:border-transparent aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
33
|
+
variants: {
|
|
34
|
+
variant: {
|
|
35
|
+
default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,
|
|
36
|
+
outline: `border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 ${DISABLED_FILL}`,
|
|
37
|
+
secondary: `bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground ${DISABLED_FILL}`,
|
|
38
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 aria-disabled:hover:bg-transparent dark:aria-disabled:hover:bg-transparent",
|
|
39
|
+
destructive: `bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/15 dark:hover:bg-destructive/20 dark:focus-visible:ring-destructive/40 ${DISABLED_FILL}`,
|
|
40
|
+
link: "text-primary underline-offset-4 hover:underline aria-disabled:hover:no-underline"
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
44
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
45
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
46
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
47
|
+
icon: "size-8",
|
|
48
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
49
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
50
|
+
"icon-lg": "size-9"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "default",
|
|
55
|
+
size: "default"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Whether this Button is rendering a link rather than a button, so it can keep
|
|
60
|
+
* link semantics. Covers `render={<a href="..." />}` and a routing component
|
|
61
|
+
* that takes an `href` (Next's Link). A component with a different prop for its
|
|
62
|
+
* destination (react-router's `to`) cannot be recognised from here: give those
|
|
63
|
+
* `nativeButton={false} role={undefined}` directly.
|
|
64
|
+
*/
|
|
65
|
+
var rendersALink = (render) => isValidElement(render) && (render.type === "a" || typeof render.props.href === "string");
|
|
66
|
+
/**
|
|
67
|
+
* A link that looks like a button is still a link, and has to be announced as
|
|
68
|
+
* one: it opens in a new tab, it has an address, Enter follows it and Space
|
|
69
|
+
* scrolls the page.
|
|
70
|
+
*
|
|
71
|
+
* Base UI needs telling, in two steps. Rendering an anchor while `nativeButton`
|
|
72
|
+
* is true (its default) warns in development and puts `type="button"` on the
|
|
73
|
+
* anchor; following the warning and passing `nativeButton={false}` then adds
|
|
74
|
+
* `role="button"`, which is what takes the link semantics away. So this does
|
|
75
|
+
* both: non-native, with the role and the tabindex Base UI would add cleared
|
|
76
|
+
* again. An explicit prop from the caller still wins over either.
|
|
77
|
+
*/
|
|
78
|
+
var LINK_PROPS = {
|
|
79
|
+
nativeButton: false,
|
|
80
|
+
role: void 0,
|
|
81
|
+
tabIndex: void 0
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* A disabled link is not :disabled (only a form control can be), so the markup has to say it: Base UI already marks it
|
|
85
|
+
* `aria-disabled` and `data-disabled` and stops the click, and this takes it out of the tab order, which LINK_PROPS
|
|
86
|
+
* would otherwise leave to the browser. The href is kept on purpose, so a routing component that requires one keeps
|
|
87
|
+
* working; the pointer is kept off the link by `data-link-disabled:pointer-events-none`, which also covers a middle
|
|
88
|
+
* click and the context menu, and the click and Enter are stopped by Base UI. It is a data attribute of its own, not
|
|
89
|
+
* `aria-disabled`, because an aria-disabled button (`focusableWhenDisabled`) is meant to stay hoverable and focusable so it
|
|
90
|
+
* can say why it cannot act; only a native :disabled button and this link are inert.
|
|
91
|
+
*/
|
|
92
|
+
var DISABLED_LINK_PROPS = {
|
|
93
|
+
...LINK_PROPS,
|
|
94
|
+
tabIndex: -1,
|
|
95
|
+
"data-link-disabled": ""
|
|
96
|
+
};
|
|
97
|
+
var Button$1 = ({ className, variant = "default", size = "default", ...props }) => {
|
|
98
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
99
|
+
"data-slot": "button",
|
|
100
|
+
...rendersALink(props.render) ? props.disabled ? DISABLED_LINK_PROPS : LINK_PROPS : {},
|
|
101
|
+
className: cn(buttonVariants({
|
|
102
|
+
variant,
|
|
103
|
+
size,
|
|
104
|
+
className
|
|
105
|
+
})),
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region ../ui/src/components/ui/popover/popover.tsx
|
|
111
|
+
var Popover$1 = ({ ...props }) => {
|
|
112
|
+
return /* @__PURE__ */ jsx(Popover.Root, {
|
|
113
|
+
"data-slot": "popover",
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
var PopoverTrigger = ({ ...props }) => {
|
|
118
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
119
|
+
"data-slot": "popover-trigger",
|
|
120
|
+
...props
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var PopoverContent = ({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, anchor, ...props }) => {
|
|
124
|
+
return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
125
|
+
align,
|
|
126
|
+
alignOffset,
|
|
127
|
+
anchor,
|
|
128
|
+
side,
|
|
129
|
+
sideOffset,
|
|
130
|
+
className: "isolate z-50",
|
|
131
|
+
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
132
|
+
"data-slot": "popover-content",
|
|
133
|
+
className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 motion-reduce:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
134
|
+
...props
|
|
135
|
+
})
|
|
136
|
+
}) });
|
|
137
|
+
};
|
|
138
|
+
var PopoverHeader = ({ className, ...props }) => {
|
|
139
|
+
return /* @__PURE__ */ jsx("div", {
|
|
140
|
+
"data-slot": "popover-header",
|
|
141
|
+
className: cn("flex flex-col gap-0.5 text-sm", className),
|
|
142
|
+
...props
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var PopoverTitle = ({ className, ...props }) => {
|
|
146
|
+
return /* @__PURE__ */ jsx(Popover.Title, {
|
|
147
|
+
"data-slot": "popover-title",
|
|
148
|
+
className: cn("font-medium", className),
|
|
149
|
+
...props
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
var PopoverDescription = ({ className, ...props }) => {
|
|
153
|
+
return /* @__PURE__ */ jsx(Popover.Description, {
|
|
154
|
+
"data-slot": "popover-description",
|
|
155
|
+
className: cn("text-muted-foreground", className),
|
|
156
|
+
...props
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../ui/src/components/ui/input/input.tsx
|
|
161
|
+
var Input$1 = ({ className, type, ...props }) => {
|
|
162
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
163
|
+
type,
|
|
164
|
+
"data-slot": "input",
|
|
165
|
+
className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
166
|
+
...props
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
export { PopoverHeader as a, Button$1 as c, cssLength as d, PopoverDescription as i, buttonVariants as l, Popover$1 as n, PopoverTitle as o, PopoverContent as r, PopoverTrigger as s, Input$1 as t, cn as u };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=input-syWxjY2U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-syWxjY2U.js","names":[],"sources":["../../../ui/src/lib/utils.ts","../../../ui/src/components/ui/button/button.tsx","../../../ui/src/components/ui/popover/popover.tsx","../../../ui/src/components/ui/input/input.tsx"],"sourcesContent":["import type { ClassValue } from 'clsx';\nimport { clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\n/** A CSS length as a component prop: a number is px, a string is used verbatim. */\nexport type TCssLength = number | string;\n\n/**\n * Normalise a size prop to a CSS length.\n *\n * Bare numbers become px, which is also what a bare numeric *string* means: an\n * element attribute arrives as a string, so `width=\"480\"` and `width={480}` have\n * to land on the same value. Anything with a unit, a percentage or a keyword\n * passes through untouched.\n */\nexport const cssLength = (value: TCssLength | null | undefined): string | undefined => {\n if (value == null || value === '') {\n return undefined;\n }\n\n if (typeof value === 'number') {\n return Number.isFinite(value) ? `${value}px` : undefined;\n }\n\n return /^-?\\d*\\.?\\d+$/.test(value.trim()) ? `${value.trim()}px` : value;\n};\n","import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { isValidElement } from 'react';\n\n/**\n * The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's\n * data-disabled, or aria-disabled on a link), in the dark theme too, where the variants set their own fill. Ghost and link\n * have no fill to begin with and are given none: a grey box would turn a link into a button.\n */\nconst DISABLED_FILL =\n 'disabled:bg-muted data-disabled:bg-muted aria-disabled:bg-muted dark:disabled:bg-muted dark:data-disabled:bg-muted dark:aria-disabled:bg-muted';\n\nexport const buttonVariants = cva(\n \"group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all motion-reduce:transition-none motion-reduce:transform-none outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:border-transparent disabled:text-foreground/60 disabled:shadow-none disabled:focus-visible:ring-0 dark:disabled:border-transparent data-link-disabled:pointer-events-none data-link-disabled:focus-visible:ring-0 data-disabled:border-transparent data-disabled:text-foreground/60 data-disabled:shadow-none dark:data-disabled:border-transparent aria-disabled:border-transparent aria-disabled:text-foreground/60 aria-disabled:shadow-none dark:aria-disabled:border-transparent aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,\n outline: `border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 ${DISABLED_FILL}`,\n secondary: `bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground ${DISABLED_FILL}`,\n ghost:\n 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 aria-disabled:hover:bg-transparent dark:aria-disabled:hover:bg-transparent',\n destructive: `bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/15 dark:hover:bg-destructive/20 dark:focus-visible:ring-destructive/40 ${DISABLED_FILL}`,\n link: 'text-primary underline-offset-4 hover:underline aria-disabled:hover:no-underline',\n },\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n icon: 'size-8',\n 'icon-xs': \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\n/**\n * Whether this Button is rendering a link rather than a button, so it can keep\n * link semantics. Covers `render={<a href=\"...\" />}` and a routing component\n * that takes an `href` (Next's Link). A component with a different prop for its\n * destination (react-router's `to`) cannot be recognised from here: give those\n * `nativeButton={false} role={undefined}` directly.\n */\nconst rendersALink = (render: ButtonPrimitive.Props['render']): boolean =>\n isValidElement(render) && (render.type === 'a' || typeof (render.props as { href?: unknown }).href === 'string');\n\n/**\n * A link that looks like a button is still a link, and has to be announced as\n * one: it opens in a new tab, it has an address, Enter follows it and Space\n * scrolls the page.\n *\n * Base UI needs telling, in two steps. Rendering an anchor while `nativeButton`\n * is true (its default) warns in development and puts `type=\"button\"` on the\n * anchor; following the warning and passing `nativeButton={false}` then adds\n * `role=\"button\"`, which is what takes the link semantics away. So this does\n * both: non-native, with the role and the tabindex Base UI would add cleared\n * again. An explicit prop from the caller still wins over either.\n */\nconst LINK_PROPS = { nativeButton: false, role: undefined, tabIndex: undefined } as const;\n\n/**\n * A disabled link is not :disabled (only a form control can be), so the markup has to say it: Base UI already marks it\n * `aria-disabled` and `data-disabled` and stops the click, and this takes it out of the tab order, which LINK_PROPS\n * would otherwise leave to the browser. The href is kept on purpose, so a routing component that requires one keeps\n * working; the pointer is kept off the link by `data-link-disabled:pointer-events-none`, which also covers a middle\n * click and the context menu, and the click and Enter are stopped by Base UI. It is a data attribute of its own, not\n * `aria-disabled`, because an aria-disabled button (`focusableWhenDisabled`) is meant to stay hoverable and focusable so it\n * can say why it cannot act; only a native :disabled button and this link are inert.\n */\nconst DISABLED_LINK_PROPS = { ...LINK_PROPS, tabIndex: -1, 'data-link-disabled': '' } as const;\n\nexport const Button = ({\n className,\n variant = 'default',\n size = 'default',\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) => {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n {...(rendersALink(props.render) ? (props.disabled ? DISABLED_LINK_PROPS : LINK_PROPS) : {})}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n};\n","import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Popover = ({ ...props }: PopoverPrimitive.Root.Props) => {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n};\n\nexport const PopoverTrigger = ({ ...props }: PopoverPrimitive.Trigger.Props) => {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n};\n\nexport const PopoverContent = ({\n className,\n align = 'center',\n alignOffset = 0,\n side = 'bottom',\n sideOffset = 4,\n anchor,\n ...props\n}: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'>) => {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n 'z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 motion-reduce:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n};\n\nexport const PopoverHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"popover-header\" className={cn('flex flex-col gap-0.5 text-sm', className)} {...props} />;\n};\n\nexport const PopoverTitle = ({ className, ...props }: PopoverPrimitive.Title.Props) => {\n return <PopoverPrimitive.Title data-slot=\"popover-title\" className={cn('font-medium', className)} {...props} />;\n};\n\nexport const PopoverDescription = ({ className, ...props }: PopoverPrimitive.Description.Props) => {\n return <PopoverPrimitive.Description data-slot=\"popover-description\" className={cn('text-muted-foreground', className)} {...props} />;\n};\n","import { Input as InputPrimitive } from '@base-ui/react/input';\nimport { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Input = ({ className, type, ...props }: React.ComponentProps<'input'>) => {\n return (\n <InputPrimitive\n type={type}\n data-slot=\"input\"\n className={cn(\n 'h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":"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"}
|