@rockshin/tao-ui 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/breadcrumb/breadcrumb.css +1088 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +268 -0
- package/dist/components/button/button.css +43 -21
- package/dist/components/checkbox/checkbox.css +30 -12
- package/dist/components/collapsible/collapsible.css +1023 -0
- package/dist/components/collapsible/collapsible.d.ts +39 -0
- package/dist/components/collapsible/collapsible.js +168 -0
- package/dist/components/context-menu/context-menu.css +1146 -0
- package/dist/components/context-menu/context-menu.d.ts +19 -0
- package/dist/components/context-menu/context-menu.js +104 -0
- package/dist/components/date-picker/date-picker.css +44 -16
- package/dist/components/drawer/drawer.css +123 -13
- package/dist/components/drawer/drawer.d.ts +36 -3
- package/dist/components/drawer/drawer.js +314 -121
- package/dist/components/dropdown/dropdown.css +996 -0
- package/dist/components/dropdown/dropdown.d.ts +45 -0
- package/dist/components/dropdown/dropdown.js +381 -0
- package/dist/components/form-field/form.css +30 -12
- package/dist/components/input/input.css +44 -14
- package/dist/components/menu/menu-render.d.ts +89 -0
- package/dist/components/menu/menu-render.js +376 -0
- package/dist/components/menu/menu.css +1142 -0
- package/dist/components/modal/confirm-dialog.d.ts +37 -0
- package/dist/components/modal/confirm-dialog.js +193 -0
- package/dist/components/modal/confirm.d.ts +13 -0
- package/dist/components/modal/confirm.js +56 -0
- package/dist/components/modal/index.d.ts +21 -0
- package/dist/components/modal/index.js +18 -0
- package/dist/components/modal/modal.css +1166 -0
- package/dist/components/modal/modal.d.ts +50 -0
- package/dist/components/modal/modal.js +353 -0
- package/dist/components/modal/use-modal.d.ts +21 -0
- package/dist/components/modal/use-modal.js +83 -0
- package/dist/components/pagination/pagination.css +30 -12
- package/dist/components/radio/radio.css +30 -12
- package/dist/components/scroll-area/scroll-area.css +30 -12
- package/dist/components/select/mobile-select.css +65 -13
- package/dist/components/select/mobile-select.js +17 -3
- package/dist/components/select/select.css +102 -15
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/select.js +204 -168
- package/dist/components/splitter/splitter.css +30 -12
- package/dist/components/switch/switch.css +30 -12
- package/dist/components/table/table.css +54 -18
- package/dist/components/table/table.d.ts +17 -2
- package/dist/components/table/table.js +214 -206
- package/dist/components/tabs/tabs.css +33 -17
- package/dist/components/tag/tag.css +30 -12
- package/dist/components/textarea/textarea.css +1204 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +181 -0
- package/dist/index.d.ts +24 -18
- package/dist/index.js +21 -15
- package/dist/layouts/stack/layout.css +30 -12
- package/dist/theme/control.css +44 -13
- package/dist/theme/theme.css +30 -12
- package/llms.txt +7 -6
- package/package.json +6 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
|
+
import { type MenuProps, type MenuSemanticPart } from '../menu/menu-render';
|
|
4
|
+
import './context-menu.css';
|
|
5
|
+
export type ContextMenuSemanticPart = MenuSemanticPart;
|
|
6
|
+
export interface ContextMenuProps {
|
|
7
|
+
menu: MenuProps;
|
|
8
|
+
/** Element whose right-click (long-press on touch) opens the menu. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Merged onto the floating content. */
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
classNames?: SemanticClassNames<ContextMenuSemanticPart>;
|
|
17
|
+
styles?: SemanticStyles<ContextMenuSemanticPart>;
|
|
18
|
+
}
|
|
19
|
+
export declare function ContextMenu({ menu, children, open, onOpenChange, disabled, className, style, classNames, styles, }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
|
+
import { cx } from "../../utils/semantic.js";
|
|
5
|
+
import { useMenuController } from "../menu/menu-render.js";
|
|
6
|
+
import "./context-menu.css";
|
|
7
|
+
import * as __rspack_external__radix_ui_react_context_menu_293d36e3 from "@radix-ui/react-context-menu";
|
|
8
|
+
const CM = {
|
|
9
|
+
Item: __rspack_external__radix_ui_react_context_menu_293d36e3.Item,
|
|
10
|
+
CheckboxItem: __rspack_external__radix_ui_react_context_menu_293d36e3.CheckboxItem,
|
|
11
|
+
RadioGroup: __rspack_external__radix_ui_react_context_menu_293d36e3.RadioGroup,
|
|
12
|
+
RadioItem: __rspack_external__radix_ui_react_context_menu_293d36e3.RadioItem,
|
|
13
|
+
Label: __rspack_external__radix_ui_react_context_menu_293d36e3.Label,
|
|
14
|
+
Separator: __rspack_external__radix_ui_react_context_menu_293d36e3.Separator,
|
|
15
|
+
Group: __rspack_external__radix_ui_react_context_menu_293d36e3.Group,
|
|
16
|
+
Sub: __rspack_external__radix_ui_react_context_menu_293d36e3.Sub,
|
|
17
|
+
SubTrigger: __rspack_external__radix_ui_react_context_menu_293d36e3.SubTrigger,
|
|
18
|
+
SubContent: __rspack_external__radix_ui_react_context_menu_293d36e3.SubContent,
|
|
19
|
+
Portal: __rspack_external__radix_ui_react_context_menu_293d36e3.Portal,
|
|
20
|
+
ItemIndicator: __rspack_external__radix_ui_react_context_menu_293d36e3.ItemIndicator
|
|
21
|
+
};
|
|
22
|
+
function ContextMenu(t0) {
|
|
23
|
+
const $ = c(22);
|
|
24
|
+
const { menu, children, open, onOpenChange, disabled, className, style, classNames, styles } = t0;
|
|
25
|
+
const { size, disabled: ctxDisabled } = useTaoConfig();
|
|
26
|
+
const resolvedDisabled = disabled ?? ctxDisabled;
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[0] !== classNames || $[1] !== styles) {
|
|
29
|
+
t1 = {
|
|
30
|
+
classNames,
|
|
31
|
+
styles
|
|
32
|
+
};
|
|
33
|
+
$[0] = classNames;
|
|
34
|
+
$[1] = styles;
|
|
35
|
+
$[2] = t1;
|
|
36
|
+
} else t1 = $[2];
|
|
37
|
+
const content = useMenuController(menu, CM, t1);
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[3] !== children || $[4] !== resolvedDisabled) {
|
|
40
|
+
t2 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_293d36e3.Trigger, {
|
|
41
|
+
disabled: resolvedDisabled,
|
|
42
|
+
"data-tao-context-menu-trigger": "",
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
$[3] = children;
|
|
46
|
+
$[4] = resolvedDisabled;
|
|
47
|
+
$[5] = t2;
|
|
48
|
+
} else t2 = $[5];
|
|
49
|
+
const t3 = classNames?.content;
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[6] !== className || $[7] !== t3) {
|
|
52
|
+
t4 = cx(t3, className);
|
|
53
|
+
$[6] = className;
|
|
54
|
+
$[7] = t3;
|
|
55
|
+
$[8] = t4;
|
|
56
|
+
} else t4 = $[8];
|
|
57
|
+
const t5 = styles?.content;
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[9] !== style || $[10] !== t5) {
|
|
60
|
+
t6 = {
|
|
61
|
+
...t5,
|
|
62
|
+
...style
|
|
63
|
+
};
|
|
64
|
+
$[9] = style;
|
|
65
|
+
$[10] = t5;
|
|
66
|
+
$[11] = t6;
|
|
67
|
+
} else t6 = $[11];
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[12] !== content || $[13] !== size || $[14] !== t4 || $[15] !== t6) {
|
|
70
|
+
t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_293d36e3.Portal, {
|
|
71
|
+
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_293d36e3.Content, {
|
|
72
|
+
"data-tao-menu-content": "",
|
|
73
|
+
"data-tao-context-menu": "",
|
|
74
|
+
"data-tao-size": size,
|
|
75
|
+
className: t4,
|
|
76
|
+
style: t6,
|
|
77
|
+
children: content
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
$[12] = content;
|
|
81
|
+
$[13] = size;
|
|
82
|
+
$[14] = t4;
|
|
83
|
+
$[15] = t6;
|
|
84
|
+
$[16] = t7;
|
|
85
|
+
} else t7 = $[16];
|
|
86
|
+
let t8;
|
|
87
|
+
if ($[17] !== onOpenChange || $[18] !== open || $[19] !== t2 || $[20] !== t7) {
|
|
88
|
+
t8 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_context_menu_293d36e3.Root, {
|
|
89
|
+
open: open,
|
|
90
|
+
onOpenChange: onOpenChange,
|
|
91
|
+
children: [
|
|
92
|
+
t2,
|
|
93
|
+
t7
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
$[17] = onOpenChange;
|
|
97
|
+
$[18] = open;
|
|
98
|
+
$[19] = t2;
|
|
99
|
+
$[20] = t7;
|
|
100
|
+
$[21] = t8;
|
|
101
|
+
} else t8 = $[21];
|
|
102
|
+
return t8;
|
|
103
|
+
}
|
|
104
|
+
export { ContextMenu };
|
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
--tao-color-fill-quaternary: color-mix(in oklch, var(--tao-color-text-base) 3%, var(--tao-color-bg-base));
|
|
88
88
|
--tao-color-bg-layout: color-mix(in oklch, var(--tao-color-text-base) 4%, var(--tao-color-bg-base));
|
|
89
89
|
--tao-color-border: color-mix(in oklch, var(--tao-color-text-base) 18%, var(--tao-color-bg-base));
|
|
90
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
91
90
|
--tao-control-outline: color-mix(in oklch, var(--tao-color-primary) 10%, transparent);
|
|
92
91
|
--tao-color-error-outline: color-mix(in oklch, var(--tao-color-error) 10%, transparent);
|
|
93
92
|
--tao-color-warning-outline: color-mix(in oklch, var(--tao-color-warning) 10%, transparent);
|
|
@@ -350,6 +349,8 @@
|
|
|
350
349
|
--tao-radius: 6px;
|
|
351
350
|
--tao-font-size: 14px;
|
|
352
351
|
--tao-control-height: 36px;
|
|
352
|
+
--tao-control-width: 200px;
|
|
353
|
+
--tao-control-range-width: 360px;
|
|
353
354
|
--tao-size-unit: 4px;
|
|
354
355
|
--tao-line-width: 1px;
|
|
355
356
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
@@ -572,8 +573,8 @@
|
|
|
572
573
|
}
|
|
573
574
|
|
|
574
575
|
:root, [data-tao-provider] {
|
|
575
|
-
--tao-color-bg-container:
|
|
576
|
-
--tao-color-bg-elevated:
|
|
576
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
577
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
577
578
|
--tao-color-border: var(--tao-color-text-base);
|
|
578
579
|
}
|
|
579
580
|
|
|
@@ -584,16 +585,7 @@
|
|
|
584
585
|
}
|
|
585
586
|
|
|
586
587
|
:root, [data-tao-provider] {
|
|
587
|
-
--tao-color-border-secondary:
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
591
|
-
:root, [data-tao-provider] {
|
|
592
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
:root, [data-tao-provider] {
|
|
588
|
+
--tao-color-border-secondary: #0000170b;
|
|
597
589
|
--tao-radius-xs: 2px;
|
|
598
590
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
599
591
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -676,6 +668,10 @@
|
|
|
676
668
|
visibility: collapse;
|
|
677
669
|
}
|
|
678
670
|
|
|
671
|
+
.visible {
|
|
672
|
+
visibility: visible;
|
|
673
|
+
}
|
|
674
|
+
|
|
679
675
|
.absolute {
|
|
680
676
|
position: absolute;
|
|
681
677
|
}
|
|
@@ -758,6 +754,10 @@
|
|
|
758
754
|
display: inline;
|
|
759
755
|
}
|
|
760
756
|
|
|
757
|
+
.inline-flex {
|
|
758
|
+
display: inline-flex;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
761
|
.table {
|
|
762
762
|
display: table;
|
|
763
763
|
}
|
|
@@ -770,6 +770,10 @@
|
|
|
770
770
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
+
.resize {
|
|
774
|
+
resize: both;
|
|
775
|
+
}
|
|
776
|
+
|
|
773
777
|
.flex-wrap {
|
|
774
778
|
flex-wrap: wrap;
|
|
775
779
|
}
|
|
@@ -785,6 +789,14 @@
|
|
|
785
789
|
border-width: 1px;
|
|
786
790
|
}
|
|
787
791
|
|
|
792
|
+
.italic {
|
|
793
|
+
font-style: italic;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.underline {
|
|
797
|
+
text-decoration-line: underline;
|
|
798
|
+
}
|
|
799
|
+
|
|
788
800
|
.shadow {
|
|
789
801
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
790
802
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -814,6 +826,24 @@
|
|
|
814
826
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
815
827
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
816
828
|
}
|
|
829
|
+
|
|
830
|
+
.select-all {
|
|
831
|
+
-webkit-user-select: all;
|
|
832
|
+
user-select: all;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
[data-tao-control] {
|
|
837
|
+
box-sizing: border-box;
|
|
838
|
+
width: var(--tao-control-width);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
[data-tao-control][data-tao-range-trigger] {
|
|
842
|
+
width: var(--tao-control-range-width);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
[data-tao-form-field] [data-tao-control] {
|
|
846
|
+
width: 100%;
|
|
817
847
|
}
|
|
818
848
|
|
|
819
849
|
[data-tao-control] {
|
|
@@ -821,8 +851,8 @@
|
|
|
821
851
|
}
|
|
822
852
|
|
|
823
853
|
[data-tao-control][data-tao-variant="outlined"] {
|
|
824
|
-
background: var(--tao-color-bg-container);
|
|
825
854
|
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
855
|
+
background: none;
|
|
826
856
|
}
|
|
827
857
|
|
|
828
858
|
[data-tao-control][data-tao-variant="outlined"]:hover:not([data-disabled]):not(:focus-within):not([data-state="open"]) {
|
|
@@ -923,7 +953,6 @@
|
|
|
923
953
|
button[data-tao-picker-trigger] {
|
|
924
954
|
align-items: center;
|
|
925
955
|
gap: var(--tao-padding-xs);
|
|
926
|
-
width: 100%;
|
|
927
956
|
font-family: var(--tao-font-family);
|
|
928
957
|
cursor: pointer;
|
|
929
958
|
appearance: none;
|
|
@@ -1451,7 +1480,6 @@ button[data-tao-picker-footer-btn][data-tao-primary]:hover {
|
|
|
1451
1480
|
}
|
|
1452
1481
|
|
|
1453
1482
|
button[data-tao-range-trigger] {
|
|
1454
|
-
width: 100%;
|
|
1455
1483
|
font-family: var(--tao-font-family);
|
|
1456
1484
|
cursor: pointer;
|
|
1457
1485
|
appearance: none;
|
|
@@ -307,6 +307,8 @@
|
|
|
307
307
|
--tao-radius: 6px;
|
|
308
308
|
--tao-font-size: 14px;
|
|
309
309
|
--tao-control-height: 36px;
|
|
310
|
+
--tao-control-width: 200px;
|
|
311
|
+
--tao-control-range-width: 360px;
|
|
310
312
|
--tao-size-unit: 4px;
|
|
311
313
|
--tao-line-width: 1px;
|
|
312
314
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
@@ -529,8 +531,8 @@
|
|
|
529
531
|
}
|
|
530
532
|
|
|
531
533
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
534
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
535
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
536
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -541,16 +543,7 @@
|
|
|
541
543
|
}
|
|
542
544
|
|
|
543
545
|
:root, [data-tao-provider] {
|
|
544
|
-
--tao-color-border-secondary:
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
548
|
-
:root, [data-tao-provider] {
|
|
549
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
:root, [data-tao-provider] {
|
|
546
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
547
|
--tao-radius-xs: 2px;
|
|
555
548
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
549
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +626,10 @@
|
|
|
633
626
|
visibility: collapse;
|
|
634
627
|
}
|
|
635
628
|
|
|
629
|
+
.visible {
|
|
630
|
+
visibility: visible;
|
|
631
|
+
}
|
|
632
|
+
|
|
636
633
|
.absolute {
|
|
637
634
|
position: absolute;
|
|
638
635
|
}
|
|
@@ -715,6 +712,10 @@
|
|
|
715
712
|
display: inline;
|
|
716
713
|
}
|
|
717
714
|
|
|
715
|
+
.inline-flex {
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
}
|
|
718
|
+
|
|
718
719
|
.table {
|
|
719
720
|
display: table;
|
|
720
721
|
}
|
|
@@ -727,6 +728,10 @@
|
|
|
727
728
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
729
|
}
|
|
729
730
|
|
|
731
|
+
.resize {
|
|
732
|
+
resize: both;
|
|
733
|
+
}
|
|
734
|
+
|
|
730
735
|
.flex-wrap {
|
|
731
736
|
flex-wrap: wrap;
|
|
732
737
|
}
|
|
@@ -742,6 +747,14 @@
|
|
|
742
747
|
border-width: 1px;
|
|
743
748
|
}
|
|
744
749
|
|
|
750
|
+
.italic {
|
|
751
|
+
font-style: italic;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.underline {
|
|
755
|
+
text-decoration-line: underline;
|
|
756
|
+
}
|
|
757
|
+
|
|
745
758
|
.shadow {
|
|
746
759
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
760
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -771,16 +784,31 @@
|
|
|
771
784
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
785
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
786
|
}
|
|
787
|
+
|
|
788
|
+
.select-all {
|
|
789
|
+
-webkit-user-select: all;
|
|
790
|
+
user-select: all;
|
|
791
|
+
}
|
|
774
792
|
}
|
|
775
793
|
|
|
776
794
|
[data-tao-drawer-overlay] {
|
|
777
795
|
z-index: 999;
|
|
778
796
|
animation: tao-fade-in var(--tao-motion-duration-mid) ease-out;
|
|
779
|
-
background: oklch(0% 0 0 / .
|
|
797
|
+
background: oklch(0% 0 0 / .1);
|
|
780
798
|
position: fixed;
|
|
781
799
|
inset: 0;
|
|
782
800
|
}
|
|
783
801
|
|
|
802
|
+
@supports (backdrop-filter: blur(4px)) {
|
|
803
|
+
[data-tao-drawer-overlay] {
|
|
804
|
+
backdrop-filter: blur(4px);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
[data-tao-drawer][data-state="closed"], [data-tao-drawer-overlay][data-state="closed"] {
|
|
809
|
+
display: none;
|
|
810
|
+
}
|
|
811
|
+
|
|
784
812
|
@keyframes tao-fade-in {
|
|
785
813
|
0% {
|
|
786
814
|
opacity: 0;
|
|
@@ -894,6 +922,18 @@
|
|
|
894
922
|
line-height: 1.4;
|
|
895
923
|
}
|
|
896
924
|
|
|
925
|
+
[data-tao-drawer-actions] {
|
|
926
|
+
align-items: center;
|
|
927
|
+
gap: var(--tao-padding-xs);
|
|
928
|
+
margin-inline-start: auto;
|
|
929
|
+
display: flex;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
[data-tao-drawer-extra] {
|
|
933
|
+
align-items: center;
|
|
934
|
+
display: flex;
|
|
935
|
+
}
|
|
936
|
+
|
|
897
937
|
button[data-tao-drawer-close] {
|
|
898
938
|
border-radius: var(--tao-radius-sm);
|
|
899
939
|
width: 32px;
|
|
@@ -928,6 +968,76 @@ button[data-tao-drawer-close]:focus-visible {
|
|
|
928
968
|
overflow-y: auto;
|
|
929
969
|
}
|
|
930
970
|
|
|
971
|
+
[data-tao-drawer-dragger] {
|
|
972
|
+
z-index: 1;
|
|
973
|
+
-webkit-user-select: none;
|
|
974
|
+
user-select: none;
|
|
975
|
+
touch-action: none;
|
|
976
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out;
|
|
977
|
+
background-color: #0000;
|
|
978
|
+
position: absolute;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
[data-tao-drawer-dragger]:hover {
|
|
982
|
+
background-color: var(--tao-color-primary);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
986
|
+
[data-tao-drawer-dragger]:hover {
|
|
987
|
+
background-color: color-mix(in oklch, var(--tao-color-primary) 20%, transparent);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
[data-tao-drawer-dragger]:active {
|
|
992
|
+
background-color: var(--tao-color-primary);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
996
|
+
[data-tao-drawer-dragger]:active {
|
|
997
|
+
background-color: color-mix(in oklch, var(--tao-color-primary) 30%, transparent);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
[data-tao-drawer-dragger][data-tao-placement="right"], [data-tao-drawer-dragger][data-tao-placement="left"] {
|
|
1002
|
+
cursor: col-resize;
|
|
1003
|
+
width: 4px;
|
|
1004
|
+
top: 0;
|
|
1005
|
+
bottom: 0;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
[data-tao-drawer-dragger][data-tao-placement="right"] {
|
|
1009
|
+
left: 0;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
[data-tao-drawer-dragger][data-tao-placement="left"] {
|
|
1013
|
+
right: 0;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
[data-tao-drawer-dragger][data-tao-placement="bottom"], [data-tao-drawer-dragger][data-tao-placement="top"] {
|
|
1017
|
+
cursor: row-resize;
|
|
1018
|
+
height: 4px;
|
|
1019
|
+
left: 0;
|
|
1020
|
+
right: 0;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
[data-tao-drawer-dragger][data-tao-placement="bottom"] {
|
|
1024
|
+
top: 0;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
[data-tao-drawer-dragger][data-tao-placement="top"] {
|
|
1028
|
+
bottom: 0;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
[data-tao-drawer-footer] {
|
|
1032
|
+
justify-content: flex-end;
|
|
1033
|
+
align-items: center;
|
|
1034
|
+
gap: var(--tao-padding-xs);
|
|
1035
|
+
padding: var(--tao-padding) var(--tao-padding-lg);
|
|
1036
|
+
border-block-start: var(--tao-line-width) solid var(--tao-color-border-secondary);
|
|
1037
|
+
flex-shrink: 0;
|
|
1038
|
+
display: flex;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
931
1041
|
@property --tw-rotate-x {
|
|
932
1042
|
syntax: "*";
|
|
933
1043
|
inherits: false
|
|
@@ -1,17 +1,50 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
3
|
import './drawer.css';
|
|
4
4
|
export type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
-
export type
|
|
5
|
+
export type DrawerSize = 'default' | 'large';
|
|
6
|
+
export type DrawerSemanticPart = 'root' | 'overlay' | 'header' | 'title' | 'extra' | 'body' | 'footer' | 'close' | 'dragger';
|
|
7
|
+
export interface DrawerResizableConfig {
|
|
8
|
+
onResize?: (size: number) => void;
|
|
9
|
+
onResizeStart?: () => void;
|
|
10
|
+
onResizeEnd?: () => void;
|
|
11
|
+
}
|
|
6
12
|
export interface DrawerProps {
|
|
7
13
|
open: boolean;
|
|
8
14
|
onClose?: () => void;
|
|
9
15
|
title?: ReactNode;
|
|
16
|
+
/** Extra content rendered on the trailing side of the header. */
|
|
17
|
+
extra?: ReactNode;
|
|
18
|
+
/** Footer content; renders a bordered footer area when provided. */
|
|
19
|
+
footer?: ReactNode;
|
|
10
20
|
placement?: DrawerPlacement;
|
|
21
|
+
/** Preset drawer size: `default` (378) / `large` (736). `width`/`height` override it. */
|
|
22
|
+
size?: DrawerSize;
|
|
11
23
|
width?: number | string;
|
|
12
24
|
height?: number | string;
|
|
25
|
+
/** Show the close (×) button. Defaults to true. */
|
|
26
|
+
closable?: boolean;
|
|
27
|
+
/** Custom close icon. */
|
|
28
|
+
closeIcon?: ReactNode;
|
|
29
|
+
/** Close when clicking the mask. Defaults to true. */
|
|
30
|
+
maskClosable?: boolean;
|
|
31
|
+
/** Render the mask/overlay. Defaults to true. */
|
|
32
|
+
mask?: boolean;
|
|
33
|
+
/** Close on Esc key. Defaults to true. */
|
|
34
|
+
keyboard?: boolean;
|
|
35
|
+
/** Allow resizing by dragging the inner edge. Pass an object for resize callbacks. */
|
|
36
|
+
resizable?: boolean | DrawerResizableConfig;
|
|
37
|
+
/** Called after open transitions in either direction. */
|
|
38
|
+
afterOpenChange?: (open: boolean) => void;
|
|
39
|
+
/** Called after the drawer has fully closed. */
|
|
40
|
+
afterClose?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Unmount children when closed. Defaults to `true`.
|
|
43
|
+
* Set `false` to keep children mounted and preserve their state across open/close.
|
|
44
|
+
*/
|
|
45
|
+
destroyOnHidden?: boolean;
|
|
13
46
|
children?: ReactNode;
|
|
14
47
|
classNames?: SemanticClassNames<DrawerSemanticPart>;
|
|
15
48
|
styles?: SemanticStyles<DrawerSemanticPart>;
|
|
16
49
|
}
|
|
17
|
-
export declare function Drawer({ open, onClose, title, placement, width, height, children, classNames, styles: stylesProp, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function Drawer({ open, onClose, title, extra, footer, placement, size, width, height, closable, closeIcon, maskClosable, mask, keyboard, resizable, afterOpenChange, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|