@hyunsdev/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/LICENSE +674 -0
- package/README.md +89 -0
- package/SKILL.md +38 -0
- package/dist/WindowContext-DybYtZJa.d.ts +50 -0
- package/dist/_styles-BbTx89aX.d.ts +3 -0
- package/dist/chunk-23KUNTRD.js +49 -0
- package/dist/chunk-23KUNTRD.js.map +1 -0
- package/dist/chunk-3RTSANKB.js +51 -0
- package/dist/chunk-3RTSANKB.js.map +1 -0
- package/dist/chunk-4QIWBOF4.js +129 -0
- package/dist/chunk-4QIWBOF4.js.map +1 -0
- package/dist/chunk-5JCWC7IU.js +293 -0
- package/dist/chunk-5JCWC7IU.js.map +1 -0
- package/dist/chunk-6ANDNGHD.js +33 -0
- package/dist/chunk-6ANDNGHD.js.map +1 -0
- package/dist/chunk-7W7QZHEZ.js +42 -0
- package/dist/chunk-7W7QZHEZ.js.map +1 -0
- package/dist/chunk-BHO4WT2N.js +51 -0
- package/dist/chunk-BHO4WT2N.js.map +1 -0
- package/dist/chunk-BI3KKBIC.js +11 -0
- package/dist/chunk-BI3KKBIC.js.map +1 -0
- package/dist/chunk-D3SP7GL3.js +55 -0
- package/dist/chunk-D3SP7GL3.js.map +1 -0
- package/dist/chunk-D7W4RSQX.js +115 -0
- package/dist/chunk-D7W4RSQX.js.map +1 -0
- package/dist/chunk-DN2AEEA2.js +11 -0
- package/dist/chunk-DN2AEEA2.js.map +1 -0
- package/dist/chunk-ETTKFCO6.js +84 -0
- package/dist/chunk-ETTKFCO6.js.map +1 -0
- package/dist/chunk-GJT7TDBS.js +66 -0
- package/dist/chunk-GJT7TDBS.js.map +1 -0
- package/dist/chunk-HZT6RQYZ.js +109 -0
- package/dist/chunk-HZT6RQYZ.js.map +1 -0
- package/dist/chunk-JB2QZV7K.js +60 -0
- package/dist/chunk-JB2QZV7K.js.map +1 -0
- package/dist/chunk-KJJB2PVC.js +21 -0
- package/dist/chunk-KJJB2PVC.js.map +1 -0
- package/dist/chunk-NE3IVPMO.js +31 -0
- package/dist/chunk-NE3IVPMO.js.map +1 -0
- package/dist/chunk-O2BG2KSY.js +23 -0
- package/dist/chunk-O2BG2KSY.js.map +1 -0
- package/dist/chunk-OUFGNJ3V.js +1726 -0
- package/dist/chunk-OUFGNJ3V.js.map +1 -0
- package/dist/chunk-PLZMCJSL.js +351 -0
- package/dist/chunk-PLZMCJSL.js.map +1 -0
- package/dist/chunk-POG5DZBT.js +104 -0
- package/dist/chunk-POG5DZBT.js.map +1 -0
- package/dist/chunk-SECZM6JE.js +170 -0
- package/dist/chunk-SECZM6JE.js.map +1 -0
- package/dist/chunk-T64WPXSC.js +48 -0
- package/dist/chunk-T64WPXSC.js.map +1 -0
- package/dist/chunk-TU5CYBB4.js +90 -0
- package/dist/chunk-TU5CYBB4.js.map +1 -0
- package/dist/chunk-UVAI2U6X.js +153 -0
- package/dist/chunk-UVAI2U6X.js.map +1 -0
- package/dist/chunk-UXCBLYG6.js +142 -0
- package/dist/chunk-UXCBLYG6.js.map +1 -0
- package/dist/chunk-VUR4MQMH.js +53 -0
- package/dist/chunk-VUR4MQMH.js.map +1 -0
- package/dist/chunk-WIEKNG4S.js +26 -0
- package/dist/chunk-WIEKNG4S.js.map +1 -0
- package/dist/chunk-WIZ4OLOB.js +23 -0
- package/dist/chunk-WIZ4OLOB.js.map +1 -0
- package/dist/chunk-WJRJBMFN.js +21 -0
- package/dist/chunk-WJRJBMFN.js.map +1 -0
- package/dist/chunk-YUPLJP3F.js +33 -0
- package/dist/chunk-YUPLJP3F.js.map +1 -0
- package/dist/chunk-Z7ITPSUF.js +184 -0
- package/dist/chunk-Z7ITPSUF.js.map +1 -0
- package/dist/chunk-ZC76ALSI.js +75 -0
- package/dist/chunk-ZC76ALSI.js.map +1 -0
- package/dist/code-block-core-xkE94Rk5.d.ts +30 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +98 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +26 -0
- package/dist/components/alert-dialog.js +341 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.js +76 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +6 -0
- package/dist/components/aspect-ratio.js +12 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +19 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +11 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +13 -0
- package/dist/components/breadcrumb.js +102 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +15 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.js +11 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +14 -0
- package/dist/components/calendar.js +13 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +13 -0
- package/dist/components/card.js +21 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +32 -0
- package/dist/components/carousel.js +196 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +46 -0
- package/dist/components/chart.js +254 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +6 -0
- package/dist/components/checkbox.js +41 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block-core.d.ts +3 -0
- package/dist/components/code-block-core.js +13 -0
- package/dist/components/code-block-core.js.map +1 -0
- package/dist/components/code-block-custom.d.ts +20 -0
- package/dist/components/code-block-custom.js +16 -0
- package/dist/components/code-block-custom.js.map +1 -0
- package/dist/components/code-block-shiki.d.ts +13 -0
- package/dist/components/code-block-shiki.js +15 -0
- package/dist/components/code-block-shiki.js.map +1 -0
- package/dist/components/code-block.d.ts +5 -0
- package/dist/components/code-block.js +14 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +24 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/collection.d.ts +63 -0
- package/dist/components/collection.js +598 -0
- package/dist/components/collection.js.map +1 -0
- package/dist/components/color-dot.d.ts +19 -0
- package/dist/components/color-dot.js +41 -0
- package/dist/components/color-dot.js.map +1 -0
- package/dist/components/color-picker.d.ts +12 -0
- package/dist/components/color-picker.js +142 -0
- package/dist/components/color-picker.js.map +1 -0
- package/dist/components/combobox.d.ts +74 -0
- package/dist/components/combobox.js +610 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +21 -0
- package/dist/components/command.js +31 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/date-picker.d.ts +43 -0
- package/dist/components/date-picker.js +235 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +25 -0
- package/dist/components/dialog.js +31 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +15 -0
- package/dist/components/drawer.js +124 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +34 -0
- package/dist/components/dropdown-menu.js +248 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +104 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +29 -0
- package/dist/components/field.js +214 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/format-bytes.d.ts +12 -0
- package/dist/components/format-bytes.js +30 -0
- package/dist/components/format-bytes.js.map +1 -0
- package/dist/components/format-number.d.ts +12 -0
- package/dist/components/format-number.js +30 -0
- package/dist/components/format-number.js.map +1 -0
- package/dist/components/gauge.d.ts +11 -0
- package/dist/components/gauge.js +82 -0
- package/dist/components/gauge.js.map +1 -0
- package/dist/components/hover-card.d.ts +8 -0
- package/dist/components/hover-card.js +45 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +24 -0
- package/dist/components/input-group.js +23 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +20 -0
- package/dist/components/input-otp.js +95 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +9 -0
- package/dist/components/input.js +9 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +27 -0
- package/dist/components/item.js +182 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +34 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +9 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.js +127 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/loading-dots.d.ts +5 -0
- package/dist/components/loading-dots.js +45 -0
- package/dist/components/loading-dots.js.map +1 -0
- package/dist/components/main-provider.d.ts +7 -0
- package/dist/components/main-provider.js +12 -0
- package/dist/components/main-provider.js.map +1 -0
- package/dist/components/mark.d.ts +11 -0
- package/dist/components/mark.js +44 -0
- package/dist/components/mark.js.map +1 -0
- package/dist/components/pagination.d.ts +21 -0
- package/dist/components/pagination.js +114 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +12 -0
- package/dist/components/popover.js +22 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/prev-next-navigation.d.ts +15 -0
- package/dist/components/prev-next-navigation.js +85 -0
- package/dist/components/prev-next-navigation.js.map +1 -0
- package/dist/components/progress.d.ts +6 -0
- package/dist/components/progress.js +38 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +7 -0
- package/dist/components/radio-group.js +57 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/relative-time.d.ts +16 -0
- package/dist/components/relative-time.js +75 -0
- package/dist/components/relative-time.js.map +1 -0
- package/dist/components/resizable.d.ts +10 -0
- package/dist/components/resizable.js +45 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +20 -0
- package/dist/components/select.js +189 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.js +25 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/show-more.d.ts +15 -0
- package/dist/components/show-more.js +79 -0
- package/dist/components/show-more.js.map +1 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +8 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +6 -0
- package/dist/components/slider.js +65 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/snippet.d.ts +13 -0
- package/dist/components/snippet.js +135 -0
- package/dist/components/snippet.js.map +1 -0
- package/dist/components/sonner.d.ts +6 -0
- package/dist/components/sonner.js +10 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +5 -0
- package/dist/components/spinner.js +8 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat.d.ts +17 -0
- package/dist/components/stat.js +71 -0
- package/dist/components/stat.js.map +1 -0
- package/dist/components/steps.d.ts +17 -0
- package/dist/components/steps.js +133 -0
- package/dist/components/steps.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +44 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +101 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +14 -0
- package/dist/components/tabs.js +88 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/theme-provider.d.ts +10 -0
- package/dist/components/theme-provider.js +14 -0
- package/dist/components/theme-provider.js.map +1 -0
- package/dist/components/time-picker.d.ts +17 -0
- package/dist/components/time-picker.js +219 -0
- package/dist/components/time-picker.js.map +1 -0
- package/dist/components/timeline.d.ts +17 -0
- package/dist/components/timeline.js +138 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +82 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +12 -0
- package/dist/components/toggle.js +11 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +9 -0
- package/dist/components/tooltip.js +15 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typography.d.ts +17 -0
- package/dist/components/typography.js +91 -0
- package/dist/components/typography.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +7 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-theme.d.ts +3 -0
- package/dist/hooks/use-theme.js +8 -0
- package/dist/hooks/use-theme.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/center/index.d.ts +18 -0
- package/dist/layouts/center/index.js +73 -0
- package/dist/layouts/center/index.js.map +1 -0
- package/dist/layouts/chat/index.d.ts +42 -0
- package/dist/layouts/chat/index.js +191 -0
- package/dist/layouts/chat/index.js.map +1 -0
- package/dist/layouts/command/index.d.ts +2 -0
- package/dist/layouts/command/index.js +1 -0
- package/dist/layouts/command/index.js.map +1 -0
- package/dist/layouts/panel/index.d.ts +55 -0
- package/dist/layouts/panel/index.js +513 -0
- package/dist/layouts/panel/index.js.map +1 -0
- package/dist/layouts/presentation/index.d.ts +14 -0
- package/dist/layouts/presentation/index.js +100 -0
- package/dist/layouts/presentation/index.js.map +1 -0
- package/dist/layouts/site/index.d.ts +17 -0
- package/dist/layouts/site/index.js +82 -0
- package/dist/layouts/site/index.js.map +1 -0
- package/dist/layouts/window/index.d.ts +223 -0
- package/dist/layouts/window/index.js +127 -0
- package/dist/layouts/window/index.js.map +1 -0
- package/dist/layouts/workbench/index.d.ts +281 -0
- package/dist/layouts/workbench/index.js +2457 -0
- package/dist/layouts/workbench/index.js.map +1 -0
- package/dist/lib/format.d.ts +15 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/theme.d.ts +22 -0
- package/dist/lib/theme.js +25 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/fonts.css +1 -0
- package/dist/styles/globals.css +717 -0
- package/dist/styles/tokens.css +693 -0
- package/package.json +137 -0
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @hyunsdev/ui
|
|
2
|
+
|
|
3
|
+
Composable React components, layout primitives, and Tailwind CSS tokens for Hyuns UI.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @hyunsdev/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
React and React DOM are peer dependencies.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pnpm add react react-dom
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Styles
|
|
18
|
+
|
|
19
|
+
For the complete default styling, import the full CSS entry once in your app:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import "@hyunsdev/ui/globals.css"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The full CSS entry assumes a Tailwind CSS v4-compatible pipeline. It imports Tailwind, `tw-animate-css`, shadcn Tailwind CSS, Hyuns UI tokens, base styles, utilities, and Inter.
|
|
26
|
+
|
|
27
|
+
For narrower control, use the split CSS entries:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import "@hyunsdev/ui/tokens.css"
|
|
31
|
+
import "@hyunsdev/ui/fonts.css"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `tokens.css` includes Hyuns UI theme variables and Tailwind `@theme` tokens without base resets, utilities, source scanning, or font loading.
|
|
35
|
+
- `fonts.css` only loads `@fontsource-variable/inter`.
|
|
36
|
+
- `globals.css` imports `fonts.css`, so do not import both unless your bundler deduplicates CSS imports.
|
|
37
|
+
|
|
38
|
+
## Imports
|
|
39
|
+
|
|
40
|
+
Prefer subpath imports in application code. They keep the bundle surface explicit.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Button } from "@hyunsdev/ui/components/button"
|
|
44
|
+
import { ThemeProvider } from "@hyunsdev/ui/components/theme-provider"
|
|
45
|
+
import { Workbench } from "@hyunsdev/ui/layouts/workbench"
|
|
46
|
+
import { cn } from "@hyunsdev/ui/lib/utils"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The root entry is intentionally small and only exposes the most common provider/theme/button APIs.
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Button, MainProvider, ThemeProvider } from "@hyunsdev/ui"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Code Blocks
|
|
56
|
+
|
|
57
|
+
Code highlighting has multiple entries so services can choose the right bundle cost.
|
|
58
|
+
|
|
59
|
+
Use the compatibility entry when you want the default Shiki bundle:
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { CodeBlock } from "@hyunsdev/ui/components/code-block"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the explicit Shiki entry for new code that accepts the default bundled languages and themes:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { CodeBlock } from "@hyunsdev/ui/components/code-block-shiki"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use the core entry when you want to provide your own highlighter and avoid the default Shiki language bundle:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { CodeBlock } from "@hyunsdev/ui/components/code-block-core"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Build Checks
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
pnpm --filter @hyunsdev/ui check
|
|
81
|
+
pnpm --filter @hyunsdev/ui smoke:consumer
|
|
82
|
+
pnpm --filter @hyunsdev/ui pack:dry-run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For the full repository publish gate, run:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
pnpm quality:publish
|
|
89
|
+
```
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Hyuns UI Usage Skill
|
|
2
|
+
|
|
3
|
+
Use this skill when adding or reviewing UI code that imports `@hyunsdev/ui`.
|
|
4
|
+
|
|
5
|
+
## Import Rules
|
|
6
|
+
|
|
7
|
+
- Prefer subpath imports such as `@hyunsdev/ui/components/button`, `@hyunsdev/ui/layouts/workbench`, and `@hyunsdev/ui/lib/utils`.
|
|
8
|
+
- Use the root `@hyunsdev/ui` entry only for its intentionally small provider/theme/button surface.
|
|
9
|
+
- Do not import from `@hyunsdev/ui/dist/*` or `@hyunsdev/ui/src/*`.
|
|
10
|
+
- Do not import from the `radix-ui` meta package in this repository. Use scoped Radix packages such as `@radix-ui/react-slot` and `@radix-ui/react-dialog`.
|
|
11
|
+
|
|
12
|
+
## CSS Rules
|
|
13
|
+
|
|
14
|
+
- Import `@hyunsdev/ui/globals.css` once for the complete default Tailwind v4 styling.
|
|
15
|
+
- Import `@hyunsdev/ui/tokens.css` when an app only needs Hyuns UI theme variables and Tailwind theme tokens.
|
|
16
|
+
- Import `@hyunsdev/ui/fonts.css` only when the app wants the bundled Inter font source.
|
|
17
|
+
- Avoid importing both `globals.css` and `fonts.css` unless the consumer build deduplicates CSS.
|
|
18
|
+
|
|
19
|
+
## Code Block Rules
|
|
20
|
+
|
|
21
|
+
- Use `@hyunsdev/ui/components/code-block-shiki` when the default Shiki bundle is acceptable.
|
|
22
|
+
- Use `@hyunsdev/ui/components/code-block-core` when a service should provide its own highlighter.
|
|
23
|
+
- Keep `@hyunsdev/ui/components/code-block` as the compatibility path for existing code.
|
|
24
|
+
|
|
25
|
+
## Verification
|
|
26
|
+
|
|
27
|
+
Run these checks before publishing or after changing package exports:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
pnpm --filter @hyunsdev/ui check
|
|
31
|
+
pnpm --filter @hyunsdev/ui build
|
|
32
|
+
pnpm --filter @hyunsdev/ui smoke:consumer
|
|
33
|
+
pnpm --filter @hyunsdev/ui pack:dry-run
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Use `smoke:consumer` for export-map and bundle-composition changes. It verifies
|
|
37
|
+
consumer imports, rejects the removed `@hyunsdev/ui/playground` export, and
|
|
38
|
+
checks that Shiki stays isolated from normal component bundles.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Button } from './components/button.js';
|
|
4
|
+
|
|
5
|
+
type WindowSize = "default" | "content" | {
|
|
6
|
+
height?: React.CSSProperties["height"];
|
|
7
|
+
maxHeight?: React.CSSProperties["maxHeight"];
|
|
8
|
+
maxWidth?: React.CSSProperties["maxWidth"];
|
|
9
|
+
minHeight?: React.CSSProperties["minHeight"];
|
|
10
|
+
minWidth?: React.CSSProperties["minWidth"];
|
|
11
|
+
width?: React.CSSProperties["width"];
|
|
12
|
+
};
|
|
13
|
+
type WindowProps = {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
forceMount?: boolean;
|
|
17
|
+
showCloseButton?: boolean;
|
|
18
|
+
size?: WindowSize;
|
|
19
|
+
};
|
|
20
|
+
type WindowCloseButtonProps = Omit<React.ComponentProps<typeof Button>, "asChild" | "children">;
|
|
21
|
+
declare function WindowCloseButton({ className, onClick, type, ...props }: WindowCloseButtonProps): React.JSX.Element;
|
|
22
|
+
declare function WindowLayout({ children, className, forceMount: forceMountProp, showCloseButton, size, }: WindowProps): React.JSX.Element;
|
|
23
|
+
declare function useWindowSizeRequest(size: WindowSize | undefined): void;
|
|
24
|
+
|
|
25
|
+
type WindowCloseReason = "close-button" | "escape-key" | "outside-click" | "programmatic" | "window-switch";
|
|
26
|
+
type WindowProviderProps = {
|
|
27
|
+
children: React__default.ReactNode;
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
onCloseRequest?: ((reason: WindowCloseReason) => boolean | Promise<boolean>) | undefined;
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
open?: boolean;
|
|
32
|
+
};
|
|
33
|
+
type WindowContextValue = {
|
|
34
|
+
blockedInteractionCount: number;
|
|
35
|
+
forceClose: () => void;
|
|
36
|
+
isOpen: boolean;
|
|
37
|
+
open: () => void;
|
|
38
|
+
close: (reason: WindowCloseReason) => Promise<boolean>;
|
|
39
|
+
indicateBlockedInteraction: () => void;
|
|
40
|
+
toggle: () => void;
|
|
41
|
+
};
|
|
42
|
+
declare const WindowStateContext: React__default.Context<WindowContextValue | null>;
|
|
43
|
+
declare function WindowStateProvider({ children, value, }: {
|
|
44
|
+
children: React__default.ReactNode;
|
|
45
|
+
value: WindowContextValue;
|
|
46
|
+
}): React__default.JSX.Element;
|
|
47
|
+
declare function useWindow(): WindowContextValue;
|
|
48
|
+
declare function WindowProvider({ children, defaultOpen, onCloseRequest, onOpenChange, open, }: WindowProviderProps): React__default.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { WindowLayout as W, WindowProvider as a, type WindowContextValue as b, type WindowSize as c, type WindowCloseReason as d, WindowCloseButton as e, type WindowCloseButtonProps as f, type WindowProps as g, type WindowProviderProps as h, WindowStateContext as i, WindowStateProvider as j, useWindowSizeRequest as k, useWindow as u };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTheme
|
|
3
|
+
} from "./chunk-UXCBLYG6.js";
|
|
4
|
+
|
|
5
|
+
// src/components/sonner.tsx
|
|
6
|
+
import {
|
|
7
|
+
CircleCheckIcon,
|
|
8
|
+
InfoIcon,
|
|
9
|
+
TriangleAlertIcon,
|
|
10
|
+
OctagonXIcon,
|
|
11
|
+
Loader2Icon
|
|
12
|
+
} from "lucide-react";
|
|
13
|
+
import { Toaster as Sonner } from "sonner";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var Toaster = ({ ...props }) => {
|
|
16
|
+
const { resolvedTheme } = useTheme();
|
|
17
|
+
const toasterStyle = {
|
|
18
|
+
"--normal-bg": "var(--color-floating-background)",
|
|
19
|
+
"--normal-text": "var(--color-floating-text)",
|
|
20
|
+
"--normal-border": "var(--color-floating-border)",
|
|
21
|
+
"--border-radius": "var(--radius-floating)"
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
Sonner,
|
|
25
|
+
{
|
|
26
|
+
theme: resolvedTheme,
|
|
27
|
+
className: "toaster group",
|
|
28
|
+
icons: {
|
|
29
|
+
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
30
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
31
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
32
|
+
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
33
|
+
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
|
|
34
|
+
},
|
|
35
|
+
style: toasterStyle,
|
|
36
|
+
toastOptions: {
|
|
37
|
+
classNames: {
|
|
38
|
+
toast: "cn-toast"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Toaster
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=chunk-23KUNTRD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/sonner.tsx"],"sourcesContent":["\"use client\"\n\nimport type * as React from \"react\"\n\nimport {\n CircleCheckIcon,\n InfoIcon,\n TriangleAlertIcon,\n OctagonXIcon,\n Loader2Icon,\n} from \"lucide-react\"\nimport { Toaster as Sonner, type ToasterProps } from \"sonner\"\n\nimport { useTheme } from \"./theme-provider\"\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { resolvedTheme } = useTheme()\n const toasterStyle = {\n \"--normal-bg\": \"var(--color-floating-background)\",\n \"--normal-text\": \"var(--color-floating-text)\",\n \"--normal-border\": \"var(--color-floating-border)\",\n \"--border-radius\": \"var(--radius-floating)\",\n } satisfies React.CSSProperties & {\n readonly \"--normal-bg\": string\n readonly \"--normal-text\": string\n readonly \"--normal-border\": string\n readonly \"--border-radius\": string\n }\n\n return (\n <Sonner\n theme={resolvedTheme}\n className=\"toaster group\"\n icons={{\n success: <CircleCheckIcon className=\"size-4\" />,\n info: <InfoIcon className=\"size-4\" />,\n warning: <TriangleAlertIcon className=\"size-4\" />,\n error: <OctagonXIcon className=\"size-4\" />,\n loading: <Loader2Icon className=\"size-4 animate-spin\" />,\n }}\n style={toasterStyle}\n toastOptions={{\n classNames: {\n toast: \"cn-toast\",\n },\n }}\n {...props}\n />\n )\n}\n\nexport { Toaster }\n"],"mappings":";;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,cAAiC;AAuBpC;AAnBjB,IAAM,UAAU,CAAC,EAAE,GAAG,MAAM,MAAoB;AAC9C,QAAM,EAAE,cAAc,IAAI,SAAS;AACnC,QAAM,eAAe;AAAA,IACnB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,EACrB;AAOA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,WAAU;AAAA,MACV,OAAO;AAAA,QACL,SAAS,oBAAC,mBAAgB,WAAU,UAAS;AAAA,QAC7C,MAAM,oBAAC,YAAS,WAAU,UAAS;AAAA,QACnC,SAAS,oBAAC,qBAAkB,WAAU,UAAS;AAAA,QAC/C,OAAO,oBAAC,gBAAa,WAAU,UAAS;AAAA,QACxC,SAAS,oBAAC,eAAY,WAAU,uBAAsB;AAAA,MACxD;AAAA,MACA,OAAO;AAAA,MACP,cAAc;AAAA,QACZ,YAAY;AAAA,UACV,OAAO;AAAA,QACT;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/lib/theme.ts
|
|
2
|
+
var ACCENT_PRESETS = [
|
|
3
|
+
"default",
|
|
4
|
+
"blue",
|
|
5
|
+
"green",
|
|
6
|
+
"yellow",
|
|
7
|
+
"pink",
|
|
8
|
+
"orange",
|
|
9
|
+
"purple"
|
|
10
|
+
];
|
|
11
|
+
var DEFAULT_ACCENT_PRESET = "default";
|
|
12
|
+
var THEME_STORAGE_KEY = "theme";
|
|
13
|
+
var ACCENT_PRESET_STORAGE_KEY = "accent-preset";
|
|
14
|
+
function isThemeMode(value) {
|
|
15
|
+
return value === "light" || value === "dark" || value === "system";
|
|
16
|
+
}
|
|
17
|
+
function isAccentPreset(value) {
|
|
18
|
+
return typeof value === "string" && ACCENT_PRESETS.some((preset) => preset === value);
|
|
19
|
+
}
|
|
20
|
+
function normalizeStoredTheme(value) {
|
|
21
|
+
if (value === "auto") {
|
|
22
|
+
return "system";
|
|
23
|
+
}
|
|
24
|
+
return isThemeMode(value) ? value : null;
|
|
25
|
+
}
|
|
26
|
+
function normalizeStoredAccentPreset(value) {
|
|
27
|
+
return isAccentPreset(value) ? value : null;
|
|
28
|
+
}
|
|
29
|
+
function resolveThemeMode(theme, prefersDark) {
|
|
30
|
+
if (theme === "system") {
|
|
31
|
+
return prefersDark ? "dark" : "light";
|
|
32
|
+
}
|
|
33
|
+
return theme;
|
|
34
|
+
}
|
|
35
|
+
function getThemeInitScript(defaultTheme = "system") {
|
|
36
|
+
return `(function(){try{var fallback=${JSON.stringify(defaultTheme)};var defaultAccent=${JSON.stringify(DEFAULT_ACCENT_PRESET)};var allowedAccents=${JSON.stringify(ACCENT_PRESETS)};var stored=window.localStorage.getItem(${JSON.stringify(THEME_STORAGE_KEY)});var accentStored=window.localStorage.getItem(${JSON.stringify(ACCENT_PRESET_STORAGE_KEY)});var mode=stored==='light'||stored==='dark'||stored==='system'?stored:(stored==='auto'?'system':fallback);var normalizedAccent=accentStored==='black'?'default':accentStored;var accent=allowedAccents.includes(normalizedAccent)?normalizedAccent:defaultAccent;var prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;var resolved=mode==='system'?(prefersDark?'dark':'light'):mode;var root=document.documentElement;root.setAttribute('data-accent',accent);root.classList.remove('light','dark');root.classList.add(resolved);if(mode==='system'){root.removeAttribute('data-theme')}else{root.setAttribute('data-theme',mode)}root.style.colorScheme=resolved;}catch(error){console.error(error)}})();`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
ACCENT_PRESETS,
|
|
41
|
+
DEFAULT_ACCENT_PRESET,
|
|
42
|
+
THEME_STORAGE_KEY,
|
|
43
|
+
ACCENT_PRESET_STORAGE_KEY,
|
|
44
|
+
isThemeMode,
|
|
45
|
+
isAccentPreset,
|
|
46
|
+
normalizeStoredTheme,
|
|
47
|
+
normalizeStoredAccentPreset,
|
|
48
|
+
resolveThemeMode,
|
|
49
|
+
getThemeInitScript
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-3RTSANKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/theme.ts"],"sourcesContent":["export type ThemeMode = \"light\" | \"dark\" | \"system\"\nexport type ResolvedTheme = Exclude<ThemeMode, \"system\">\nexport const ACCENT_PRESETS = [\n \"default\",\n \"blue\",\n \"green\",\n \"yellow\",\n \"pink\",\n \"orange\",\n \"purple\",\n] as const\nexport type AccentPreset = (typeof ACCENT_PRESETS)[number]\n\nexport interface ThemeContextValue {\n theme: ThemeMode\n resolvedTheme: ResolvedTheme\n accentPreset: AccentPreset\n setTheme: (theme: ThemeMode) => void\n setAccentPreset: (accentPreset: AccentPreset) => void\n}\n\nexport const DEFAULT_ACCENT_PRESET: AccentPreset = \"default\"\nexport const THEME_STORAGE_KEY = \"theme\"\nexport const ACCENT_PRESET_STORAGE_KEY = \"accent-preset\"\n\nexport function isThemeMode(value: string | null | undefined): value is ThemeMode {\n return value === \"light\" || value === \"dark\" || value === \"system\"\n}\n\nexport function isAccentPreset(value: string | null | undefined): value is AccentPreset {\n return typeof value === \"string\" && ACCENT_PRESETS.some((preset) => preset === value)\n}\n\nexport function normalizeStoredTheme(value: string | null | undefined): ThemeMode | null {\n if (value === \"auto\") {\n return \"system\"\n }\n\n return isThemeMode(value) ? value : null\n}\n\nexport function normalizeStoredAccentPreset(value: string | null | undefined): AccentPreset | null {\n return isAccentPreset(value) ? value : null\n}\n\nexport function resolveThemeMode(theme: ThemeMode, prefersDark: boolean): ResolvedTheme {\n if (theme === \"system\") {\n return prefersDark ? \"dark\" : \"light\"\n }\n\n return theme\n}\n\nexport function getThemeInitScript(defaultTheme: ThemeMode = \"system\") {\n return `(function(){try{var fallback=${JSON.stringify(defaultTheme)};var defaultAccent=${JSON.stringify(DEFAULT_ACCENT_PRESET)};var allowedAccents=${JSON.stringify(ACCENT_PRESETS)};var stored=window.localStorage.getItem(${JSON.stringify(THEME_STORAGE_KEY)});var accentStored=window.localStorage.getItem(${JSON.stringify(ACCENT_PRESET_STORAGE_KEY)});var mode=stored==='light'||stored==='dark'||stored==='system'?stored:(stored==='auto'?'system':fallback);var normalizedAccent=accentStored==='black'?'default':accentStored;var accent=allowedAccents.includes(normalizedAccent)?normalizedAccent:defaultAccent;var prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;var resolved=mode==='system'?(prefersDark?'dark':'light'):mode;var root=document.documentElement;root.setAttribute('data-accent',accent);root.classList.remove('light','dark');root.classList.add(resolved);if(mode==='system'){root.removeAttribute('data-theme')}else{root.setAttribute('data-theme',mode)}root.style.colorScheme=resolved;}catch(error){console.error(error)}})();`\n}\n"],"mappings":";AAEO,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAWO,IAAM,wBAAsC;AAC5C,IAAM,oBAAoB;AAC1B,IAAM,4BAA4B;AAElC,SAAS,YAAY,OAAsD;AAChF,SAAO,UAAU,WAAW,UAAU,UAAU,UAAU;AAC5D;AAEO,SAAS,eAAe,OAAyD;AACtF,SAAO,OAAO,UAAU,YAAY,eAAe,KAAK,CAAC,WAAW,WAAW,KAAK;AACtF;AAEO,SAAS,qBAAqB,OAAoD;AACvF,MAAI,UAAU,QAAQ;AACpB,WAAO;AAAA,EACT;AAEA,SAAO,YAAY,KAAK,IAAI,QAAQ;AACtC;AAEO,SAAS,4BAA4B,OAAuD;AACjG,SAAO,eAAe,KAAK,IAAI,QAAQ;AACzC;AAEO,SAAS,iBAAiB,OAAkB,aAAqC;AACtF,MAAI,UAAU,UAAU;AACtB,WAAO,cAAc,SAAS;AAAA,EAChC;AAEA,SAAO;AACT;AAEO,SAAS,mBAAmB,eAA0B,UAAU;AACrE,SAAO,gCAAgC,KAAK,UAAU,YAAY,CAAC,sBAAsB,KAAK,UAAU,qBAAqB,CAAC,uBAAuB,KAAK,UAAU,cAAc,CAAC,2CAA2C,KAAK,UAAU,iBAAiB,CAAC,kDAAkD,KAAK,UAAU,yBAAyB,CAAC;AAC5V;","names":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-TU5CYBB4.js";
|
|
4
|
+
import {
|
|
5
|
+
overlayScrimClass
|
|
6
|
+
} from "./chunk-O2BG2KSY.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-DN2AEEA2.js";
|
|
10
|
+
|
|
11
|
+
// src/components/sheet.tsx
|
|
12
|
+
import "react";
|
|
13
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
14
|
+
import { XIcon } from "lucide-react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function Sheet({ ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
18
|
+
}
|
|
19
|
+
function SheetTrigger({ ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
21
|
+
}
|
|
22
|
+
function SheetClose({ ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
24
|
+
}
|
|
25
|
+
function SheetPortal({ ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
27
|
+
}
|
|
28
|
+
function SheetOverlay({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
SheetPrimitive.Overlay,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "sheet-overlay",
|
|
36
|
+
className: cn(
|
|
37
|
+
"data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 z-[var(--layer-dialog)] duration-150",
|
|
38
|
+
overlayScrimClass,
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function SheetContent({
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
side = "right",
|
|
49
|
+
showCloseButton = true,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
54
|
+
/* @__PURE__ */ jsxs(
|
|
55
|
+
SheetPrimitive.Content,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "sheet-content",
|
|
58
|
+
"data-side": side,
|
|
59
|
+
className: cn(
|
|
60
|
+
"border-dialog-border bg-dialog-background text-dialog-text shadow-dialog data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 fixed z-[var(--layer-dialog)] flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:rounded-t-[var(--radius-dialog)] data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:rounded-r-[var(--radius-dialog)] data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:rounded-l-[var(--radius-dialog)] data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:rounded-b-[var(--radius-dialog)] data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...props,
|
|
64
|
+
children: [
|
|
65
|
+
children,
|
|
66
|
+
showCloseButton && /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", className: "absolute top-3 right-3", size: "icon-sm", children: [
|
|
67
|
+
/* @__PURE__ */ jsx(XIcon, {}),
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
69
|
+
] }) })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
function SheetHeader({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "sheet-header",
|
|
80
|
+
className: cn("flex flex-col gap-0.5 p-4", className),
|
|
81
|
+
...props
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function SheetFooter({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "sheet-footer",
|
|
90
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function SheetTitle({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
SheetPrimitive.Title,
|
|
98
|
+
{
|
|
99
|
+
"data-slot": "sheet-title",
|
|
100
|
+
className: cn("font-heading text-dialog-text text-base font-medium", className),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function SheetDescription({
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
SheetPrimitive.Description,
|
|
111
|
+
{
|
|
112
|
+
"data-slot": "sheet-description",
|
|
113
|
+
className: cn("text-text-muted text-sm", className),
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
Sheet,
|
|
121
|
+
SheetTrigger,
|
|
122
|
+
SheetClose,
|
|
123
|
+
SheetContent,
|
|
124
|
+
SheetHeader,
|
|
125
|
+
SheetFooter,
|
|
126
|
+
SheetTitle,
|
|
127
|
+
SheetDescription
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=chunk-4QIWBOF4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/sheet.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { Button } from \"@hyunsdev/ui/components/button\"\nimport { cn } from \"@hyunsdev/ui/lib/utils\"\n\nimport { overlayScrimClass } from \"./_styles\"\n\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 z-[var(--layer-dialog)] duration-150\",\n overlayScrimClass,\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"border-dialog-border bg-dialog-background text-dialog-text shadow-dialog data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 fixed z-[var(--layer-dialog)] flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:rounded-t-[var(--radius-dialog)] data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:rounded-r-[var(--radius-dialog)] data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:rounded-l-[var(--radius-dialog)] data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:rounded-b-[var(--radius-dialog)] data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\">\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-0.5 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"font-heading text-dialog-text text-base font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-text-muted text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"],"mappings":";;;;;;;;;;;AAEA,OAAuB;AAEvB,YAAY,oBAAoB;AAChC,SAAS,aAAa;AAQb,cAyDG,YAzDH;AADT,SAAS,MAAM,EAAE,GAAG,MAAM,GAAqD;AAC7E,SAAO,oBAAgB,qBAAf,EAAoB,aAAU,SAAS,GAAG,OAAO;AAC3D;AAEA,SAAS,aAAa,EAAE,GAAG,MAAM,GAAwD;AACvF,SAAO,oBAAgB,wBAAf,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;AAEA,SAAS,WAAW,EAAE,GAAG,MAAM,GAAsD;AACnF,SAAO,oBAAgB,sBAAf,EAAqB,aAAU,eAAe,GAAG,OAAO;AAClE;AAEA,SAAS,YAAY,EAAE,GAAG,MAAM,GAAuD;AACrF,SAAO,oBAAgB,uBAAf,EAAsB,aAAU,gBAAgB,GAAG,OAAO;AACpE;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,GAAG;AACL,GAGG;AACD,SACE,qBAAC,eACC;AAAA,wBAAC,gBAAa;AAAA,IACd;AAAA,MAAgB;AAAA,MAAf;AAAA,QACC,aAAU;AAAA,QACV,aAAW;AAAA,QACX,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,mBACC,oBAAgB,sBAAf,EAAqB,aAAU,eAAc,SAAO,MACnD,+BAAC,UAAO,SAAQ,SAAQ,WAAU,0BAAyB,MAAK,WAC9D;AAAA,gCAAC,SAAM;AAAA,YACP,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA,aACjC,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAsD;AAC9F,SACE;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,uDAAuD,SAAS;AAAA,MAC7E,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,2BAA2B,SAAS;AAAA,MACjD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|