@lt-three/love3 0.0.0 → 0.1.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/README.md +85 -1
- package/dist/native/analytics/animation.d.ts +4 -0
- package/dist/native/analytics/animation.js +6 -0
- package/dist/native/analytics/chart.types.d.ts +25 -0
- package/dist/native/analytics/chart.types.js +0 -0
- package/dist/native/analytics/line-chart.d.ts +4 -0
- package/dist/native/analytics/line-chart.ios.d.ts +4 -0
- package/dist/native/analytics/line-chart.ios.js +24 -0
- package/dist/native/analytics/line-chart.js +33 -0
- package/dist/native/analytics/metric-card.d.ts +10 -0
- package/dist/native/analytics/metric-card.js +29 -0
- package/dist/native/analytics/multi-line-chart.d.ts +18 -0
- package/dist/native/analytics/multi-line-chart.js +216 -0
- package/dist/native/analytics/pie-chart.d.ts +15 -0
- package/dist/native/analytics/pie-chart.ios.d.ts +4 -0
- package/dist/native/analytics/pie-chart.ios.js +24 -0
- package/dist/native/analytics/pie-chart.js +92 -0
- package/dist/native/analytics/single-number.d.ts +19 -0
- package/dist/native/analytics/single-number.js +101 -0
- package/dist/native/atom/avatar.d.ts +21 -0
- package/dist/native/atom/avatar.js +46 -0
- package/dist/native/atom/badge.d.ts +28 -0
- package/dist/native/atom/badge.js +51 -0
- package/dist/native/atom/button.d.ts +46 -0
- package/dist/native/atom/button.js +109 -0
- package/dist/native/atom/checkbox.d.ts +21 -0
- package/dist/native/atom/checkbox.js +47 -0
- package/dist/native/atom/colored-value.d.ts +12 -0
- package/dist/native/atom/colored-value.js +24 -0
- package/dist/native/atom/image.d.ts +21 -0
- package/dist/native/atom/image.js +72 -0
- package/dist/native/atom/label.d.ts +18 -0
- package/dist/native/atom/label.js +33 -0
- package/dist/native/atom/link.d.ts +18 -0
- package/dist/native/atom/link.js +25 -0
- package/dist/native/atom/readout.d.ts +22 -0
- package/dist/native/atom/readout.js +39 -0
- package/dist/native/atom/search-input.d.ts +12 -0
- package/dist/native/atom/search-input.js +36 -0
- package/dist/native/atom/select.d.ts +54 -0
- package/dist/native/atom/select.js +200 -0
- package/dist/native/atom/separator.d.ts +12 -0
- package/dist/native/atom/separator.js +16 -0
- package/dist/native/atom/skeleton.d.ts +12 -0
- package/dist/native/atom/skeleton.js +39 -0
- package/dist/native/atom/slider.d.ts +32 -0
- package/dist/native/atom/slider.js +75 -0
- package/dist/native/atom/spinner.d.ts +15 -0
- package/dist/native/atom/spinner.js +25 -0
- package/dist/native/atom/switch.d.ts +18 -0
- package/dist/native/atom/switch.js +52 -0
- package/dist/native/atom/symbol.d.ts +16 -0
- package/dist/native/atom/symbol.js +38 -0
- package/dist/native/atom/symbol.types.d.ts +25 -0
- package/dist/native/atom/symbol.types.js +49 -0
- package/dist/native/atom/text-field.d.ts +49 -0
- package/dist/native/atom/text-field.js +56 -0
- package/dist/native/atom/text.d.ts +2 -0
- package/dist/native/atom/text.js +3 -0
- package/dist/native/atom/theme-toggle.d.ts +21 -0
- package/dist/native/atom/theme-toggle.js +36 -0
- package/dist/native/atom/timezone-select.d.ts +16 -0
- package/dist/native/atom/timezone-select.js +28 -0
- package/dist/native/atom/typography.d.ts +13 -0
- package/dist/native/atom/typography.js +28 -0
- package/dist/native/base/button.d.ts +61 -0
- package/dist/native/base/button.js +92 -0
- package/dist/native/base/form.d.ts +72 -0
- package/dist/native/base/form.js +113 -0
- package/dist/native/base/glass-card.d.ts +15 -0
- package/dist/native/base/glass-card.js +38 -0
- package/dist/native/base/input.d.ts +29 -0
- package/dist/native/base/input.js +27 -0
- package/dist/native/base/sheet.d.ts +71 -0
- package/dist/native/base/sheet.js +187 -0
- package/dist/native/base/text.d.ts +14 -0
- package/dist/native/base/text.js +53 -0
- package/dist/native/form/checkbox.d.ts +13 -0
- package/dist/native/form/checkbox.js +55 -0
- package/dist/native/form/date-picker.d.ts +23 -0
- package/dist/native/form/date-picker.js +119 -0
- package/dist/native/form/form.d.ts +22 -0
- package/dist/native/form/form.js +44 -0
- package/dist/native/form/radio-group.d.ts +23 -0
- package/dist/native/form/radio-group.js +88 -0
- package/dist/native/form/select.d.ts +13 -0
- package/dist/native/form/select.js +45 -0
- package/dist/native/form/slider.d.ts +14 -0
- package/dist/native/form/slider.js +42 -0
- package/dist/native/form/switch.d.ts +9 -0
- package/dist/native/form/switch.js +59 -0
- package/dist/native/form/text-area.d.ts +11 -0
- package/dist/native/form/text-area.js +50 -0
- package/dist/native/form/text-input.d.ts +18 -0
- package/dist/native/form/text-input.js +90 -0
- package/dist/native/index.d.ts +1 -0
- package/dist/native/index.js +0 -0
- package/dist/native/layout/accordion.d.ts +25 -0
- package/dist/native/layout/accordion.js +54 -0
- package/dist/native/layout/card.d.ts +47 -0
- package/dist/native/layout/card.js +57 -0
- package/dist/native/layout/description.d.ts +16 -0
- package/dist/native/layout/description.js +32 -0
- package/dist/native/layout/error.d.ts +21 -0
- package/dist/native/layout/error.js +44 -0
- package/dist/native/layout/information.d.ts +25 -0
- package/dist/native/layout/information.js +35 -0
- package/dist/native/layout/locked.d.ts +38 -0
- package/dist/native/layout/locked.js +94 -0
- package/dist/native/layout/modal.d.ts +25 -0
- package/dist/native/layout/modal.js +93 -0
- package/dist/native/layout/not-found.d.ts +17 -0
- package/dist/native/layout/not-found.js +30 -0
- package/dist/native/layout/page-frame.d.ts +23 -0
- package/dist/native/layout/page-frame.js +46 -0
- package/dist/native/layout/panel.d.ts +18 -0
- package/dist/native/layout/panel.js +23 -0
- package/dist/native/layout/reorderable-list.d.ts +42 -0
- package/dist/native/layout/reorderable-list.js +52 -0
- package/dist/native/layout/sheet.d.ts +30 -0
- package/dist/native/layout/sheet.js +46 -0
- package/dist/native/layout/simple-dialog.d.ts +16 -0
- package/dist/native/layout/simple-dialog.js +20 -0
- package/dist/native/layout/simple-table.d.ts +50 -0
- package/dist/native/layout/simple-table.js +75 -0
- package/dist/native/layout/tab-bar.d.ts +33 -0
- package/dist/native/layout/tab-bar.js +48 -0
- package/dist/native/layout/tabs.d.ts +28 -0
- package/dist/native/layout/tabs.js +54 -0
- package/dist/native/layout/tuning-panel.d.ts +24 -0
- package/dist/native/layout/tuning-panel.js +246 -0
- package/dist/native/lib/autocomplete.d.ts +7 -0
- package/dist/native/lib/autocomplete.js +34 -0
- package/dist/native/lib/breakpoints.d.ts +14 -0
- package/dist/native/lib/breakpoints.js +17 -0
- package/dist/native/lib/chart-palette.d.ts +8 -0
- package/dist/native/lib/chart-palette.js +20 -0
- package/dist/native/lib/confirm.d.ts +48 -0
- package/dist/native/lib/confirm.js +69 -0
- package/dist/native/lib/control.d.ts +24 -0
- package/dist/native/lib/control.js +0 -0
- package/dist/native/lib/external-store.d.ts +16 -0
- package/dist/native/lib/external-store.js +30 -0
- package/dist/native/lib/keyboard.d.ts +15 -0
- package/dist/native/lib/keyboard.js +24 -0
- package/dist/native/lib/labels.d.ts +15 -0
- package/dist/native/lib/labels.js +17 -0
- package/dist/native/lib/loading.d.ts +10 -0
- package/dist/native/lib/loading.js +15 -0
- package/dist/native/lib/network.d.ts +11 -0
- package/dist/native/lib/network.js +20 -0
- package/dist/native/lib/scheme.d.ts +18 -0
- package/dist/native/lib/scheme.js +22 -0
- package/dist/native/lib/snackbar.d.ts +45 -0
- package/dist/native/lib/snackbar.js +59 -0
- package/dist/native/lib/theme.d.ts +34 -0
- package/dist/native/lib/theme.js +53 -0
- package/dist/native/lib/timezone.d.ts +26 -0
- package/dist/native/lib/timezone.js +95 -0
- package/dist/native/lib/token-color.d.ts +5 -0
- package/dist/native/lib/token-color.js +13 -0
- package/dist/native/lib/token-color.web.d.ts +4 -0
- package/dist/native/lib/token-color.web.js +7 -0
- package/dist/native/lib/tuning-context.d.ts +9 -0
- package/dist/native/lib/tuning-context.js +7 -0
- package/dist/native/lib/tuning.d.ts +24 -0
- package/dist/native/lib/tuning.js +42 -0
- package/dist/native/lib/typography.d.ts +10 -0
- package/dist/native/lib/typography.js +11 -0
- package/dist/native/lib/utils.d.ts +11 -0
- package/dist/native/lib/utils.js +21 -0
- package/dist/native/once/confirm.d.ts +7 -0
- package/dist/native/once/confirm.js +60 -0
- package/dist/native/once/error-boundary.d.ts +28 -0
- package/dist/native/once/error-boundary.js +55 -0
- package/dist/native/once/loading-lock.d.ts +8 -0
- package/dist/native/once/loading-lock.js +28 -0
- package/dist/native/once/offline-banner.d.ts +15 -0
- package/dist/native/once/offline-banner.js +35 -0
- package/dist/native/once/snackbar.d.ts +17 -0
- package/dist/native/once/snackbar.js +106 -0
- package/dist/native/styles.css +46 -0
- package/dist/shared/analytics.d.ts +71 -0
- package/dist/shared/analytics.js +0 -0
- package/dist/shared/button.d.ts +7 -0
- package/dist/shared/button.js +23 -0
- package/dist/shared/form.d.ts +45 -0
- package/dist/shared/form.js +46 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/tokens/contrast-pairs.d.ts +30 -0
- package/dist/tokens/contrast-pairs.js +404 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.js +10 -0
- package/dist/tokens/styles.gen.css +250 -0
- package/dist/tokens/tokens.gen.d.ts +141 -0
- package/dist/tokens/tokens.gen.js +206 -0
- package/dist/tuning/catalog.d.ts +27 -0
- package/dist/tuning/catalog.gen.d.ts +4 -0
- package/dist/tuning/catalog.gen.js +397 -0
- package/dist/tuning/catalog.js +128 -0
- package/dist/tuning/color.d.ts +20 -0
- package/dist/tuning/color.js +80 -0
- package/dist/tuning/css.d.ts +35 -0
- package/dist/tuning/css.js +147 -0
- package/dist/tuning/index.d.ts +8 -0
- package/dist/tuning/index.js +9 -0
- package/dist/tuning/model.d.ts +33 -0
- package/dist/tuning/model.js +154 -0
- package/dist/tuning/native.d.ts +35 -0
- package/dist/tuning/native.js +80 -0
- package/dist/tuning/schema.d.ts +69 -0
- package/dist/tuning/schema.js +247 -0
- package/dist/tuning/types.d.ts +75 -0
- package/dist/tuning/types.js +39 -0
- package/dist/web/analytics/line-chart.d.ts +20 -0
- package/dist/web/analytics/line-chart.js +28 -0
- package/dist/web/analytics/metric-card.d.ts +18 -0
- package/dist/web/analytics/metric-card.js +40 -0
- package/dist/web/analytics/multi-line-chart.d.ts +39 -0
- package/dist/web/analytics/multi-line-chart.js +345 -0
- package/dist/web/atom/avatar.d.ts +11 -0
- package/dist/web/atom/avatar.js +24 -0
- package/dist/web/atom/badge.d.ts +2 -0
- package/dist/web/atom/badge.js +3 -0
- package/dist/web/atom/button.d.ts +23 -0
- package/dist/web/atom/button.js +35 -0
- package/dist/web/atom/checkbox.d.ts +19 -0
- package/dist/web/atom/checkbox.js +33 -0
- package/dist/web/atom/colored-value.d.ts +13 -0
- package/dist/web/atom/colored-value.js +24 -0
- package/dist/web/atom/help.d.ts +10 -0
- package/dist/web/atom/help.js +18 -0
- package/dist/web/atom/label.d.ts +2 -0
- package/dist/web/atom/label.js +3 -0
- package/dist/web/atom/segmented-control.d.ts +39 -0
- package/dist/web/atom/segmented-control.js +42 -0
- package/dist/web/atom/select.d.ts +43 -0
- package/dist/web/atom/select.js +93 -0
- package/dist/web/atom/separator.d.ts +2 -0
- package/dist/web/atom/separator.js +3 -0
- package/dist/web/atom/skeleton.d.ts +2 -0
- package/dist/web/atom/skeleton.js +3 -0
- package/dist/web/atom/slider.d.ts +33 -0
- package/dist/web/atom/slider.js +70 -0
- package/dist/web/atom/spinner.d.ts +8 -0
- package/dist/web/atom/spinner.js +14 -0
- package/dist/web/atom/switch.d.ts +11 -0
- package/dist/web/atom/switch.js +10 -0
- package/dist/web/atom/text-area.d.ts +23 -0
- package/dist/web/atom/text-area.js +27 -0
- package/dist/web/atom/text-field.d.ts +18 -0
- package/dist/web/atom/text-field.js +22 -0
- package/dist/web/atom/toggle-chip.d.ts +22 -0
- package/dist/web/atom/toggle-chip.js +28 -0
- package/dist/web/atom/tooltip.d.ts +23 -0
- package/dist/web/atom/tooltip.js +26 -0
- package/dist/web/atom/typography.d.ts +6 -0
- package/dist/web/atom/typography.js +23 -0
- package/dist/web/base/accordion.d.ts +9 -0
- package/dist/web/base/accordion.js +44 -0
- package/dist/web/base/alert.d.ts +11 -0
- package/dist/web/base/alert.js +37 -0
- package/dist/web/base/avatar.d.ts +8 -0
- package/dist/web/base/avatar.js +29 -0
- package/dist/web/base/badge.d.ts +12 -0
- package/dist/web/base/badge.js +26 -0
- package/dist/web/base/breadcrumb.d.ts +16 -0
- package/dist/web/base/breadcrumb.js +72 -0
- package/dist/web/base/button.d.ts +12 -0
- package/dist/web/base/button.js +47 -0
- package/dist/web/base/card.d.ts +19 -0
- package/dist/web/base/card.js +74 -0
- package/dist/web/base/checkbox.d.ts +6 -0
- package/dist/web/base/checkbox.js +21 -0
- package/dist/web/base/dialog.d.ts +20 -0
- package/dist/web/base/dialog.js +92 -0
- package/dist/web/base/dropdown-menu.d.ts +29 -0
- package/dist/web/base/dropdown-menu.js +125 -0
- package/dist/web/base/field.d.ts +27 -0
- package/dist/web/base/field.js +118 -0
- package/dist/web/base/form.d.ts +38 -0
- package/dist/web/base/form.js +110 -0
- package/dist/web/base/input.d.ts +9 -0
- package/dist/web/base/input.js +23 -0
- package/dist/web/base/label.d.ts +6 -0
- package/dist/web/base/label.js +15 -0
- package/dist/web/base/pagination.d.ts +34 -0
- package/dist/web/base/pagination.js +90 -0
- package/dist/web/base/popover.d.ts +11 -0
- package/dist/web/base/popover.js +37 -0
- package/dist/web/base/radio-group.d.ts +7 -0
- package/dist/web/base/radio-group.js +27 -0
- package/dist/web/base/scroll-area.d.ts +10 -0
- package/dist/web/base/scroll-area.js +41 -0
- package/dist/web/base/select.d.ts +17 -0
- package/dist/web/base/select.js +96 -0
- package/dist/web/base/separator.d.ts +6 -0
- package/dist/web/base/separator.js +17 -0
- package/dist/web/base/sheet.d.ts +19 -0
- package/dist/web/base/sheet.js +88 -0
- package/dist/web/base/skeleton.d.ts +5 -0
- package/dist/web/base/skeleton.js +14 -0
- package/dist/web/base/slider.d.ts +9 -0
- package/dist/web/base/slider.js +39 -0
- package/dist/web/base/sonner.d.ts +9 -0
- package/dist/web/base/sonner.js +25 -0
- package/dist/web/base/spinner.d.ts +5 -0
- package/dist/web/base/spinner.js +17 -0
- package/dist/web/base/switch.d.ts +6 -0
- package/dist/web/base/switch.js +19 -0
- package/dist/web/base/table.d.ts +14 -0
- package/dist/web/base/table.js +68 -0
- package/dist/web/base/tabs.d.ts +9 -0
- package/dist/web/base/tabs.js +36 -0
- package/dist/web/base/textarea.d.ts +9 -0
- package/dist/web/base/textarea.js +23 -0
- package/dist/web/base/tooltip.d.ts +9 -0
- package/dist/web/base/tooltip.js +36 -0
- package/dist/web/form/checkbox.d.ts +35 -0
- package/dist/web/form/checkbox.js +91 -0
- package/dist/web/form/radio-group.d.ts +24 -0
- package/dist/web/form/radio-group.js +75 -0
- package/dist/web/form/select.d.ts +16 -0
- package/dist/web/form/select.js +44 -0
- package/dist/web/form/slider.d.ts +19 -0
- package/dist/web/form/slider.js +51 -0
- package/dist/web/form/switch.d.ts +11 -0
- package/dist/web/form/switch.js +50 -0
- package/dist/web/form/text-area.d.ts +10 -0
- package/dist/web/form/text-area.js +31 -0
- package/dist/web/form/text-input.d.ts +10 -0
- package/dist/web/form/text-input.js +42 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +0 -0
- package/dist/web/layout/accordion.d.ts +26 -0
- package/dist/web/layout/accordion.js +29 -0
- package/dist/web/layout/alert-modal.d.ts +41 -0
- package/dist/web/layout/alert-modal.js +71 -0
- package/dist/web/layout/card.d.ts +17 -0
- package/dist/web/layout/card.js +35 -0
- package/dist/web/layout/description.d.ts +12 -0
- package/dist/web/layout/description.js +20 -0
- package/dist/web/layout/information.d.ts +36 -0
- package/dist/web/layout/information.js +53 -0
- package/dist/web/layout/modal.d.ts +16 -0
- package/dist/web/layout/modal.js +37 -0
- package/dist/web/layout/page-frame.d.ts +37 -0
- package/dist/web/layout/page-frame.js +79 -0
- package/dist/web/layout/scroll-area.d.ts +10 -0
- package/dist/web/layout/scroll-area.js +13 -0
- package/dist/web/layout/sheet.d.ts +32 -0
- package/dist/web/layout/sheet.js +68 -0
- package/dist/web/layout/simple-dialog.d.ts +11 -0
- package/dist/web/layout/simple-dialog.js +24 -0
- package/dist/web/layout/simple-table.d.ts +49 -0
- package/dist/web/layout/simple-table.js +58 -0
- package/dist/web/layout/tabs.d.ts +26 -0
- package/dist/web/layout/tabs.js +42 -0
- package/dist/web/layout/titled-modal.d.ts +32 -0
- package/dist/web/layout/titled-modal.js +58 -0
- package/dist/web/lib/css-vars.d.ts +14 -0
- package/dist/web/lib/css-vars.js +18 -0
- package/dist/web/lib/dialog.d.ts +13 -0
- package/dist/web/lib/dialog.js +0 -0
- package/dist/web/lib/form.d.ts +2 -0
- package/dist/web/lib/form.js +3 -0
- package/dist/web/lib/labels.d.ts +27 -0
- package/dist/web/lib/labels.js +29 -0
- package/dist/web/lib/modal-open-focus.d.ts +17 -0
- package/dist/web/lib/modal-open-focus.js +44 -0
- package/dist/web/lib/restore-focus.d.ts +12 -0
- package/dist/web/lib/restore-focus.js +32 -0
- package/dist/web/lib/utils.d.ts +4 -0
- package/dist/web/lib/utils.js +10 -0
- package/dist/web/styles.css +162 -0
- package/package.json +203 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SelectTrigger } from "../base/select.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/web/atom/select.d.ts
|
|
4
|
+
export type SelectOption = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** For text search (specify when label is a ReactNode) */
|
|
8
|
+
textValue?: string;
|
|
9
|
+
};
|
|
10
|
+
export type SelectOptionGroup = {
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
options: SelectOption[];
|
|
13
|
+
};
|
|
14
|
+
export type SelectProps = {
|
|
15
|
+
value: string;
|
|
16
|
+
onValueChange: (value: string) => void;
|
|
17
|
+
options: (SelectOption | SelectOptionGroup)[];
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
helpText?: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
wrapperClassName?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
size?: "xs" | "sm" | "default";
|
|
27
|
+
/** Controls the open state (inline editing, etc.) */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/** DOM props passed straight to the Trigger (autoFocus, onBlur, etc.) */
|
|
31
|
+
triggerProps?: ComponentProps<typeof SelectTrigger>;
|
|
32
|
+
/** Slot for the form side to insert an error */
|
|
33
|
+
errorSlot?: ReactNode;
|
|
34
|
+
invalid?: boolean;
|
|
35
|
+
/** DEV-E2E: ID used by e2e to identify the trigger button */
|
|
36
|
+
"data-testid"?: string;
|
|
37
|
+
/** DOM id of the trigger. Use it to pair with an outer `<label htmlFor>`. */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** Accessible name when there is no visible label. Not needed when `label` is passed. */
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, className, wrapperClassName, disabled, size, open, onOpenChange, triggerProps, errorSlot, invalid, id, "aria-label": ariaLabel, "data-testid": testId }: SelectProps): import("react").JSX.Element;
|
|
43
|
+
//#endregion
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Label } from "../base/label.js";
|
|
3
|
+
import { Select as Select$1, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "../base/select.js";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/web/atom/select.tsx
|
|
8
|
+
const EMPTY_SENTINEL = "__atom_select_empty__";
|
|
9
|
+
/**
|
|
10
|
+
* Whether `""` may be treated as "not selected yet" rather than "an empty choice".
|
|
11
|
+
*
|
|
12
|
+
* When it is replaced by the sentinel, Radix interprets it as **a value is selected**, so
|
|
13
|
+
* `<SelectValue placeholder>` is not rendered at all (the value is not among the options, so the
|
|
14
|
+
* content is empty too, and the trigger becomes a **silently empty button**). When there is no
|
|
15
|
+
* empty option, draw the placeholder yourself so that it reads as "not selected".
|
|
16
|
+
*/
|
|
17
|
+
function hasEmptyOption(options) {
|
|
18
|
+
return options.some((o) => isOptionGroup(o) ? o.options.some((x) => x.value === "") : o.value === "");
|
|
19
|
+
}
|
|
20
|
+
function toInternalValue(value) {
|
|
21
|
+
return value === "" ? EMPTY_SENTINEL : value;
|
|
22
|
+
}
|
|
23
|
+
function fromInternalValue(value) {
|
|
24
|
+
return value === EMPTY_SENTINEL ? "" : value;
|
|
25
|
+
}
|
|
26
|
+
function isOptionGroup(option) {
|
|
27
|
+
return "options" in option;
|
|
28
|
+
}
|
|
29
|
+
function renderOption(option) {
|
|
30
|
+
const v = toInternalValue(option.value);
|
|
31
|
+
return /* @__PURE__ */ jsx(SelectItem, {
|
|
32
|
+
value: v,
|
|
33
|
+
textValue: option.textValue,
|
|
34
|
+
children: option.label
|
|
35
|
+
}, v);
|
|
36
|
+
}
|
|
37
|
+
function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, className, wrapperClassName, disabled, size = "default", open, onOpenChange, triggerProps, errorSlot, invalid, id, "aria-label": ariaLabel, "data-testid": testId }) {
|
|
38
|
+
const generatedId = useId();
|
|
39
|
+
const triggerId = id ?? generatedId;
|
|
40
|
+
const select = /* @__PURE__ */ jsxs(Select$1, {
|
|
41
|
+
value: toInternalValue(value),
|
|
42
|
+
onValueChange: (v) => onValueChange(fromInternalValue(v)),
|
|
43
|
+
disabled,
|
|
44
|
+
open,
|
|
45
|
+
onOpenChange,
|
|
46
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
47
|
+
id: triggerId,
|
|
48
|
+
size,
|
|
49
|
+
"aria-label": ariaLabel,
|
|
50
|
+
"aria-invalid": invalid,
|
|
51
|
+
"data-testid": testId,
|
|
52
|
+
...triggerProps,
|
|
53
|
+
className: cn("w-full cursor-pointer", className, triggerProps?.className),
|
|
54
|
+
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
55
|
+
placeholder,
|
|
56
|
+
children: value === "" && !hasEmptyOption(options) ? /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: "text-muted-foreground",
|
|
58
|
+
children: placeholder
|
|
59
|
+
}) : void 0
|
|
60
|
+
})
|
|
61
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: options.map((option) => isOptionGroup(option) ? /* @__PURE__ */ jsxs(SelectGroup, { children: [/* @__PURE__ */ jsx(SelectLabel, { children: option.label }), option.options.map(renderOption)] }, typeof option.label === "string" ? option.label : option.options.map((o) => o.value).join(",")) : renderOption(option)) })]
|
|
62
|
+
});
|
|
63
|
+
if (!label && !description && !errorSlot) return select;
|
|
64
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: cn("flex flex-col gap-1.5", wrapperClassName),
|
|
66
|
+
children: [
|
|
67
|
+
label && /* @__PURE__ */ jsxs(Label, {
|
|
68
|
+
htmlFor: triggerId,
|
|
69
|
+
className: "font-semibold text-xs opacity-80 flex items-center gap-1",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
72
|
+
required ? /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "text-destructive",
|
|
74
|
+
children: "*"
|
|
75
|
+
}) : null,
|
|
76
|
+
helpText ? /* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "text-muted-foreground font-normal",
|
|
78
|
+
children: helpText
|
|
79
|
+
}) : null
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
select,
|
|
83
|
+
description && /* @__PURE__ */ jsx("p", {
|
|
84
|
+
className: "text-xs text-muted-foreground",
|
|
85
|
+
children: description
|
|
86
|
+
}),
|
|
87
|
+
errorSlot
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { Select };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Slider as Slider$1 } from "../base/slider.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/web/atom/slider.d.ts
|
|
4
|
+
type CommonProps = {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
helpText?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
wrapperClassName?: string;
|
|
11
|
+
errorSlot?: ReactNode;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
min?: number;
|
|
15
|
+
max: number;
|
|
16
|
+
step?: number;
|
|
17
|
+
/** Formatted string shown to the right of the value. If not given, the raw number is shown (a range is separated by ` / `) */
|
|
18
|
+
formattedValue?: ReactNode;
|
|
19
|
+
} & Omit<ComponentProps<typeof Slider$1>, "value" | "onValueChange" | "defaultValue" | "min" | "max" | "step" | "disabled" | "className">;
|
|
20
|
+
export type SliderProps = ({
|
|
21
|
+
value: number;
|
|
22
|
+
onValueChange: (value: number) => void;
|
|
23
|
+
} & CommonProps) | ({
|
|
24
|
+
value: number[];
|
|
25
|
+
onValueChange: (value: number[]) => void;
|
|
26
|
+
} & CommonProps);
|
|
27
|
+
/**
|
|
28
|
+
* A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
|
|
29
|
+
* Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Slider(props: SliderProps): import("react").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Label } from "../base/label.js";
|
|
3
|
+
import { Slider as Slider$1 } from "../base/slider.js";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/web/atom/slider.tsx
|
|
8
|
+
function isRange(props) {
|
|
9
|
+
return Array.isArray(props.value);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
|
|
13
|
+
* Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
|
|
14
|
+
*/
|
|
15
|
+
function Slider(props) {
|
|
16
|
+
const { label, required, description, helpText, className, wrapperClassName, errorSlot, invalid, "aria-invalid": ariaInvalid, min, max, step, disabled, formattedValue, value, onValueChange: _onValueChange, ...rest } = props;
|
|
17
|
+
const labelId = useId();
|
|
18
|
+
const sliderValue = Array.isArray(value) ? value : typeof value === "number" ? [value] : [];
|
|
19
|
+
const handleChange = (next) => {
|
|
20
|
+
if (isRange(props)) props.onValueChange(next);
|
|
21
|
+
else if (typeof next[0] === "number") props.onValueChange(next[0]);
|
|
22
|
+
};
|
|
23
|
+
const inlineDisplay = formattedValue ?? sliderValue.join(" / ");
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: cn("flex flex-col gap-2", wrapperClassName),
|
|
26
|
+
children: [
|
|
27
|
+
(label || formattedValue !== void 0 || sliderValue.length > 0) && /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "flex items-baseline justify-between gap-2",
|
|
29
|
+
children: [label ? /* @__PURE__ */ jsxs(Label, {
|
|
30
|
+
id: labelId,
|
|
31
|
+
className: "font-semibold text-xs opacity-80 flex items-center gap-1",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
34
|
+
required ? /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "text-destructive",
|
|
36
|
+
children: "*"
|
|
37
|
+
}) : null,
|
|
38
|
+
helpText ? /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "text-muted-foreground font-normal",
|
|
40
|
+
children: helpText
|
|
41
|
+
}) : null
|
|
42
|
+
]
|
|
43
|
+
}) : /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: "text-muted-foreground text-sm font-mono tabular-nums",
|
|
45
|
+
children: inlineDisplay
|
|
46
|
+
})]
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(Slider$1, {
|
|
49
|
+
"aria-labelledby": label ? labelId : void 0,
|
|
50
|
+
...rest,
|
|
51
|
+
"aria-invalid": invalid ?? ariaInvalid,
|
|
52
|
+
value: sliderValue,
|
|
53
|
+
onValueChange: handleChange,
|
|
54
|
+
min,
|
|
55
|
+
max,
|
|
56
|
+
step,
|
|
57
|
+
disabled,
|
|
58
|
+
className: cn("grow", className)
|
|
59
|
+
}),
|
|
60
|
+
description && /* @__PURE__ */ jsx("p", {
|
|
61
|
+
className: "text-xs text-muted-foreground",
|
|
62
|
+
children: description
|
|
63
|
+
}),
|
|
64
|
+
errorSlot
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Slider };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Spinner as Spinner$1 } from "../base/spinner.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
//#region src/web/atom/spinner.d.ts
|
|
4
|
+
export type SpinnerProps = React.ComponentProps<typeof Spinner$1> & {
|
|
5
|
+
full?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function Spinner({ full, ...props }: SpinnerProps): React.JSX.Element;
|
|
8
|
+
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Spinner as Spinner$1 } from "../base/spinner.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/web/atom/spinner.tsx
|
|
6
|
+
function Spinner({ full, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
className: cn(full && "grow w-full h-full flex justify-center items-center"),
|
|
9
|
+
children: /* @__PURE__ */ jsx(Spinner$1, { ...props })
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Spinner };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Switch as Switch$1 } from "../base/switch.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
//#region src/web/atom/switch.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A controlled Switch that works outside a form.
|
|
6
|
+
* `form/switch.tsx` depends on TanStack Form's field context,
|
|
7
|
+
* so use this one for a standalone ON/OFF toggle.
|
|
8
|
+
*/
|
|
9
|
+
export type SwitchProps = ComponentProps<typeof Switch$1>;
|
|
10
|
+
export declare function Switch(props: SwitchProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { textareaVariants } from "../base/textarea.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/web/atom/text-area.d.ts
|
|
5
|
+
export type TextAreaProps = Omit<ComponentProps<"textarea">, "value" | "onChange"> & VariantProps<typeof textareaVariants> & {
|
|
6
|
+
value: string;
|
|
7
|
+
onValueChange: (value: string) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A plain multi-line input. Use it directly from screens that do not use TanStack Form
|
|
11
|
+
* (settings, small edit fields, read-only output). Apps are expected not to import
|
|
12
|
+
* `base/textarea` directly, so this is the entry point for it. A multi-line version
|
|
13
|
+
* of `atom/text-field`.
|
|
14
|
+
*
|
|
15
|
+
* The variants match `atom/text-field`:
|
|
16
|
+
* default ... a field with a 1px border
|
|
17
|
+
* `<3` ... an underline-only field that attaches to an existing row
|
|
18
|
+
* block ... a field with no border that reads as body text (an always-editable row)
|
|
19
|
+
*
|
|
20
|
+
* When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
|
|
21
|
+
*/
|
|
22
|
+
export declare function TextArea({ value, onValueChange, ...props }: TextAreaProps): import("react").JSX.Element;
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Textarea } from "../base/textarea.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/web/atom/text-area.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A plain multi-line input. Use it directly from screens that do not use TanStack Form
|
|
7
|
+
* (settings, small edit fields, read-only output). Apps are expected not to import
|
|
8
|
+
* `base/textarea` directly, so this is the entry point for it. A multi-line version
|
|
9
|
+
* of `atom/text-field`.
|
|
10
|
+
*
|
|
11
|
+
* The variants match `atom/text-field`:
|
|
12
|
+
* default ... a field with a 1px border
|
|
13
|
+
* `<3` ... an underline-only field that attaches to an existing row
|
|
14
|
+
* block ... a field with no border that reads as body text (an always-editable row)
|
|
15
|
+
*
|
|
16
|
+
* When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
|
|
17
|
+
*/
|
|
18
|
+
function TextArea({ value, onValueChange, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
20
|
+
value,
|
|
21
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { TextArea };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inputVariants } from "../base/input.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/web/atom/text-field.d.ts
|
|
5
|
+
export type TextFieldProps = Omit<ComponentProps<"input">, "value" | "onChange"> & VariantProps<typeof inputVariants> & {
|
|
6
|
+
value: string;
|
|
7
|
+
onValueChange: (value: string) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A plain text input. Use it directly from screens that do not use TanStack Form
|
|
11
|
+
* (settings, search filters, small edit fields). Apps are expected not to import
|
|
12
|
+
* `base/input` directly, so this is the entry point for it.
|
|
13
|
+
*
|
|
14
|
+
* When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
|
|
15
|
+
* It pairs with native's `atom/text-field`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TextField({ value, onValueChange, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Input } from "../base/input.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/web/atom/text-field.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A plain text input. Use it directly from screens that do not use TanStack Form
|
|
7
|
+
* (settings, search filters, small edit fields). Apps are expected not to import
|
|
8
|
+
* `base/input` directly, so this is the entry point for it.
|
|
9
|
+
*
|
|
10
|
+
* When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
|
|
11
|
+
* It pairs with native's `atom/text-field`.
|
|
12
|
+
*/
|
|
13
|
+
function TextField({ value, onValueChange, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
15
|
+
value,
|
|
16
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { TextField };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BadgeVariants } from "../base/badge.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/web/atom/toggle-chip.d.ts
|
|
4
|
+
export type ToggleChipProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Whether it is selected. When selected, `variant` becomes `default` (indigo fill). */
|
|
7
|
+
pressed: boolean;
|
|
8
|
+
onPressedChange: (pressed: boolean) => void;
|
|
9
|
+
/** Look when not selected (default `outline`). */
|
|
10
|
+
inactiveVariant?: BadgeVariants;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A Badge that toggles selection when pressed. Used for filter tags and multi-selecting accounts.
|
|
16
|
+
*
|
|
17
|
+
* Wrapping a `Badge` in a `<button>` by hand makes it easy to forget `type="button"`
|
|
18
|
+
* or miss `aria-pressed`. How the pressed state looks (indigo fill) is also something
|
|
19
|
+
* the design system should decide, so it is gathered into a single component.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ToggleChip({ children, pressed, onPressedChange, inactiveVariant, disabled, className }: ToggleChipProps): import("react").JSX.Element;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Badge } from "../base/badge.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/web/atom/toggle-chip.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A Badge that toggles selection when pressed. Used for filter tags and multi-selecting accounts.
|
|
8
|
+
*
|
|
9
|
+
* Wrapping a `Badge` in a `<button>` by hand makes it easy to forget `type="button"`
|
|
10
|
+
* or miss `aria-pressed`. How the pressed state looks (indigo fill) is also something
|
|
11
|
+
* the design system should decide, so it is gathered into a single component.
|
|
12
|
+
*/
|
|
13
|
+
function ToggleChip({ children, pressed, onPressedChange, inactiveVariant = "outline", disabled, className }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
"aria-pressed": pressed,
|
|
17
|
+
disabled,
|
|
18
|
+
onClick: () => onPressedChange(!pressed),
|
|
19
|
+
className: cn("shrink-0", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer", className),
|
|
20
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
21
|
+
variant: pressed ? "default" : inactiveVariant,
|
|
22
|
+
children
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ToggleChip };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/web/atom/tooltip.d.ts
|
|
3
|
+
type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The tooltip body. When falsy, no tooltip is attached and the children are rendered as is.
|
|
6
|
+
* This makes it easy to enable conditionally, e.g. "show the reason only when the button is disabled".
|
|
7
|
+
*/
|
|
8
|
+
content?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The element that is the target of hover and focus. A disabled element is wrapped in a focusable span.
|
|
11
|
+
* Even if you pass `<button disabled>`, the body appears on hover and on keyboard focus.
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A light component wrapping shadcn's Tooltip. It is meant for "showing the reason when the trigger is disabled (cannot be pressed)".
|
|
18
|
+
*
|
|
19
|
+
* When content is empty, no tooltip is attached and the children are rendered as is.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Tooltip({ content, children, side }: Props): React.JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Tooltip as Tooltip$1, TooltipContent, TooltipTrigger } from "../base/tooltip.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/web/atom/tooltip.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A light component wrapping shadcn's Tooltip. It is meant for "showing the reason when the trigger is disabled (cannot be pressed)".
|
|
7
|
+
*
|
|
8
|
+
* When content is empty, no tooltip is attached and the children are rendered as is.
|
|
9
|
+
*/
|
|
10
|
+
function Tooltip({ content, children, side }) {
|
|
11
|
+
if (!content) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
12
|
+
return /* @__PURE__ */ jsxs(Tooltip$1, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
13
|
+
asChild: true,
|
|
14
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
15
|
+
tabIndex: 0,
|
|
16
|
+
className: "contents",
|
|
17
|
+
children
|
|
18
|
+
})
|
|
19
|
+
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
20
|
+
side,
|
|
21
|
+
children: content
|
|
22
|
+
})] });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Tooltip };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/web/atom/typography.tsx
|
|
5
|
+
function SectionTitle({ className, children, description, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
+
className: "flex flex-col gap-0.5",
|
|
8
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
9
|
+
className: "after:bg-action/70 relative py-2 pl-3 text-sm after:absolute after:inset-y-2 after:left-1 after:w-0.5",
|
|
10
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
11
|
+
className: cn("font-semibold", className),
|
|
12
|
+
...props,
|
|
13
|
+
children
|
|
14
|
+
})
|
|
15
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
16
|
+
className: "text-muted-foreground text-sm",
|
|
17
|
+
children: description
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SectionTitle };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
//#region src/web/base/accordion.d.ts
|
|
4
|
+
declare function Accordion({ ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Root>): React$1.JSX.Element;
|
|
5
|
+
declare function AccordionItem({ className, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Item>): React$1.JSX.Element;
|
|
6
|
+
declare function AccordionTrigger({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): React$1.JSX.Element;
|
|
7
|
+
declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Content>): React$1.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
//#region src/web/base/accordion.tsx
|
|
7
|
+
function Accordion({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, {
|
|
9
|
+
"data-slot": "accordion",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function AccordionItem({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
|
|
15
|
+
"data-slot": "accordion-item",
|
|
16
|
+
className: cn("border-b last:border-b-0", className),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
|
|
22
|
+
className: "flex",
|
|
23
|
+
children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
|
|
24
|
+
"data-slot": "accordion-trigger",
|
|
25
|
+
className: cn(" flex flex-1 items-start justify-between gap-4 rounded-control py-3 text-left text-[13px] font-medium outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className),
|
|
26
|
+
...props,
|
|
27
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5" })]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function AccordionContent({ className, children, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
33
|
+
"data-slot": "accordion-content",
|
|
34
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-[13px]",
|
|
35
|
+
...props,
|
|
36
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: cn("pt-0 pb-3", className),
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/web/base/alert.d.ts
|
|
4
|
+
declare const alertVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React$1.JSX.Element;
|
|
8
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
//#region src/web/base/alert.tsx
|
|
6
|
+
const alertVariants = cva("relative w-full rounded-surface border px-3.5 py-3 text-[13px] grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "bg-card text-card-foreground",
|
|
9
|
+
destructive: "border-state-error/30 bg-state-error/5 text-state-error [&>svg]:text-current *:data-[slot=alert-description]:text-state-error"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { variant: "default" }
|
|
12
|
+
});
|
|
13
|
+
function Alert({ className, variant, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "alert",
|
|
16
|
+
role: "alert",
|
|
17
|
+
className: cn(alertVariants({ variant }), className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function AlertTitle({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "alert-title",
|
|
24
|
+
className: cn("col-start-2 min-h-4 font-medium tracking-tight", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function AlertDescription({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "alert-description",
|
|
31
|
+
className: cn("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
//#region src/web/base/avatar.d.ts
|
|
4
|
+
declare function Avatar({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Root>): React$1.JSX.Element;
|
|
5
|
+
declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Image>): React$1.JSX.Element;
|
|
6
|
+
declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): React$1.JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Avatar, AvatarFallback, AvatarImage };
|