@bzync/rui 0.0.4 → 0.0.8
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 +10 -0
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.js +20 -0
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -0
- package/dist/components/avatar-group.d.ts +14 -0
- package/dist/components/avatar-group.js +35 -0
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -0
- package/dist/components/blockquote.d.ts +10 -0
- package/dist/components/blockquote.js +32 -0
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -0
- package/dist/components/button-group.d.ts +7 -0
- package/dist/components/button-group.js +26 -0
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.d.ts +4 -4
- package/dist/components/code.js +62 -60
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +5 -4
- package/dist/components/currency.cjs +1 -0
- package/dist/components/currency.d.ts +18 -0
- package/dist/components/currency.js +62 -0
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -0
- package/dist/components/description-list.d.ts +14 -0
- package/dist/components/description-list.js +38 -0
- package/dist/components/divider.cjs +1 -0
- package/dist/components/divider.d.ts +12 -0
- package/dist/components/divider.js +45 -0
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -0
- package/dist/components/rating.d.ts +15 -0
- package/dist/components/rating.js +75 -0
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +2 -2
- package/dist/components/scroll-area.cjs +1 -0
- package/dist/components/scroll-area.d.ts +8 -0
- package/dist/components/scroll-area.js +19 -0
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -0
- package/dist/components/time-picker.d.ts +31 -0
- package/dist/components/time-picker.js +394 -0
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -0
- package/dist/components/toggle.d.ts +42 -0
- package/dist/components/toggle.js +116 -0
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -0
- package/dist/components/typography.d.ts +50 -0
- package/dist/components/typography.js +202 -0
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +125 -86
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export * from './components/accordion';
|
|
2
|
+
export * from './components/aspect-ratio';
|
|
2
3
|
export * from './components/calendar';
|
|
3
4
|
export * from './components/alert';
|
|
4
5
|
export * from './components/auth-backdrop';
|
|
5
6
|
export * from './components/autocomplete';
|
|
6
7
|
export * from './components/avatar';
|
|
8
|
+
export * from './components/avatar-group';
|
|
7
9
|
export * from './components/badge';
|
|
8
10
|
export * from './components/billing-interval-toggle';
|
|
11
|
+
export * from './components/blockquote';
|
|
9
12
|
export * from './components/breadcrumb';
|
|
10
13
|
export * from './components/button';
|
|
14
|
+
export * from './components/button-group';
|
|
11
15
|
export * from './components/callout';
|
|
12
16
|
export * from './components/card';
|
|
13
17
|
export * from './components/charts';
|
|
@@ -16,8 +20,11 @@ export * from './components/code';
|
|
|
16
20
|
export * from './components/command';
|
|
17
21
|
export * from './components/confirm-dialog';
|
|
18
22
|
export * from './components/copy-button';
|
|
23
|
+
export * from './components/currency';
|
|
19
24
|
export * from './components/datatable';
|
|
20
25
|
export * from './components/datepicker';
|
|
26
|
+
export * from './components/description-list';
|
|
27
|
+
export * from './components/divider';
|
|
21
28
|
export * from './components/drawer';
|
|
22
29
|
export * from './components/dropdown-menu';
|
|
23
30
|
export * from './components/empty-state';
|
|
@@ -39,7 +46,9 @@ export * from './components/pagination';
|
|
|
39
46
|
export * from './components/popover';
|
|
40
47
|
export * from './components/progressbar';
|
|
41
48
|
export * from './components/radio';
|
|
49
|
+
export * from './components/rating';
|
|
42
50
|
export * from './components/richtext';
|
|
51
|
+
export * from './components/scroll-area';
|
|
43
52
|
export * from './components/select';
|
|
44
53
|
export * from './components/separator';
|
|
45
54
|
export * from './components/skeleton';
|
|
@@ -56,10 +65,13 @@ export * from './components/tag';
|
|
|
56
65
|
export * from './components/terminal';
|
|
57
66
|
export * from './components/textarea';
|
|
58
67
|
export * from './components/timeline';
|
|
68
|
+
export * from './components/toggle';
|
|
59
69
|
export * from './components/tooltip';
|
|
60
70
|
export * from './components/theme-provider';
|
|
61
71
|
export * from './components/theme-toggle';
|
|
72
|
+
export * from './components/time-picker';
|
|
62
73
|
export * from './components/tree';
|
|
74
|
+
export * from './components/typography';
|
|
63
75
|
export * from './lib/cn';
|
|
64
76
|
export * from './hooks';
|
|
65
77
|
export * from './types';
|
|
@@ -68,3 +80,7 @@ export * from './utils';
|
|
|
68
80
|
export * from './errors/error-boundary';
|
|
69
81
|
export * from './lifecycle';
|
|
70
82
|
export * from './components/seo';
|
|
83
|
+
export * from './components/visually-hidden';
|
|
84
|
+
export * from './components/slot';
|
|
85
|
+
export * from './components/overlay';
|
|
86
|
+
export * from './lib/motion';
|
package/dist/index.js
CHANGED
|
@@ -1,73 +1,90 @@
|
|
|
1
|
-
import { t as e } from "./cn-
|
|
1
|
+
import { t as e } from "./cn-BJyZJP-y.js";
|
|
2
2
|
import { Accordion as t, Collapsible as n } from "./components/accordion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { AspectRatio as r } from "./components/aspect-ratio.js";
|
|
4
|
+
import { t as i } from "./calendar-nkYCMEy3.js";
|
|
5
|
+
import { Alert as a } from "./components/alert.js";
|
|
6
|
+
import { AuthBackdrop as ee } from "./components/auth-backdrop.js";
|
|
7
|
+
import { t as te } from "./autocomplete-bgySuP8X.js";
|
|
7
8
|
import { t as o } from "./use-event-callback-DGkfO_uu.js";
|
|
8
|
-
import { Avatar as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import {
|
|
25
|
-
import { t as ce } from "./
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
9
|
+
import { Avatar as ne } from "./components/avatar.js";
|
|
10
|
+
import { AvatarGroup as re, AvatarGroupOverflow as ie } from "./components/avatar-group.js";
|
|
11
|
+
import { Badge as ae, badgeVariants as oe } from "./components/badge.js";
|
|
12
|
+
import { BillingIntervalToggle as s } from "./components/billing-interval-toggle.js";
|
|
13
|
+
import { Blockquote as c } from "./components/blockquote.js";
|
|
14
|
+
import { Breadcrumb as l } from "./components/breadcrumb.js";
|
|
15
|
+
import { Slot as u } from "./components/slot.js";
|
|
16
|
+
import { Button as d, buttonSizes as f, buttonVariants as p } from "./components/button.js";
|
|
17
|
+
import { ButtonGroup as m } from "./components/button-group.js";
|
|
18
|
+
import { Callout as h } from "./components/callout.js";
|
|
19
|
+
import { Card as g, CardBody as _, CardDescription as v, CardFooter as y, CardHeader as b, CardTitle as x, cardVariants as S } from "./components/card.js";
|
|
20
|
+
import { a as C, c as w, i as T, l as E, n as D, o as O, r as k, s as A, t as j, u as M } from "./charts-Dscl6UC3.js";
|
|
21
|
+
import { Checkbox as N } from "./components/checkbox.js";
|
|
22
|
+
import { CodeBlock as P, CodeEditor as F, InlineCode as I } from "./components/code.js";
|
|
23
|
+
import { a as L, i as R, n as z, r as B, t as V } from "./focus-Dk1YWVPN.js";
|
|
24
|
+
import { n as H, t as U } from "./motion-gnRzFS5f.js";
|
|
25
|
+
import { CommandPalette as W, CommandProvider as G, useCommand as K } from "./components/command.js";
|
|
26
|
+
import { n as q, r as se, t as ce } from "./use-focus-trap-CS6BXJAB.js";
|
|
27
|
+
import { Modal as le, ModalBody as ue, ModalDescription as de, ModalFooter as fe, ModalHeader as pe, ModalTitle as me } from "./components/modal.js";
|
|
28
|
+
import { ConfirmDialog as he } from "./components/confirm-dialog.js";
|
|
29
|
+
import { CopyButton as ge } from "./components/copy-button.js";
|
|
30
|
+
import { Currency as _e, formatCurrency as ve } from "./components/currency.js";
|
|
31
|
+
import { t as ye } from "./datatable-BJoZMrKI.js";
|
|
32
|
+
import { DatePicker as be } from "./components/datepicker.js";
|
|
33
|
+
import { DescriptionDetails as xe, DescriptionItem as Se, DescriptionList as Ce, DescriptionTerm as we } from "./components/description-list.js";
|
|
34
|
+
import { Divider as Te } from "./components/divider.js";
|
|
35
|
+
import { Drawer as Ee } from "./components/drawer.js";
|
|
36
|
+
import { DropdownMenu as De } from "./components/dropdown-menu.js";
|
|
37
|
+
import { EmptyState as Oe } from "./components/empty-state.js";
|
|
38
|
+
import { ErrorState as ke } from "./components/error-state.js";
|
|
39
|
+
import { FileUpload as Ae } from "./components/file-upload.js";
|
|
40
|
+
import { Field as je, FieldContent as Me, FieldDescription as Ne, FieldError as Pe, FieldLabel as Fe, FormField as Ie } from "./components/form-field.js";
|
|
41
|
+
import { Input as Le } from "./components/input.js";
|
|
42
|
+
import { InfoButton as Re } from "./components/info-button.js";
|
|
43
|
+
import { Kbd as ze } from "./components/kbd.js";
|
|
44
|
+
import { Label as Be } from "./components/label.js";
|
|
45
|
+
import { Link as Ve } from "./components/link.js";
|
|
46
|
+
import { List as He, ListItem as Ue } from "./components/list.js";
|
|
47
|
+
import { AppShell as We, AppShellBody as Ge, AppShellHeader as Ke, AppShellMain as qe, Container as Je, Footer as Ye, Inline as Xe, PageHeader as Ze, Stack as Qe } from "./components/layout.js";
|
|
48
|
+
import { BottomBar as $e, BrandLink as et, IconButton as tt, Navbar as nt, NavigationLink as rt, Sidebar as it, Topbar as at, TopbarTitle as J } from "./components/navigation.js";
|
|
49
|
+
import { NumberInput as ot } from "./components/number-input.js";
|
|
50
|
+
import { OtpInput as st } from "./components/otp-input.js";
|
|
51
|
+
import { Pagination as ct } from "./components/pagination.js";
|
|
52
|
+
import { Popover as lt, PopoverContent as ut } from "./components/popover.js";
|
|
53
|
+
import { Progressbar as dt } from "./components/progressbar.js";
|
|
54
|
+
import { Radio as ft, RadioGroup as pt } from "./components/radio.js";
|
|
55
|
+
import { Rating as mt } from "./components/rating.js";
|
|
56
|
+
import { RichTextEditor as ht } from "./components/richtext.js";
|
|
57
|
+
import { ScrollArea as gt } from "./components/scroll-area.js";
|
|
58
|
+
import { t as _t } from "./select-CiMzLhUK.js";
|
|
59
|
+
import { Separator as vt } from "./components/separator.js";
|
|
60
|
+
import { Skeleton as yt, SkeletonAvatar as bt, SkeletonCard as xt, SkeletonList as St, SkeletonStat as Ct, SkeletonTable as wt, SkeletonText as Tt, SkeletonTopbar as Et } from "./components/skeleton.js";
|
|
61
|
+
import { Slider as Dt } from "./components/slider.js";
|
|
62
|
+
import { SnackbarProvider as Ot, useSnackbar as kt } from "./components/snackbar.js";
|
|
63
|
+
import { Spinner as At } from "./components/spinner.js";
|
|
64
|
+
import { Stat as jt } from "./components/stat.js";
|
|
65
|
+
import { StatusDot as Mt } from "./components/status-dot.js";
|
|
66
|
+
import { Stepper as Nt } from "./components/stepper.js";
|
|
67
|
+
import { Switch as Pt } from "./components/switch.js";
|
|
68
|
+
import { Table as Ft, TableBody as It, TableCell as Lt, TableHead as Rt, TableHeader as zt, TableRow as Bt } from "./components/table.js";
|
|
69
|
+
import { Tabs as Vt, TabsContent as Ht, TabsList as Ut, TabsTrigger as Wt } from "./components/tabs.js";
|
|
70
|
+
import { Tag as Gt } from "./components/tag.js";
|
|
71
|
+
import { n as Kt, t as qt } from "./terminal-VXdxVoAv.js";
|
|
72
|
+
import { Textarea as Jt } from "./components/textarea.js";
|
|
73
|
+
import { Timeline as Yt } from "./components/timeline.js";
|
|
74
|
+
import { Toggle as Xt, ToggleGroup as Zt, ToggleGroupItem as Qt, toggleSizes as $t, toggleVariants as en } from "./components/toggle.js";
|
|
75
|
+
import { Tooltip as tn } from "./components/tooltip.js";
|
|
76
|
+
import { ThemeProvider as nn, useTheme as rn } from "./components/theme-provider.js";
|
|
77
|
+
import { ThemeToggle as an } from "./components/theme-toggle.js";
|
|
78
|
+
import { TimePicker as on } from "./components/time-picker.js";
|
|
79
|
+
import { Tree as sn } from "./components/tree.js";
|
|
80
|
+
import { Heading as cn, Prose as ln, Text as un } from "./components/typography.js";
|
|
81
|
+
import { ArticleJsonLd as dn, BreadcrumbJsonLd as fn, SeoImage as pn, StructuredData as mn } from "./components/seo.js";
|
|
82
|
+
import { VisuallyHidden as hn } from "./components/visually-hidden.js";
|
|
83
|
+
import { Overlay as gn, OverlayBackdrop as _n } from "./components/overlay.js";
|
|
84
|
+
import { Component as vn, useCallback as Y, useEffect as X, useLayoutEffect as yn, useRef as Z, useState as Q } from "react";
|
|
85
|
+
import { jsx as $, jsxs as bn } from "react/jsx-runtime";
|
|
69
86
|
//#region src/hooks/use-is-mounted.ts
|
|
70
|
-
function
|
|
87
|
+
function xn() {
|
|
71
88
|
let e = Z(!1);
|
|
72
89
|
return X(() => (e.current = !0, () => {
|
|
73
90
|
e.current = !1;
|
|
@@ -75,10 +92,10 @@ function Ft() {
|
|
|
75
92
|
}
|
|
76
93
|
//#endregion
|
|
77
94
|
//#region src/hooks/use-isomorphic-layout-effect.ts
|
|
78
|
-
var
|
|
95
|
+
var Sn = typeof window < "u" ? yn : X;
|
|
79
96
|
//#endregion
|
|
80
97
|
//#region src/hooks/use-previous.ts
|
|
81
|
-
function
|
|
98
|
+
function Cn(e) {
|
|
82
99
|
let t = Z(void 0);
|
|
83
100
|
return X(() => {
|
|
84
101
|
t.current = e;
|
|
@@ -86,7 +103,7 @@ function Lt(e) {
|
|
|
86
103
|
}
|
|
87
104
|
//#endregion
|
|
88
105
|
//#region src/hooks/use-update-effect.ts
|
|
89
|
-
function
|
|
106
|
+
function wn(e, t) {
|
|
90
107
|
let n = Z(!1);
|
|
91
108
|
X(() => {
|
|
92
109
|
if (!n.current) {
|
|
@@ -98,7 +115,7 @@ function Rt(e, t) {
|
|
|
98
115
|
}
|
|
99
116
|
//#endregion
|
|
100
117
|
//#region src/hooks/use-controllable-state.ts
|
|
101
|
-
function
|
|
118
|
+
function Tn({ value: e, defaultValue: t, onChange: n }) {
|
|
102
119
|
let [r, i] = Q(t), a = e !== void 0;
|
|
103
120
|
return [a ? e : r, Y((e) => {
|
|
104
121
|
a || i(e), n?.(e);
|
|
@@ -106,7 +123,7 @@ function zt({ value: e, defaultValue: t, onChange: n }) {
|
|
|
106
123
|
}
|
|
107
124
|
//#endregion
|
|
108
125
|
//#region src/hooks/use-media-query.ts
|
|
109
|
-
function
|
|
126
|
+
function En(e) {
|
|
110
127
|
let [t, n] = Q(() => typeof window > "u" || window.matchMedia === void 0 ? !1 : window.matchMedia(e).matches);
|
|
111
128
|
return X(() => {
|
|
112
129
|
let t = window.matchMedia(e), r = () => n(t.matches);
|
|
@@ -117,7 +134,7 @@ function Bt(e) {
|
|
|
117
134
|
}
|
|
118
135
|
//#endregion
|
|
119
136
|
//#region src/hooks/use-abort-signal.ts
|
|
120
|
-
function
|
|
137
|
+
function Dn(e = []) {
|
|
121
138
|
let t = Z(null);
|
|
122
139
|
return t.current === null && (t.current = new AbortController()), X(() => {
|
|
123
140
|
let e = new AbortController();
|
|
@@ -125,20 +142,42 @@ function Vt(e = []) {
|
|
|
125
142
|
}, e), t.current.signal;
|
|
126
143
|
}
|
|
127
144
|
//#endregion
|
|
145
|
+
//#region src/hooks/use-outside-click.ts
|
|
146
|
+
function On(e, t, n, r = {}) {
|
|
147
|
+
let i = o(n);
|
|
148
|
+
X(() => {
|
|
149
|
+
if (!t) return;
|
|
150
|
+
function n(t) {
|
|
151
|
+
e.current?.contains(t.target) || i();
|
|
152
|
+
}
|
|
153
|
+
function a(e) {
|
|
154
|
+
r.escape !== !1 && e.key === "Escape" && (e.preventDefault(), i());
|
|
155
|
+
}
|
|
156
|
+
return document.addEventListener("mousedown", n), r.escape !== !1 && document.addEventListener("keydown", a), () => {
|
|
157
|
+
document.removeEventListener("mousedown", n), document.removeEventListener("keydown", a);
|
|
158
|
+
};
|
|
159
|
+
}, [
|
|
160
|
+
t,
|
|
161
|
+
e,
|
|
162
|
+
i,
|
|
163
|
+
r.escape
|
|
164
|
+
]);
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
128
167
|
//#region src/utils/portal.ts
|
|
129
|
-
function
|
|
168
|
+
function kn(e = "rui-portal") {
|
|
130
169
|
if (typeof document > "u") return null;
|
|
131
170
|
let t = document.getElementById(e);
|
|
132
171
|
return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
|
|
133
172
|
}
|
|
134
173
|
//#endregion
|
|
135
174
|
//#region src/utils/assert.ts
|
|
136
|
-
function
|
|
175
|
+
function An(e, t) {
|
|
137
176
|
if (!e) throw Error(t);
|
|
138
177
|
}
|
|
139
178
|
//#endregion
|
|
140
179
|
//#region src/errors/error-boundary.tsx
|
|
141
|
-
var
|
|
180
|
+
var jn = class extends vn {
|
|
142
181
|
state = {
|
|
143
182
|
hasError: !1,
|
|
144
183
|
error: null
|
|
@@ -160,23 +199,23 @@ var Wt = class extends Mt {
|
|
|
160
199
|
};
|
|
161
200
|
render() {
|
|
162
201
|
if (this.state.hasError) {
|
|
163
|
-
let { fallback:
|
|
164
|
-
return typeof
|
|
202
|
+
let { fallback: t } = this.props;
|
|
203
|
+
return typeof t == "function" ? t(this.state.error, this.reset) : t || /* @__PURE__ */ bn("div", {
|
|
165
204
|
role: "alert",
|
|
166
|
-
className: "rounded-lg border border-red-500/20 bg-red-500/[0.06] p-4 text-sm text-red-700 dark:text-red-300",
|
|
205
|
+
className: e("rounded-lg border border-red-500/20 bg-red-500/[0.06] p-4 text-sm text-red-700 dark:text-red-300", this.props.className),
|
|
167
206
|
children: [
|
|
168
207
|
/* @__PURE__ */ $("p", {
|
|
169
|
-
className: "font-medium",
|
|
208
|
+
className: e("font-medium", this.props.titleClassName),
|
|
170
209
|
children: "Something went wrong."
|
|
171
210
|
}),
|
|
172
211
|
/* @__PURE__ */ $("p", {
|
|
173
|
-
className: "mt-1 text-xs opacity-80",
|
|
212
|
+
className: e("mt-1 text-xs opacity-80", this.props.descriptionClassName),
|
|
174
213
|
children: this.state.error?.message
|
|
175
214
|
}),
|
|
176
215
|
/* @__PURE__ */ $("button", {
|
|
177
216
|
type: "button",
|
|
178
217
|
onClick: this.reset,
|
|
179
|
-
className: "mt-3 rounded-md bg-red-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-red-500",
|
|
218
|
+
className: e("mt-3 rounded-md bg-red-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-red-500", this.props.retryButtonClassName),
|
|
180
219
|
children: "Try again"
|
|
181
220
|
})
|
|
182
221
|
]
|
|
@@ -187,7 +226,7 @@ var Wt = class extends Mt {
|
|
|
187
226
|
};
|
|
188
227
|
//#endregion
|
|
189
228
|
//#region src/lifecycle/create-safe-effect.ts
|
|
190
|
-
function
|
|
229
|
+
function Mn(e, t) {
|
|
191
230
|
let n = Z(null);
|
|
192
231
|
X(() => {
|
|
193
232
|
let t = new AbortController();
|
|
@@ -203,13 +242,13 @@ function Gt(e, t) {
|
|
|
203
242
|
}
|
|
204
243
|
//#endregion
|
|
205
244
|
//#region src/lifecycle/mount.ts
|
|
206
|
-
function
|
|
245
|
+
function Nn(e) {
|
|
207
246
|
let t = o(e);
|
|
208
247
|
X(() => t(), [t]);
|
|
209
248
|
}
|
|
210
|
-
function
|
|
249
|
+
function Pn(e) {
|
|
211
250
|
let t = o(e);
|
|
212
251
|
X(() => () => t(), [t]);
|
|
213
252
|
}
|
|
214
253
|
//#endregion
|
|
215
|
-
export { t as Accordion,
|
|
254
|
+
export { t as Accordion, a as Alert, We as AppShell, Ge as AppShellBody, Ke as AppShellHeader, qe as AppShellMain, dn as ArticleJsonLd, r as AspectRatio, ee as AuthBackdrop, te as Autocomplete, ne as Avatar, re as AvatarGroup, ie as AvatarGroupOverflow, ae as Badge, M as BarChart, s as BillingIntervalToggle, c as Blockquote, $e as BottomBar, et as BrandLink, l as Breadcrumb, fn as BreadcrumbJsonLd, d as Button, m as ButtonGroup, i as Calendar, h as Callout, g as Card, _ as CardBody, v as CardDescription, y as CardFooter, b as CardHeader, x as CardTitle, N as Checkbox, P as CodeBlock, F as CodeEditor, n as Collapsible, W as CommandPalette, G as CommandProvider, he as ConfirmDialog, Je as Container, ge as CopyButton, _e as Currency, B as DURATIONS, ye as DataTable, be as DatePicker, xe as DescriptionDetails, Se as DescriptionItem, Ce as DescriptionList, we as DescriptionTerm, Te as Divider, A as DonutChart, Ee as Drawer, De as DropdownMenu, Oe as EmptyState, jn as ErrorBoundary, ke as ErrorState, R as FOCUSABLE_SELECTOR, je as Field, Me as FieldContent, Ne as FieldDescription, Pe as FieldError, Fe as FieldLabel, Ae as FileUpload, Ye as Footer, Ie as FormField, D as FunnelChart, C as GanttChart, cn as Heading, T as HeatmapChart, tt as IconButton, Re as InfoButton, Xe as Inline, I as InlineCode, Le as Input, L as KEY, ze as Kbd, Be as Label, E as LineChart, Ve as Link, He as List, Ue as ListItem, le as Modal, ue as ModalBody, de as ModalDescription, fe as ModalFooter, pe as ModalHeader, me as ModalTitle, w as MultiLineChart, nt as Navbar, rt as NavigationLink, ot as NumberInput, st as OtpInput, gn as Overlay, _n as OverlayBackdrop, Ze as PageHeader, ct as Pagination, lt as Popover, ut as PopoverContent, dt as Progressbar, ln as Prose, k as RadarChart, ft as Radio, pt as RadioGroup, mt as Rating, ht as RichTextEditor, O as ScatterChart, gt as ScrollArea, _t as Select, pn as SeoImage, vt as Separator, it as Sidebar, yt as Skeleton, bt as SkeletonAvatar, xt as SkeletonCard, St as SkeletonList, Ct as SkeletonStat, wt as SkeletonTable, Tt as SkeletonText, Et as SkeletonTopbar, Dt as Slider, u as Slot, Ot as SnackbarProvider, At as Spinner, Qe as Stack, jt as Stat, Mt as StatusDot, Nt as Stepper, mn as StructuredData, Pt as Switch, Ft as Table, It as TableBody, Lt as TableCell, Rt as TableHead, zt as TableHeader, Bt as TableRow, Vt as Tabs, Ht as TabsContent, Ut as TabsList, Wt as TabsTrigger, Gt as Tag, Kt as TerminalBlock, qt as TerminalEmulator, un as Text, Jt as Textarea, nn as ThemeProvider, an as ThemeToggle, on as TimePicker, Yt as Timeline, Xt as Toggle, Zt as ToggleGroup, Qt as ToggleGroupItem, tn as Tooltip, at as Topbar, J as TopbarTitle, sn as Tree, hn as VisuallyHidden, j as WaterfallChart, oe as badgeVariants, f as buttonSizes, p as buttonVariants, S as cardVariants, e as cn, ve as formatCurrency, V as getFocusable, An as invariant, U as motionTokens, kn as portalTarget, $t as toggleSizes, en as toggleVariants, H as transitions, z as trapFocus, Dn as useAbortSignal, K as useCommand, Tn as useControllableState, o as useEventCallback, ce as useFocusTrap, xn as useIsMounted, Sn as useIsomorphicLayoutEffect, En as useMediaQuery, Nn as useMountEffect, On as useOutsideClick, Cn as usePrevious, q as useRestoreFocus, Mn as useSafeEffect, se as useScrollLock, kt as useSnackbar, rn as useTheme, Pn as useUnmountEffect, wn as useUpdateEffect };
|
package/dist/lib/cn.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Accepted by {@link cn} — strings, numbers, nested arrays, or
|
|
3
|
+
* `{ "class": boolean }` maps. Mirrors clsx's `ClassValue`.
|
|
4
|
+
*/
|
|
5
|
+
export type ClassValue = string | number | bigint | null | boolean | undefined | ClassValue[] | {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Join conditional class values and resolve conflicting Tailwind utilities so a
|
|
10
|
+
* caller's `className` reliably wins over a component's defaults
|
|
11
|
+
* (`cn("px-2", "px-4")` → `"px-4"`). `tailwind-merge` is bundled into the
|
|
12
|
+
* published package — @bzync/rui ships with no runtime dependencies.
|
|
13
|
+
*/
|
|
2
14
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -4,7 +4,19 @@ export declare const fieldRootStyles = "flex w-full flex-col gap-1.5";
|
|
|
4
4
|
export declare const fieldLabelStyles = "text-xs font-semibold leading-5 text-foreground";
|
|
5
5
|
export declare const fieldDescriptionStyles = "text-xs leading-5 text-muted-foreground";
|
|
6
6
|
export declare const fieldErrorStyles = "text-xs leading-5 text-destructive";
|
|
7
|
+
/** Text inputs / selects / textareas: the ring hugs the border (no offset gap)
|
|
8
|
+
* and the border itself turns cobalt — that colored edge is this system's
|
|
9
|
+
* "inset line", the field-shaped counterpart to the focus halo on buttons. */
|
|
7
10
|
export declare const controlBaseStyles: string;
|
|
8
|
-
export declare const controlInvalidStyles = "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/
|
|
9
|
-
|
|
11
|
+
export declare const controlInvalidStyles = "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25";
|
|
12
|
+
/** The library's signature focus treatment. Routes through the `.focus-ring`
|
|
13
|
+
* utility in globals.css (1px inset hairline + 3px cobalt halo with a 2px gap),
|
|
14
|
+
* so every button, tab, menu item, link, and toggle that opts in shares one
|
|
15
|
+
* byte-identical focus state. Requires the element to sit inside a
|
|
16
|
+
* `ThemeProvider` (`.rui-theme`) scope — always true for library consumers. */
|
|
17
|
+
export declare const focusRingStyles = "focus-ring";
|
|
18
|
+
/** For controls whose focusable element is a sibling (checkbox/radio/switch
|
|
19
|
+
* inputs visually hidden behind a styled proxy). Mirrors the halo geometry with
|
|
20
|
+
* peer-* utilities since the box-shadow utility can't reach across elements. */
|
|
21
|
+
export declare const peerFocusRingStyles = "peer-focus-visible:ring-[3px] peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg";
|
|
10
22
|
export declare const iconButtonStyles: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The three glyphs the library itself renders (Drawer close, ThemeToggle
|
|
4
|
+
* sun/moon). Inlined so `lucide-react` is not a runtime dependency — consumers
|
|
5
|
+
* still pass their own icons everywhere else. Paths are lucide's (ISC).
|
|
6
|
+
*/
|
|
7
|
+
export type IconProps = Omit<SVGProps<SVGSVGElement>, "size"> & {
|
|
8
|
+
size?: number | string;
|
|
9
|
+
};
|
|
10
|
+
export declare function CloseIcon(props: IconProps): import("react").JSX.Element;
|
|
11
|
+
export declare function SunIcon(props: IconProps): import("react").JSX.Element;
|
|
12
|
+
export declare function MoonIcon(props: IconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion tokens — single source for framer-motion transitions.
|
|
3
|
+
* Maps CSS variables to JS durations/easings so code and stylesheet agree.
|
|
4
|
+
*/
|
|
5
|
+
export declare const motionTokens: {
|
|
6
|
+
readonly duration: {
|
|
7
|
+
readonly instant: 0;
|
|
8
|
+
readonly fast: 0.12;
|
|
9
|
+
readonly normal: 0.2;
|
|
10
|
+
readonly slow: 0.32;
|
|
11
|
+
};
|
|
12
|
+
readonly ease: {
|
|
13
|
+
readonly standard: readonly [0.2, 0, 0, 1];
|
|
14
|
+
readonly enter: readonly [0.16, 1, 0.3, 1];
|
|
15
|
+
readonly exit: readonly [0.4, 0, 1, 1];
|
|
16
|
+
};
|
|
17
|
+
readonly spring: {
|
|
18
|
+
readonly snappy: {
|
|
19
|
+
readonly type: "spring";
|
|
20
|
+
readonly stiffness: 450;
|
|
21
|
+
readonly damping: 32;
|
|
22
|
+
};
|
|
23
|
+
readonly gentle: {
|
|
24
|
+
readonly type: "spring";
|
|
25
|
+
readonly stiffness: 600;
|
|
26
|
+
readonly damping: 35;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** Common transitions */
|
|
31
|
+
export declare const transitions: {
|
|
32
|
+
readonly overlay: {
|
|
33
|
+
readonly duration: 0.2;
|
|
34
|
+
readonly ease: readonly [0.2, 0, 0, 1];
|
|
35
|
+
};
|
|
36
|
+
readonly panelEnter: {
|
|
37
|
+
readonly duration: 0.22;
|
|
38
|
+
readonly ease: readonly [0.16, 1, 0.3, 1];
|
|
39
|
+
};
|
|
40
|
+
readonly panelExit: {
|
|
41
|
+
readonly duration: 0.2;
|
|
42
|
+
readonly ease: readonly [0.4, 0, 1, 1];
|
|
43
|
+
};
|
|
44
|
+
readonly fade: {
|
|
45
|
+
readonly duration: 0.12;
|
|
46
|
+
readonly ease: readonly [0.2, 0, 0, 1];
|
|
47
|
+
};
|
|
48
|
+
readonly tabIndicator: {
|
|
49
|
+
readonly type: "spring";
|
|
50
|
+
readonly stiffness: 450;
|
|
51
|
+
readonly damping: 32;
|
|
52
|
+
};
|
|
53
|
+
readonly switchThumb: {
|
|
54
|
+
readonly type: "spring";
|
|
55
|
+
readonly stiffness: 600;
|
|
56
|
+
readonly damping: 35;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={duration:{instant:0,fast:.12,normal:.2,slow:.32},ease:{standard:[.2,0,0,1],enter:[.16,1,.3,1],exit:[.4,0,1,1]},spring:{snappy:{type:`spring`,stiffness:450,damping:32},gentle:{type:`spring`,stiffness:600,damping:35}}},t={overlay:{duration:e.duration.normal,ease:e.ease.standard},panelEnter:{duration:.22,ease:e.ease.enter},panelExit:{duration:.2,ease:e.ease.exit},fade:{duration:e.duration.fast,ease:e.ease.standard},tabIndicator:e.spring.snappy,switchThumb:e.spring.gentle};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region src/lib/motion.ts
|
|
2
|
+
var e = {
|
|
3
|
+
duration: {
|
|
4
|
+
instant: 0,
|
|
5
|
+
fast: .12,
|
|
6
|
+
normal: .2,
|
|
7
|
+
slow: .32
|
|
8
|
+
},
|
|
9
|
+
ease: {
|
|
10
|
+
standard: [
|
|
11
|
+
.2,
|
|
12
|
+
0,
|
|
13
|
+
0,
|
|
14
|
+
1
|
|
15
|
+
],
|
|
16
|
+
enter: [
|
|
17
|
+
.16,
|
|
18
|
+
1,
|
|
19
|
+
.3,
|
|
20
|
+
1
|
|
21
|
+
],
|
|
22
|
+
exit: [
|
|
23
|
+
.4,
|
|
24
|
+
0,
|
|
25
|
+
1,
|
|
26
|
+
1
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
spring: {
|
|
30
|
+
snappy: {
|
|
31
|
+
type: "spring",
|
|
32
|
+
stiffness: 450,
|
|
33
|
+
damping: 32
|
|
34
|
+
},
|
|
35
|
+
gentle: {
|
|
36
|
+
type: "spring",
|
|
37
|
+
stiffness: 600,
|
|
38
|
+
damping: 35
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, t = {
|
|
42
|
+
overlay: {
|
|
43
|
+
duration: e.duration.normal,
|
|
44
|
+
ease: e.ease.standard
|
|
45
|
+
},
|
|
46
|
+
panelEnter: {
|
|
47
|
+
duration: .22,
|
|
48
|
+
ease: e.ease.enter
|
|
49
|
+
},
|
|
50
|
+
panelExit: {
|
|
51
|
+
duration: .2,
|
|
52
|
+
ease: e.ease.exit
|
|
53
|
+
},
|
|
54
|
+
fade: {
|
|
55
|
+
duration: e.duration.fast,
|
|
56
|
+
ease: e.ease.standard
|
|
57
|
+
},
|
|
58
|
+
tabIndicator: e.spring.snappy,
|
|
59
|
+
switchThumb: e.spring.gentle
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { t as n, e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./cn-B6R3HKzx.cjs"),t=require("./component-styles-DY4wigiq.cjs"),n=require("./utils-MnnCTelh.cjs"),r=require("./use-event-callback-Du9_9eAi.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");function c({listId:t,listRef:r,open:a,pos:c,options:u,flat:d,activeIdx:f,setActiveIdx:p,isSelected:m,onSelect:h,colorDot:g,multiselectable:_=!1,className:v,optionClassName:y,groupLabelClassName:b}){return typeof document>`u`?null:(0,s.createPortal)((0,o.jsx)(i.AnimatePresence,{children:a&&c&&(0,o.jsx)(i.motion.ul,{ref:r,id:t,role:`listbox`,"aria-multiselectable":_,initial:{opacity:0,y:c.placement===`bottom`?-4:4,scaleY:.97},animate:{opacity:1,y:0,scaleY:1},exit:{opacity:0,y:c.placement===`bottom`?-4:4,scaleY:.97},transition:{duration:.13},style:{originY:c.placement===`bottom`?0:1,position:`fixed`,top:c.top,left:c.left,width:c.width,maxHeight:c.maxHeight},className:e.t(`z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating`,v),children:u.map((r,i)=>n.a(r)?(0,o.jsxs)(`li`,{children:[(0,o.jsx)(`p`,{className:e.t(`px-3 pt-2 pb-1 text-xs font-semibold text-slate-600 uppercase tracking-widest`,b),children:r.group}),(0,o.jsx)(`ul`,{children:r.options.map(e=>{let n=d.find(t=>t.value===e.value);return(0,o.jsx)(l,{opt:e,listId:t,flatIdx:n.flatIdx,isActive:n.flatIdx===f,isSelected:m(e.value),onSelect:h,onHover:p,colorDot:g,className:y},e.value)})})]},i):(0,o.jsx)(l,{opt:r,listId:t,flatIdx:d.find(e=>e.value===r.value).flatIdx,isActive:d.find(e=>e.value===r.value).flatIdx===f,isSelected:m(r.value),onSelect:h,onHover:p,colorDot:g,className:y},r.value))})}),document.body)}function l({opt:t,listId:n,flatIdx:r,isActive:i,isSelected:a,onSelect:s,onHover:c,colorDot:l,className:u}){return(0,o.jsxs)(`li`,{id:`${n}-opt-${r}`,role:`option`,"aria-selected":a,"aria-disabled":t.disabled,"data-idx":r,onMouseDown:e=>e.preventDefault(),onClick:()=>!t.disabled&&s(t),onMouseEnter:()=>!t.disabled&&c(r),className:e.t(`flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors select-none`,i&&`bg-surface-muted`,a&&!i&&`bg-accent-50 dark:bg-accent-500/10`,t.disabled&&`opacity-40 cursor-not-allowed pointer-events-none`,u),children:[t.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:t.icon}),t.color&&t.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-2 h-2 rounded-full shrink-0`,l[t.color])}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`p`,{className:e.t(`text-sm leading-snug truncate`,a?`text-accent-700 dark:text-accent-300 font-medium`:`text-foreground`),children:t.label}),t.description&&(0,o.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:t.description})]}),a&&(0,o.jsx)(`svg`,{"aria-hidden":`true`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-accent-600 shrink-0`,children:(0,o.jsx)(`path`,{d:`m20 6-11 11-5-5`})})]})}var u=(0,a.forwardRef)(({options:i,value:s,defaultValue:l,onChange:u,placeholder:d=`Select…`,label:f,hint:p,error:m,disabled:h,required:g,clearable:_=!1,className:v,wrapperClassName:y,triggerClassName:b,listClassName:x,labelClassName:S,messageClassName:C,optionClassName:w,groupLabelClassName:T,id:E,unstyled:D=!1},O)=>{let k=(0,a.useId)(),A=E??k,j=`${A}-list`,M=`${A}-message`,[N,P]=(0,a.useState)(!1),[F,I]=(0,a.useState)(l??``),[L,R]=(0,a.useState)(-1),z=(0,a.useRef)(null),B=(0,a.useRef)(null),V=r.t(e=>u?.(e)),H=s===void 0?F:s,U=(0,a.useMemo)(()=>n.i(i),[i]),W=(0,a.useMemo)(()=>U.find(e=>e.value===H),[U,H]),G=(0,a.useCallback)(e=>{s===void 0&&I(e.value),V(e.value),P(!1),R(-1)},[s,V]),K=(0,a.useCallback)(e=>{e.stopPropagation(),s===void 0&&I(``),V(``)},[s,V]),q=(0,a.useCallback)(e=>{if(!N){if([`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(e.key)){e.preventDefault(),P(!0);let t=U.find(e=>e.value===H&&e.flatIdx>=0)?.flatIdx??-1,n=U.filter(e=>e.flatIdx>=0);R(t>=0?t:e.key===`ArrowUp`?n[n.length-1]?.flatIdx??-1:n[0]?.flatIdx??-1)}return}if(e.key===`ArrowDown`)e.preventDefault(),R(e=>{let t=U.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.min(n+1,t.length-1)]?.flatIdx??e});else if(e.key===`ArrowUp`)e.preventDefault(),R(e=>{let t=U.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.max(n-1,0)]?.flatIdx??e});else if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=U.find(e=>e.flatIdx===L);t&&G(t)}else(e.key===`Escape`||e.key===`Tab`)&&(P(!1),R(-1))},[N,U,H,L,G]);(0,a.useEffect)(()=>{L<0||!B.current||B.current.querySelector(`[data-idx="${L}"]`)?.scrollIntoView({block:`nearest`})},[L]),(0,a.useEffect)(()=>{function e(e){let t=e.target;z.current?.contains(t)||B.current?.contains(t)||P(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let J=n.o(N,z);return D?(0,o.jsxs)(`div`,{ref:z,className:e.t(v,y),children:[(0,o.jsx)(`button`,{ref:O,id:A,type:`button`,role:`combobox`,"aria-expanded":N,onClick:()=>P(e=>!e),className:b,children:W?.label??d}),N&&(0,o.jsx)(`ul`,{ref:B,id:j,className:x,children:U.map(e=>(0,o.jsx)(`li`,{"data-idx":e.flatIdx,onClick:()=>G(e),children:e.label},e.value))})]}):(0,o.jsxs)(`div`,{ref:z,className:e.t(`relative`,t.o,y,v),children:[f&&(0,o.jsxs)(`label`,{htmlFor:A,className:e.t(`text-xs font-semibold leading-5 text-foreground`,S),children:[f,g&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,o.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,o.jsxs)(`button`,{ref:O,id:A,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":N,"aria-controls":j,"aria-activedescendant":N&&L>=0?`${j}-opt-${L}`:void 0,"aria-invalid":m?!0:void 0,"aria-required":g||void 0,"aria-describedby":m||p?M:void 0,disabled:h,onKeyDown:q,onClick:()=>{h||(P(e=>!e),N||R(U.find(e=>e.value===H&&e.flatIdx>=0)?.flatIdx??-1))},className:e.t(`flex h-9 w-full items-center gap-2 rounded-[var(--radius-md)] px-3 text-left outline-none`,t.t,`focus:border-accent-500 focus:ring-[3px] focus:ring-focus-ring/25`,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,h&&`opacity-50 cursor-not-allowed`,b),children:[W?.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:W.icon}),W?.color&&W.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-2 h-2 rounded-full shrink-0`,n.r[W.color])}),(0,o.jsx)(`span`,{className:e.t(`flex-1 min-w-0 text-sm truncate`,W?`text-foreground`:`text-muted-foreground`),children:W?.label??d}),_&&H&&!h&&(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:K,className:`shrink-0 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,children:(0,o.jsx)(n.n,{})}),(0,o.jsx)(n.t,{open:N})]}),(0,o.jsx)(c,{listId:j,listRef:B,open:N,pos:J,options:i,flat:U,activeIdx:L,setActiveIdx:R,isSelected:e=>e===H,onSelect:G,colorDot:n.r,className:x,optionClassName:w,groupLabelClassName:T}),m&&(0,o.jsx)(`p`,{id:M,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,C),children:m}),p&&!m&&(0,o.jsx)(`p`,{id:M,className:e.t(`text-xs leading-5 text-muted-foreground`,C),children:p})]})});u.displayName=`SelectSingle`;var d=(0,a.forwardRef)(({options:r,value:i,defaultValue:s,onChange:l,placeholder:u=`Select…`,label:d,hint:f,error:p,disabled:m,required:h,clearable:g=!1,className:_,wrapperClassName:v,triggerClassName:y,listClassName:b,labelClassName:x,messageClassName:S,optionClassName:C,groupLabelClassName:w,id:T,unstyled:E=!1},D)=>{let O=(0,a.useId)(),k=T??O,A=`${k}-list`,j=`${k}-message`,[M,N]=(0,a.useState)(!1),[P,F]=(0,a.useState)(s??[]),[I,L]=(0,a.useState)(-1),R=(0,a.useRef)(null),z=(0,a.useRef)(null),B=i===void 0?P:i,V=n.i(r),H=V.filter(e=>B.includes(e.value));function U(e){let t=B.includes(e.value)?B.filter(t=>t!==e.value):[...B,e.value];i===void 0&&F(t),l?.(t)}function W(e,t){t.stopPropagation();let n=B.filter(t=>t!==e);i===void 0&&F(n),l?.(n)}function G(e){e.stopPropagation(),i===void 0&&F([]),l?.([])}function K(e){if(!M){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(e.key)&&(e.preventDefault(),N(!0));return}if(e.key===`ArrowDown`)e.preventDefault(),L(e=>{let t=V.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.min(n+1,t.length-1)]?.flatIdx??e});else if(e.key===`ArrowUp`)e.preventDefault(),L(e=>{let t=V.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.max(n-1,0)]?.flatIdx??e});else if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=V.find(e=>e.flatIdx===I);t&&U(t)}else(e.key===`Escape`||e.key===`Tab`)&&(N(!1),L(-1))}(0,a.useEffect)(()=>{I<0||!z.current||z.current.querySelector(`[data-idx="${I}"]`)?.scrollIntoView({block:`nearest`})},[I]),(0,a.useEffect)(()=>{function e(e){let t=e.target;R.current?.contains(t)||z.current?.contains(t)||N(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let q=n.o(M,R);return E?(0,o.jsxs)(`div`,{ref:R,className:e.t(_,v),children:[(0,o.jsx)(`button`,{ref:D,id:k,type:`button`,role:`combobox`,"aria-expanded":M,"aria-controls":A,onKeyDown:K,onClick:()=>N(e=>!e),className:y,children:H.length>0?H.map(e=>e.label).join(`, `):u}),(0,o.jsx)(c,{listId:A,listRef:z,open:M,pos:q,options:r,flat:V,activeIdx:I,setActiveIdx:L,isSelected:e=>B.includes(e),onSelect:U,multiselectable:!0,colorDot:n.r,className:b})]}):(0,o.jsxs)(`div`,{ref:R,className:e.t(`relative`,t.o,v,_),children:[d&&(0,o.jsxs)(`label`,{htmlFor:k,className:e.t(`text-xs font-semibold leading-5 text-foreground`,x),children:[d,h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,o.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,o.jsxs)(`button`,{ref:D,id:k,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":M,"aria-controls":A,"aria-activedescendant":M&&I>=0?`${A}-opt-${I}`:void 0,"aria-invalid":p?!0:void 0,"aria-required":h||void 0,"aria-describedby":p||f?j:void 0,disabled:m,onKeyDown:K,onClick:()=>{m||N(e=>!e)},className:e.t(`flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 text-left outline-none`,t.t,`focus:border-accent-500 focus:ring-[3px] focus:ring-focus-ring/25`,p&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,m&&`opacity-50 cursor-not-allowed`,y),children:[H.length===0?(0,o.jsx)(`span`,{className:`flex-1 text-sm text-slate-500 truncate`,children:u}):H.map(t=>(0,o.jsxs)(`span`,{className:`inline-flex max-w-[160px] items-center gap-1 rounded-md border border-border bg-surface-muted px-2 py-0.5 text-xs font-medium text-foreground`,children:[t.color&&t.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-1.5 h-1.5 rounded-full shrink-0`,n.r[t.color])}),(0,o.jsx)(`span`,{className:`truncate`,children:t.label}),(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onMouseDown:e=>e.stopPropagation(),onClick:e=>W(t.value,e),className:`shrink-0 text-slate-500 dark:text-slate-400 hover:text-foreground transition-colors cursor-pointer ml-0.5`,"aria-label":`Remove ${t.label}`,children:(0,o.jsx)(n.n,{})})]},t.value)),(0,o.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 shrink-0 pl-1`,children:[g&&B.length>0&&!m&&(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:G,className:`text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,"aria-label":`Clear all`,children:(0,o.jsx)(n.n,{})}),B.length>0&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-slate-500 tabular-nums`,children:B.length}),(0,o.jsx)(n.t,{open:M})]})]}),(0,o.jsx)(c,{listId:A,listRef:z,open:M,pos:q,options:r,flat:V,activeIdx:I,setActiveIdx:L,isSelected:e=>B.includes(e),onSelect:U,multiselectable:!0,colorDot:n.r,className:b,optionClassName:C,groupLabelClassName:w}),p&&(0,o.jsx)(`p`,{id:j,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,S),children:p}),f&&!p&&(0,o.jsx)(`p`,{id:j,className:e.t(`text-xs leading-5 text-muted-foreground`,S),children:f})]})});d.displayName=`SelectMulti`;var f=(0,a.forwardRef)((e,t)=>e.multiple?(0,o.jsx)(d,{...e,ref:t}):(0,o.jsx)(u,{...e,ref:t}));f.displayName=`Select`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|