@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,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './notification.css';
|
|
4
|
+
var e = {
|
|
5
|
+
notification: "_notification_10586_2",
|
|
6
|
+
icon: "_icon_10586_58",
|
|
7
|
+
body: "_body_10586_79",
|
|
8
|
+
title: "_title_10586_87",
|
|
9
|
+
description: "_description_10586_93",
|
|
10
|
+
actions: "_actions_10586_99",
|
|
11
|
+
dismiss: "_dismiss_10586_106"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_q5e5w_2{gap:var(--cascivo-space-1);--_stepper-width:1.5rem;flex-direction:column;display:flex}._wrapper_q5e5w_2[data-size=sm]{--_input-height:2rem;--_input-font:var(--cascivo-text-sm);--_input-px:var(--cascivo-space-3)}._wrapper_q5e5w_2[data-size=md]{--_input-height:2.5rem;--_input-font:var(--cascivo-text-sm);--_input-px:var(--cascivo-space-4)}._wrapper_q5e5w_2[data-size=lg]{--_input-height:3rem;--_input-font:var(--cascivo-text-base);--_input-px:var(--cascivo-space-4)}._label_q5e5w_27{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)}._field_q5e5w_35{position:relative}._input_q5e5w_39{width:100%;height:var(--_input-height,2.5rem);font-family:var(--cascivo-font-sans);font-size:var(--_input-font,var(--cascivo-text-sm));font-variant-numeric:tabular-nums;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;padding-inline-start:var(--_input-px,var(--cascivo-space-4));padding-inline-end:calc(var(--_stepper-width) + var(--cascivo-space-2))}._input_q5e5w_39::placeholder{color:var(--cascivo-color-text-muted)}._input_q5e5w_39:hover:not(:disabled):not(:focus){border-color:var(--cascivo-color-border-strong)}._input_q5e5w_39:focus{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._input_q5e5w_39:disabled{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._wrapper_q5e5w_2[data-state=error] ._input_q5e5w_39{border-color:var(--cascivo-color-destructive)}._wrapper_q5e5w_2[data-state=error] ._input_q5e5w_39:focus{box-shadow:0 0 0 3px rgb(from var(--cascivo-color-destructive) r g b / .3)}._steppers_q5e5w_84{inline-size:var(--_stepper-width);border-start-end-radius:calc(var(--cascivo-radius-field) - 1px);border-end-end-radius:calc(var(--cascivo-radius-field) - 1px);flex-direction:column;display:flex;position:absolute;inset-block:1px;inset-inline-end:1px;overflow:hidden}._stepper_q5e5w_84{border:none;border-inline-start:1px solid var(--cascivo-color-border);color:var(--cascivo-color-text-subtle);cursor:pointer;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out), color var(--cascivo-duration-150) var(--cascivo-ease-out);background-color:#0000;flex:1;justify-content:center;align-items:center;padding:0;display:flex}._stepper_q5e5w_84+._stepper_q5e5w_84{border-block-start:1px solid var(--cascivo-color-border)}._stepper_q5e5w_84:hover:not(:disabled){background-color:var(--cascivo-color-bg-subtle);color:var(--cascivo-color-text)}._stepper_q5e5w_84:disabled{opacity:.5;cursor:not-allowed}._stepper_q5e5w_84 svg{block-size:.625rem;inline-size:.625rem}._error_q5e5w_131{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-destructive);line-height:var(--cascivo-leading-snug)}._hint_q5e5w_138{font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-snug)}}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./number-input.module.js";
|
|
4
|
+
import { cn as t, createMachine as n, useMachine as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
5
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
//#region ../components/src/number-input/number-input.tsx
|
|
8
|
+
var u = n({
|
|
9
|
+
initial: "idle",
|
|
10
|
+
states: {
|
|
11
|
+
idle: { on: { FOCUS: "focused" } },
|
|
12
|
+
focused: { on: { BLUR: "idle" } }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
function d(e, t, n) {
|
|
16
|
+
let r = e;
|
|
17
|
+
return t !== void 0 && (r = Math.max(r, t)), n !== void 0 && (r = Math.min(r, n)), r;
|
|
18
|
+
}
|
|
19
|
+
function f(e) {
|
|
20
|
+
let t = String(e), n = t.indexOf(".");
|
|
21
|
+
return n === -1 ? 0 : t.length - n - 1;
|
|
22
|
+
}
|
|
23
|
+
function p(e, t) {
|
|
24
|
+
let n = 10 ** t;
|
|
25
|
+
return Math.round(e * n) / n;
|
|
26
|
+
}
|
|
27
|
+
function m(e) {
|
|
28
|
+
let t = e.trim();
|
|
29
|
+
if (t === "") return null;
|
|
30
|
+
let n = Number(t);
|
|
31
|
+
return Number.isFinite(n) ? n : null;
|
|
32
|
+
}
|
|
33
|
+
function h({ value: n, defaultValue: h, onChange: g, min: _, max: v, step: y = 1, precision: b, formatOptions: x, label: S, hint: C, error: w, size: T = "md", disabled: E, incrementLabel: D, decrementLabel: O, className: k, id: A, onFocus: j, onBlur: M, onKeyDown: N, ...P }) {
|
|
34
|
+
a();
|
|
35
|
+
let F = D ?? s(o.numberInput.increment), I = O ?? s(o.numberInput.decrement), [L, R] = r(u), z = n !== void 0, B = i(h ?? null), V = i(""), H = z ? n : B.value, U = A ?? (S ? `cascade-number-input-${S.toLowerCase().replace(/\s+/g, "-")}` : void 0), W = (e) => {
|
|
36
|
+
z || (B.value = e), V.value = e == null ? "" : String(e), e !== H && g?.(e);
|
|
37
|
+
}, G = () => {
|
|
38
|
+
let e = m(V.value);
|
|
39
|
+
e != null && (e = d(e, _, v), b !== void 0 && (e = p(e, b))), W(e);
|
|
40
|
+
}, K = (e) => {
|
|
41
|
+
let t = (L.value === "focused" ? m(V.value) : H) ?? 0, n = b ?? Math.max(f(y), f(t));
|
|
42
|
+
W(d(p(t + e * y, n), _, v));
|
|
43
|
+
}, q = L.value === "focused" ? V.value : ((e) => e == null ? "" : x ? new Intl.NumberFormat(void 0, x).format(e) : String(e))(H), J = H != null && v !== void 0 && H >= v, Y = H != null && _ !== void 0 && H <= _;
|
|
44
|
+
return /* @__PURE__ */ l("div", {
|
|
45
|
+
className: t(e.wrapper, k),
|
|
46
|
+
"data-state": w ? "error" : L.value,
|
|
47
|
+
"data-size": T,
|
|
48
|
+
children: [
|
|
49
|
+
S && /* @__PURE__ */ c("label", {
|
|
50
|
+
className: e.label,
|
|
51
|
+
htmlFor: U,
|
|
52
|
+
children: S
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ l("div", {
|
|
55
|
+
className: e.field,
|
|
56
|
+
children: [/* @__PURE__ */ c("input", {
|
|
57
|
+
id: U,
|
|
58
|
+
type: "text",
|
|
59
|
+
inputMode: "decimal",
|
|
60
|
+
autoComplete: "off",
|
|
61
|
+
role: "spinbutton",
|
|
62
|
+
className: e.input,
|
|
63
|
+
value: q,
|
|
64
|
+
disabled: E,
|
|
65
|
+
"aria-valuenow": H ?? void 0,
|
|
66
|
+
"aria-valuemin": _,
|
|
67
|
+
"aria-valuemax": v,
|
|
68
|
+
"aria-invalid": w ? !0 : void 0,
|
|
69
|
+
"aria-describedby": w ? `${U}-error` : C ? `${U}-hint` : void 0,
|
|
70
|
+
onChange: (e) => {
|
|
71
|
+
V.value = e.target.value;
|
|
72
|
+
},
|
|
73
|
+
onFocus: (e) => {
|
|
74
|
+
V.value = H == null ? "" : String(H), R("FOCUS"), j?.(e);
|
|
75
|
+
},
|
|
76
|
+
onBlur: (e) => {
|
|
77
|
+
G(), R("BLUR"), M?.(e);
|
|
78
|
+
},
|
|
79
|
+
onKeyDown: (e) => {
|
|
80
|
+
e.key === "ArrowUp" ? (e.preventDefault(), K(1)) : e.key === "ArrowDown" ? (e.preventDefault(), K(-1)) : e.key === "Enter" && G(), N?.(e);
|
|
81
|
+
},
|
|
82
|
+
...P
|
|
83
|
+
}), /* @__PURE__ */ l("div", {
|
|
84
|
+
className: e.steppers,
|
|
85
|
+
children: [/* @__PURE__ */ c("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
className: e.stepper,
|
|
88
|
+
"aria-label": F,
|
|
89
|
+
tabIndex: -1,
|
|
90
|
+
disabled: E || J,
|
|
91
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
92
|
+
onClick: () => K(1),
|
|
93
|
+
children: /* @__PURE__ */ c("svg", {
|
|
94
|
+
viewBox: "0 0 10 10",
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
focusable: "false",
|
|
97
|
+
children: /* @__PURE__ */ c("path", {
|
|
98
|
+
d: "M2 6.5 5 3.5 8 6.5",
|
|
99
|
+
fill: "none",
|
|
100
|
+
stroke: "currentColor",
|
|
101
|
+
strokeWidth: "1.5",
|
|
102
|
+
strokeLinecap: "round",
|
|
103
|
+
strokeLinejoin: "round"
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
}), /* @__PURE__ */ c("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
className: e.stepper,
|
|
109
|
+
"aria-label": I,
|
|
110
|
+
tabIndex: -1,
|
|
111
|
+
disabled: E || Y,
|
|
112
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
113
|
+
onClick: () => K(-1),
|
|
114
|
+
children: /* @__PURE__ */ c("svg", {
|
|
115
|
+
viewBox: "0 0 10 10",
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
focusable: "false",
|
|
118
|
+
children: /* @__PURE__ */ c("path", {
|
|
119
|
+
d: "M2 3.5 5 6.5 8 3.5",
|
|
120
|
+
fill: "none",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth: "1.5",
|
|
123
|
+
strokeLinecap: "round",
|
|
124
|
+
strokeLinejoin: "round"
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
})]
|
|
128
|
+
})]
|
|
129
|
+
}),
|
|
130
|
+
w && /* @__PURE__ */ c("span", {
|
|
131
|
+
id: `${U}-error`,
|
|
132
|
+
className: e.error,
|
|
133
|
+
role: "alert",
|
|
134
|
+
children: w
|
|
135
|
+
}),
|
|
136
|
+
!w && C && /* @__PURE__ */ c("span", {
|
|
137
|
+
id: `${U}-hint`,
|
|
138
|
+
className: e.hint,
|
|
139
|
+
children: C
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { h as NumberInput };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './number-input.css';
|
|
4
|
+
var e = {
|
|
5
|
+
wrapper: "_wrapper_q5e5w_2",
|
|
6
|
+
label: "_label_q5e5w_27",
|
|
7
|
+
field: "_field_q5e5w_35",
|
|
8
|
+
input: "_input_q5e5w_39",
|
|
9
|
+
steppers: "_steppers_q5e5w_84",
|
|
10
|
+
stepper: "_stepper_q5e5w_84",
|
|
11
|
+
error: "_error_q5e5w_131",
|
|
12
|
+
hint: "_hint_q5e5w_138"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_15f1m_2{gap:var(--cascivo-space-2);align-items:center;display:flex}._slot_15f1m_8{width:2.75rem;height:3rem;font-family:var(--cascivo-font-mono,var(--cascivo-font-sans));font-size:var(--cascivo-text-xl);font-weight:var(--cascivo-font-semibold);text-align:center;color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1.5px 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);caret-color:#0000;outline:none}._slot_15f1m_8:hover:not(:disabled){border-color:var(--cascivo-color-border-strong)}._slot_15f1m_8:focus{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._slot_15f1m_8[data-filled]{border-color:var(--cascivo-color-border-strong);background-color:var(--cascivo-color-bg-subtle)}._slot_15f1m_8:disabled{opacity:.5;cursor:not-allowed}}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./otp-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 } from "react/jsx-runtime";
|
|
7
|
+
import { useRef as s } from "react";
|
|
8
|
+
//#region ../components/src/otp-input/otp-input.tsx
|
|
9
|
+
function c({ length: c = 6, value: l, onValueChange: u, disabled: d = !1, type: f = "numeric", className: p, ...m }) {
|
|
10
|
+
r();
|
|
11
|
+
let h = n(Array.from({ length: c }, (e, t) => l[t] ?? "")), g = s([]), _ = Array.from({ length: c }, (e, t) => l[t] ?? "");
|
|
12
|
+
JSON.stringify(h.value) !== JSON.stringify(_) && (h.value = _);
|
|
13
|
+
function v(e) {
|
|
14
|
+
u(e.join("")), h.value = e;
|
|
15
|
+
}
|
|
16
|
+
function y(e) {
|
|
17
|
+
let t = Math.max(0, Math.min(c - 1, e));
|
|
18
|
+
g.current[t]?.focus();
|
|
19
|
+
}
|
|
20
|
+
function b(e, t) {
|
|
21
|
+
if (!(f === "numeric" ? /^\d$/ : /^[a-zA-Z0-9]$/).test(t)) return;
|
|
22
|
+
let n = [...h.value];
|
|
23
|
+
n[e] = t, v(n), e < c - 1 && y(e + 1);
|
|
24
|
+
}
|
|
25
|
+
function x(e, t) {
|
|
26
|
+
if (t.key === "Backspace") {
|
|
27
|
+
t.preventDefault();
|
|
28
|
+
let n = [...h.value];
|
|
29
|
+
n[e] ? (n[e] = "", v(n)) : e > 0 && (n[e - 1] = "", v(n), y(e - 1));
|
|
30
|
+
} else t.key === "ArrowLeft" ? (t.preventDefault(), y(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), y(e + 1));
|
|
31
|
+
}
|
|
32
|
+
function S(e, t) {
|
|
33
|
+
let n = t.clipboardData.getData("text").replace(/\s/g, "").slice(0, c - e);
|
|
34
|
+
if (!(f === "numeric" ? /^\d+$/ : /^[a-zA-Z0-9]+$/).test(n)) return;
|
|
35
|
+
t.preventDefault();
|
|
36
|
+
let r = [...h.value];
|
|
37
|
+
for (let t = 0; t < n.length; t++) e + t < c && (r[e + t] = n[t] ?? "");
|
|
38
|
+
v(r), y(Math.min(e + n.length, c - 1));
|
|
39
|
+
}
|
|
40
|
+
let C = a(i.otpInput.label);
|
|
41
|
+
return /* @__PURE__ */ o("div", {
|
|
42
|
+
className: t(e.wrapper, p),
|
|
43
|
+
role: "group",
|
|
44
|
+
"aria-label": C,
|
|
45
|
+
...m,
|
|
46
|
+
children: h.value.map((t, n) => /* @__PURE__ */ o("input", {
|
|
47
|
+
ref: (e) => {
|
|
48
|
+
g.current[n] = e;
|
|
49
|
+
},
|
|
50
|
+
type: f === "numeric" ? "tel" : "text",
|
|
51
|
+
inputMode: f === "numeric" ? "numeric" : "text",
|
|
52
|
+
className: e.slot,
|
|
53
|
+
value: t,
|
|
54
|
+
maxLength: 1,
|
|
55
|
+
"aria-label": a(i.otpInput.digit, { n: String(n + 1) }),
|
|
56
|
+
autoComplete: n === 0 ? "one-time-code" : "off",
|
|
57
|
+
disabled: d,
|
|
58
|
+
"data-filled": t ? "" : void 0,
|
|
59
|
+
onChange: (e) => {
|
|
60
|
+
let t = e.currentTarget.value.slice(-1);
|
|
61
|
+
t && b(n, t);
|
|
62
|
+
},
|
|
63
|
+
onKeyDown: (e) => x(n, e),
|
|
64
|
+
onPaste: (e) => S(n, e),
|
|
65
|
+
onFocus: (e) => e.currentTarget.select()
|
|
66
|
+
}, n))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { c as OtpInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._root_14jtg_2{display:inline-flex}._trigger_14jtg_6{color:var(--cascivo-color-text-muted);border-radius:var(--cascivo-radius-control);cursor:pointer;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out), color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);background-color:#0000;border:1px solid #0000;justify-content:center;align-items:center;padding:0;display:inline-flex}._trigger_14jtg_6[data-size=sm]{block-size:2rem;inline-size:2rem}._trigger_14jtg_6[data-size=md]{block-size:2.5rem;inline-size:2.5rem}._trigger_14jtg_6:hover:not(:disabled){color:var(--cascivo-color-text);background-color:var(--cascivo-color-bg-subtle)}._trigger_14jtg_6:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._trigger_14jtg_6:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}._destructive-flag_14jtg_49{display:none}._root_14jtg_2 [role=menuitem]:has(._destructive-flag_14jtg_49){color:var(--cascivo-color-destructive)}._root_14jtg_2 [role=menuitem]:has(._destructive-flag_14jtg_49):hover:not(:disabled),._root_14jtg_2 [role=menuitem]:has(._destructive-flag_14jtg_49):focus-visible{background-color:var(--cascivo-color-destructive-subtle)}._root_14jtg_2 [role=menuitem]:has(._destructive-flag_14jtg_49)>span{color:inherit}._root_14jtg_2 [role=menuitem]>span:has(>._destructive-flag_14jtg_49:only-child){display:none}}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Dropdown as e } from "../dropdown/dropdown.js";
|
|
4
|
+
import t from "./overflow-menu.module.js";
|
|
5
|
+
import { cn as n, useSignals as r } from "@cascivo/core";
|
|
6
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
//#region ../components/src/overflow-menu/overflow-menu.tsx
|
|
9
|
+
function l() {
|
|
10
|
+
return /* @__PURE__ */ c("svg", {
|
|
11
|
+
viewBox: "0 0 16 16",
|
|
12
|
+
width: "16",
|
|
13
|
+
height: "16",
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ s("circle", {
|
|
18
|
+
cx: "8",
|
|
19
|
+
cy: "3",
|
|
20
|
+
r: "1.5"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ s("circle", {
|
|
23
|
+
cx: "8",
|
|
24
|
+
cy: "8",
|
|
25
|
+
r: "1.5"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ s("circle", {
|
|
28
|
+
cx: "8",
|
|
29
|
+
cy: "13",
|
|
30
|
+
r: "1.5"
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function u({ items: u, onSelect: d, placement: f = "bottom-end", ariaLabel: p, size: m = "md", disabled: h = !1, className: g }) {
|
|
36
|
+
r();
|
|
37
|
+
let _ = p ?? a(i.overflowMenu.trigger), v = u.map((e) => {
|
|
38
|
+
let n = {
|
|
39
|
+
label: e.label,
|
|
40
|
+
value: e.value
|
|
41
|
+
};
|
|
42
|
+
return e.disabled !== void 0 && (n.disabled = e.disabled), e.destructive ? n.icon = /* @__PURE__ */ c(o, { children: [e.icon, /* @__PURE__ */ s("span", {
|
|
43
|
+
className: t["destructive-flag"],
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
})] }) : e.icon !== void 0 && (n.icon = e.icon), n;
|
|
46
|
+
});
|
|
47
|
+
return /* @__PURE__ */ s("div", {
|
|
48
|
+
className: n(t.root, g),
|
|
49
|
+
children: /* @__PURE__ */ s(e, {
|
|
50
|
+
items: v,
|
|
51
|
+
onSelect: (e) => d?.(e),
|
|
52
|
+
placement: f,
|
|
53
|
+
trigger: /* @__PURE__ */ s("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
className: t.trigger,
|
|
56
|
+
"data-size": m,
|
|
57
|
+
disabled: h,
|
|
58
|
+
"aria-label": _,
|
|
59
|
+
children: /* @__PURE__ */ s(l, {})
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { u as OverflowMenu };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._pagination_1rt7c_2{align-items:center;gap:var(--cascivo-space-4);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);flex-wrap:wrap;display:flex;container-type:inline-size}._group_1rt7c_13{align-items:center;gap:var(--cascivo-space-2);display:flex}._label_1rt7c_19{color:var(--cascivo-color-text-muted);line-height:var(--cascivo-leading-snug);white-space:nowrap}._range_1rt7c_25{color:var(--cascivo-color-text-muted);line-height:var(--cascivo-leading-snug);white-space:nowrap}@container (width<=28rem){._range_1rt7c_25{display:none}}._select_1rt7c_35{appearance:none;height:2rem;font-family:var(--cascivo-font-sans);font-size: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);cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='gray' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right var(--cascivo-space-1) center;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);background-size:1rem;outline:none;padding-inline-start:var(--cascivo-space-2);padding-inline-end:var(--cascivo-space-6)}._select_1rt7c_35:hover:not(:disabled):not(:focus){border-color:var(--cascivo-color-border-strong)}._select_1rt7c_35:focus-visible{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._select_1rt7c_35: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)){background-position:left var(--cascivo-space-1) center}._buttons_1rt7c_70{align-items:center;gap:var(--cascivo-space-1);display:flex}._button_1rt7c_70{block-size:2rem;inline-size:2rem;font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-lg);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), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);background-color:#0000;border:1px solid #0000;justify-content:center;align-items:center;display:inline-flex}._button_1rt7c_70:hover:not(:disabled){background-color:var(--cascivo-color-bg-subtle)}._button_1rt7c_70:active:not(:disabled){background-color:var(--cascivo-color-accent-subtle)}._button_1rt7c_70:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._button_1rt7c_70:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./pagination.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/pagination/pagination.tsx
|
|
8
|
+
var s = [
|
|
9
|
+
10,
|
|
10
|
+
25,
|
|
11
|
+
50,
|
|
12
|
+
100
|
|
13
|
+
];
|
|
14
|
+
function c({ page: c, pageSize: l, totalItems: u, onPageChange: d, onPageSizeChange: f, pageSizeOptions: p = s, labels: m, className: h }) {
|
|
15
|
+
n();
|
|
16
|
+
let g = Math.max(1, Math.ceil(u / l)), _ = Math.min(Math.max(c, 1), g), v = u === 0 ? 0 : (_ - 1) * l + 1, y = Math.min(_ * l, u), b = m?.nav ?? i(r.pagination.nav), x = m?.itemsPerPage ?? i(r.pagination.itemsPerPage), S = m?.pageOf?.(_, g) ?? i(r.pagination.pageOf, {
|
|
17
|
+
page: _,
|
|
18
|
+
total: g
|
|
19
|
+
}), C = m?.range?.(v, y, u) ?? i(r.pagination.range, {
|
|
20
|
+
start: v,
|
|
21
|
+
end: y,
|
|
22
|
+
total: u
|
|
23
|
+
}), w = m?.previous ?? i(r.pagination.previous), T = m?.next ?? i(r.pagination.next);
|
|
24
|
+
return /* @__PURE__ */ o("nav", {
|
|
25
|
+
"aria-label": b,
|
|
26
|
+
className: t(e.pagination, h),
|
|
27
|
+
children: [
|
|
28
|
+
f && /* @__PURE__ */ o("label", {
|
|
29
|
+
className: e.group,
|
|
30
|
+
children: [/* @__PURE__ */ a("span", {
|
|
31
|
+
className: e.label,
|
|
32
|
+
children: x
|
|
33
|
+
}), /* @__PURE__ */ a("select", {
|
|
34
|
+
className: e.select,
|
|
35
|
+
value: l,
|
|
36
|
+
onChange: (e) => f(Number(e.target.value)),
|
|
37
|
+
children: p.map((e) => /* @__PURE__ */ a("option", {
|
|
38
|
+
value: e,
|
|
39
|
+
children: e
|
|
40
|
+
}, e))
|
|
41
|
+
})]
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ a("span", {
|
|
44
|
+
className: e.range,
|
|
45
|
+
children: C
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ o("div", {
|
|
48
|
+
className: e.group,
|
|
49
|
+
children: [/* @__PURE__ */ a("select", {
|
|
50
|
+
className: e.select,
|
|
51
|
+
"aria-label": S,
|
|
52
|
+
value: _,
|
|
53
|
+
onChange: (e) => d(Number(e.target.value)),
|
|
54
|
+
children: Array.from({ length: g }, (e, t) => /* @__PURE__ */ a("option", {
|
|
55
|
+
value: t + 1,
|
|
56
|
+
children: t + 1
|
|
57
|
+
}, t + 1))
|
|
58
|
+
}), /* @__PURE__ */ a("span", {
|
|
59
|
+
className: e.label,
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
children: S
|
|
62
|
+
})]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ o("div", {
|
|
65
|
+
className: e.buttons,
|
|
66
|
+
children: [/* @__PURE__ */ a("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
className: e.button,
|
|
69
|
+
"aria-label": w,
|
|
70
|
+
disabled: _ <= 1,
|
|
71
|
+
onClick: () => d(_ - 1),
|
|
72
|
+
children: /* @__PURE__ */ a("span", {
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
children: "‹"
|
|
75
|
+
})
|
|
76
|
+
}), /* @__PURE__ */ a("button", {
|
|
77
|
+
type: "button",
|
|
78
|
+
className: e.button,
|
|
79
|
+
"aria-label": T,
|
|
80
|
+
disabled: _ >= g,
|
|
81
|
+
onClick: () => d(_ + 1),
|
|
82
|
+
children: /* @__PURE__ */ a("span", {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
children: "›"
|
|
85
|
+
})
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { c as Pagination };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './pagination.css';
|
|
4
|
+
var e = {
|
|
5
|
+
pagination: "_pagination_1rt7c_2",
|
|
6
|
+
group: "_group_1rt7c_13",
|
|
7
|
+
label: "_label_1rt7c_19",
|
|
8
|
+
range: "_range_1rt7c_25",
|
|
9
|
+
select: "_select_1rt7c_35",
|
|
10
|
+
buttons: "_buttons_1rt7c_70",
|
|
11
|
+
button: "_button_1rt7c_70"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._wrapper_r2rcd_2{gap:var(--cascivo-space-1);flex-direction:column;display:flex}._wrapper_r2rcd_2[data-size=sm]{--_height:2rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-3)}._wrapper_r2rcd_2[data-size=md]{--_height:2.5rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-4)}._wrapper_r2rcd_2[data-size=lg]{--_height:3rem;--_font:var(--cascivo-text-base);--_px:var(--cascivo-space-4)}._input-row_r2rcd_26{align-items:center;display:flex;position:relative}._input_r2rcd_26{width:100%;height: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;padding-inline-end:calc(var(--_px,var(--cascivo-space-4)) + 2.5rem)}._input_r2rcd_26::placeholder{color:var(--cascivo-color-text-muted)}._input_r2rcd_26:hover:not(:disabled):not(:focus){border-color:var(--cascivo-color-border-strong)}._input_r2rcd_26:focus{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._input_r2rcd_26:disabled{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._reveal-btn_r2rcd_68{border-radius:var(--cascivo-radius-control);width:2rem;height:2rem;color:var(--cascivo-color-text-subtle);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:flex;position:absolute;inset-inline-end:var(--cascivo-space-2)}._reveal-btn_r2rcd_68:hover{color:var(--cascivo-color-text);background-color:var(--cascivo-color-bg-subtle)}._reveal-btn_r2rcd_68:focus-visible{outline:2px solid var(--cascivo-color-accent);outline-offset:1px}._reveal-icon_r2rcd_94{background-color:currentColor;width:1.25rem;height:1.25rem;display:block;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}._wrapper_r2rcd_2[data-revealed] ._reveal-icon_r2rcd_94{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E")}._strength-meter_r2rcd_114{gap:var(--cascivo-space-1);display:flex}._strength-meter_r2rcd_114[data-strength=weak]{--_seg-color:var(--cascivo-color-destructive)}._strength-meter_r2rcd_114[data-strength=fair]{--_seg-color:var(--cascivo-color-warning)}._strength-meter_r2rcd_114[data-strength=good],._strength-meter_r2rcd_114[data-strength=strong]{--_seg-color:var(--cascivo-color-success)}._strength-segment_r2rcd_135{border-radius:var(--cascivo-radius-full);background-color:var(--cascivo-color-border);height:.25rem;transition:background-color var(--cascivo-duration-150) var(--cascivo-ease-out);flex:1}._strength-segment_r2rcd_135[data-filled]{background-color:var(--_seg-color,var(--cascivo-color-accent))}}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./password-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 { useId as c } from "react";
|
|
8
|
+
//#region ../components/src/password-input/password-input.tsx
|
|
9
|
+
function l(e) {
|
|
10
|
+
if (!e) return {
|
|
11
|
+
score: 0,
|
|
12
|
+
label: "weak"
|
|
13
|
+
};
|
|
14
|
+
let t = 0;
|
|
15
|
+
return /[a-z]/.test(e) && t++, /[A-Z]/.test(e) && t++, /[0-9]/.test(e) && t++, /[^a-zA-Z0-9]/.test(e) && t++, e.length >= 12 && (t = Math.min(4, t + 1)), t = Math.min(4, t), {
|
|
16
|
+
score: t,
|
|
17
|
+
label: [
|
|
18
|
+
"weak",
|
|
19
|
+
"weak",
|
|
20
|
+
"fair",
|
|
21
|
+
"good",
|
|
22
|
+
"strong"
|
|
23
|
+
][t]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function u({ showStrengthMeter: u = !1, size: d = "md", labels: f, className: p, id: m, value: h, defaultValue: g, onChange: _, ...v }) {
|
|
27
|
+
r();
|
|
28
|
+
let y = n(!1), b = n(typeof h == "string" ? h : typeof g == "string" ? g : "");
|
|
29
|
+
typeof h == "string" && (b.value = h);
|
|
30
|
+
let x = c(), S = m ?? `cascade-password-${x}`, C = u ? l(b.value) : null, w = y.value ? f?.hide ?? a(i.passwordInput.hide) : f?.reveal ?? a(i.passwordInput.reveal), T = C ? f?.strengthLabel ? f.strengthLabel(C.label) : a(i.passwordInput.strengthLabel, { level: C.label }) : void 0;
|
|
31
|
+
return /* @__PURE__ */ s("div", {
|
|
32
|
+
className: t(e.wrapper, p),
|
|
33
|
+
"data-size": d,
|
|
34
|
+
"data-revealed": y.value ? "" : void 0,
|
|
35
|
+
children: [/* @__PURE__ */ s("div", {
|
|
36
|
+
className: e["input-row"],
|
|
37
|
+
children: [/* @__PURE__ */ o("input", {
|
|
38
|
+
...v,
|
|
39
|
+
id: S,
|
|
40
|
+
type: y.value ? "text" : "password",
|
|
41
|
+
className: e.input,
|
|
42
|
+
value: h,
|
|
43
|
+
defaultValue: g,
|
|
44
|
+
onChange: (e) => {
|
|
45
|
+
typeof h != "string" && (b.value = e.currentTarget.value), _?.(e);
|
|
46
|
+
}
|
|
47
|
+
}), /* @__PURE__ */ o("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
className: e["reveal-btn"],
|
|
50
|
+
"aria-label": w,
|
|
51
|
+
onClick: () => {
|
|
52
|
+
y.value = !y.value;
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ o("span", {
|
|
55
|
+
className: e["reveal-icon"],
|
|
56
|
+
"aria-hidden": "true"
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
}), u && C && /* @__PURE__ */ o("div", {
|
|
60
|
+
className: e["strength-meter"],
|
|
61
|
+
"aria-label": T,
|
|
62
|
+
"data-strength": C.label,
|
|
63
|
+
children: [
|
|
64
|
+
0,
|
|
65
|
+
1,
|
|
66
|
+
2,
|
|
67
|
+
3
|
|
68
|
+
].map((t) => /* @__PURE__ */ o("div", {
|
|
69
|
+
className: e["strength-segment"],
|
|
70
|
+
"data-filled": t < C.score ? "" : void 0
|
|
71
|
+
}, t))
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { u as PasswordInput };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import './password-input.css';
|
|
4
|
+
var e = {
|
|
5
|
+
wrapper: "_wrapper_r2rcd_2",
|
|
6
|
+
"input-row": "_input-row_r2rcd_26",
|
|
7
|
+
input: "_input_r2rcd_26",
|
|
8
|
+
"reveal-btn": "_reveal-btn_r2rcd_68",
|
|
9
|
+
"reveal-icon": "_reveal-icon_r2rcd_94",
|
|
10
|
+
"strength-meter": "_strength-meter_r2rcd_114",
|
|
11
|
+
"strength-segment": "_strength-segment_r2rcd_135"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cascivo.component{._content_208tz_6{padding:var(--cascivo-space-3);background:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-overlay);box-shadow:var(--cascivo-shadow-md);margin:0;position:fixed;inset:auto}@supports (anchor-name:--a){._content_208tz_6{position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;inset-block-start:anchor(end);inset-inline-start:anchor(start)}}._content_208tz_6{opacity:1;transition:opacity var(--cascivo-motion-enter), translate var(--cascivo-motion-enter), display var(--cascivo-motion-enter) allow-discrete, overlay var(--cascivo-motion-enter) allow-discrete;translate:0}@starting-style{._content_208tz_6{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2))}}._content_208tz_6[data-state=closed]{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2));transition:opacity var(--cascivo-motion-exit), translate var(--cascivo-motion-exit), display var(--cascivo-motion-exit) allow-discrete, overlay var(--cascivo-motion-exit) allow-discrete}}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { usePopover as e } from "./use-popover.js";
|
|
4
|
+
import t from "./popover.module.js";
|
|
5
|
+
import { useSignals as n } from "@cascivo/core";
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
+
import { createContext as i } from "react";
|
|
8
|
+
//#region ../components/src/popover/popover.tsx
|
|
9
|
+
var a = i(null);
|
|
10
|
+
function o({ children: t, ...n }) {
|
|
11
|
+
let i = e(n);
|
|
12
|
+
return /* @__PURE__ */ r(a.Provider, {
|
|
13
|
+
value: i,
|
|
14
|
+
children: t
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function s({ children: e }) {
|
|
18
|
+
return n(), /* @__PURE__ */ r(a.Consumer, { children: (n) => {
|
|
19
|
+
if (!n) throw Error("PopoverTrigger must be used inside <Popover>");
|
|
20
|
+
let { triggerRef: i, toggle: a, anchorName: o, isOpen: s } = n;
|
|
21
|
+
return /* @__PURE__ */ r("button", {
|
|
22
|
+
ref: i,
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-expanded": s.value,
|
|
25
|
+
"aria-haspopup": "dialog",
|
|
26
|
+
style: { anchorName: o },
|
|
27
|
+
onClick: a,
|
|
28
|
+
className: t.trigger,
|
|
29
|
+
children: e
|
|
30
|
+
});
|
|
31
|
+
} });
|
|
32
|
+
}
|
|
33
|
+
function c({ children: e, className: i }) {
|
|
34
|
+
return n(), /* @__PURE__ */ r(a.Consumer, { children: (n) => {
|
|
35
|
+
if (!n) throw Error("PopoverContent must be used inside <Popover>");
|
|
36
|
+
let { popoverRef: a, anchorName: o, isOpen: s } = n;
|
|
37
|
+
return /* @__PURE__ */ r("div", {
|
|
38
|
+
ref: a,
|
|
39
|
+
popover: "auto",
|
|
40
|
+
role: "dialog",
|
|
41
|
+
"data-state": s.value ? "open" : "closed",
|
|
42
|
+
style: { positionAnchor: o },
|
|
43
|
+
className: [t.content, i].filter(Boolean).join(" "),
|
|
44
|
+
children: e
|
|
45
|
+
});
|
|
46
|
+
} });
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { o as Popover, c as PopoverContent, s as PopoverTrigger };
|