@cascivo/react 0.3.4 → 0.3.7
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 +12 -9
- package/dist/accordion/accordion.css +1 -0
- package/dist/accordion/accordion.js +95 -0
- package/dist/accordion/accordion.module.js +14 -0
- package/dist/action-sheet/action-sheet.css +1 -0
- package/dist/action-sheet/action-sheet.js +91 -0
- package/dist/action-sheet/action-sheet.module.js +15 -0
- package/dist/alert/alert.css +1 -0
- package/dist/alert/alert.js +55 -0
- package/dist/alert/alert.module.js +14 -0
- package/dist/alert-dialog/alert-dialog.css +1 -0
- package/dist/alert-dialog/alert-dialog.js +68 -0
- package/dist/alert-dialog/alert-dialog.module.js +14 -0
- package/dist/app-shell/app-shell.css +1 -0
- package/dist/app-shell/app-shell.js +80 -0
- package/dist/app-shell/app-shell.module.js +15 -0
- package/dist/aspect-ratio/aspect-ratio.css +1 -0
- package/dist/aspect-ratio/aspect-ratio.js +22 -0
- package/dist/aspect-ratio/aspect-ratio.module.js +9 -0
- package/dist/avatar/avatar.css +1 -0
- package/dist/avatar/avatar.js +45 -0
- package/dist/avatar/avatar.module.js +11 -0
- package/dist/avatar-group/avatar-group.css +1 -0
- package/dist/avatar-group/avatar-group.js +26 -0
- package/dist/avatar-group/avatar-group.module.js +9 -0
- package/dist/badge/badge.css +1 -0
- package/dist/badge/badge.js +17 -0
- package/dist/badge/badge.module.js +6 -0
- package/dist/blockquote/blockquote.css +1 -0
- package/dist/blockquote/blockquote.js +18 -0
- package/dist/blockquote/blockquote.module.js +9 -0
- package/dist/bottom-sheet/bottom-sheet.css +1 -0
- package/dist/bottom-sheet/bottom-sheet.js +111 -0
- package/dist/bottom-sheet/bottom-sheet.module.js +17 -0
- package/dist/breadcrumb/breadcrumb.css +1 -0
- package/dist/breadcrumb/breadcrumb.js +28 -0
- package/dist/breadcrumb/breadcrumb.module.js +6 -0
- package/dist/button/button.css +1 -0
- package/dist/button/button.js +31 -0
- package/dist/button/button.module.js +6 -0
- package/dist/button-group/button-group.css +1 -0
- package/dist/button-group/button-group.js +39 -0
- package/dist/button-group/button-group.module.js +6 -0
- package/dist/calendar/calendar.css +1 -0
- package/dist/calendar/calendar.js +195 -0
- package/dist/calendar/calendar.module.js +17 -0
- package/dist/card/card.css +1 -0
- package/dist/card/card.js +45 -0
- package/dist/card/card.module.js +12 -0
- package/dist/carousel/carousel.css +1 -0
- package/dist/carousel/carousel.js +138 -0
- package/dist/carousel/carousel.module.js +16 -0
- package/dist/chat-bubble/chat-bubble.css +1 -0
- package/dist/chat-bubble/chat-bubble.js +33 -0
- package/dist/chat-bubble/chat-bubble.module.js +14 -0
- package/dist/checkbox/checkbox.css +1 -0
- package/dist/checkbox/checkbox.js +38 -0
- package/dist/checkbox/checkbox.module.js +11 -0
- package/dist/checkbox-card/checkbox-card.css +1 -0
- package/dist/checkbox-card/checkbox-card.js +48 -0
- package/dist/checkbox-card/checkbox-card.module.js +14 -0
- package/dist/code/code.css +1 -0
- package/dist/code/code.js +16 -0
- package/dist/code/code.module.js +6 -0
- package/dist/code-snippet/code-snippet.css +1 -0
- package/dist/code-snippet/code-snippet.js +116 -0
- package/dist/code-snippet/code-snippet.module.js +20 -0
- package/dist/code-snippet/highlight.js +69 -0
- package/dist/collapsible/collapsible.css +1 -0
- package/dist/collapsible/collapsible.js +42 -0
- package/dist/collapsible/collapsible.module.js +11 -0
- package/dist/color-picker/color-picker.css +1 -0
- package/dist/color-picker/color-picker.js +268 -0
- package/dist/color-picker/color-picker.module.js +21 -0
- package/dist/combobox/combobox.css +1 -0
- package/dist/combobox/combobox.js +164 -0
- package/dist/combobox/combobox.module.js +22 -0
- package/dist/command-menu/command-menu.css +1 -0
- package/dist/command-menu/command-menu.js +263 -0
- package/dist/command-menu/command-menu.module.js +22 -0
- package/dist/comparison/comparison.css +1 -0
- package/dist/comparison/comparison.js +69 -0
- package/dist/comparison/comparison.module.js +12 -0
- package/dist/contained-list/contained-list.css +1 -0
- package/dist/contained-list/contained-list.js +41 -0
- package/dist/contained-list/contained-list.module.js +14 -0
- package/dist/context-menu/context-menu.css +1 -0
- package/dist/context-menu/context-menu.js +60 -0
- package/dist/context-menu/context-menu.module.js +10 -0
- package/dist/copy-button/copy-button.css +1 -0
- package/dist/copy-button/copy-button.js +58 -0
- package/dist/copy-button/copy-button.module.js +9 -0
- package/dist/data-list/data-list.css +1 -0
- package/dist/data-list/data-list.js +27 -0
- package/dist/data-list/data-list.module.js +11 -0
- package/dist/data-table/data-table.css +1 -0
- package/dist/data-table/data-table.js +368 -0
- package/dist/data-table/data-table.module.js +36 -0
- package/dist/date-picker/date-picker.css +1 -0
- package/dist/date-picker/date-picker.js +218 -0
- package/dist/date-picker/date-picker.module.js +26 -0
- package/dist/date-range-picker/date-range-picker.css +1 -0
- package/dist/date-range-picker/date-range-picker.js +195 -0
- package/dist/date-range-picker/date-range-picker.module.js +21 -0
- package/dist/dock/dock.css +1 -0
- package/dist/dock/dock.js +32 -0
- package/dist/dock/dock.module.js +11 -0
- package/dist/drawer/drawer.css +1 -0
- package/dist/drawer/drawer.js +95 -0
- package/dist/drawer/drawer.module.js +16 -0
- package/dist/dropdown/dropdown.css +1 -0
- package/dist/dropdown/dropdown.js +109 -0
- package/dist/dropdown/dropdown.module.js +12 -0
- package/dist/editable/editable.css +1 -0
- package/dist/editable/editable.js +67 -0
- package/dist/editable/editable.module.js +14 -0
- package/dist/empty-state/empty-state.css +1 -0
- package/dist/empty-state/empty-state.js +34 -0
- package/dist/empty-state/empty-state.module.js +12 -0
- package/dist/fab/fab.css +1 -0
- package/dist/fab/fab.js +93 -0
- package/dist/fab/fab.module.js +15 -0
- package/dist/field/field.css +1 -0
- package/dist/field/field.js +39 -0
- package/dist/field/field.module.js +10 -0
- package/dist/file-uploader/file-uploader.css +1 -0
- package/dist/file-uploader/file-uploader.js +122 -0
- package/dist/file-uploader/file-uploader.module.js +21 -0
- package/dist/filter/filter.css +1 -0
- package/dist/filter/filter.js +34 -0
- package/dist/filter/filter.module.js +9 -0
- package/dist/form/form.css +1 -0
- package/dist/form/form.js +88 -0
- package/dist/form/form.module.js +6 -0
- package/dist/header/header.css +1 -0
- package/dist/header/header.js +44 -0
- package/dist/header/header.module.js +14 -0
- package/dist/header-panel/header-panel.css +1 -0
- package/dist/header-panel/header-panel.js +74 -0
- package/dist/header-panel/header-panel.module.js +12 -0
- package/dist/heading/heading.css +1 -0
- package/dist/heading/heading.js +24 -0
- package/dist/heading/heading.module.js +6 -0
- package/dist/hover-card/hover-card.css +1 -0
- package/dist/hover-card/hover-card.js +84 -0
- package/dist/hover-card/hover-card.module.js +9 -0
- package/dist/icon-button/icon-button.css +1 -0
- package/dist/icon-button/icon-button.js +21 -0
- package/dist/icon-button/icon-button.module.js +6 -0
- package/dist/image/image.css +1 -0
- package/dist/image/image.js +64 -0
- package/dist/image/image.module.js +12 -0
- package/dist/indicator/indicator.css +1 -0
- package/dist/indicator/indicator.js +18 -0
- package/dist/indicator/indicator.module.js +9 -0
- package/dist/inline-loading/inline-loading.css +1 -0
- package/dist/inline-loading/inline-loading.js +76 -0
- package/dist/inline-loading/inline-loading.module.js +12 -0
- package/dist/input/input.css +1 -0
- package/dist/input/input.js +54 -0
- package/dist/input/input.module.js +12 -0
- package/dist/input-group/input-group.css +1 -0
- package/dist/input-group/input-group.js +41 -0
- package/dist/input-group/input-group.module.js +12 -0
- package/dist/item/item.css +1 -0
- package/dist/item/item.js +52 -0
- package/dist/item/item.module.js +13 -0
- package/dist/join/join.css +1 -0
- package/dist/join/join.js +14 -0
- package/dist/join/join.module.js +6 -0
- package/dist/kbd/kbd.css +1 -0
- package/dist/kbd/kbd.js +16 -0
- package/dist/kbd/kbd.module.js +6 -0
- package/dist/label/label.css +1 -0
- package/dist/label/label.js +25 -0
- package/dist/label/label.module.js +10 -0
- package/dist/link/link.css +1 -0
- package/dist/link/link.js +22 -0
- package/dist/link/link.module.js +6 -0
- package/dist/list/list.css +1 -0
- package/dist/list/list.js +23 -0
- package/dist/list/list.module.js +9 -0
- package/dist/menu/menu.css +1 -0
- package/dist/menu/menu.js +96 -0
- package/dist/menu/menu.module.js +11 -0
- package/dist/menu-button/menu-button.css +1 -0
- package/dist/menu-button/menu-button.js +92 -0
- package/dist/menu-button/menu-button.module.js +11 -0
- package/dist/menubar/menubar.css +1 -0
- package/dist/menubar/menubar.js +103 -0
- package/dist/menubar/menubar.module.js +11 -0
- package/dist/modal/modal.css +1 -0
- package/dist/modal/modal.js +73 -0
- package/dist/modal/modal.module.js +14 -0
- package/dist/multi-select/multi-select.css +1 -0
- package/dist/multi-select/multi-select.js +105 -0
- package/dist/multi-select/multi-select.module.js +18 -0
- package/dist/native-select/native-select.css +1 -0
- package/dist/native-select/native-select.js +37 -0
- package/dist/native-select/native-select.module.js +10 -0
- package/dist/navigation-menu/navigation-menu.css +1 -0
- package/dist/navigation-menu/navigation-menu.js +95 -0
- package/dist/navigation-menu/navigation-menu.module.js +13 -0
- package/dist/notification/notification.css +1 -0
- package/dist/notification/notification.js +134 -0
- package/dist/notification/notification.module.js +14 -0
- package/dist/number-input/number-input.css +1 -0
- package/dist/number-input/number-input.js +145 -0
- package/dist/number-input/number-input.module.js +15 -0
- package/dist/otp-input/otp-input.css +1 -0
- package/dist/otp-input/otp-input.js +70 -0
- package/dist/otp-input/otp-input.module.js +9 -0
- package/dist/overflow-menu/overflow-menu.css +1 -0
- package/dist/overflow-menu/overflow-menu.js +65 -0
- package/dist/overflow-menu/overflow-menu.module.js +10 -0
- package/dist/pagination/pagination.css +1 -0
- package/dist/pagination/pagination.js +92 -0
- package/dist/pagination/pagination.module.js +14 -0
- package/dist/password-input/password-input.css +1 -0
- package/dist/password-input/password-input.js +76 -0
- package/dist/password-input/password-input.module.js +14 -0
- package/dist/popover/popover.css +1 -0
- package/dist/popover/popover.js +49 -0
- package/dist/popover/popover.module.js +9 -0
- package/dist/popover/use-popover.js +57 -0
- package/dist/progress/progress.css +1 -0
- package/dist/progress/progress.js +17 -0
- package/dist/progress/progress.module.js +9 -0
- package/dist/progress-bar/progress-bar.css +1 -0
- package/dist/progress-bar/progress-bar.js +44 -0
- package/dist/progress-bar/progress-bar.module.js +14 -0
- package/dist/progress-circle/progress-circle.css +1 -0
- package/dist/progress-circle/progress-circle.js +48 -0
- package/dist/progress-circle/progress-circle.module.js +12 -0
- package/dist/progress-indicator/progress-indicator.css +1 -0
- package/dist/progress-indicator/progress-indicator.js +36 -0
- package/dist/progress-indicator/progress-indicator.module.js +13 -0
- package/dist/prose/prose.css +1 -0
- package/dist/prose/prose.js +15 -0
- package/dist/prose/prose.module.js +6 -0
- package/dist/pull-to-refresh/pull-to-refresh.css +1 -0
- package/dist/pull-to-refresh/pull-to-refresh.js +82 -0
- package/dist/pull-to-refresh/pull-to-refresh.module.js +12 -0
- package/dist/qr-code/encode.js +585 -0
- package/dist/qr-code/qr-code.css +1 -0
- package/dist/qr-code/qr-code.js +41 -0
- package/dist/qr-code/qr-code.module.js +9 -0
- package/dist/radial-progress/radial-progress.css +1 -0
- package/dist/radial-progress/radial-progress.js +25 -0
- package/dist/radial-progress/radial-progress.module.js +9 -0
- package/dist/radio/radio.css +1 -0
- package/dist/radio/radio.js +49 -0
- package/dist/radio/radio.module.js +12 -0
- package/dist/radio-card/radio-card.css +1 -0
- package/dist/radio-card/radio-card.js +63 -0
- package/dist/radio-card/radio-card.module.js +14 -0
- package/dist/rating-group/rating-group.css +1 -0
- package/dist/rating-group/rating-group.js +37 -0
- package/dist/rating-group/rating-group.module.js +9 -0
- package/dist/react/src/index.js +130 -0
- package/dist/relative-time/relative-time.css +1 -0
- package/dist/relative-time/relative-time.js +65 -0
- package/dist/relative-time/relative-time.module.js +6 -0
- package/dist/resizable/resizable.css +1 -0
- package/dist/resizable/resizable.js +80 -0
- package/dist/resizable/resizable.module.js +11 -0
- package/dist/scroll-area/scroll-area.css +1 -0
- package/dist/scroll-area/scroll-area.js +38 -0
- package/dist/scroll-area/scroll-area.module.js +6 -0
- package/dist/search/search.css +1 -0
- package/dist/search/search.js +94 -0
- package/dist/search/search.module.js +12 -0
- package/dist/segmented-control/segmented-control.css +1 -0
- package/dist/segmented-control/segmented-control.js +43 -0
- package/dist/segmented-control/segmented-control.module.js +9 -0
- package/dist/select/select.css +1 -0
- package/dist/select/select.js +71 -0
- package/dist/select/select.module.js +14 -0
- package/dist/separator/separator.css +1 -0
- package/dist/separator/separator.js +21 -0
- package/dist/separator/separator.module.js +6 -0
- package/dist/sheet/sheet.css +1 -0
- package/dist/sheet/sheet.js +50 -0
- package/dist/sheet/sheet.module.js +12 -0
- package/dist/shell-header/shell-header.css +1 -0
- package/dist/shell-header/shell-header.js +165 -0
- package/dist/shell-header/shell-header.module.js +26 -0
- package/dist/side-nav/side-nav.css +1 -0
- package/dist/side-nav/side-nav.js +326 -0
- package/dist/side-nav/side-nav.module.js +34 -0
- package/dist/skeleton/skeleton.css +1 -0
- package/dist/skeleton/skeleton.js +25 -0
- package/dist/skeleton/skeleton.module.js +10 -0
- package/dist/skip-nav/skip-nav.css +1 -0
- package/dist/skip-nav/skip-nav.js +27 -0
- package/dist/skip-nav/skip-nav.module.js +6 -0
- package/dist/slider/slider.css +1 -0
- package/dist/slider/slider.js +29 -0
- package/dist/slider/slider.module.js +10 -0
- package/dist/spinner/spinner.css +1 -0
- package/dist/spinner/spinner.js +18 -0
- package/dist/spinner/spinner.module.js +9 -0
- package/dist/stack/stack.css +1 -0
- package/dist/stack/stack.js +19 -0
- package/dist/stack/stack.module.js +9 -0
- package/dist/stat/stat.css +1 -0
- package/dist/stat/stat.js +37 -0
- package/dist/stat/stat.module.js +13 -0
- package/dist/status/status.css +1 -0
- package/dist/status/status.js +20 -0
- package/dist/status/status.module.js +10 -0
- package/dist/steps/steps.css +1 -0
- package/dist/steps/steps.js +32 -0
- package/dist/steps/steps.module.js +11 -0
- package/dist/structured-list/structured-list.css +1 -0
- package/dist/structured-list/structured-list.js +101 -0
- package/dist/structured-list/structured-list.module.js +15 -0
- package/dist/styles.css +248 -0
- package/dist/swap/swap.css +1 -0
- package/dist/swap/swap.js +36 -0
- package/dist/swap/swap.module.js +10 -0
- package/dist/swipe-item/swipe-item.css +1 -0
- package/dist/swipe-item/swipe-item.js +62 -0
- package/dist/swipe-item/swipe-item.module.js +15 -0
- package/dist/switcher/switcher.css +1 -0
- package/dist/switcher/switcher.js +29 -0
- package/dist/switcher/switcher.module.js +11 -0
- package/dist/tabs/tabs.css +1 -0
- package/dist/tabs/tabs.js +95 -0
- package/dist/tabs/tabs.module.js +11 -0
- package/dist/tag/tag.css +1 -0
- package/dist/tag/tag.js +26 -0
- package/dist/tag/tag.module.js +9 -0
- package/dist/tags-input/tags-input.css +1 -0
- package/dist/tags-input/tags-input.js +63 -0
- package/dist/tags-input/tags-input.module.js +11 -0
- package/dist/text/text.css +1 -0
- package/dist/text/text.js +18 -0
- package/dist/text/text.module.js +6 -0
- package/dist/textarea/textarea.css +1 -0
- package/dist/textarea/textarea.js +56 -0
- package/dist/textarea/textarea.module.js +12 -0
- package/dist/tile/tile.css +1 -0
- package/dist/tile/tile.js +39 -0
- package/dist/tile/tile.module.js +10 -0
- package/dist/time-picker/time-picker.css +1 -0
- package/dist/time-picker/time-picker.js +62 -0
- package/dist/time-picker/time-picker.module.js +12 -0
- package/dist/timeline/timeline.css +1 -0
- package/dist/timeline/timeline.js +41 -0
- package/dist/timeline/timeline.module.js +14 -0
- package/dist/toast/toast.css +1 -0
- package/dist/toast/toast.js +85 -0
- package/dist/toast/toast.module.js +14 -0
- package/dist/toc/toc.css +1 -0
- package/dist/toc/toc.js +42 -0
- package/dist/toc/toc.module.js +6 -0
- package/dist/toc/use-toc-from-region.js +17 -0
- package/dist/toggle/toggle.css +1 -0
- package/dist/toggle/toggle.js +39 -0
- package/dist/toggle/toggle.module.js +11 -0
- package/dist/toggle-group/toggle-group.css +1 -0
- package/dist/toggle-group/toggle-group.js +55 -0
- package/dist/toggle-group/toggle-group.module.js +9 -0
- package/dist/toggletip/toggletip.css +1 -0
- package/dist/toggletip/toggletip.js +49 -0
- package/dist/toggletip/toggletip.module.js +10 -0
- package/dist/tooltip/tooltip.css +1 -0
- package/dist/tooltip/tooltip.js +58 -0
- package/dist/tooltip/tooltip.module.js +9 -0
- package/dist/tree-view/tree-view.css +1 -0
- package/dist/tree-view/tree-view.js +201 -0
- package/dist/tree-view/tree-view.module.js +16 -0
- package/dist/user/user.css +1 -0
- package/dist/user/user.js +33 -0
- package/dist/user/user.module.js +12 -0
- package/dist/visually-hidden/visually-hidden.css +1 -0
- package/dist/visually-hidden/visually-hidden.js +15 -0
- package/dist/visually-hidden/visually-hidden.module.js +6 -0
- package/package.json +6 -6
- package/readme.body.md +12 -9
- package/dist/cascivo.css +0 -2
- package/dist/index.js +0 -9174
package/README.md
CHANGED
|
@@ -38,28 +38,32 @@ for `LineChart`, `AreaChart`, `BarChart`, `Sparkline`, and more.
|
|
|
38
38
|
|
|
39
39
|
### Framework setup (Next.js App Router)
|
|
40
40
|
|
|
41
|
-
In a Server Component file (e.g. `app/layout.tsx`), import the
|
|
41
|
+
In a Server Component file (e.g. `app/layout.tsx`), import the themes once:
|
|
42
42
|
|
|
43
43
|
```tsx
|
|
44
|
-
import '@cascivo/react/styles.css'
|
|
45
44
|
import '@cascivo/themes/all'
|
|
46
45
|
```
|
|
47
46
|
|
|
47
|
+
Component CSS ships **per component** and is pulled in automatically when you
|
|
48
|
+
import a component — a bundler (Vite, webpack/Next.js) includes the styles only
|
|
49
|
+
for the components you actually use and tree-shakes the rest. There is no
|
|
50
|
+
component-CSS import to add or maintain.
|
|
51
|
+
|
|
48
52
|
Components ship with `'use client'` preserved in the bundle, so they work inside
|
|
49
53
|
RSC without any extra wrapper.
|
|
50
54
|
|
|
51
|
-
> **
|
|
52
|
-
>
|
|
53
|
-
> import
|
|
55
|
+
> **No bundler? (CDN, import maps, plain `<link>`)** Import the aggregate sheet
|
|
56
|
+
> `@cascivo/react/styles.css` — it contains every component's CSS in one file.
|
|
57
|
+
> With a bundler you don't need it; import it only if you prefer one explicit
|
|
58
|
+
> stylesheet over per-component tree-shaking.
|
|
54
59
|
|
|
55
60
|
## Use
|
|
56
61
|
|
|
57
62
|
```tsx
|
|
58
|
-
// once, in your entry file —
|
|
59
|
-
import '@cascivo/react/styles.css' // component styles
|
|
63
|
+
// once, in your entry file — themes are the only global import
|
|
60
64
|
import '@cascivo/themes/all' // tokens (once) + base typography + light & dark
|
|
61
65
|
|
|
62
|
-
// anywhere
|
|
66
|
+
// anywhere — each component brings its own CSS along
|
|
63
67
|
import { Button, Card, CardContent, Toggle } from '@cascivo/react'
|
|
64
68
|
|
|
65
69
|
export function App() {
|
|
@@ -84,7 +88,6 @@ Prefer à-la-carte? Import only the themes you need — each self-imports the to
|
|
|
84
88
|
(deduped by URL, so light + dark load tokens once):
|
|
85
89
|
|
|
86
90
|
```tsx
|
|
87
|
-
import '@cascivo/react/styles.css'
|
|
88
91
|
import '@cascivo/themes/base' // base typography (font/line-height/color)
|
|
89
92
|
import '@cascivo/themes/light'
|
|
90
93
|
import '@cascivo/themes/dark'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._accordion_9ch4s_2{border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);flex-direction:column;display:flex;overflow:hidden}._item_9ch4s_10:not(:last-child){border-block-end:1px solid var(--cascivo-color-border)}._heading_9ch4s_16{font-size:inherit;font-weight:inherit;margin:0}._trigger_9ch4s_22{justify-content:space-between;align-items:center;gap:var(--cascivo-space-3);inline-size:100%;padding:var(--cascivo-space-4);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);text-align:start;color:var(--cascivo-color-text);cursor:pointer;background:0 0;border:none;display:flex}._trigger_9ch4s_22:hover{background-color:var(--cascivo-color-bg-subtle)}._trigger_9ch4s_22:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._indicator_9ch4s_48{block-size:.75rem;inline-size:.75rem;transition:rotate var(--cascivo-duration-200) var(--cascivo-ease-out);background-color:currentColor;flex-shrink:0;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") 50%/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") 50%/contain no-repeat}._trigger_9ch4s_22[data-state=open] ._indicator_9ch4s_48{rotate:180deg}._content_9ch4s_62{visibility:hidden;color:var(--cascivo-color-text);transition:grid-template-rows var(--cascivo-duration-200) var(--cascivo-ease-out), visibility var(--cascivo-duration-200) var(--cascivo-ease-out);grid-template-rows:0fr;display:grid}._content_9ch4s_62[data-state=open]{visibility:visible;grid-template-rows:1fr}._contentInner_9ch4s_77{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-relaxed);overflow:hidden}._content_9ch4s_62[data-state=open] ._contentInner_9ch4s_77{padding-inline:var(--cascivo-space-4);padding-block-end:var(--cascivo-space-4)}}@media (forced-colors:active){._accordion_9ch4s_2{border:1px solid buttontext}._trigger_9ch4s_22:focus-visible{outline-offset:2px;outline:2px solid highlight}}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./accordion.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { createContext as o, useId as s } from "react";
|
|
7
|
+
//#region ../components/src/accordion/accordion.tsx
|
|
8
|
+
var c = o(null), l = o(null);
|
|
9
|
+
function u(e) {
|
|
10
|
+
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
11
|
+
}
|
|
12
|
+
function d({ type: r = "single", defaultValue: a, value: o, onValueChange: l, className: d, children: f }) {
|
|
13
|
+
let p = s(), m = n(u(o ?? a));
|
|
14
|
+
o !== void 0 && (m.value = u(o));
|
|
15
|
+
let h = {
|
|
16
|
+
open: m,
|
|
17
|
+
baseId: p,
|
|
18
|
+
toggle: (e) => {
|
|
19
|
+
let t = m.value, n;
|
|
20
|
+
n = r === "multiple" ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], o === void 0 && (m.value = n), l?.(r === "multiple" ? n : n[0] ?? "");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ i(c.Provider, {
|
|
24
|
+
value: h,
|
|
25
|
+
children: /* @__PURE__ */ i("div", {
|
|
26
|
+
"data-type": r,
|
|
27
|
+
className: t(e.accordion, d),
|
|
28
|
+
children: f
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function f({ value: n, className: r, children: a, ...o }) {
|
|
33
|
+
return /* @__PURE__ */ i(l.Provider, {
|
|
34
|
+
value: { value: n },
|
|
35
|
+
children: /* @__PURE__ */ i("div", {
|
|
36
|
+
"data-value": n,
|
|
37
|
+
className: t(e.item, r),
|
|
38
|
+
...o,
|
|
39
|
+
children: a
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function p(e) {
|
|
44
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => /* @__PURE__ */ i(l.Consumer, { children: (n) => t && n ? /* @__PURE__ */ i(m, {
|
|
45
|
+
store: t,
|
|
46
|
+
item: n,
|
|
47
|
+
...e
|
|
48
|
+
}) : null }) });
|
|
49
|
+
}
|
|
50
|
+
function m({ store: n, item: o, className: s, children: c, ...l }) {
|
|
51
|
+
r();
|
|
52
|
+
let u = n.open.value.includes(o.value);
|
|
53
|
+
return /* @__PURE__ */ i("h3", {
|
|
54
|
+
className: e.heading,
|
|
55
|
+
children: /* @__PURE__ */ a("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
id: `${n.baseId}-trigger-${o.value}`,
|
|
58
|
+
"aria-expanded": u,
|
|
59
|
+
"aria-controls": `${n.baseId}-content-${o.value}`,
|
|
60
|
+
"data-state": u ? "open" : "closed",
|
|
61
|
+
className: t(e.trigger, s),
|
|
62
|
+
onClick: () => n.toggle(o.value),
|
|
63
|
+
...l,
|
|
64
|
+
children: [/* @__PURE__ */ i("span", { children: c }), /* @__PURE__ */ i("span", {
|
|
65
|
+
className: e.indicator,
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function h(e) {
|
|
72
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => /* @__PURE__ */ i(l.Consumer, { children: (n) => t && n ? /* @__PURE__ */ i(g, {
|
|
73
|
+
store: t,
|
|
74
|
+
item: n,
|
|
75
|
+
...e
|
|
76
|
+
}) : null }) });
|
|
77
|
+
}
|
|
78
|
+
function g({ store: n, item: a, className: o, children: s, ...c }) {
|
|
79
|
+
r();
|
|
80
|
+
let l = n.open.value.includes(a.value);
|
|
81
|
+
return /* @__PURE__ */ i("div", {
|
|
82
|
+
role: "region",
|
|
83
|
+
id: `${n.baseId}-content-${a.value}`,
|
|
84
|
+
"aria-labelledby": `${n.baseId}-trigger-${a.value}`,
|
|
85
|
+
"data-state": l ? "open" : "closed",
|
|
86
|
+
className: t(e.content, o),
|
|
87
|
+
...c,
|
|
88
|
+
children: /* @__PURE__ */ i("div", {
|
|
89
|
+
className: e.contentInner,
|
|
90
|
+
children: s
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { d as Accordion, h as AccordionContent, f as AccordionItem, p as AccordionTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './accordion.css';
|
|
4
|
+
var e = {
|
|
5
|
+
accordion: "_accordion_9ch4s_2",
|
|
6
|
+
item: "_item_9ch4s_10",
|
|
7
|
+
heading: "_heading_9ch4s_16",
|
|
8
|
+
trigger: "_trigger_9ch4s_22",
|
|
9
|
+
indicator: "_indicator_9ch4s_48",
|
|
10
|
+
content: "_content_9ch4s_62",
|
|
11
|
+
contentInner: "_contentInner_9ch4s_77"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._overlay_17irl_2{z-index:var(--cascivo-z-overlay,50);padding:var(--cascivo-space-3);opacity:1;transition:opacity var(--cascivo-motion-enter);background-color:#0006;flex-direction:column;justify-content:flex-end;align-items:center;padding-block-end:calc(var(--cascivo-space-3) + env(safe-area-inset-bottom,0px));display:flex;position:fixed;inset:0}._overlay_17irl_2[data-state=closed]{opacity:0;transition:opacity var(--cascivo-motion-exit)}@starting-style{._overlay_17irl_2[data-state=open]{opacity:0}}._sheet_17irl_28{gap:var(--cascivo-space-2);inline-size:100%;max-inline-size:32rem;transition:translate var(--cascivo-motion-enter);flex-direction:column;display:flex;translate:0}._overlay_17irl_2[data-state=closed] ._sheet_17irl_28{transition:translate var(--cascivo-motion-exit);translate:0 100%}@starting-style{._overlay_17irl_2[data-state=open] ._sheet_17irl_28{translate:0 100%}}._group_17irl_50{background:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-overlay);box-shadow:var(--cascivo-shadow-overlay);flex-direction:column;display:flex;overflow:hidden}._heading_17irl_60{padding:var(--cascivo-space-4) var(--cascivo-space-6);text-align:center;border-block-end:1px solid var(--cascivo-color-border)}._title_17irl_66{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-semibold);color:var(--cascivo-color-text);margin:0}._description_17irl_73{margin:var(--cascivo-space-1) 0 0;font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle)}._item_17irl_79{min-block-size:3rem;inline-size:100%;padding:var(--cascivo-space-3) var(--cascivo-space-6);font-size:var(--cascivo-text-base);color:var(--cascivo-color-accent);cursor:pointer;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out);background:0 0;border:none;justify-content:center;align-items:center;display:flex}._item_17irl_79+._item_17irl_79{border-block-start:1px solid var(--cascivo-color-border)}._item_17irl_79:hover{background-color:var(--cascivo-color-bg-subtle)}._item_17irl_79:focus-visible{box-shadow:var(--cascivo-focus-ring);z-index:1;outline:none;position:relative}._item_17irl_79[aria-disabled=true]{color:var(--cascivo-color-text-muted);cursor:not-allowed}._item_17irl_79[data-destructive]{color:var(--cascivo-color-destructive)}._cancel_17irl_119{font-weight:var(--cascivo-font-semibold);color:var(--cascivo-color-text)}@media (prefers-reduced-motion:reduce){._sheet_17irl_28{transition:none}}}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./action-sheet.module.js";
|
|
4
|
+
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useRovingFocus as s, useSignals as c } from "@cascivo/core";
|
|
5
|
+
import { builtin as l, t as u } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { useId as p } from "react";
|
|
8
|
+
//#region ../components/src/action-sheet/action-sheet.tsx
|
|
9
|
+
function m({ open: m, defaultOpen: h, onOpenChange: g, actions: _, title: v, description: y, showCancel: b = !0, labels: x, className: S }) {
|
|
10
|
+
c();
|
|
11
|
+
let [C, w] = o({
|
|
12
|
+
value: m,
|
|
13
|
+
defaultValue: h ?? !1,
|
|
14
|
+
onChange: g
|
|
15
|
+
}), T = s({
|
|
16
|
+
orientation: "vertical",
|
|
17
|
+
loop: !0
|
|
18
|
+
}), E = p(), D = p(), O = x?.cancel ?? u(l.actionSheet.cancel), k = x?.label ?? u(l.actionSheet.label), A = (e) => {
|
|
19
|
+
e.disabled || (e.onSelect(), w(!1));
|
|
20
|
+
}, j = _.length;
|
|
21
|
+
return /* @__PURE__ */ d(r, { children: /* @__PURE__ */ d(i, {
|
|
22
|
+
present: C,
|
|
23
|
+
children: /* @__PURE__ */ d("div", {
|
|
24
|
+
className: e.overlay,
|
|
25
|
+
children: /* @__PURE__ */ d(t, {
|
|
26
|
+
onDismiss: () => w(!1),
|
|
27
|
+
children: /* @__PURE__ */ d(n, {
|
|
28
|
+
trapped: !0,
|
|
29
|
+
restoreFocus: !0,
|
|
30
|
+
autoFocus: !0,
|
|
31
|
+
children: /* @__PURE__ */ f("div", {
|
|
32
|
+
role: "menu",
|
|
33
|
+
"aria-label": v ? void 0 : k,
|
|
34
|
+
"aria-labelledby": v ? E : void 0,
|
|
35
|
+
"aria-describedby": y ? D : void 0,
|
|
36
|
+
className: a(e.sheet, S),
|
|
37
|
+
children: [/* @__PURE__ */ f("div", {
|
|
38
|
+
className: e.group,
|
|
39
|
+
children: [(v || y) && /* @__PURE__ */ f("div", {
|
|
40
|
+
className: e.heading,
|
|
41
|
+
role: "presentation",
|
|
42
|
+
children: [v && /* @__PURE__ */ d("p", {
|
|
43
|
+
id: E,
|
|
44
|
+
className: e.title,
|
|
45
|
+
children: v
|
|
46
|
+
}), y && /* @__PURE__ */ d("p", {
|
|
47
|
+
id: D,
|
|
48
|
+
className: e.description,
|
|
49
|
+
children: y
|
|
50
|
+
})]
|
|
51
|
+
}), _.map((t, n) => {
|
|
52
|
+
let r = T.getItemProps(n);
|
|
53
|
+
return /* @__PURE__ */ d("button", {
|
|
54
|
+
ref: r.ref,
|
|
55
|
+
type: "button",
|
|
56
|
+
role: "menuitem",
|
|
57
|
+
tabIndex: r.tabIndex,
|
|
58
|
+
"aria-disabled": t.disabled || void 0,
|
|
59
|
+
"data-destructive": t.destructive ? "" : void 0,
|
|
60
|
+
className: e.item,
|
|
61
|
+
onKeyDown: r.onKeyDown,
|
|
62
|
+
onFocus: r.onFocus,
|
|
63
|
+
onClick: () => A(t),
|
|
64
|
+
children: t.label
|
|
65
|
+
}, n);
|
|
66
|
+
})]
|
|
67
|
+
}), b && /* @__PURE__ */ d("div", {
|
|
68
|
+
className: e.group,
|
|
69
|
+
children: (() => {
|
|
70
|
+
let t = T.getItemProps(j);
|
|
71
|
+
return /* @__PURE__ */ d("button", {
|
|
72
|
+
ref: t.ref,
|
|
73
|
+
type: "button",
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
tabIndex: t.tabIndex,
|
|
76
|
+
className: a(e.item, e.cancel),
|
|
77
|
+
onKeyDown: t.onKeyDown,
|
|
78
|
+
onFocus: t.onFocus,
|
|
79
|
+
onClick: () => w(!1),
|
|
80
|
+
children: O
|
|
81
|
+
});
|
|
82
|
+
})()
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}) });
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { m as ActionSheet };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './action-sheet.css';
|
|
4
|
+
var e = {
|
|
5
|
+
overlay: "_overlay_17irl_2",
|
|
6
|
+
sheet: "_sheet_17irl_28",
|
|
7
|
+
group: "_group_17irl_50",
|
|
8
|
+
heading: "_heading_17irl_60",
|
|
9
|
+
title: "_title_17irl_66",
|
|
10
|
+
description: "_description_17irl_73",
|
|
11
|
+
item: "_item_17irl_79",
|
|
12
|
+
cancel: "_cancel_17irl_119"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._alert_1n8hp_2{gap:var(--cascivo-space-3);padding:var(--cascivo-space-4);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background-color:var(--cascivo-color-surface);font-family:var(--cascivo-font-sans);color:var(--cascivo-color-text);display:flex}._alert_1n8hp_2[data-variant=info]{border-color:color-mix(in oklch, var(--cascivo-color-info) 35%, var(--cascivo-color-border));background:color-mix(in oklch, var(--cascivo-color-info) 5%, var(--cascivo-color-bg));color:var(--cascivo-color-info-content)}._alert_1n8hp_2[data-variant=info] ._icon_1n8hp_18,._alert_1n8hp_2[data-variant=info] ._title_1n8hp_19{color:var(--cascivo-color-info)}._alert_1n8hp_2[data-variant=success]{border-color:color-mix(in oklch, var(--cascivo-color-success) 35%, var(--cascivo-color-border));background:color-mix(in oklch, var(--cascivo-color-success) 5%, var(--cascivo-color-bg));color:var(--cascivo-color-success-content)}._alert_1n8hp_2[data-variant=success] ._icon_1n8hp_18,._alert_1n8hp_2[data-variant=success] ._title_1n8hp_19{color:var(--cascivo-color-success-foreground,var(--cascivo-color-success))}._alert_1n8hp_2[data-variant=warning]{border-color:color-mix(in oklch, var(--cascivo-color-warning) 35%, var(--cascivo-color-border));background:color-mix(in oklch, var(--cascivo-color-warning) 5%, var(--cascivo-color-bg));color:var(--cascivo-color-warning-content)}._alert_1n8hp_2[data-variant=warning] ._icon_1n8hp_18,._alert_1n8hp_2[data-variant=warning] ._title_1n8hp_19{color:var(--cascivo-color-warning-foreground,var(--cascivo-color-warning))}._alert_1n8hp_2[data-variant=destructive]{border-color:color-mix(in oklch, var(--cascivo-color-destructive) 35%, var(--cascivo-color-border));background:color-mix(in oklch, var(--cascivo-color-destructive) 5%, var(--cascivo-color-bg));color:var(--cascivo-color-destructive-content)}._alert_1n8hp_2[data-variant=destructive] ._icon_1n8hp_18,._alert_1n8hp_2[data-variant=destructive] ._title_1n8hp_19{color:var(--cascivo-color-destructive)}._icon_1n8hp_18{flex-shrink:0;align-items:center;margin-block-start:.125rem;line-height:1;display:flex}._alert_1n8hp_2[data-variant=info] ._icon_1n8hp_18{color:var(--cascivo-color-info)}._alert_1n8hp_2[data-variant=success] ._icon_1n8hp_18{color:var(--cascivo-color-success)}._alert_1n8hp_2[data-variant=warning] ._icon_1n8hp_18{color:var(--cascivo-color-warning)}._alert_1n8hp_2[data-variant=destructive] ._icon_1n8hp_18{color:var(--cascivo-color-destructive)}._body_1n8hp_90{gap:var(--cascivo-space-1);flex-direction:column;flex:1;min-inline-size:0;display:flex}._title_1n8hp_19{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-semibold);line-height:var(--cascivo-leading-snug)}._content_1n8hp_104{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-normal)}._action_1n8hp_110{padding-block:var(--cascivo-space-1);padding-inline:var(--cascivo-space-2);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);line-height:var(--cascivo-leading-none);color:var(--cascivo-color-text);border-radius:var(--cascivo-radius-control);cursor:pointer;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out);background:0 0;border:none;align-self:flex-start;margin-block-start:var(--cascivo-space-1)}._action_1n8hp_110:hover{background-color:var(--cascivo-color-bg-subtle)}._action_1n8hp_110:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._alert_1n8hp_2[data-variant=info] ._action_1n8hp_110{color:var(--cascivo-color-info)}._alert_1n8hp_2[data-variant=success] ._action_1n8hp_110{color:var(--cascivo-color-success)}._alert_1n8hp_2[data-variant=warning] ._action_1n8hp_110{color:var(--cascivo-color-warning)}._alert_1n8hp_2[data-variant=destructive] ._action_1n8hp_110{color:var(--cascivo-color-destructive)}._dismiss_1n8hp_149{block-size:1.5rem;inline-size:1.5rem;font-size:var(--cascivo-text-xs);color:var(--cascivo-color-text-muted);border-radius:var(--cascivo-radius-control);cursor:pointer;transition:color var(--cascivo-duration-150) var(--cascivo-ease-out), background-color var(--cascivo-duration-150) var(--cascivo-ease-out);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex}._dismiss_1n8hp_149:hover{color:var(--cascivo-color-text);background-color:var(--cascivo-color-bg-subtle)}._dismiss_1n8hp_149:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}}@media (forced-colors:active){._alert_1n8hp_2{border:1px solid canvastext}._alert_1n8hp_2[data-variant=info],._alert_1n8hp_2[data-variant=success],._alert_1n8hp_2[data-variant=warning],._alert_1n8hp_2[data-variant=destructive]{border-width:2px}._dismiss_1n8hp_149:focus-visible{outline-offset:2px;outline:2px solid highlight}}@media (prefers-contrast:more){._alert_1n8hp_2,._alert_1n8hp_2[data-variant=info],._alert_1n8hp_2[data-variant=success],._alert_1n8hp_2[data-variant=warning],._alert_1n8hp_2[data-variant=destructive]{border-width:2px}}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./alert.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
//#region ../components/src/alert/alert.tsx
|
|
8
|
+
var c = new Set(["warning", "destructive"]);
|
|
9
|
+
function l({ variant: l = "default", title: u, icon: d, dismissible: f = !1, onDismiss: p, action: m, className: h, children: g, ..._ }) {
|
|
10
|
+
r();
|
|
11
|
+
let v = n(!1);
|
|
12
|
+
return v.value ? null : /* @__PURE__ */ s("div", {
|
|
13
|
+
role: c.has(l) ? "alert" : "status",
|
|
14
|
+
"data-variant": l,
|
|
15
|
+
className: t(e.alert, h),
|
|
16
|
+
..._,
|
|
17
|
+
children: [
|
|
18
|
+
d && /* @__PURE__ */ o("span", {
|
|
19
|
+
className: e.icon,
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
children: d
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ s("div", {
|
|
24
|
+
className: e.body,
|
|
25
|
+
children: [
|
|
26
|
+
u && /* @__PURE__ */ o("div", {
|
|
27
|
+
className: e.title,
|
|
28
|
+
children: u
|
|
29
|
+
}),
|
|
30
|
+
g && /* @__PURE__ */ o("div", {
|
|
31
|
+
className: e.content,
|
|
32
|
+
children: g
|
|
33
|
+
}),
|
|
34
|
+
m && /* @__PURE__ */ o("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: e.action,
|
|
37
|
+
onClick: m.onClick,
|
|
38
|
+
children: m.label
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
f && /* @__PURE__ */ o("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
className: e.dismiss,
|
|
45
|
+
"aria-label": a(i.alert.dismiss),
|
|
46
|
+
onClick: () => {
|
|
47
|
+
v.value = !0, p?.();
|
|
48
|
+
},
|
|
49
|
+
children: "✕"
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { l as Alert };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './alert.css';
|
|
4
|
+
var e = {
|
|
5
|
+
alert: "_alert_1n8hp_2",
|
|
6
|
+
icon: "_icon_1n8hp_18",
|
|
7
|
+
title: "_title_1n8hp_19",
|
|
8
|
+
body: "_body_1n8hp_90",
|
|
9
|
+
content: "_content_1n8hp_104",
|
|
10
|
+
action: "_action_1n8hp_110",
|
|
11
|
+
dismiss: "_dismiss_1n8hp_149"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._dialog_1net6_2{opacity:1;width:fit-content;height:fit-content;transition:opacity var(--cascivo-motion-enter), scale var(--cascivo-motion-enter), display var(--cascivo-motion-enter) allow-discrete, overlay var(--cascivo-motion-enter) allow-discrete;background:0 0;border:none;margin:auto;padding:0;position:fixed;inset:0;scale:1}@starting-style{._dialog_1net6_2{opacity:0;scale:.95}}._dialog_1net6_2[data-state=closed]{opacity:0;transition:opacity var(--cascivo-motion-exit), scale var(--cascivo-motion-exit), display var(--cascivo-motion-exit) allow-discrete, overlay var(--cascivo-motion-exit) allow-discrete;scale:.95}._dialog_1net6_2::backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:1;transition:opacity var(--cascivo-motion-enter), display var(--cascivo-motion-enter) allow-discrete, overlay var(--cascivo-motion-enter) allow-discrete;background-color:#00000080}@starting-style{._dialog_1net6_2::backdrop{opacity:0}}._dialog_1net6_2[data-state=closed]::backdrop{opacity:0;transition:opacity var(--cascivo-motion-exit), display var(--cascivo-motion-exit) allow-discrete, overlay var(--cascivo-motion-exit) allow-discrete}._content_1net6_58{width:28rem;max-width:calc(100vw - var(--cascivo-space-8));background:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-overlay);box-shadow:var(--cascivo-shadow-overlay);padding:var(--cascivo-space-6);gap:var(--cascivo-space-2);flex-direction:column;display:flex}._title_1net6_71{font-size:var(--cascivo-text-lg);font-weight:var(--cascivo-font-semibold);color:var(--cascivo-color-text);margin:0}._description_1net6_78{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);margin:0}._actions_1net6_84{justify-content:flex-end;gap:var(--cascivo-space-2);margin-block-start:var(--cascivo-space-4);display:flex}@media (width<=40rem){._dialog_1net6_2{max-block-size:90dvh;margin:0;inset-block-end:0;inset-inline:0}._content_1net6_58{inline-size:100%;max-width:100%;max-block-size:90dvh;border-start-start-radius:var(--cascivo-radius-overlay);border-start-end-radius:var(--cascivo-radius-overlay);border-end-end-radius:0;border-end-start-radius:0;padding-block-end:env(safe-area-inset-bottom,0);overflow-y:auto}}@media (prefers-reduced-motion:reduce){._dialog_1net6_2,._dialog_1net6_2[data-state=closed]{transition:none}}._cancel_1net6_123,._confirm_1net6_124{padding:var(--cascivo-space-2) var(--cascivo-space-4);border-radius:var(--cascivo-radius-control);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);cursor:pointer;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out), color var(--cascivo-duration-150) var(--cascivo-ease-out);border:1px solid #0000}:is(._cancel_1net6_123,._confirm_1net6_124):focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._cancel_1net6_123{background:var(--cascivo-color-bg-subtle);color:var(--cascivo-color-text);border-color:var(--cascivo-color-border)}._cancel_1net6_123:hover{background:var(--cascivo-color-bg-muted)}._confirm_1net6_124{background:var(--cascivo-color-accent);color:var(--cascivo-color-on-accent)}._confirm_1net6_124:hover{opacity:.9}[data-variant=destructive] ._confirm_1net6_124{background:var(--cascivo-color-destructive);color:var(--cascivo-color-on-destructive)}}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./alert-dialog.module.js";
|
|
4
|
+
import { useSignal as t, useSignalEffect as n } from "@cascivo/core";
|
|
5
|
+
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { useRef as s } from "react";
|
|
8
|
+
//#region ../components/src/alert-dialog/alert-dialog.tsx
|
|
9
|
+
function c({ open: c, title: l, description: u, onConfirm: d, onCancel: f, labels: p, variant: m = "default" }) {
|
|
10
|
+
let h = s(null), g = t(c);
|
|
11
|
+
g.value = c;
|
|
12
|
+
let _ = s(null), v = s(f);
|
|
13
|
+
v.current = f;
|
|
14
|
+
let y = s(d);
|
|
15
|
+
return y.current = d, n(() => {
|
|
16
|
+
let e = h.current;
|
|
17
|
+
if (e) if (g.value) {
|
|
18
|
+
try {
|
|
19
|
+
e.showPopover();
|
|
20
|
+
} catch {}
|
|
21
|
+
requestAnimationFrame(() => _.current?.focus());
|
|
22
|
+
} else try {
|
|
23
|
+
e.hidePopover();
|
|
24
|
+
} catch {}
|
|
25
|
+
}), /* @__PURE__ */ a("div", {
|
|
26
|
+
ref: h,
|
|
27
|
+
popover: "manual",
|
|
28
|
+
role: "alertdialog",
|
|
29
|
+
"aria-modal": "true",
|
|
30
|
+
"aria-labelledby": "cascade-alert-dialog-title",
|
|
31
|
+
"aria-describedby": "cascade-alert-dialog-desc",
|
|
32
|
+
"data-state": c ? "open" : "closed",
|
|
33
|
+
"data-variant": m,
|
|
34
|
+
className: e.dialog,
|
|
35
|
+
children: /* @__PURE__ */ o("div", {
|
|
36
|
+
className: e.content,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ a("p", {
|
|
39
|
+
id: "cascade-alert-dialog-title",
|
|
40
|
+
className: e.title,
|
|
41
|
+
children: l
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ a("p", {
|
|
44
|
+
id: "cascade-alert-dialog-desc",
|
|
45
|
+
className: e.description,
|
|
46
|
+
children: u
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ o("div", {
|
|
49
|
+
className: e.actions,
|
|
50
|
+
children: [/* @__PURE__ */ a("button", {
|
|
51
|
+
ref: _,
|
|
52
|
+
type: "button",
|
|
53
|
+
className: e.cancel,
|
|
54
|
+
onClick: () => v.current(),
|
|
55
|
+
children: p?.cancel ?? i(r.alertDialog.cancel)
|
|
56
|
+
}), /* @__PURE__ */ a("button", {
|
|
57
|
+
type: "button",
|
|
58
|
+
className: e.confirm,
|
|
59
|
+
onClick: () => y.current(),
|
|
60
|
+
children: p?.confirm ?? i(r.alertDialog.confirm)
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { c as AlertDialog };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './alert-dialog.css';
|
|
4
|
+
var e = {
|
|
5
|
+
dialog: "_dialog_1net6_2",
|
|
6
|
+
content: "_content_1net6_58",
|
|
7
|
+
title: "_title_1net6_71",
|
|
8
|
+
description: "_description_1net6_78",
|
|
9
|
+
actions: "_actions_1net6_84",
|
|
10
|
+
cancel: "_cancel_1net6_123",
|
|
11
|
+
confirm: "_confirm_1net6_124"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._shell_11je2_4{box-sizing:border-box;block-size:100dvh;font-family:var(--cascivo-font-sans);color:var(--cascivo-color-foreground);background-color:var(--cascivo-color-background);flex-direction:column;display:flex;overflow:hidden}._header_11je2_16{z-index:var(--cascivo-z-raised);flex:none}._body_11je2_21{flex:auto;min-block-size:0;display:flex;position:relative}._navWrapper_11je2_32{z-index:var(--cascivo-z-overlay);block-size:100%;transition:transform var(--cascivo-motion-emphasis);position:absolute;inset-block:0;inset-inline-start:0;overflow:hidden;transform:translate(-100%)}._navWrapper_11je2_32[data-open=true]{transform:translate(0)}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) ._navWrapper_11je2_32{transform:translate(100%)}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) ._navWrapper_11je2_32[data-open=true]{transform:translate(0)}._navInner_11je2_58{block-size:100%;inline-size:var(--cascivo-shell-panel-inline-size,20rem);display:flex}._navInner_11je2_58>*{flex:auto;min-block-size:0}._scrim_11je2_70{z-index:var(--cascivo-z-dropdown);opacity:0;visibility:hidden;transition:opacity var(--cascivo-motion-emphasis), visibility var(--cascivo-motion-emphasis);background-color:oklch(0% 0 0/.4);position:absolute;inset:0}._scrim_11je2_70[data-open=true]{opacity:1;visibility:visible}._main_11je2_87{flex:auto;min-inline-size:0;overflow-y:auto}._footer_11je2_93{flex:none}@media (width>=64rem){._navWrapper_11je2_32{z-index:auto;inline-size:var(--cascivo-shell-aside-inline-size,18rem);transition:inline-size var(--cascivo-motion-emphasis);position:static;transform:none}._navWrapper_11je2_32[data-open=false]{inline-size:0}._navInner_11je2_58{inline-size:var(--cascivo-shell-aside-inline-size,18rem)}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) ._navWrapper_11je2_32{transform:none}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) ._navWrapper_11je2_32[data-open=true]{transform:none}._scrim_11je2_70{display:none}}}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./app-shell.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { cloneElement as c, isValidElement as l, useRef as u } from "react";
|
|
7
|
+
//#region ../components/src/app-shell/app-shell.tsx
|
|
8
|
+
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _, className: v }) {
|
|
9
|
+
i();
|
|
10
|
+
let y = h !== void 0, b = n(h ?? g ?? !0);
|
|
11
|
+
y && (b.value = h);
|
|
12
|
+
let x = u(null), S = u(null);
|
|
13
|
+
function C(e) {
|
|
14
|
+
y || (b.value = e), _?.(e);
|
|
15
|
+
}
|
|
16
|
+
function w() {
|
|
17
|
+
typeof document < "u" && (S.current = document.activeElement), C(!b.value);
|
|
18
|
+
}
|
|
19
|
+
r(() => {
|
|
20
|
+
y || g !== void 0 || typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(max-width: 63.999rem)").matches && (b.value = !1);
|
|
21
|
+
}), r(() => {
|
|
22
|
+
if (!b.value || typeof document > "u") return;
|
|
23
|
+
let e = (e) => {
|
|
24
|
+
e.key === "Escape" && C(!1);
|
|
25
|
+
};
|
|
26
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
27
|
+
}), r(() => {
|
|
28
|
+
let e = x.current;
|
|
29
|
+
if (e) if (b.value) e.removeAttribute("inert");
|
|
30
|
+
else {
|
|
31
|
+
e.setAttribute("inert", "");
|
|
32
|
+
let t = S.current;
|
|
33
|
+
t && e.contains(document.activeElement) && t.focus();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
let T = l(d) && f ? c(d, {
|
|
37
|
+
onMenuClick: w,
|
|
38
|
+
menuExpanded: b.value
|
|
39
|
+
}) : d;
|
|
40
|
+
return /* @__PURE__ */ s("div", {
|
|
41
|
+
className: t(e.shell, v),
|
|
42
|
+
"data-open": b.value,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ o("div", {
|
|
45
|
+
className: e.header,
|
|
46
|
+
children: T
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ s("div", {
|
|
49
|
+
className: e.body,
|
|
50
|
+
children: [f && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("div", {
|
|
51
|
+
ref: x,
|
|
52
|
+
className: e.navWrapper,
|
|
53
|
+
"data-open": b.value,
|
|
54
|
+
"data-testid": "app-shell-nav",
|
|
55
|
+
children: /* @__PURE__ */ o("div", {
|
|
56
|
+
className: e.navInner,
|
|
57
|
+
children: f
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */ o("div", {
|
|
60
|
+
className: e.scrim,
|
|
61
|
+
"data-open": b.value,
|
|
62
|
+
"data-testid": "app-shell-scrim",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
onClick: () => C(!1)
|
|
65
|
+
})] }), /* @__PURE__ */ o("main", {
|
|
66
|
+
id: "cascade-main",
|
|
67
|
+
tabIndex: -1,
|
|
68
|
+
className: e.main,
|
|
69
|
+
children: p
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
m && /* @__PURE__ */ o("div", {
|
|
73
|
+
className: e.footer,
|
|
74
|
+
children: m
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { d as AppShell };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './app-shell.css';
|
|
4
|
+
var e = {
|
|
5
|
+
shell: "_shell_11je2_4",
|
|
6
|
+
header: "_header_11je2_16",
|
|
7
|
+
body: "_body_11je2_21",
|
|
8
|
+
navWrapper: "_navWrapper_11je2_32",
|
|
9
|
+
navInner: "_navInner_11je2_58",
|
|
10
|
+
scrim: "_scrim_11je2_70",
|
|
11
|
+
main: "_main_11je2_87",
|
|
12
|
+
footer: "_footer_11je2_93"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._root_5ltw4_2{inline-size:100%;aspect-ratio:var(--cascivo-aspect-ratio,1);position:relative}._inner_5ltw4_8{block-size:100%;inline-size:100%;position:absolute;inset:0}._inner_5ltw4_8>*{object-fit:cover;block-size:100%;inline-size:100%}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./aspect-ratio.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/aspect-ratio/aspect-ratio.tsx
|
|
7
|
+
function r({ ratio: r = 16 / 9, className: i, style: a, children: o, ...s }) {
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: t(e.root, i),
|
|
10
|
+
style: {
|
|
11
|
+
"--cascivo-aspect-ratio": r,
|
|
12
|
+
...a
|
|
13
|
+
},
|
|
14
|
+
...s,
|
|
15
|
+
children: /* @__PURE__ */ n("div", {
|
|
16
|
+
className: e.inner,
|
|
17
|
+
children: o
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as AspectRatio };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._avatar_18xp4_2{border-radius:var(--cascivo-radius-full);background-color:var(--cascivo-color-accent-subtle);color:var(--cascivo-color-text);font-family:var(--cascivo-font-sans);font-weight:var(--cascivo-font-medium);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:visible}._avatar_18xp4_2[data-size=xs]{block-size:1.5rem;inline-size:1.5rem;font-size:var(--cascivo-text-xs)}._avatar_18xp4_2[data-size=sm]{block-size:2rem;inline-size:2rem;font-size:var(--cascivo-text-xs)}._avatar_18xp4_2[data-size=md]{block-size:2.5rem;inline-size:2.5rem;font-size:var(--cascivo-text-sm)}._avatar_18xp4_2[data-size=lg]{block-size:3rem;inline-size:3rem;font-size:var(--cascivo-text-base)}._avatar_18xp4_2[data-size=xl]{block-size:4rem;inline-size:4rem;font-size:var(--cascivo-text-lg)}._image_18xp4_43{object-fit:cover;border-radius:inherit;block-size:100%;inline-size:100%}._fallback_18xp4_50{text-transform:uppercase;line-height:1}._status_18xp4_55{border-radius:var(--cascivo-radius-full);border:2px solid var(--cascivo-color-surface);block-size:28%;min-block-size:.5rem;inline-size:28%;min-inline-size:.5rem;position:absolute;inset-block-end:0;inset-inline-end:0}._avatar_18xp4_2[data-status=online] ._status_18xp4_55{background-color:var(--cascivo-color-success)}._avatar_18xp4_2[data-status=offline] ._status_18xp4_55{background-color:var(--cascivo-color-text-muted)}._avatar_18xp4_2[data-status=busy] ._status_18xp4_55{background-color:var(--cascivo-color-destructive)}}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./avatar.module.js";
|
|
4
|
+
import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/avatar/avatar.tsx
|
|
7
|
+
var s = n({
|
|
8
|
+
initial: "loading",
|
|
9
|
+
states: {
|
|
10
|
+
loading: { on: {
|
|
11
|
+
LOADED: "loaded",
|
|
12
|
+
ERROR: "error"
|
|
13
|
+
} },
|
|
14
|
+
loaded: {},
|
|
15
|
+
error: {}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function c({ src: n, alt: c = "", fallback: l, size: u = "md", status: d, className: f, ...p }) {
|
|
19
|
+
i();
|
|
20
|
+
let [m, h] = r(s), g = !!n && m.value !== "error";
|
|
21
|
+
return /* @__PURE__ */ o("span", {
|
|
22
|
+
"data-size": u,
|
|
23
|
+
"data-status": d,
|
|
24
|
+
className: t(e.avatar, f),
|
|
25
|
+
role: g ? void 0 : "img",
|
|
26
|
+
"aria-label": g ? void 0 : c || l,
|
|
27
|
+
...p,
|
|
28
|
+
children: [g ? /* @__PURE__ */ a("img", {
|
|
29
|
+
className: e.image,
|
|
30
|
+
src: n,
|
|
31
|
+
alt: c,
|
|
32
|
+
onLoad: () => h("LOADED"),
|
|
33
|
+
onError: () => h("ERROR")
|
|
34
|
+
}) : /* @__PURE__ */ a("span", {
|
|
35
|
+
className: e.fallback,
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
children: l
|
|
38
|
+
}), d && /* @__PURE__ */ a("span", {
|
|
39
|
+
className: e.status,
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { c as Avatar };
|