@thangnqdev/ui 0.1.0
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 +196 -0
- package/dist/Label-DWOlgSNW.d.cts +14 -0
- package/dist/Label-DWOlgSNW.d.ts +14 -0
- package/dist/bento/index.cjs +140 -0
- package/dist/bento/index.cjs.map +1 -0
- package/dist/bento/index.d.cts +4 -0
- package/dist/bento/index.d.ts +4 -0
- package/dist/bento/index.js +4 -0
- package/dist/bento/index.js.map +1 -0
- package/dist/bento/styles.css +46 -0
- package/dist/buttons/index.cjs +365 -0
- package/dist/buttons/index.cjs.map +1 -0
- package/dist/buttons/index.d.cts +4 -0
- package/dist/buttons/index.d.ts +4 -0
- package/dist/buttons/index.js +5 -0
- package/dist/buttons/index.js.map +1 -0
- package/dist/buttons/styles.css +6 -0
- package/dist/chunk-2OXZK6IP.js +514 -0
- package/dist/chunk-2OXZK6IP.js.map +1 -0
- package/dist/chunk-4S6L5V7X.js +15 -0
- package/dist/chunk-4S6L5V7X.js.map +1 -0
- package/dist/chunk-5FZ6ZFII.js +728 -0
- package/dist/chunk-5FZ6ZFII.js.map +1 -0
- package/dist/chunk-66VWUJEI.js +86 -0
- package/dist/chunk-66VWUJEI.js.map +1 -0
- package/dist/chunk-A7P3O5Z5.js +163 -0
- package/dist/chunk-A7P3O5Z5.js.map +1 -0
- package/dist/chunk-ATYGDTMK.js +257 -0
- package/dist/chunk-ATYGDTMK.js.map +1 -0
- package/dist/chunk-C4SUXMI3.js +138 -0
- package/dist/chunk-C4SUXMI3.js.map +1 -0
- package/dist/chunk-EU2LPUYP.js +25 -0
- package/dist/chunk-EU2LPUYP.js.map +1 -0
- package/dist/chunk-F5Q7BTMH.js +1991 -0
- package/dist/chunk-F5Q7BTMH.js.map +1 -0
- package/dist/chunk-GXI2H5XA.js +46 -0
- package/dist/chunk-GXI2H5XA.js.map +1 -0
- package/dist/chunk-H3LCNPMC.js +101 -0
- package/dist/chunk-H3LCNPMC.js.map +1 -0
- package/dist/chunk-IABPUCAQ.js +19 -0
- package/dist/chunk-IABPUCAQ.js.map +1 -0
- package/dist/chunk-KJRBRTQE.js +101 -0
- package/dist/chunk-KJRBRTQE.js.map +1 -0
- package/dist/chunk-LBUBXUYQ.js +40 -0
- package/dist/chunk-LBUBXUYQ.js.map +1 -0
- package/dist/chunk-LWFRUJRU.js +537 -0
- package/dist/chunk-LWFRUJRU.js.map +1 -0
- package/dist/chunk-NFVONJUK.js +882 -0
- package/dist/chunk-NFVONJUK.js.map +1 -0
- package/dist/chunk-PF4ZHGVW.js +284 -0
- package/dist/chunk-PF4ZHGVW.js.map +1 -0
- package/dist/chunk-WAFHC4DQ.js +366 -0
- package/dist/chunk-WAFHC4DQ.js.map +1 -0
- package/dist/chunk-X76KBH4Y.js +71 -0
- package/dist/chunk-X76KBH4Y.js.map +1 -0
- package/dist/core/index.cjs +103 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +3 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/styles.css +128 -0
- package/dist/data-display/index.cjs +1023 -0
- package/dist/data-display/index.cjs.map +1 -0
- package/dist/data-display/index.d.cts +4 -0
- package/dist/data-display/index.d.ts +4 -0
- package/dist/data-display/index.js +6 -0
- package/dist/data-display/index.js.map +1 -0
- package/dist/data-display/styles.css +4 -0
- package/dist/feedback/index.cjs +368 -0
- package/dist/feedback/index.cjs.map +1 -0
- package/dist/feedback/index.d.cts +4 -0
- package/dist/feedback/index.d.ts +4 -0
- package/dist/feedback/index.js +4 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/styles.css +4 -0
- package/dist/forms/index.cjs +2287 -0
- package/dist/forms/index.cjs.map +1 -0
- package/dist/forms/index.d.cts +5 -0
- package/dist/forms/index.d.ts +5 -0
- package/dist/forms/index.js +10 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/styles.css +6 -0
- package/dist/glass/index.cjs +165 -0
- package/dist/glass/index.cjs.map +1 -0
- package/dist/glass/index.d.cts +4 -0
- package/dist/glass/index.d.ts +4 -0
- package/dist/glass/index.js +4 -0
- package/dist/glass/index.js.map +1 -0
- package/dist/glass/styles.css +81 -0
- package/dist/index-BTvkbCIj.d.cts +146 -0
- package/dist/index-BTvkbCIj.d.ts +146 -0
- package/dist/index-BkRqGNG1.d.cts +201 -0
- package/dist/index-BkRqGNG1.d.ts +201 -0
- package/dist/index-BlPcGeW-.d.cts +45 -0
- package/dist/index-BlPcGeW-.d.ts +45 -0
- package/dist/index-BzOCqvC6.d.cts +32 -0
- package/dist/index-BzOCqvC6.d.ts +32 -0
- package/dist/index-CCeWYAvn.d.cts +83 -0
- package/dist/index-COQ7uwt9.d.cts +44 -0
- package/dist/index-COQ7uwt9.d.ts +44 -0
- package/dist/index-CenuF_P2.d.cts +221 -0
- package/dist/index-CenuF_P2.d.ts +221 -0
- package/dist/index-Cle6QzQl.d.ts +371 -0
- package/dist/index-D6fE7w-b.d.cts +90 -0
- package/dist/index-D6fE7w-b.d.ts +90 -0
- package/dist/index-DR8cfJUG.d.ts +83 -0
- package/dist/index-DzcWh1Hs.d.cts +131 -0
- package/dist/index-DzcWh1Hs.d.ts +131 -0
- package/dist/index-TyK-Ldpy.d.cts +371 -0
- package/dist/index-ugj5s6a3.d.cts +95 -0
- package/dist/index-ugj5s6a3.d.ts +95 -0
- package/dist/index.cjs +6400 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.cjs +516 -0
- package/dist/layout/index.cjs.map +1 -0
- package/dist/layout/index.d.cts +4 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/styles.css +8 -0
- package/dist/navigation/index.cjs +673 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +2 -0
- package/dist/navigation/index.d.ts +2 -0
- package/dist/navigation/index.js +8 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/styles.css +4 -0
- package/dist/overlays/index.cjs +954 -0
- package/dist/overlays/index.cjs.map +1 -0
- package/dist/overlays/index.d.cts +4 -0
- package/dist/overlays/index.d.ts +4 -0
- package/dist/overlays/index.js +9 -0
- package/dist/overlays/index.js.map +1 -0
- package/dist/overlays/styles.css +8 -0
- package/dist/styles.css +333 -0
- package/dist/typography/index.cjs +311 -0
- package/dist/typography/index.cjs.map +1 -0
- package/dist/typography/index.d.cts +5 -0
- package/dist/typography/index.d.ts +5 -0
- package/dist/typography/index.js +6 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/styles.css +5 -0
- package/llms.txt +113 -0
- package/package.json +116 -0
- package/src/bento/BentoCard.tsx +140 -0
- package/src/bento/BentoGrid.tsx +50 -0
- package/src/bento/index.ts +2 -0
- package/src/bento/tokens.css +46 -0
- package/src/buttons/Button.tsx +104 -0
- package/src/buttons/ButtonGroup.tsx +43 -0
- package/src/buttons/IconButton.tsx +79 -0
- package/src/buttons/SplitButton.tsx +86 -0
- package/src/buttons/ToggleButton.tsx +157 -0
- package/src/buttons/index.ts +5 -0
- package/src/buttons/tokens.css +6 -0
- package/src/core/ThemeProvider.tsx +123 -0
- package/src/core/index.ts +2 -0
- package/src/core/tokens.css +128 -0
- package/src/data-display/Accordion.tsx +147 -0
- package/src/data-display/Avatar.tsx +134 -0
- package/src/data-display/Card.tsx +112 -0
- package/src/data-display/Carousel.tsx +130 -0
- package/src/data-display/Chip.tsx +74 -0
- package/src/data-display/DataTablePro.tsx +356 -0
- package/src/data-display/StatCard.tsx +60 -0
- package/src/data-display/Table.tsx +74 -0
- package/src/data-display/Timeline.tsx +62 -0
- package/src/data-display/TreeView.tsx +140 -0
- package/src/data-display/index.ts +10 -0
- package/src/data-display/tokens.css +4 -0
- package/src/feedback/Alert.tsx +80 -0
- package/src/feedback/EmptyState.tsx +45 -0
- package/src/feedback/ProgressBar.tsx +174 -0
- package/src/feedback/Skeleton.tsx +66 -0
- package/src/feedback/Spinner.tsx +65 -0
- package/src/feedback/index.ts +5 -0
- package/src/feedback/tokens.css +4 -0
- package/src/forms/Checkbox.tsx +69 -0
- package/src/forms/CheckboxGroup.tsx +29 -0
- package/src/forms/Combobox.tsx +368 -0
- package/src/forms/DatePicker.tsx +480 -0
- package/src/forms/FileUpload.tsx +222 -0
- package/src/forms/FormField.tsx +115 -0
- package/src/forms/Input.tsx +151 -0
- package/src/forms/MaskedInput.tsx +97 -0
- package/src/forms/NumberInput.tsx +248 -0
- package/src/forms/PasswordInput.tsx +35 -0
- package/src/forms/PinInput.tsx +125 -0
- package/src/forms/Radio.tsx +142 -0
- package/src/forms/RangeSlider.tsx +111 -0
- package/src/forms/SearchInput.tsx +34 -0
- package/src/forms/Select.tsx +103 -0
- package/src/forms/Slider.tsx +85 -0
- package/src/forms/Switch.tsx +95 -0
- package/src/forms/Textarea.tsx +114 -0
- package/src/forms/index.ts +18 -0
- package/src/forms/tokens.css +6 -0
- package/src/glass/GlassBadge.tsx +61 -0
- package/src/glass/GlassButton.tsx +59 -0
- package/src/glass/GlassCard.tsx +71 -0
- package/src/glass/index.ts +3 -0
- package/src/glass/tokens.css +81 -0
- package/src/index.ts +26 -0
- package/src/layout/AspectRatio.tsx +39 -0
- package/src/layout/Container.tsx +53 -0
- package/src/layout/Divider.tsx +61 -0
- package/src/layout/Flex.tsx +79 -0
- package/src/layout/Grid.tsx +124 -0
- package/src/layout/PageLayout.tsx +59 -0
- package/src/layout/ScrollArea.tsx +43 -0
- package/src/layout/Section.tsx +47 -0
- package/src/layout/Spacer.tsx +30 -0
- package/src/layout/Stack.tsx +88 -0
- package/src/layout/index.ts +10 -0
- package/src/layout/tokens.css +8 -0
- package/src/navigation/Breadcrumb.tsx +73 -0
- package/src/navigation/CommandPalette.tsx +142 -0
- package/src/navigation/DropdownMenu.tsx +160 -0
- package/src/navigation/Pagination.tsx +114 -0
- package/src/navigation/Stepper.tsx +93 -0
- package/src/navigation/Tabs.tsx +133 -0
- package/src/navigation/index.ts +6 -0
- package/src/navigation/tokens.css +4 -0
- package/src/overlays/AlertDialog.tsx +54 -0
- package/src/overlays/BottomSheet.tsx +123 -0
- package/src/overlays/ContextMenu.tsx +119 -0
- package/src/overlays/Drawer.tsx +145 -0
- package/src/overlays/FocusTrap.tsx +49 -0
- package/src/overlays/HoverCard.tsx +72 -0
- package/src/overlays/Modal.tsx +219 -0
- package/src/overlays/Popover.tsx +126 -0
- package/src/overlays/Portal.tsx +23 -0
- package/src/overlays/Toast.tsx +137 -0
- package/src/overlays/Tooltip.tsx +100 -0
- package/src/overlays/index.ts +11 -0
- package/src/overlays/tokens.css +8 -0
- package/src/styles/tokens.css +2 -0
- package/src/typography/Blockquote.tsx +32 -0
- package/src/typography/Code.tsx +89 -0
- package/src/typography/Heading.tsx +56 -0
- package/src/typography/Kbd.tsx +25 -0
- package/src/typography/Label.tsx +47 -0
- package/src/typography/Link.tsx +56 -0
- package/src/typography/Text.tsx +62 -0
- package/src/typography/index.ts +7 -0
- package/src/typography/tokens.css +5 -0
- package/src/utils/cn.ts +6 -0
- package/ui-contract.json +62 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ==========================================================================
|
|
3
|
+
AETHER SPATIAL DESIGN TOKENS — LIGHT MODE (ARCHITECTURAL ALABASTER)
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
/* Glass Surface Tokens */
|
|
7
|
+
--ui-glass-subtle-bg: rgba(255, 255, 255, 0.65);
|
|
8
|
+
--ui-glass-subtle-border: rgba(15, 23, 42, 0.08);
|
|
9
|
+
--ui-glass-subtle-blur: 12px;
|
|
10
|
+
|
|
11
|
+
--ui-glass-standard-bg: rgba(255, 255, 255, 0.82);
|
|
12
|
+
--ui-glass-standard-border: rgba(15, 23, 42, 0.10);
|
|
13
|
+
--ui-glass-standard-blur: 20px;
|
|
14
|
+
--ui-glass-standard-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.06), inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
|
|
15
|
+
|
|
16
|
+
--ui-glass-frosted-bg: rgba(255, 255, 255, 0.90);
|
|
17
|
+
--ui-glass-frosted-border: rgba(15, 23, 42, 0.12);
|
|
18
|
+
--ui-glass-frosted-blur: 32px;
|
|
19
|
+
--ui-glass-frosted-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 1);
|
|
20
|
+
|
|
21
|
+
--ui-glass-acrylic-bg: linear-gradient(175deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 247, 250, 0.80) 100%);
|
|
22
|
+
--ui-glass-acrylic-border: rgba(15, 23, 42, 0.14);
|
|
23
|
+
--ui-glass-acrylic-blur: 44px;
|
|
24
|
+
--ui-glass-acrylic-shadow: 0 28px 64px -12px rgba(15, 23, 42, 0.12), inset 0 1.5px 0 0 rgba(255, 255, 255, 1);
|
|
25
|
+
|
|
26
|
+
--ui-glass-specular-light: linear-gradient(90deg, transparent 0%, rgba(15, 23, 42, 0.06) 20%, rgba(15, 23, 42, 0.18) 50%, rgba(15, 23, 42, 0.06) 80%, transparent 100%);
|
|
27
|
+
--ui-glass-text-primary: #0a0c10;
|
|
28
|
+
--ui-glass-text-secondary: #4b5563;
|
|
29
|
+
--ui-glass-text-muted: #8b949e;
|
|
30
|
+
|
|
31
|
+
/* Button Tokens */
|
|
32
|
+
--ui-glass-btn-default-bg: rgba(255, 255, 255, 0.85);
|
|
33
|
+
--ui-glass-btn-default-hover: rgba(255, 255, 255, 1);
|
|
34
|
+
--ui-glass-btn-default-border: rgba(15, 23, 42, 0.12);
|
|
35
|
+
--ui-glass-btn-default-text: #0a0c10;
|
|
36
|
+
|
|
37
|
+
/* Focus Ring */
|
|
38
|
+
--ui-focus-ring: 0 0 0 1px #fff, 0 0 0 3px rgba(15, 23, 42, 0.9);
|
|
39
|
+
--ui-focus-ring-offset: #fafbfc;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dark {
|
|
43
|
+
/* ==========================================================================
|
|
44
|
+
AETHER SPATIAL DESIGN TOKENS — DARK MODE (OBSIDIAN & LUNAR PRISM)
|
|
45
|
+
========================================================================== */
|
|
46
|
+
|
|
47
|
+
/* Glass Surface Tokens */
|
|
48
|
+
--ui-glass-subtle-bg: rgba(18, 20, 26, 0.45);
|
|
49
|
+
--ui-glass-subtle-border: rgba(255, 255, 255, 0.07);
|
|
50
|
+
--ui-glass-subtle-blur: 14px;
|
|
51
|
+
|
|
52
|
+
--ui-glass-standard-bg: rgba(18, 21, 28, 0.65);
|
|
53
|
+
--ui-glass-standard-border: rgba(255, 255, 255, 0.10);
|
|
54
|
+
--ui-glass-standard-blur: 24px;
|
|
55
|
+
--ui-glass-standard-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
|
|
56
|
+
|
|
57
|
+
--ui-glass-frosted-bg: rgba(22, 26, 36, 0.78);
|
|
58
|
+
--ui-glass-frosted-border: rgba(255, 255, 255, 0.14);
|
|
59
|
+
--ui-glass-frosted-blur: 36px;
|
|
60
|
+
--ui-glass-frosted-shadow: 0 28px 60px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
|
|
61
|
+
|
|
62
|
+
--ui-glass-acrylic-bg: linear-gradient(175deg, rgba(30, 36, 48, 0.85) 0%, rgba(14, 17, 24, 0.70) 100%);
|
|
63
|
+
--ui-glass-acrylic-border: rgba(255, 255, 255, 0.18);
|
|
64
|
+
--ui-glass-acrylic-blur: 48px;
|
|
65
|
+
--ui-glass-acrylic-shadow: 0 36px 80px -16px rgba(0, 0, 0, 0.85), inset 0 1.5px 0 0 rgba(255, 255, 255, 0.24);
|
|
66
|
+
|
|
67
|
+
--ui-glass-specular-light: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 20%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0.15) 80%, transparent 100%);
|
|
68
|
+
--ui-glass-text-primary: #f0f3f8;
|
|
69
|
+
--ui-glass-text-secondary: #a0aec0;
|
|
70
|
+
--ui-glass-text-muted: #5e697a;
|
|
71
|
+
|
|
72
|
+
/* Button Tokens */
|
|
73
|
+
--ui-glass-btn-default-bg: rgba(255, 255, 255, 0.06);
|
|
74
|
+
--ui-glass-btn-default-hover: rgba(255, 255, 255, 0.12);
|
|
75
|
+
--ui-glass-btn-default-border: rgba(255, 255, 255, 0.15);
|
|
76
|
+
--ui-glass-btn-default-text: #f0f3f8;
|
|
77
|
+
|
|
78
|
+
/* Focus Ring */
|
|
79
|
+
--ui-focus-ring: 0 0 0 1px #07080b, 0 0 0 3px rgba(255, 255, 255, 0.8);
|
|
80
|
+
--ui-focus-ring-offset: #07080b;
|
|
81
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Domain Namespaces
|
|
2
|
+
export * as Core from './core';
|
|
3
|
+
export * as Layout from './layout';
|
|
4
|
+
export * as Typography from './typography';
|
|
5
|
+
export * as Buttons from './buttons';
|
|
6
|
+
export * as Forms from './forms';
|
|
7
|
+
export * as Overlays from './overlays';
|
|
8
|
+
export * as Navigation from './navigation';
|
|
9
|
+
export * as DataDisplay from './data-display';
|
|
10
|
+
export * as Feedback from './feedback';
|
|
11
|
+
export * as Glass from './glass';
|
|
12
|
+
export * as Bento from './bento';
|
|
13
|
+
|
|
14
|
+
// Flat Exports
|
|
15
|
+
export * from './core';
|
|
16
|
+
export * from './layout';
|
|
17
|
+
export * from './typography';
|
|
18
|
+
export * from './buttons';
|
|
19
|
+
export * from './forms';
|
|
20
|
+
export * from './overlays';
|
|
21
|
+
export * from './navigation';
|
|
22
|
+
export * from './data-display';
|
|
23
|
+
export * from './feedback';
|
|
24
|
+
export * from './glass';
|
|
25
|
+
export * from './bento';
|
|
26
|
+
export * from './utils/cn';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
export interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
ratio?: number | `${number}/${number}`;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(
|
|
10
|
+
({ className, ratio = 16 / 9, style, children, ...props }, ref) => {
|
|
11
|
+
const computedRatio =
|
|
12
|
+
typeof ratio === 'string'
|
|
13
|
+
? ratio
|
|
14
|
+
.split('/')
|
|
15
|
+
.map(Number)
|
|
16
|
+
.reduce((w, h) => (h ? w / h : 1))
|
|
17
|
+
: ratio;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
ref={ref}
|
|
22
|
+
style={{
|
|
23
|
+
...style,
|
|
24
|
+
position: 'relative',
|
|
25
|
+
width: '100%',
|
|
26
|
+
paddingBottom: `${(1 / computedRatio) * 100}%`,
|
|
27
|
+
}}
|
|
28
|
+
className={cn('overflow-hidden', className)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<div className="absolute inset-0 w-full h-full [&>img]:object-cover [&>video]:object-cover [&>img]:w-full [&>img]:h-full [&>video]:w-full [&>video]:h-full">
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
AspectRatio.displayName = 'AspectRatio';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
export const containerVariants = cva('w-full mx-auto', {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: 'max-w-screen-sm',
|
|
9
|
+
md: 'max-w-screen-md',
|
|
10
|
+
lg: 'max-w-screen-lg',
|
|
11
|
+
xl: 'max-w-screen-xl',
|
|
12
|
+
'2xl': 'max-w-screen-2xl',
|
|
13
|
+
fluid: 'max-w-full',
|
|
14
|
+
},
|
|
15
|
+
padding: {
|
|
16
|
+
none: 'px-0',
|
|
17
|
+
sm: 'px-4',
|
|
18
|
+
md: 'px-6',
|
|
19
|
+
lg: 'px-8 sm:px-12',
|
|
20
|
+
},
|
|
21
|
+
centered: {
|
|
22
|
+
true: 'flex flex-col items-center justify-center',
|
|
23
|
+
false: '',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: 'xl',
|
|
28
|
+
padding: 'md',
|
|
29
|
+
centered: false,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export interface ContainerProps
|
|
34
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
35
|
+
VariantProps<typeof containerVariants> {
|
|
36
|
+
as?: React.ElementType;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Container = forwardRef<HTMLDivElement, ContainerProps>(
|
|
40
|
+
({ className, size, padding, centered, as: Component = 'div', children, ...props }, ref) => {
|
|
41
|
+
return (
|
|
42
|
+
<Component
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(containerVariants({ size, padding, centered }), className)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</Component>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
Container.displayName = 'Container';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
export const dividerVariants = cva('border-0 flex-shrink-0', {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
horizontal: 'w-full h-px border-t border-[var(--ui-border-subtle)] my-4',
|
|
9
|
+
vertical: 'h-full w-px border-l border-[var(--ui-border-subtle)] mx-4 inline-block align-middle self-stretch',
|
|
10
|
+
},
|
|
11
|
+
variant: {
|
|
12
|
+
solid: 'border-solid',
|
|
13
|
+
dashed: 'border-dashed',
|
|
14
|
+
dotted: 'border-dotted',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
orientation: 'horizontal',
|
|
19
|
+
variant: 'solid',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export interface DividerProps
|
|
24
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
25
|
+
VariantProps<typeof dividerVariants> {
|
|
26
|
+
label?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Divider = forwardRef<HTMLDivElement, DividerProps>(
|
|
30
|
+
({ className, orientation = 'horizontal', variant, label, children, ...props }, ref) => {
|
|
31
|
+
const content = label || children;
|
|
32
|
+
|
|
33
|
+
if (orientation === 'horizontal' && content) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
ref={ref}
|
|
37
|
+
role="separator"
|
|
38
|
+
aria-orientation="horizontal"
|
|
39
|
+
className={cn('flex items-center w-full my-4 text-xs font-medium text-[var(--ui-text-muted)]', className)}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<div className={cn('flex-grow border-t border-[var(--ui-border-subtle)]', dividerVariants({ variant }))} />
|
|
43
|
+
<span className="px-3 select-none">{content}</span>
|
|
44
|
+
<div className={cn('flex-grow border-t border-[var(--ui-border-subtle)]', dividerVariants({ variant }))} />
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
ref={ref}
|
|
52
|
+
role="separator"
|
|
53
|
+
aria-orientation={orientation || 'horizontal'}
|
|
54
|
+
className={cn(dividerVariants({ orientation, variant }), className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
export const flexVariants = cva('flex', {
|
|
6
|
+
variants: {
|
|
7
|
+
direction: {
|
|
8
|
+
row: 'flex-row',
|
|
9
|
+
'row-reverse': 'flex-row-reverse',
|
|
10
|
+
column: 'flex-col',
|
|
11
|
+
'column-reverse': 'flex-col-reverse',
|
|
12
|
+
},
|
|
13
|
+
align: {
|
|
14
|
+
start: 'items-start',
|
|
15
|
+
center: 'items-center',
|
|
16
|
+
end: 'items-end',
|
|
17
|
+
stretch: 'items-stretch',
|
|
18
|
+
baseline: 'items-baseline',
|
|
19
|
+
},
|
|
20
|
+
justify: {
|
|
21
|
+
start: 'justify-start',
|
|
22
|
+
center: 'justify-center',
|
|
23
|
+
end: 'justify-end',
|
|
24
|
+
between: 'justify-between',
|
|
25
|
+
around: 'justify-around',
|
|
26
|
+
evenly: 'justify-evenly',
|
|
27
|
+
},
|
|
28
|
+
wrap: {
|
|
29
|
+
nowrap: 'flex-nowrap',
|
|
30
|
+
wrap: 'flex-wrap',
|
|
31
|
+
'wrap-reverse': 'flex-wrap-reverse',
|
|
32
|
+
},
|
|
33
|
+
gap: {
|
|
34
|
+
0: 'gap-0',
|
|
35
|
+
1: 'gap-1',
|
|
36
|
+
2: 'gap-2',
|
|
37
|
+
3: 'gap-3',
|
|
38
|
+
4: 'gap-4',
|
|
39
|
+
5: 'gap-5',
|
|
40
|
+
6: 'gap-6',
|
|
41
|
+
8: 'gap-8',
|
|
42
|
+
10: 'gap-10',
|
|
43
|
+
12: 'gap-12',
|
|
44
|
+
},
|
|
45
|
+
inline: {
|
|
46
|
+
true: 'inline-flex',
|
|
47
|
+
false: 'flex',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
direction: 'row',
|
|
52
|
+
align: 'stretch',
|
|
53
|
+
justify: 'start',
|
|
54
|
+
wrap: 'nowrap',
|
|
55
|
+
inline: false,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export interface FlexProps
|
|
60
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
61
|
+
VariantProps<typeof flexVariants> {
|
|
62
|
+
as?: React.ElementType;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Flex = forwardRef<HTMLDivElement, FlexProps>(
|
|
66
|
+
({ className, direction, align, justify, wrap, gap, inline, as: Component = 'div', children, ...props }, ref) => {
|
|
67
|
+
return (
|
|
68
|
+
<Component
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={cn(flexVariants({ direction, align, justify, wrap, gap, inline }), className)}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</Component>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
Flex.displayName = 'Flex';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
export const gridVariants = cva('grid', {
|
|
6
|
+
variants: {
|
|
7
|
+
cols: {
|
|
8
|
+
1: 'grid-cols-1',
|
|
9
|
+
2: 'grid-cols-1 sm:grid-cols-2',
|
|
10
|
+
3: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3',
|
|
11
|
+
4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',
|
|
12
|
+
5: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5',
|
|
13
|
+
6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',
|
|
14
|
+
12: 'grid-cols-12',
|
|
15
|
+
},
|
|
16
|
+
gap: {
|
|
17
|
+
0: 'gap-0',
|
|
18
|
+
1: 'gap-1',
|
|
19
|
+
2: 'gap-2',
|
|
20
|
+
3: 'gap-3',
|
|
21
|
+
4: 'gap-4',
|
|
22
|
+
5: 'gap-5',
|
|
23
|
+
6: 'gap-6',
|
|
24
|
+
8: 'gap-8',
|
|
25
|
+
10: 'gap-10',
|
|
26
|
+
12: 'gap-12',
|
|
27
|
+
},
|
|
28
|
+
flow: {
|
|
29
|
+
row: 'grid-flow-row',
|
|
30
|
+
col: 'grid-flow-col',
|
|
31
|
+
dense: 'grid-flow-dense',
|
|
32
|
+
'row-dense': 'grid-flow-row-dense',
|
|
33
|
+
'col-dense': 'grid-flow-col-dense',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
cols: 1,
|
|
38
|
+
gap: 4,
|
|
39
|
+
flow: 'row',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export interface GridProps
|
|
44
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
45
|
+
VariantProps<typeof gridVariants> {
|
|
46
|
+
as?: React.ElementType;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Grid = forwardRef<HTMLDivElement, GridProps>(
|
|
50
|
+
({ className, cols, gap, flow, as: Component = 'div', children, ...props }, ref) => {
|
|
51
|
+
return (
|
|
52
|
+
<Component
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn(gridVariants({ cols, gap, flow }), className)}
|
|
55
|
+
{...props}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</Component>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
Grid.displayName = 'Grid';
|
|
63
|
+
|
|
64
|
+
export const gridItemVariants = cva('', {
|
|
65
|
+
variants: {
|
|
66
|
+
colSpan: {
|
|
67
|
+
1: 'col-span-1',
|
|
68
|
+
2: 'col-span-2',
|
|
69
|
+
3: 'col-span-3',
|
|
70
|
+
4: 'col-span-4',
|
|
71
|
+
5: 'col-span-5',
|
|
72
|
+
6: 'col-span-6',
|
|
73
|
+
7: 'col-span-7',
|
|
74
|
+
8: 'col-span-8',
|
|
75
|
+
9: 'col-span-9',
|
|
76
|
+
10: 'col-span-10',
|
|
77
|
+
11: 'col-span-11',
|
|
78
|
+
12: 'col-span-12',
|
|
79
|
+
full: 'col-span-full',
|
|
80
|
+
},
|
|
81
|
+
rowSpan: {
|
|
82
|
+
1: 'row-span-1',
|
|
83
|
+
2: 'row-span-2',
|
|
84
|
+
3: 'row-span-3',
|
|
85
|
+
4: 'row-span-4',
|
|
86
|
+
5: 'row-span-5',
|
|
87
|
+
6: 'row-span-6',
|
|
88
|
+
full: 'row-span-full',
|
|
89
|
+
},
|
|
90
|
+
colStart: {
|
|
91
|
+
1: 'col-start-1',
|
|
92
|
+
2: 'col-start-2',
|
|
93
|
+
3: 'col-start-3',
|
|
94
|
+
4: 'col-start-4',
|
|
95
|
+
5: 'col-start-5',
|
|
96
|
+
6: 'col-start-6',
|
|
97
|
+
auto: 'col-start-auto',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
defaultVariants: {
|
|
101
|
+
colSpan: 1,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export interface GridItemProps
|
|
106
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
107
|
+
VariantProps<typeof gridItemVariants> {
|
|
108
|
+
as?: React.ElementType;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const GridItem = forwardRef<HTMLDivElement, GridItemProps>(
|
|
112
|
+
({ className, colSpan, rowSpan, colStart, as: Component = 'div', children, ...props }, ref) => {
|
|
113
|
+
return (
|
|
114
|
+
<Component
|
|
115
|
+
ref={ref}
|
|
116
|
+
className={cn(gridItemVariants({ colSpan, rowSpan, colStart }), className)}
|
|
117
|
+
{...props}
|
|
118
|
+
>
|
|
119
|
+
{children}
|
|
120
|
+
</Component>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
GridItem.displayName = 'GridItem';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
export interface PageLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
sidebar?: React.ReactNode;
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
sidebarWidth?: string;
|
|
9
|
+
sidebarCollapsed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const PageLayout = forwardRef<HTMLDivElement, PageLayoutProps>(
|
|
13
|
+
({ className, header, sidebar, footer, children, sidebarWidth = '16rem', sidebarCollapsed = false, ...props }, ref) => {
|
|
14
|
+
return (
|
|
15
|
+
<div ref={ref} className={cn('min-h-screen flex flex-col bg-[var(--ui-bg-primary)] text-[var(--ui-text-primary)]', className)} {...props}>
|
|
16
|
+
{header && <header className="sticky top-0 z-30 w-full border-b border-[var(--ui-border-subtle)] bg-[var(--ui-bg-surface)] backdrop-blur-md">{header}</header>}
|
|
17
|
+
|
|
18
|
+
<div className="flex-1 flex w-full">
|
|
19
|
+
{sidebar && (
|
|
20
|
+
<aside
|
|
21
|
+
style={{ width: sidebarCollapsed ? '4rem' : sidebarWidth }}
|
|
22
|
+
className="hidden md:flex flex-col flex-shrink-0 border-r border-[var(--ui-border-subtle)] bg-[var(--ui-bg-secondary)] transition-[width] duration-200"
|
|
23
|
+
>
|
|
24
|
+
{sidebar}
|
|
25
|
+
</aside>
|
|
26
|
+
)}
|
|
27
|
+
|
|
28
|
+
<main className="flex-1 flex flex-col min-w-0 overflow-y-auto">
|
|
29
|
+
<div className="flex-1 p-4 md:p-6 lg:p-8">{children}</div>
|
|
30
|
+
{footer && <footer className="border-t border-[var(--ui-border-subtle)] bg-[var(--ui-bg-surface)] p-4 md:p-6">{footer}</footer>}
|
|
31
|
+
</main>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
PageLayout.displayName = 'PageLayout';
|
|
38
|
+
|
|
39
|
+
export const PageHeader = forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(
|
|
40
|
+
({ className, children, ...props }, ref) => {
|
|
41
|
+
return (
|
|
42
|
+
<div ref={ref as any} className={cn('flex items-center justify-between h-16 px-4 md:px-6 w-full', className)} {...props}>
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
PageHeader.displayName = 'PageHeader';
|
|
49
|
+
|
|
50
|
+
export const PageSidebar = forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(
|
|
51
|
+
({ className, children, ...props }, ref) => {
|
|
52
|
+
return (
|
|
53
|
+
<div ref={ref as any} className={cn('flex flex-col h-full p-4 overflow-y-auto', className)} {...props}>
|
|
54
|
+
{children}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
PageSidebar.displayName = 'PageSidebar';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useState, useEffect } from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
maxHeight?: string | number;
|
|
6
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
7
|
+
hideScrollbar?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
maxHeight = '100%',
|
|
14
|
+
orientation = 'vertical',
|
|
15
|
+
hideScrollbar = false,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
ref
|
|
22
|
+
) => {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
style={{ maxHeight, ...style }}
|
|
27
|
+
className={cn(
|
|
28
|
+
'relative w-full overflow-auto',
|
|
29
|
+
orientation === 'vertical' && 'overflow-y-auto overflow-x-hidden',
|
|
30
|
+
orientation === 'horizontal' && 'overflow-x-auto overflow-y-hidden',
|
|
31
|
+
orientation === 'both' && 'overflow-auto',
|
|
32
|
+
hideScrollbar && '[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden',
|
|
33
|
+
!hideScrollbar && '[scrollbar-width:thin] [scrollbar-color:rgba(150,150,160,0.3)_transparent]',
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
ScrollArea.displayName = 'ScrollArea';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
export const sectionVariants = cva('w-full relative', {
|
|
6
|
+
variants: {
|
|
7
|
+
spacing: {
|
|
8
|
+
none: 'py-0',
|
|
9
|
+
sm: 'py-6 md:py-8',
|
|
10
|
+
md: 'py-12 md:py-16',
|
|
11
|
+
lg: 'py-16 md:py-24',
|
|
12
|
+
xl: 'py-24 md:py-32',
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
default: 'bg-transparent text-[var(--ui-text-primary)]',
|
|
16
|
+
subtle: 'bg-[var(--ui-bg-secondary)] text-[var(--ui-text-primary)]',
|
|
17
|
+
surface: 'bg-[var(--ui-bg-surface)] text-[var(--ui-text-primary)]',
|
|
18
|
+
muted: 'bg-[var(--ui-bg-tertiary)] text-[var(--ui-text-primary)]',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
spacing: 'md',
|
|
23
|
+
variant: 'default',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export interface SectionProps
|
|
28
|
+
extends React.HTMLAttributes<HTMLElement>,
|
|
29
|
+
VariantProps<typeof sectionVariants> {
|
|
30
|
+
as?: React.ElementType;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Section = forwardRef<HTMLElement, SectionProps>(
|
|
34
|
+
({ className, spacing, variant, as: Component = 'section', children, ...props }, ref) => {
|
|
35
|
+
return (
|
|
36
|
+
<Component
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(sectionVariants({ spacing, variant }), className)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</Component>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
Section.displayName = 'Section';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
export interface SpacerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
x?: number | string;
|
|
6
|
+
y?: number | string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Spacer = forwardRef<HTMLDivElement, SpacerProps>(
|
|
10
|
+
({ className, x, y, style, ...props }, ref) => {
|
|
11
|
+
const spacingStyle: React.CSSProperties = {
|
|
12
|
+
...style,
|
|
13
|
+
...(x !== undefined && {
|
|
14
|
+
width: typeof x === 'number' ? `${x * 0.25}rem` : x,
|
|
15
|
+
minWidth: typeof x === 'number' ? `${x * 0.25}rem` : x,
|
|
16
|
+
}),
|
|
17
|
+
...(y !== undefined && {
|
|
18
|
+
height: typeof y === 'number' ? `${y * 0.25}rem` : y,
|
|
19
|
+
minHeight: typeof y === 'number' ? `${y * 0.25}rem` : y,
|
|
20
|
+
}),
|
|
21
|
+
...(x === undefined && y === undefined && {
|
|
22
|
+
flex: '1 1 0%',
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return <div ref={ref} aria-hidden="true" style={spacingStyle} className={cn('pointer-events-none', className)} {...props} />;
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
Spacer.displayName = 'Spacer';
|