@cascivo/react 0.3.4 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -10
- 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/index.d.ts +59 -1
- 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/log-viewer/log-viewer.css +1 -0
- package/dist/log-viewer/log-viewer.js +184 -0
- package/dist/log-viewer/log-viewer.module.js +19 -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 +131 -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 +250 -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 +23 -10
- package/dist/cascivo.css +0 -2
- package/dist/index.js +0 -9174
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._swap_77yf0_2{cursor:pointer;background:0 0;border:none;grid-template-areas:"swap";padding:0;display:inline-grid;position:relative;overflow:hidden}._swap_77yf0_2:focus-visible{outline:var(--cascivo-ring-width) solid var(--cascivo-ring-color);outline-offset:2px;border-radius:var(--cascivo-radius-control)}._on_77yf0_19,._off_77yf0_20{transition-property:transform,opacity;transition-duration:.2s;transition-timing-function:var(--cascivo-ease-out);grid-area:swap;justify-content:center;align-items:center;display:flex}._swap_77yf0_2[data-mode=rotate] ._on_77yf0_19{opacity:1;transform:rotate(0)}._swap_77yf0_2[data-mode=rotate] ._off_77yf0_20{opacity:0;transform:rotate(-90deg)}._swap_77yf0_2[data-mode=rotate][data-checked] ._on_77yf0_19{opacity:0;transform:rotate(90deg)}._swap_77yf0_2[data-mode=rotate][data-checked] ._off_77yf0_20{opacity:1;transform:rotate(0)}._swap_77yf0_2[data-mode=flip] ._on_77yf0_19{opacity:1;transform:rotateY(0)}._swap_77yf0_2[data-mode=flip] ._off_77yf0_20{opacity:0;transform:rotateY(180deg)}._swap_77yf0_2[data-mode=flip][data-checked] ._on_77yf0_19{opacity:0;transform:rotateY(-180deg)}._swap_77yf0_2[data-mode=flip][data-checked] ._off_77yf0_20{opacity:1;transform:rotateY(0)}}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./swap.module.js";
|
|
4
|
+
import { useSignal as t, useSignals as n } from "@cascivo/core";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/swap/swap.tsx
|
|
7
|
+
function a({ on: a, off: o, checked: s = !1, onChange: c, mode: l = "rotate", className: u, ...d }) {
|
|
8
|
+
n();
|
|
9
|
+
let f = t(s);
|
|
10
|
+
f.value = s;
|
|
11
|
+
function p() {
|
|
12
|
+
let e = !f.value;
|
|
13
|
+
c?.(e);
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ i("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
role: "switch",
|
|
18
|
+
"aria-checked": f.value,
|
|
19
|
+
className: [e.swap, u].filter(Boolean).join(" "),
|
|
20
|
+
"data-checked": f.value || void 0,
|
|
21
|
+
"data-mode": l,
|
|
22
|
+
onClick: p,
|
|
23
|
+
...d,
|
|
24
|
+
children: [/* @__PURE__ */ r("span", {
|
|
25
|
+
className: e.on,
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: a
|
|
28
|
+
}), /* @__PURE__ */ r("span", {
|
|
29
|
+
className: e.off,
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
children: o
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as Swap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._root_3ykmd_2{background:var(--cascivo-color-surface);position:relative;overflow:hidden}._panel_3ykmd_8{display:flex;position:absolute;inset-block:0}._leading_3ykmd_14{inset-inline-start:0}._trailing_3ykmd_18{inset-inline-end:0}._content_3ykmd_22{min-block-size:var(--cascivo-target-min-coarse,2.75rem);background:var(--cascivo-color-surface);touch-action:pan-y;transition:transform var(--cascivo-motion-enter);align-items:center;display:flex;position:relative}._content_3ykmd_22[data-dragging]{transition:none}._action_3ykmd_37{justify-content:center;align-items:center;gap:var(--cascivo-space-1);inline-size:4.5rem;padding-inline:var(--cascivo-space-2);font-size:var(--cascivo-text-xs);color:var(--cascivo-color-accent-content);background:var(--cascivo-color-accent);cursor:pointer;border:none;flex-direction:column;display:flex}._action_3ykmd_37:focus-visible{box-shadow:var(--cascivo-focus-ring);z-index:1;outline:none}._action_3ykmd_37[data-destructive]{color:var(--cascivo-color-text-on-destructive);background:var(--cascivo-color-destructive)}._actionIcon_3ykmd_64{block-size:1.25rem;inline-size:1.25rem;display:inline-flex}._actionLabel_3ykmd_70{white-space:nowrap}@media (prefers-reduced-motion:reduce){._content_3ykmd_22{transition:none}}}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./swipe-item.module.js";
|
|
4
|
+
import { cn as t, useDraggable as n, useSignal as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/swipe-item/swipe-item.tsx
|
|
7
|
+
var s = 72, c = 100;
|
|
8
|
+
function l({ children: l, leadingActions: u = [], trailingActions: d = [], className: f }) {
|
|
9
|
+
i();
|
|
10
|
+
let p = r(0), m = r("closed"), h = u.length * s, g = d.length * s, { handleRef: _, offset: v, velocity: y, isDragging: b, reset: x } = n({
|
|
11
|
+
axis: "x",
|
|
12
|
+
onDragEnd: (e) => {
|
|
13
|
+
let t = y.value.x, n = p.value + e.x;
|
|
14
|
+
x();
|
|
15
|
+
let r = n + t * c, i = 0;
|
|
16
|
+
h > 0 && r > h / 2 ? i = h : g > 0 && r < -g / 2 && (i = -g), p.value = i, m.value = i > 0 ? "leading" : i < 0 ? "trailing" : "closed";
|
|
17
|
+
}
|
|
18
|
+
}), S = (e) => {
|
|
19
|
+
p.value = e === "leading" ? h : -g, m.value = e;
|
|
20
|
+
}, C = () => {
|
|
21
|
+
p.value = 0, m.value = "closed", x();
|
|
22
|
+
}, w = (e) => {
|
|
23
|
+
e.onSelect(), C();
|
|
24
|
+
}, T = Math.max(-g, Math.min(h, p.value + v.value.x)), E = (n, r) => /* @__PURE__ */ a("div", {
|
|
25
|
+
className: t(e.panel, e[n]),
|
|
26
|
+
children: r.map((t) => /* @__PURE__ */ o("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
"data-destructive": t.destructive ? "" : void 0,
|
|
29
|
+
className: e.action,
|
|
30
|
+
onFocus: () => S(n),
|
|
31
|
+
onClick: () => w(t),
|
|
32
|
+
children: [t.icon && /* @__PURE__ */ a("span", {
|
|
33
|
+
className: e.actionIcon,
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: t.icon
|
|
36
|
+
}), /* @__PURE__ */ a("span", {
|
|
37
|
+
className: e.actionLabel,
|
|
38
|
+
children: t.label
|
|
39
|
+
})]
|
|
40
|
+
}, t.label))
|
|
41
|
+
});
|
|
42
|
+
return /* @__PURE__ */ o("div", {
|
|
43
|
+
className: t(e.root, f),
|
|
44
|
+
"data-state": m.value,
|
|
45
|
+
onKeyDown: (e) => {
|
|
46
|
+
e.key === "Escape" && m.value !== "closed" && C();
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
u.length > 0 && E("leading", u),
|
|
50
|
+
d.length > 0 && E("trailing", d),
|
|
51
|
+
/* @__PURE__ */ a("div", {
|
|
52
|
+
ref: _,
|
|
53
|
+
className: e.content,
|
|
54
|
+
"data-dragging": b.value ? "" : void 0,
|
|
55
|
+
style: { transform: `translateX(${T}px)` },
|
|
56
|
+
children: l
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { l as SwipeItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './swipe-item.css';
|
|
4
|
+
var e = {
|
|
5
|
+
root: "_root_3ykmd_2",
|
|
6
|
+
panel: "_panel_3ykmd_8",
|
|
7
|
+
leading: "_leading_3ykmd_14",
|
|
8
|
+
trailing: "_trailing_3ykmd_18",
|
|
9
|
+
content: "_content_3ykmd_22",
|
|
10
|
+
action: "_action_3ykmd_37",
|
|
11
|
+
actionIcon: "_actionIcon_3ykmd_64",
|
|
12
|
+
actionLabel: "_actionLabel_3ykmd_70"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._switcher_1f5vq_2{padding:0;padding-inline:var(--cascivo-space-2);flex-direction:column;margin:0;list-style:none;display:flex}._item_1f5vq_11{align-items:center;gap:var(--cascivo-space-3);padding-block:var(--cascivo-space-3);padding-inline:var(--cascivo-space-4);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);border-radius:var(--cascivo-radius-item);color:var(--cascivo-color-text-subtle);transition:color var(--cascivo-duration-150) var(--cascivo-ease-out), background-color var(--cascivo-duration-150) var(--cascivo-ease-out);text-decoration:none;display:flex}._item_1f5vq_11:hover{background:var(--cascivo-color-bg-subtle);color:var(--cascivo-color-text)}._item_1f5vq_11:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._item_1f5vq_11[data-state=active]{background:var(--cascivo-color-active-bg);color:var(--cascivo-color-text);font-weight:var(--cascivo-font-medium)}._icon_1f5vq_43{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._divider_1f5vq_50{block-size:0;margin-block:var(--cascivo-space-2);border-block-start:1px solid var(--cascivo-color-border)}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./switcher.module.js";
|
|
4
|
+
import { cn as t, useSignals 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
|
+
//#region ../components/src/switcher/switcher.tsx
|
|
8
|
+
function s({ items: s, label: c, className: l }) {
|
|
9
|
+
return n(), /* @__PURE__ */ a("ul", {
|
|
10
|
+
"aria-label": c ?? i(r.switcher.label),
|
|
11
|
+
className: t(e.switcher, l),
|
|
12
|
+
children: s.map((t, n) => "divider" in t ? /* @__PURE__ */ a("li", {
|
|
13
|
+
role: "separator",
|
|
14
|
+
className: e.divider
|
|
15
|
+
}, `divider-${n}`) : /* @__PURE__ */ a("li", { children: /* @__PURE__ */ o("a", {
|
|
16
|
+
href: t.href,
|
|
17
|
+
"aria-current": t.active ? "page" : void 0,
|
|
18
|
+
"data-state": t.active ? "active" : void 0,
|
|
19
|
+
className: e.item,
|
|
20
|
+
children: [t.icon && /* @__PURE__ */ a("span", {
|
|
21
|
+
className: e.icon,
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: t.icon
|
|
24
|
+
}), t.label]
|
|
25
|
+
}) }, t.href))
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { s as Switcher };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._tabs_1i48y_2{gap:var(--cascivo-space-4);flex-direction:column;display:flex}._list_1i48y_8{gap:var(--cascivo-space-1);border-block-end:1px solid var(--cascivo-color-border);scroll-snap-type:x proximity;scrollbar-width:thin;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;flex-wrap:nowrap;display:flex;overflow-x:auto}._trigger_1i48y_20{padding-inline:var(--cascivo-space-3);padding-block:var(--cascivo-space-2);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text-subtle);cursor:pointer;transition:color var(--cascivo-duration-150) var(--cascivo-ease-out);background:0 0;border:none;position:relative}._trigger_1i48y_20:after{content:"";background-color:var(--cascivo-color-accent);block-size:2px;transition:scale var(--cascivo-duration-150) var(--cascivo-ease-out);position:absolute;inset-block-end:-1px;inset-inline:0;scale:0 1}._trigger_1i48y_20:hover:not(:disabled){color:var(--cascivo-color-text)}._trigger_1i48y_20:focus-visible{box-shadow:var(--cascivo-focus-ring);border-radius:var(--cascivo-radius-control);outline:none}._trigger_1i48y_20:disabled{opacity:.5;cursor:not-allowed}._trigger_1i48y_20[data-state=active]{color:var(--cascivo-color-text)}._trigger_1i48y_20[data-state=active]:after{scale:1}._content_1i48y_68{font-family:var(--cascivo-font-sans);color:var(--cascivo-color-text)}._content_1i48y_68:focus-visible{box-shadow:var(--cascivo-focus-ring);border-radius:var(--cascivo-radius-control);outline:none}}@media (forced-colors:active){._list_1i48y_8{border-block-end:1px solid buttontext}._trigger_1i48y_20[data-state=active]{border-block-end:2px solid highlight}._trigger_1i48y_20:focus-visible{outline-offset:2px;outline:2px solid highlight}}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./tabs.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { createContext as a, useId as o, useRef as s } from "react";
|
|
7
|
+
//#region ../components/src/tabs/tabs.tsx
|
|
8
|
+
var c = a(null);
|
|
9
|
+
function l({ defaultValue: r, value: a, onValueChange: s, className: l, children: u }) {
|
|
10
|
+
let d = o(), f = n(a ?? r ?? "");
|
|
11
|
+
a !== void 0 && (f.value = a);
|
|
12
|
+
let p = {
|
|
13
|
+
active: f,
|
|
14
|
+
baseId: d,
|
|
15
|
+
setValue: (e) => {
|
|
16
|
+
a === void 0 && (f.value = e), s?.(e);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ i(c.Provider, {
|
|
20
|
+
value: p,
|
|
21
|
+
children: /* @__PURE__ */ i("div", {
|
|
22
|
+
className: t(e.tabs, l),
|
|
23
|
+
children: u
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function u({ className: n, children: r, ...a }) {
|
|
28
|
+
let o = s(null);
|
|
29
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (s) => /* @__PURE__ */ i("div", {
|
|
30
|
+
ref: o,
|
|
31
|
+
role: "tablist",
|
|
32
|
+
className: t(e.list, n),
|
|
33
|
+
onKeyDown: (e) => {
|
|
34
|
+
if (!s || ![
|
|
35
|
+
"ArrowRight",
|
|
36
|
+
"ArrowLeft",
|
|
37
|
+
"Home",
|
|
38
|
+
"End"
|
|
39
|
+
].includes(e.key)) return;
|
|
40
|
+
let t = Array.from(o.current?.querySelectorAll("[role=\"tab\"]:not([disabled])") ?? []);
|
|
41
|
+
if (t.length === 0) return;
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
let n = t.findIndex((e) => e.dataset.value === s.active.value), r = n;
|
|
44
|
+
e.key === "ArrowRight" ? r = (n + 1) % t.length : e.key === "ArrowLeft" ? r = (n - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1);
|
|
45
|
+
let i = t[r];
|
|
46
|
+
i?.focus(), i?.dataset.value && s.setValue(i.dataset.value);
|
|
47
|
+
},
|
|
48
|
+
...a,
|
|
49
|
+
children: r
|
|
50
|
+
}) });
|
|
51
|
+
}
|
|
52
|
+
function d(e) {
|
|
53
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => t ? /* @__PURE__ */ i(f, {
|
|
54
|
+
store: t,
|
|
55
|
+
...e
|
|
56
|
+
}) : null });
|
|
57
|
+
}
|
|
58
|
+
function f({ store: n, value: a, className: o, children: s, disabled: c, ...l }) {
|
|
59
|
+
r();
|
|
60
|
+
let u = n.active.value === a;
|
|
61
|
+
return /* @__PURE__ */ i("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
role: "tab",
|
|
64
|
+
id: `${n.baseId}-trigger-${a}`,
|
|
65
|
+
"aria-selected": u,
|
|
66
|
+
"aria-controls": `${n.baseId}-content-${a}`,
|
|
67
|
+
tabIndex: u ? 0 : -1,
|
|
68
|
+
"data-state": u ? "active" : "inactive",
|
|
69
|
+
"data-value": a,
|
|
70
|
+
disabled: c,
|
|
71
|
+
className: t(e.trigger, o),
|
|
72
|
+
onClick: () => n.setValue(a),
|
|
73
|
+
...l,
|
|
74
|
+
children: s
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function p(e) {
|
|
78
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => t ? /* @__PURE__ */ i(m, {
|
|
79
|
+
store: t,
|
|
80
|
+
...e
|
|
81
|
+
}) : null });
|
|
82
|
+
}
|
|
83
|
+
function m({ store: n, value: a, className: o, children: s, ...c }) {
|
|
84
|
+
return r(), n.active.value === a ? /* @__PURE__ */ i("div", {
|
|
85
|
+
role: "tabpanel",
|
|
86
|
+
id: `${n.baseId}-content-${a}`,
|
|
87
|
+
"aria-labelledby": `${n.baseId}-trigger-${a}`,
|
|
88
|
+
tabIndex: 0,
|
|
89
|
+
className: t(e.content, o),
|
|
90
|
+
...c,
|
|
91
|
+
children: s
|
|
92
|
+
}) : null;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { l as Tabs, p as TabsContent, u as TabsList, d as TabsTrigger };
|
package/dist/tag/tag.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._tag_9ufpk_2{align-items:center;gap:var(--cascivo-space-1);font-family:var(--cascivo-font-sans);font-weight:var(--cascivo-font-medium);border-radius:var(--cascivo-radius-badge);white-space:nowrap;display:inline-flex}._tag_9ufpk_2[data-size=sm]{padding-inline:var(--cascivo-space-2);padding-block:var(--cascivo-space-1);font-size:var(--cascivo-text-xs);line-height:1}._tag_9ufpk_2[data-size=md]{padding-inline:var(--cascivo-space-3);padding-block:var(--cascivo-space-1);font-size:var(--cascivo-text-xs);line-height:var(--cascivo-leading-normal)}._tag_9ufpk_2[data-variant=default]{background-color:var(--cascivo-color-bg-subtle);color:var(--cascivo-color-text-subtle)}._tag_9ufpk_2[data-variant=info]{background-color:var(--cascivo-color-info-subtle);color:var(--cascivo-color-info)}._tag_9ufpk_2[data-variant=success]{background-color:var(--cascivo-color-success-subtle);color:var(--cascivo-color-success)}._tag_9ufpk_2[data-variant=warning]{background-color:var(--cascivo-color-warning-subtle);color:var(--cascivo-color-warning)}._tag_9ufpk_2[data-variant=error]{background-color:var(--cascivo-color-destructive-subtle);color:var(--cascivo-color-destructive)}._dismiss_9ufpk_51{color:currentColor;font-size:inherit;cursor:pointer;border-radius:var(--cascivo-radius-full);opacity:.7;transition:opacity var(--cascivo-duration-150) var(--cascivo-ease-out);background:0 0;border:none;justify-content:center;align-items:center;margin-inline-end:calc(-1 * var(--cascivo-space-1));padding:0;line-height:1;display:inline-flex}._dismiss_9ufpk_51:hover{opacity:1}._dismiss_9ufpk_51:focus-visible{box-shadow:var(--cascivo-focus-ring);opacity:1;outline:none}}
|
package/dist/tag/tag.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./tag.module.js";
|
|
4
|
+
import { cn as t, useSignals 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
|
+
//#region ../components/src/tag/tag.tsx
|
|
8
|
+
function s({ variant: s = "default", size: c = "md", onDismiss: l, dismissLabel: u, className: d, children: f, ...p }) {
|
|
9
|
+
n();
|
|
10
|
+
let m = u ?? i(r.tag.dismiss);
|
|
11
|
+
return /* @__PURE__ */ o("span", {
|
|
12
|
+
"data-variant": s,
|
|
13
|
+
"data-size": c,
|
|
14
|
+
className: t(e.tag, d),
|
|
15
|
+
...p,
|
|
16
|
+
children: [f, l && /* @__PURE__ */ a("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
className: e.dismiss,
|
|
19
|
+
"aria-label": m,
|
|
20
|
+
onClick: l,
|
|
21
|
+
children: "✕"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { s as Tag };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_1ftmq_2{gap:var(--cascivo-space-1);min-height:2.5rem;padding:var(--cascivo-space-2);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);cursor:text;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);flex-wrap:wrap;display:flex}._wrapper_1ftmq_2:focus-within{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._wrapper_1ftmq_2[data-disabled]{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._tag_1ftmq_28{align-items:center;gap:var(--cascivo-space-1);padding-block:var(--cascivo-space-0-5);padding-inline:var(--cascivo-space-2);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background-color:var(--cascivo-color-bg-subtle);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-full);line-height:1.25;display:inline-flex}._tag_1ftmq_28[data-state=invalid]{color:var(--cascivo-color-destructive);background-color:rgb(from var(--cascivo-color-destructive) r g b / .08);border-color:var(--cascivo-color-destructive)}._dismiss_1ftmq_49{border-radius:var(--cascivo-radius-full);width:1rem;height:1rem;color:var(--cascivo-color-text-muted);cursor:pointer;font-size:var(--cascivo-text-sm);background:0 0;border:none;justify-content:center;align-items:center;padding:0;line-height:1;display:inline-flex}._dismiss_1ftmq_49:hover{color:var(--cascivo-color-text);background-color:var(--cascivo-color-border)}._dismiss_1ftmq_49:focus-visible{outline:2px solid var(--cascivo-color-accent);outline-offset:1px}._dismiss_1ftmq_49:disabled{cursor:not-allowed}._input_1ftmq_79{min-width:4rem;font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background:0 0;border:none;outline:none;flex:1}._input_1ftmq_79::placeholder{color:var(--cascivo-color-text-muted)}._input_1ftmq_79:disabled{cursor:not-allowed}}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./tags-input.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
|
+
import { useRef as c } from "react";
|
|
8
|
+
//#region ../components/src/tags-input/tags-input.tsx
|
|
9
|
+
function l({ value: l, onValueChange: u, placeholder: d, validate: f, max: p, disabled: m = !1, className: h, ...g }) {
|
|
10
|
+
r();
|
|
11
|
+
let _ = n(""), v = c(null);
|
|
12
|
+
function y(e) {
|
|
13
|
+
let t = e.trim();
|
|
14
|
+
t && (p !== void 0 && l.length >= p || l.includes(t) || f && !f(t) || (u([...l, t]), _.value = ""));
|
|
15
|
+
}
|
|
16
|
+
function b(e) {
|
|
17
|
+
u(l.filter((t, n) => n !== e));
|
|
18
|
+
}
|
|
19
|
+
let x = d ?? a(i.tagsInput.placeholder);
|
|
20
|
+
return /* @__PURE__ */ s("div", {
|
|
21
|
+
className: t(e.wrapper, h),
|
|
22
|
+
"data-disabled": m ? "" : void 0,
|
|
23
|
+
onClick: () => v.current?.focus(),
|
|
24
|
+
...g,
|
|
25
|
+
children: [l.map((t, n) => {
|
|
26
|
+
let r = f ? !f(t) : !1;
|
|
27
|
+
return /* @__PURE__ */ s("span", {
|
|
28
|
+
className: e.tag,
|
|
29
|
+
"data-state": r ? "invalid" : void 0,
|
|
30
|
+
children: [t, /* @__PURE__ */ o("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
className: e.dismiss,
|
|
33
|
+
"aria-label": a(i.tagsInput.remove, { tag: t }),
|
|
34
|
+
disabled: m,
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
e.stopPropagation(), b(n);
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ o("span", {
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: "×"
|
|
41
|
+
})
|
|
42
|
+
})]
|
|
43
|
+
}, n);
|
|
44
|
+
}), /* @__PURE__ */ o("input", {
|
|
45
|
+
ref: v,
|
|
46
|
+
className: e.input,
|
|
47
|
+
value: _.value,
|
|
48
|
+
placeholder: l.length === 0 ? x : void 0,
|
|
49
|
+
disabled: m,
|
|
50
|
+
onChange: (e) => {
|
|
51
|
+
_.value = e.currentTarget.value;
|
|
52
|
+
},
|
|
53
|
+
onKeyDown: (e) => {
|
|
54
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), y(_.value)) : e.key === "Backspace" && !_.value && b(l.length - 1);
|
|
55
|
+
},
|
|
56
|
+
onBlur: () => {
|
|
57
|
+
_.value && y(_.value);
|
|
58
|
+
}
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { l as TagsInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._text_18h86_2{font-family:var(--cascivo-font-sans);line-height:var(--cascivo-leading-normal);color:var(--cascivo-color-text);margin:0}._text_18h86_2[data-size=sm]{font-size:var(--cascivo-text-sm)}._text_18h86_2[data-size=md]{font-size:var(--cascivo-text-base)}._text_18h86_2[data-size=lg]{font-size:var(--cascivo-text-lg)}._text_18h86_2[data-weight=normal]{font-weight:var(--cascivo-font-normal)}._text_18h86_2[data-weight=medium]{font-weight:var(--cascivo-font-medium)}._text_18h86_2[data-weight=semibold]{font-weight:var(--cascivo-font-semibold)}._text_18h86_2[data-muted]{color:var(--cascivo-color-text-subtle)}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./text.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/text/text.tsx
|
|
7
|
+
function r({ as: r = "p", size: i = "md", weight: a = "normal", muted: o = !1, className: s, children: c, ...l }) {
|
|
8
|
+
return /* @__PURE__ */ n(r, {
|
|
9
|
+
"data-size": i,
|
|
10
|
+
"data-weight": a,
|
|
11
|
+
"data-muted": o ? "" : void 0,
|
|
12
|
+
className: t(e.text, s),
|
|
13
|
+
...l,
|
|
14
|
+
children: c
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as Text };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_xbrwe_2{gap:var(--cascivo-space-1);flex-direction:column;display:flex}._wrapper_xbrwe_2[data-resize=none] ._textarea_xbrwe_7{resize:none}._wrapper_xbrwe_2[data-resize=vertical] ._textarea_xbrwe_7{resize:vertical}._wrapper_xbrwe_2[data-resize=both] ._textarea_xbrwe_7{resize:both}._label_xbrwe_18{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text);line-height:var(--cascivo-leading-snug)}._textarea_xbrwe_7{width:100%;min-block-size:4rem;padding-inline:var(--cascivo-space-4);padding-block:var(--cascivo-space-3);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);line-height:var(--cascivo-leading-normal);color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);outline:none}._textarea_xbrwe_7::placeholder{color:var(--cascivo-color-text-muted)}._textarea_xbrwe_7:hover:not(:disabled):not(:focus){border-color:var(--cascivo-color-border-strong)}._textarea_xbrwe_7:focus{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._textarea_xbrwe_7:disabled{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._wrapper_xbrwe_2[data-state=error] ._textarea_xbrwe_7{border-color:var(--cascivo-color-destructive)}._wrapper_xbrwe_2[data-state=error] ._textarea_xbrwe_7:focus{box-shadow:0 0 0 3px rgb(from var(--cascivo-color-destructive) r g b / .3)}._error_xbrwe_71{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-destructive);line-height:var(--cascivo-leading-snug)}._hint_xbrwe_78{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-snug)}@media (pointer:coarse){._textarea_xbrwe_7{min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}}@media (forced-colors:active){._textarea_xbrwe_7{color:fieldtext;background-color:field;border:1px solid fieldtext}._textarea_xbrwe_7:focus{outline-offset:2px;outline:2px solid highlight}}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./textarea.module.js";
|
|
4
|
+
import { cn as t, createMachine as n, useMachine as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/textarea/textarea.tsx
|
|
7
|
+
var o = n({
|
|
8
|
+
initial: "idle",
|
|
9
|
+
states: {
|
|
10
|
+
idle: { on: { FOCUS: "focused" } },
|
|
11
|
+
focused: { on: { BLUR: "idle" } }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function s({ label: n, hint: s, error: c, resize: l = "vertical", rows: u = 4, className: d, id: f, onFocus: p, onBlur: m, ...h }) {
|
|
15
|
+
let [g, _] = r(o), v = f ?? (n ? `cascade-textarea-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
16
|
+
return /* @__PURE__ */ a("div", {
|
|
17
|
+
className: t(e.wrapper, d),
|
|
18
|
+
"data-state": c ? "error" : g.value,
|
|
19
|
+
"data-resize": l,
|
|
20
|
+
children: [
|
|
21
|
+
n && /* @__PURE__ */ i("label", {
|
|
22
|
+
className: e.label,
|
|
23
|
+
htmlFor: v,
|
|
24
|
+
children: n
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ i("textarea", {
|
|
27
|
+
id: v,
|
|
28
|
+
rows: u,
|
|
29
|
+
"aria-multiline": "true",
|
|
30
|
+
className: e.textarea,
|
|
31
|
+
"aria-invalid": c ? !0 : void 0,
|
|
32
|
+
"aria-describedby": c ? `${v}-error` : s ? `${v}-hint` : void 0,
|
|
33
|
+
onFocus: (e) => {
|
|
34
|
+
_("FOCUS"), p?.(e);
|
|
35
|
+
},
|
|
36
|
+
onBlur: (e) => {
|
|
37
|
+
_("BLUR"), m?.(e);
|
|
38
|
+
},
|
|
39
|
+
...h
|
|
40
|
+
}),
|
|
41
|
+
c && /* @__PURE__ */ i("span", {
|
|
42
|
+
id: `${v}-error`,
|
|
43
|
+
className: e.error,
|
|
44
|
+
role: "alert",
|
|
45
|
+
children: c
|
|
46
|
+
}),
|
|
47
|
+
!c && s && /* @__PURE__ */ i("span", {
|
|
48
|
+
id: `${v}-hint`,
|
|
49
|
+
className: e.hint,
|
|
50
|
+
children: s
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { s as Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._tile_1wkku_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:var(--cascivo-color-bg);color:var(--cascivo-color-text);cursor:pointer;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), background-color var(--cascivo-duration-150) var(--cascivo-ease-out);align-items:flex-start;display:flex}._tile_1wkku_2:hover:not([data-disabled]){border-color:var(--cascivo-color-border-strong)}._tile_1wkku_2:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._tile_1wkku_2[data-selected]{border-color:var(--cascivo-color-accent);background:color-mix(in oklch, var(--cascivo-color-accent) 4%, var(--cascivo-color-bg))}._tile_1wkku_2[data-disabled]{opacity:.5;cursor:not-allowed}._icon_1wkku_36{block-size:1.5rem;inline-size:1.5rem;color:var(--cascivo-color-text-muted);flex:none;place-items:center;display:grid}._tile_1wkku_2[data-selected] ._icon_1wkku_36{color:var(--cascivo-color-accent)}._body_1wkku_49{gap:var(--cascivo-space-1);font-size:var(--cascivo-text-sm);flex-direction:column;display:flex}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./tile.module.js";
|
|
4
|
+
import { Slot as t, cn as n, useControllableSignal as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/tile/tile.tsx
|
|
7
|
+
function s({ value: s, selected: c, defaultSelected: l, onSelect: u, selectable: d = "single", disabled: f, icon: p, asChild: m, children: h, className: g }) {
|
|
8
|
+
i();
|
|
9
|
+
let [_, v] = r({
|
|
10
|
+
value: c,
|
|
11
|
+
defaultValue: l ?? !1,
|
|
12
|
+
onChange: () => u?.(s)
|
|
13
|
+
}), y = () => {
|
|
14
|
+
f || v(d === "multi" ? !_.value : !0);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ o(m ? t : "div", {
|
|
17
|
+
role: d === "multi" ? "checkbox" : "radio",
|
|
18
|
+
"aria-checked": _.value,
|
|
19
|
+
"aria-disabled": f || void 0,
|
|
20
|
+
tabIndex: f ? -1 : 0,
|
|
21
|
+
"data-selected": _.value || void 0,
|
|
22
|
+
"data-disabled": f || void 0,
|
|
23
|
+
className: n(e.tile, g),
|
|
24
|
+
onClick: y,
|
|
25
|
+
onKeyDown: (e) => {
|
|
26
|
+
(e.key === " " || e.key === "Enter") && (e.preventDefault(), y());
|
|
27
|
+
},
|
|
28
|
+
children: [p && /* @__PURE__ */ a("span", {
|
|
29
|
+
className: e.icon,
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
children: p
|
|
32
|
+
}), /* @__PURE__ */ a("span", {
|
|
33
|
+
className: e.body,
|
|
34
|
+
children: h
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { s as Tile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_shh6w_2{gap:var(--cascivo-space-1);font-family:var(--cascivo-font-sans);flex-direction:column;display:flex}._wrapper_shh6w_2[data-size=sm]{--_height:2rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-3)}._wrapper_shh6w_2[data-size=md]{--_height:2.5rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-4)}._wrapper_shh6w_2[data-size=lg]{--_height:3rem;--_font:var(--cascivo-text-base);--_px:var(--cascivo-space-4)}._label_shh6w_25{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text);line-height:var(--cascivo-leading-snug)}._input_shh6w_32{block-size:var(--_height,2.5rem);padding-inline:var(--_px,var(--cascivo-space-4));font-family:var(--cascivo-font-sans);font-size:var(--_font,var(--cascivo-text-sm));color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);outline:none}._input_shh6w_32:hover:not(:disabled):not(:focus-visible){border-color:var(--cascivo-color-border-strong)}._input_shh6w_32:focus-visible{border-color:var(--cascivo-color-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--cascivo-color-accent) 20%, transparent)}._input_shh6w_32:disabled{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._wrapper_shh6w_2[data-state=error] ._input_shh6w_32{border-color:var(--cascivo-color-danger)}._error_shh6w_66{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-danger)}._hint_shh6w_71{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-text-muted)}}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./time-picker.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/time-picker/time-picker.tsx
|
|
7
|
+
var s = n({
|
|
8
|
+
initial: "idle",
|
|
9
|
+
states: {
|
|
10
|
+
idle: { on: { FOCUS: "focused" } },
|
|
11
|
+
focused: { on: { BLUR: "idle" } }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function c({ value: n, defaultValue: c, onChange: l, min: u, max: d, step: f, label: p, hint: m, error: h, size: g = "md", className: _, id: v, onFocus: y, onBlur: b, ...x }) {
|
|
15
|
+
i();
|
|
16
|
+
let [S, C] = r(s), w = v ?? (p ? `cascade-time-picker-${p.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
17
|
+
return /* @__PURE__ */ o("div", {
|
|
18
|
+
className: t(e.wrapper, _),
|
|
19
|
+
"data-state": h ? "error" : S.value,
|
|
20
|
+
"data-size": g,
|
|
21
|
+
children: [
|
|
22
|
+
p && /* @__PURE__ */ a("label", {
|
|
23
|
+
className: e.label,
|
|
24
|
+
htmlFor: w,
|
|
25
|
+
children: p
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ a("input", {
|
|
28
|
+
id: w,
|
|
29
|
+
type: "time",
|
|
30
|
+
className: e.input,
|
|
31
|
+
value: n,
|
|
32
|
+
defaultValue: c,
|
|
33
|
+
min: u,
|
|
34
|
+
max: d,
|
|
35
|
+
step: f,
|
|
36
|
+
"aria-invalid": h ? !0 : void 0,
|
|
37
|
+
"aria-describedby": h ? `${w}-error` : m ? `${w}-hint` : void 0,
|
|
38
|
+
onChange: (e) => l?.(e.target.value),
|
|
39
|
+
onFocus: (e) => {
|
|
40
|
+
C("FOCUS"), y?.(e);
|
|
41
|
+
},
|
|
42
|
+
onBlur: (e) => {
|
|
43
|
+
C("BLUR"), b?.(e);
|
|
44
|
+
},
|
|
45
|
+
...x
|
|
46
|
+
}),
|
|
47
|
+
h && /* @__PURE__ */ a("span", {
|
|
48
|
+
id: `${w}-error`,
|
|
49
|
+
className: e.error,
|
|
50
|
+
role: "alert",
|
|
51
|
+
children: h
|
|
52
|
+
}),
|
|
53
|
+
!h && m && /* @__PURE__ */ a("span", {
|
|
54
|
+
id: `${w}-hint`,
|
|
55
|
+
className: e.hint,
|
|
56
|
+
children: m
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { c as TimePicker };
|