solid-tiny-ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/alert/alert.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/alert/alert.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/buttons/basic-button/basic-button.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/buttons/basic-button/basic-button.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/drawer/drawer-helper.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/drawer/drawer-helper.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/drawer/drawer.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/drawer/drawer.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/field/field.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/field/field.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/checkbox/checkbox.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/checkbox/checkbox.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/combobox/combobox.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/combobox/combobox.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/number-input/number-input.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/number-input/number-input.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/password-input/password-input.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/password-input/password-input.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/radio-group/radio-group.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/radio-group/radio-group.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/switcher/switcher.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/switcher/switcher.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/text-field/text-field.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/text-field/text-field.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/textarea/textarea.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/textarea/textarea.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/time-picker/time-picker.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/time-picker/time-picker.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/modal/modal-helper.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/modal/modal-helper.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/modal/modal.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/modal/modal.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/pagination/pagination.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/pagination/pagination.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/popover/popover.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/popover/popover.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/spin/spin.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/spin/spin.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tabs/tabs.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tabs/tabs.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/toaster/toaster.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/toaster/toaster.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tooltip/tooltip.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tooltip/tooltip.jsx +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/visually-hidden/visually-hidden.js +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/visually-hidden/visually-hidden.jsx +5 -0
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/root-provider/global.js +1 -1
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/root-provider/global.jsx +1 -1
- package/dist/components/alert/alert.d.ts +25 -0
- package/dist/components/alert/alert.js +186 -0
- package/dist/components/alert/alert.jsx +73 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/alert/index.jsx +1 -0
- package/dist/components/buttons/basic-button/basic-button.d.ts +2 -2
- package/dist/components/buttons/basic-button/basic-button.js +20 -29
- package/dist/components/buttons/basic-button/basic-button.jsx +6 -7
- package/dist/components/buttons/state-button/state-button.d.ts +2 -2
- package/dist/components/buttons/state-button/state-button.js +2 -2
- package/dist/components/buttons/state-button/state-button.jsx +2 -2
- package/dist/components/drawer/helpers.d.ts +25 -0
- package/dist/components/drawer/helpers.js +104 -0
- package/dist/components/drawer/helpers.jsx +60 -0
- package/dist/components/drawer/index.d.ts +42 -0
- package/dist/components/drawer/index.js +95 -0
- package/dist/components/drawer/index.jsx +57 -0
- package/dist/components/field/index.d.ts +10 -0
- package/dist/components/field/index.js +11 -0
- package/dist/components/field/index.jsx +11 -0
- package/dist/components/field/parts.d.ts +24 -0
- package/dist/components/field/parts.js +69 -0
- package/dist/components/field/parts.jsx +41 -0
- package/dist/components/form-components/checkbox/checkbox.d.ts +26 -0
- package/dist/components/form-components/checkbox/checkbox.js +118 -0
- package/dist/components/form-components/checkbox/checkbox.jsx +42 -0
- package/dist/components/form-components/checkbox/index.d.ts +1 -0
- package/dist/components/form-components/checkbox/index.js +1 -0
- package/dist/components/form-components/checkbox/index.jsx +1 -0
- package/dist/components/form-components/checkbox-group/checkbox-group.d.ts +26 -0
- package/dist/components/form-components/checkbox-group/checkbox-group.js +76 -0
- package/dist/components/form-components/checkbox-group/checkbox-group.jsx +34 -0
- package/dist/components/form-components/checkbox-group/index.d.ts +1 -0
- package/dist/components/form-components/checkbox-group/index.js +1 -0
- package/dist/components/form-components/checkbox-group/index.jsx +1 -0
- package/dist/components/{combobox → form-components/combobox}/combobox.d.ts +6 -4
- package/dist/components/{combobox → form-components/combobox}/combobox.js +18 -14
- package/dist/components/{combobox → form-components/combobox}/combobox.jsx +10 -10
- package/dist/components/form-components/index.d.ts +19 -0
- package/dist/components/form-components/index.js +19 -0
- package/dist/components/form-components/index.jsx +19 -0
- package/dist/components/form-components/number-input/index.d.ts +1 -0
- package/dist/components/form-components/number-input/index.js +1 -0
- package/dist/components/form-components/number-input/index.jsx +1 -0
- package/dist/components/form-components/number-input/number-input.d.ts +33 -0
- package/dist/components/form-components/number-input/number-input.js +113 -0
- package/dist/components/form-components/number-input/number-input.jsx +59 -0
- package/dist/components/form-components/password-input/index.d.ts +1 -0
- package/dist/components/form-components/password-input/index.js +1 -0
- package/dist/components/form-components/password-input/index.jsx +1 -0
- package/dist/components/form-components/password-input/password-input.d.ts +31 -0
- package/dist/components/form-components/password-input/password-input.js +95 -0
- package/dist/components/form-components/password-input/password-input.jsx +36 -0
- package/dist/components/form-components/radio-group/index.d.ts +1 -0
- package/dist/components/form-components/radio-group/index.js +1 -0
- package/dist/components/form-components/radio-group/index.jsx +1 -0
- package/dist/components/form-components/radio-group/radio-group.d.ts +26 -0
- package/dist/components/form-components/radio-group/radio-group.js +118 -0
- package/dist/components/form-components/radio-group/radio-group.jsx +45 -0
- package/dist/components/form-components/switcher/index.d.ts +1 -0
- package/dist/components/form-components/switcher/index.js +1 -0
- package/dist/components/form-components/switcher/index.jsx +1 -0
- package/dist/components/form-components/switcher/switcher.d.ts +23 -0
- package/dist/components/form-components/switcher/switcher.js +92 -0
- package/dist/components/form-components/switcher/switcher.jsx +32 -0
- package/dist/components/form-components/text-field/index.d.ts +1 -0
- package/dist/components/form-components/text-field/index.js +1 -0
- package/dist/components/form-components/text-field/index.jsx +1 -0
- package/dist/components/form-components/text-field/text-field.d.ts +30 -0
- package/dist/components/form-components/text-field/text-field.js +112 -0
- package/dist/components/form-components/text-field/text-field.jsx +40 -0
- package/dist/components/{textarea → form-components/textarea}/textarea.d.ts +5 -2
- package/dist/components/form-components/textarea/textarea.js +55 -0
- package/dist/components/form-components/textarea/textarea.jsx +24 -0
- package/dist/components/form-components/time-picker/index.d.ts +27 -0
- package/dist/components/form-components/time-picker/index.js +106 -0
- package/dist/components/form-components/time-picker/index.jsx +44 -0
- package/dist/components/form-components/time-picker/panel.js +185 -0
- package/dist/components/form-components/time-picker/panel.jsx +108 -0
- package/dist/components/form-components/time-picker/trigger.js +68 -0
- package/dist/components/form-components/time-picker/trigger.jsx +37 -0
- package/dist/components/modal/helpers.js +1 -1
- package/dist/components/modal/helpers.jsx +1 -1
- package/dist/components/modal/index.d.ts +5 -8
- package/dist/components/modal/index.js +13 -10
- package/dist/components/modal/index.jsx +7 -4
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/index.jsx +1 -0
- package/dist/components/pagination/pagination.d.ts +32 -0
- package/dist/components/pagination/pagination.js +336 -0
- package/dist/components/pagination/pagination.jsx +104 -0
- package/dist/components/popover/index.js +4 -3
- package/dist/components/popover/index.jsx +2 -1
- package/dist/components/progress/circle-progress.d.ts +7 -0
- package/dist/components/progress/circle-progress.js +33 -14
- package/dist/components/progress/circle-progress.jsx +15 -12
- package/dist/components/progress/line-progress.d.ts +2 -2
- package/dist/components/progress/line-progress.js +6 -5
- package/dist/components/progress/line-progress.jsx +6 -5
- package/dist/components/progress/loading-bar.d.ts +2 -2
- package/dist/components/spin/spin-ring.d.ts +2 -2
- package/dist/components/spin/spin-ring.js +1 -1
- package/dist/components/spin/spin-ring.jsx +1 -1
- package/dist/components/spin/spin.js +8 -7
- package/dist/components/spin/spin.jsx +6 -5
- package/dist/components/tabs/index.d.ts +7 -0
- package/dist/components/tabs/index.js +40 -12
- package/dist/components/tabs/index.jsx +9 -7
- package/dist/components/toaster/context.js +31 -0
- package/dist/components/toaster/context.jsx +31 -0
- package/dist/components/toaster/icon.js +50 -0
- package/dist/components/toaster/icon.jsx +27 -0
- package/dist/components/toaster/index.d.ts +3 -0
- package/dist/components/toaster/index.js +2 -0
- package/dist/components/toaster/index.jsx +2 -0
- package/dist/components/toaster/locator.js +67 -0
- package/dist/components/toaster/locator.jsx +54 -0
- package/dist/components/toaster/one-toaster.js +146 -0
- package/dist/components/toaster/one-toaster.jsx +104 -0
- package/dist/components/toaster/provider.d.ts +11 -0
- package/dist/components/toaster/provider.js +64 -0
- package/dist/components/toaster/provider.jsx +51 -0
- package/dist/components/toaster/type.d.ts +15 -0
- package/dist/components/toaster/use-toaster.d.ts +48 -0
- package/dist/components/toaster/use-toaster.js +72 -0
- package/dist/components/toaster/use-toaster.jsx +72 -0
- package/dist/components/tooltip/tooltip.d.ts +7 -0
- package/dist/components/tooltip/tooltip.js +9 -2
- package/dist/components/tooltip/tooltip.jsx +4 -2
- package/dist/components/visually-hidden/index.js +19 -0
- package/dist/components/visually-hidden/index.jsx +12 -0
- package/dist/icons/arrow-down-s-line.d.ts +3 -2
- package/dist/icons/arrow-down-s-line.js +4 -4
- package/dist/icons/arrow-down-s-line.jsx +2 -2
- package/dist/icons/arrow-left.d.ts +7 -0
- package/dist/icons/arrow-left.js +13 -0
- package/dist/icons/arrow-left.jsx +11 -0
- package/dist/icons/arrow-right.d.ts +7 -0
- package/dist/icons/arrow-right.js +13 -0
- package/dist/icons/arrow-right.jsx +11 -0
- package/dist/icons/check-bold.d.ts +7 -0
- package/dist/icons/check-bold.js +13 -0
- package/dist/icons/check-bold.jsx +11 -0
- package/dist/icons/check-line.d.ts +7 -0
- package/dist/icons/check-line.js +13 -0
- package/dist/icons/check-line.jsx +11 -0
- package/dist/icons/checkbox-circle-line.d.ts +7 -0
- package/dist/icons/checkbox-circle-line.js +13 -0
- package/dist/icons/checkbox-circle-line.jsx +11 -0
- package/dist/icons/close-line.d.ts +3 -2
- package/dist/icons/close-line.js +4 -4
- package/dist/icons/close-line.jsx +2 -2
- package/dist/icons/common.d.ts +9 -0
- package/dist/icons/common.js +12 -2
- package/dist/icons/common.jsx +1 -1
- package/dist/icons/ellipsis.d.ts +7 -0
- package/dist/icons/ellipsis.js +13 -0
- package/dist/icons/ellipsis.jsx +11 -0
- package/dist/icons/error-warning-line.d.ts +7 -0
- package/dist/icons/error-warning-line.js +13 -0
- package/dist/icons/error-warning-line.jsx +11 -0
- package/dist/icons/eye-line.d.ts +7 -0
- package/dist/icons/eye-line.js +13 -0
- package/dist/icons/eye-line.jsx +11 -0
- package/dist/icons/eye-off-line.d.ts +7 -0
- package/dist/icons/eye-off-line.js +13 -0
- package/dist/icons/eye-off-line.jsx +11 -0
- package/dist/icons/index.d.ts +13 -1
- package/dist/icons/index.js +13 -1
- package/dist/icons/index.jsx +13 -1
- package/dist/icons/information-line.d.ts +7 -0
- package/dist/icons/information-line.js +13 -0
- package/dist/icons/information-line.jsx +11 -0
- package/dist/icons/loading.d.ts +13 -0
- package/dist/icons/loading.js +18 -0
- package/dist/icons/loading.jsx +19 -0
- package/dist/icons/subtract.d.ts +7 -0
- package/dist/icons/subtract.js +13 -0
- package/dist/icons/subtract.jsx +11 -0
- package/dist/index.d.ts +23 -8
- package/dist/index.js +23 -9
- package/dist/index.jsx +23 -9
- package/dist/layout/flex/index.d.ts +5 -4
- package/dist/layout/flex/index.js +25 -15
- package/dist/layout/flex/index.jsx +23 -10
- package/dist/layout/index.d.ts +1 -2
- package/dist/layout/index.js +0 -1
- package/dist/layout/index.jsx +0 -1
- package/dist/primitives/animated-group/context.d.ts +9 -9
- package/dist/primitives/animated-group/panel.js +14 -13
- package/dist/primitives/animated-group/panel.jsx +7 -6
- package/dist/primitives/animated-group/root.d.ts +4 -4
- package/dist/primitives/animated-group/root.js +2 -3
- package/dist/primitives/animated-group/root.jsx +2 -3
- package/dist/primitives/checkbox/context.d.ts +63 -0
- package/dist/primitives/checkbox/context.js +13 -0
- package/dist/primitives/checkbox/context.jsx +13 -0
- package/dist/primitives/checkbox/index.d.ts +26 -0
- package/dist/primitives/checkbox/index.js +13 -0
- package/dist/primitives/checkbox/index.jsx +13 -0
- package/dist/primitives/checkbox/parts.d.ts +10 -0
- package/dist/primitives/checkbox/parts.js +62 -0
- package/dist/primitives/checkbox/parts.jsx +28 -0
- package/dist/primitives/checkbox/root.d.ts +16 -0
- package/dist/primitives/checkbox/root.js +25 -0
- package/dist/primitives/checkbox/root.jsx +24 -0
- package/dist/primitives/checkbox-group/context.js +21 -0
- package/dist/primitives/checkbox-group/context.jsx +21 -0
- package/dist/primitives/checkbox-group/index.js +12 -0
- package/dist/primitives/checkbox-group/index.jsx +12 -0
- package/dist/primitives/checkbox-group/parts.js +33 -0
- package/dist/primitives/checkbox-group/parts.jsx +21 -0
- package/dist/primitives/checkbox-group/root.js +24 -0
- package/dist/primitives/checkbox-group/root.jsx +23 -0
- package/dist/primitives/fake-scroll-list/context.js +30 -0
- package/dist/primitives/fake-scroll-list/context.jsx +30 -0
- package/dist/primitives/fake-scroll-list/index.d.ts +52 -0
- package/dist/primitives/fake-scroll-list/index.js +36 -0
- package/dist/primitives/fake-scroll-list/index.jsx +36 -0
- package/dist/primitives/fake-scroll-list/item.d.ts +11 -0
- package/dist/primitives/fake-scroll-list/item.js +30 -0
- package/dist/primitives/fake-scroll-list/item.jsx +13 -0
- package/dist/primitives/fake-scroll-list/listbox.d.ts +8 -0
- package/dist/primitives/fake-scroll-list/listbox.js +72 -0
- package/dist/primitives/fake-scroll-list/listbox.jsx +61 -0
- package/dist/primitives/fake-scroll-list/root.d.ts +15 -0
- package/dist/primitives/fake-scroll-list/root.js +52 -0
- package/dist/primitives/fake-scroll-list/root.jsx +40 -0
- package/dist/primitives/floating/content.js +12 -11
- package/dist/primitives/floating/content.jsx +7 -6
- package/dist/primitives/floating/context.d.ts +10 -9
- package/dist/primitives/floating/context.js +1 -1
- package/dist/primitives/floating/context.jsx +1 -1
- package/dist/primitives/floating/index.d.ts +3 -2
- package/dist/primitives/floating/trigger.js +1 -1
- package/dist/primitives/floating/trigger.jsx +1 -1
- package/dist/primitives/floating/types.d.ts +2 -1
- package/dist/primitives/index.d.ts +8 -1
- package/dist/primitives/index.js +8 -3
- package/dist/primitives/index.jsx +8 -3
- package/dist/primitives/listbox/listbox.d.ts +3 -3
- package/dist/primitives/modal/content.d.ts +3 -3
- package/dist/primitives/modal/content.js +2 -3
- package/dist/primitives/modal/content.jsx +2 -3
- package/dist/primitives/modal/context.d.ts +16 -29
- package/dist/primitives/modal/context.js +2 -4
- package/dist/primitives/modal/context.jsx +2 -4
- package/dist/primitives/modal/index.d.ts +5 -8
- package/dist/primitives/modal/portal.js +1 -1
- package/dist/primitives/modal/portal.jsx +1 -1
- package/dist/primitives/modal/root.d.ts +2 -3
- package/dist/primitives/modal/root.js +10 -10
- package/dist/primitives/modal/root.jsx +10 -10
- package/dist/primitives/pagination/context.d.ts +89 -0
- package/dist/primitives/pagination/context.js +88 -0
- package/dist/primitives/pagination/context.jsx +88 -0
- package/dist/primitives/pagination/index.d.ts +33 -0
- package/dist/primitives/pagination/index.js +12 -0
- package/dist/primitives/pagination/index.jsx +12 -0
- package/dist/primitives/pagination/items.d.ts +9 -0
- package/dist/primitives/pagination/items.js +19 -0
- package/dist/primitives/pagination/items.jsx +11 -0
- package/dist/primitives/pagination/root.d.ts +16 -0
- package/dist/primitives/pagination/root.js +24 -0
- package/dist/primitives/pagination/root.jsx +23 -0
- package/dist/primitives/radio-group/context.d.ts +91 -0
- package/dist/primitives/radio-group/context.js +16 -0
- package/dist/primitives/radio-group/context.jsx +16 -0
- package/dist/primitives/radio-group/index.d.ts +34 -0
- package/dist/primitives/radio-group/index.js +15 -0
- package/dist/primitives/radio-group/index.jsx +15 -0
- package/dist/primitives/radio-group/item.d.ts +19 -0
- package/dist/primitives/radio-group/item.js +74 -0
- package/dist/primitives/radio-group/item.jsx +44 -0
- package/dist/primitives/radio-group/root.d.ts +14 -0
- package/dist/primitives/radio-group/root.js +23 -0
- package/dist/primitives/radio-group/root.jsx +22 -0
- package/dist/root-provider/context.d.ts +16 -9
- package/dist/root-provider/context.js +4 -1
- package/dist/root-provider/context.jsx +4 -1
- package/dist/root-provider/gen-colors.js +138 -0
- package/dist/root-provider/gen-colors.jsx +138 -0
- package/dist/root-provider/provider.js +4 -3
- package/dist/root-provider/provider.jsx +3 -2
- package/dist/utils/duration.js +10 -0
- package/dist/utils/duration.jsx +10 -0
- package/dist/utils/index.js +1 -4
- package/dist/utils/index.jsx +1 -4
- package/dist/utils/types.d.ts +4 -8
- package/package.json +9 -8
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/combobox/combobox.js +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/combobox/combobox.jsx +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/input/input.js +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/input/input.jsx +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/textarea/textarea.js +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/textarea/textarea.jsx +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/layout/input-compact/input-compact.js +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/layout/input-compact/input-compact.jsx +0 -5
- package/dist/components/input/index.d.ts +0 -1
- package/dist/components/input/index.js +0 -1
- package/dist/components/input/index.jsx +0 -1
- package/dist/components/input/input.d.ts +0 -15
- package/dist/components/input/input.js +0 -44
- package/dist/components/input/input.jsx +0 -16
- package/dist/components/textarea/textarea.js +0 -49
- package/dist/components/textarea/textarea.jsx +0 -24
- package/dist/layout/input-compact/index.d.ts +0 -13
- package/dist/layout/input-compact/index.js +0 -42
- package/dist/layout/input-compact/index.jsx +0 -32
- package/dist/root-provider/gen-brand.js +0 -55
- package/dist/root-provider/gen-brand.jsx +0 -55
- package/dist/utils/types.js +0 -7
- package/dist/utils/types.jsx +0 -7
- /package/dist/components/{combobox → form-components/combobox}/index.d.ts +0 -0
- /package/dist/components/{combobox → form-components/combobox}/index.js +0 -0
- /package/dist/components/{combobox → form-components/combobox}/index.jsx +0 -0
- /package/dist/components/{textarea → form-components/textarea}/index.d.ts +0 -0
- /package/dist/components/{textarea → form-components/textarea}/index.js +0 -0
- /package/dist/components/{textarea → form-components/textarea}/index.jsx +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createClassStyles, extraAriasAndDatasets } from "../../../utils/index.jsx";
|
|
2
|
+
import text_field_default from "../../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/text-field/text-field.jsx";
|
|
3
|
+
import { Show, children } from "solid-js";
|
|
4
|
+
import { combineClass, combineStyle, dataIf, mountStyle } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/components/form-components/text-field/text-field.tsx
|
|
7
|
+
function TextField(props) {
|
|
8
|
+
mountStyle(text_field_default, "tiny-text-field");
|
|
9
|
+
const prefix = children(() => props.prefix);
|
|
10
|
+
const suffix = children(() => props.suffix);
|
|
11
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({
|
|
12
|
+
disabled: props.disabled ?? false,
|
|
13
|
+
invalid: props.invalid ?? false,
|
|
14
|
+
size: props.size || "medium"
|
|
15
|
+
}));
|
|
16
|
+
const handleKeyDown = (e) => {
|
|
17
|
+
if (e.key === "Enter") {
|
|
18
|
+
props.onPressEnter?.(e);
|
|
19
|
+
e.currentTarget.blur();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return <div class={combineClass("tiny-text-field", classes().root)} data-disabled={dataIf(props.disabled ?? false)} data-invalid={dataIf(props.invalid ?? false)} data-size={props.size || "medium"} style={combineStyle({}, styles().root)}>
|
|
23
|
+
<Show when={prefix()}>
|
|
24
|
+
<div class={combineClass("tiny-text-field-prefix", classes().prefix)} style={combineStyle({}, styles().prefix)}>
|
|
25
|
+
{prefix()}
|
|
26
|
+
</div>
|
|
27
|
+
</Show>
|
|
28
|
+
<input {...extraAriasAndDatasets(props)} class={combineClass("tiny-text-field-input", classes().input)} disabled={props.disabled} id={props.id} name={props.name} onInput={(e) => {
|
|
29
|
+
props.onChange?.(e.currentTarget.value);
|
|
30
|
+
}} onKeyDown={handleKeyDown} placeholder={props.placeholder} style={combineStyle({}, styles().input)} type="text" value={props.value} />
|
|
31
|
+
<Show when={suffix()}>
|
|
32
|
+
<div class={combineClass("tiny-text-field-suffix", classes().suffix)} style={combineStyle({}, styles().suffix)}>
|
|
33
|
+
{suffix()}
|
|
34
|
+
</div>
|
|
35
|
+
</Show>
|
|
36
|
+
</div>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TextField };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClassNames, Styles } from "
|
|
1
|
+
import { ClassNames, Styles } from "../../../utils/types.js";
|
|
2
2
|
import { JSX } from "solid-js";
|
|
3
3
|
|
|
4
|
-
//#region src/components/textarea/textarea.d.ts
|
|
4
|
+
//#region src/components/form-components/textarea/textarea.d.ts
|
|
5
5
|
declare function Textarea(props: {
|
|
6
6
|
autosize?: boolean;
|
|
7
7
|
rows?: number;
|
|
@@ -16,7 +16,10 @@ declare function Textarea(props: {
|
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
}>;
|
|
18
18
|
onChange?: (value: string) => void;
|
|
19
|
+
invalid?: boolean;
|
|
19
20
|
value?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
name?: string;
|
|
20
23
|
}): JSX.Element;
|
|
21
24
|
//#endregion
|
|
22
25
|
export { Textarea };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createClassStyles } from "../../../utils/index.js";
|
|
2
|
+
import textarea_default from "../../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/textarea/textarea.js";
|
|
3
|
+
import { className, delegateEvents, effect, setAttribute, style, template } from "solid-js/web";
|
|
4
|
+
import { mergeProps as mergeProps$1 } from "solid-js";
|
|
5
|
+
import { combineClass, combineStyle, dataIf, mountStyle } from "solid-tiny-utils";
|
|
6
|
+
|
|
7
|
+
//#region src/components/form-components/textarea/textarea.tsx
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<textarea>`);
|
|
9
|
+
function Textarea(props) {
|
|
10
|
+
mountStyle(textarea_default, "tiny-textarea");
|
|
11
|
+
const real = mergeProps$1({
|
|
12
|
+
autosize: false,
|
|
13
|
+
rows: 3,
|
|
14
|
+
disabled: false
|
|
15
|
+
}, props);
|
|
16
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({ disabled: real.disabled }));
|
|
17
|
+
return (() => {
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
_el$.$$input = (e) => {
|
|
20
|
+
props.onChange?.(e.target.value);
|
|
21
|
+
};
|
|
22
|
+
effect((_p$) => {
|
|
23
|
+
var _v$ = combineClass("tiny-textarea", classes().root), _v$2 = dataIf(real.invalid ?? false), _v$3 = real.disabled, _v$4 = props.id, _v$5 = real.maxLength, _v$6 = props.name, _v$7 = real.placeholder, _v$8 = real.rows, _v$9 = combineStyle({
|
|
24
|
+
resize: real.resize,
|
|
25
|
+
"min-height": "88px"
|
|
26
|
+
}, styles().root);
|
|
27
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
28
|
+
_v$2 !== _p$.t && setAttribute(_el$, "data-invalid", _p$.t = _v$2);
|
|
29
|
+
_v$3 !== _p$.a && (_el$.disabled = _p$.a = _v$3);
|
|
30
|
+
_v$4 !== _p$.o && setAttribute(_el$, "id", _p$.o = _v$4);
|
|
31
|
+
_v$5 !== _p$.i && setAttribute(_el$, "maxlength", _p$.i = _v$5);
|
|
32
|
+
_v$6 !== _p$.n && setAttribute(_el$, "name", _p$.n = _v$6);
|
|
33
|
+
_v$7 !== _p$.s && setAttribute(_el$, "placeholder", _p$.s = _v$7);
|
|
34
|
+
_v$8 !== _p$.h && setAttribute(_el$, "rows", _p$.h = _v$8);
|
|
35
|
+
_p$.r = style(_el$, _v$9, _p$.r);
|
|
36
|
+
return _p$;
|
|
37
|
+
}, {
|
|
38
|
+
e: void 0,
|
|
39
|
+
t: void 0,
|
|
40
|
+
a: void 0,
|
|
41
|
+
o: void 0,
|
|
42
|
+
i: void 0,
|
|
43
|
+
n: void 0,
|
|
44
|
+
s: void 0,
|
|
45
|
+
h: void 0,
|
|
46
|
+
r: void 0
|
|
47
|
+
});
|
|
48
|
+
effect(() => _el$.value = real.value);
|
|
49
|
+
return _el$;
|
|
50
|
+
})();
|
|
51
|
+
}
|
|
52
|
+
delegateEvents(["input"]);
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Textarea };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createClassStyles } from "../../../utils/index.jsx";
|
|
2
|
+
import textarea_default from "../../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/textarea/textarea.jsx";
|
|
3
|
+
import { mergeProps } from "solid-js";
|
|
4
|
+
import { combineClass, combineStyle, dataIf, mountStyle } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/components/form-components/textarea/textarea.tsx
|
|
7
|
+
function Textarea(props) {
|
|
8
|
+
mountStyle(textarea_default, "tiny-textarea");
|
|
9
|
+
const real = mergeProps({
|
|
10
|
+
autosize: false,
|
|
11
|
+
rows: 3,
|
|
12
|
+
disabled: false
|
|
13
|
+
}, props);
|
|
14
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({ disabled: real.disabled }));
|
|
15
|
+
return <textarea class={combineClass("tiny-textarea", classes().root)} data-invalid={dataIf(real.invalid ?? false)} disabled={real.disabled} id={props.id} maxLength={real.maxLength} name={props.name} onInput={(e) => {
|
|
16
|
+
props.onChange?.(e.target.value);
|
|
17
|
+
}} placeholder={real.placeholder} rows={real.rows} style={combineStyle({
|
|
18
|
+
resize: real.resize,
|
|
19
|
+
"min-height": "88px"
|
|
20
|
+
}, styles().root)} value={real.value} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Textarea };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClassNames, Styles } from "../../../utils/types.js";
|
|
2
|
+
import * as solid_js43 from "solid-js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/form-components/time-picker/index.d.ts
|
|
5
|
+
declare function TimePicker(props: {
|
|
6
|
+
type?: "hour" | "minute" | "second";
|
|
7
|
+
size?: "small" | "medium" | "large";
|
|
8
|
+
hour?: number | null;
|
|
9
|
+
minute?: number | null;
|
|
10
|
+
second?: number | null;
|
|
11
|
+
onChange?: (time: {
|
|
12
|
+
hour: number | null;
|
|
13
|
+
minute: number | null;
|
|
14
|
+
second: number | null;
|
|
15
|
+
}) => void;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
classNames?: ClassNames<"trigger" | "popover", {
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
size: "small" | "medium" | "large";
|
|
20
|
+
}>;
|
|
21
|
+
styles?: Styles<"trigger" | "popover", {
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
size: "small" | "medium" | "large";
|
|
24
|
+
}>;
|
|
25
|
+
}): solid_js43.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { TimePicker };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createClassStyles } from "../../../utils/index.js";
|
|
2
|
+
import { Popover } from "../../popover/index.js";
|
|
3
|
+
import time_picker_default from "../../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/time-picker/time-picker.js";
|
|
4
|
+
import { TimePanel } from "./panel.js";
|
|
5
|
+
import { TimeTrigger } from "./trigger.js";
|
|
6
|
+
import { createComponent, memo } from "solid-js/web";
|
|
7
|
+
import { combineClass, mountStyle, noop } from "solid-tiny-utils";
|
|
8
|
+
import { getHours, getMinutes, getSeconds } from "time-core";
|
|
9
|
+
|
|
10
|
+
//#region src/components/form-components/time-picker/index.tsx
|
|
11
|
+
function TimePicker(props) {
|
|
12
|
+
mountStyle(time_picker_default, "tiny-time-picker");
|
|
13
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({
|
|
14
|
+
disabled: props.disabled ?? false,
|
|
15
|
+
size: props.size ?? "medium"
|
|
16
|
+
}));
|
|
17
|
+
return createComponent(Popover, {
|
|
18
|
+
get disabled() {
|
|
19
|
+
return props.disabled;
|
|
20
|
+
},
|
|
21
|
+
floatingOption: {
|
|
22
|
+
offset: ({ rects }) => {
|
|
23
|
+
return -rects.reference.height * 4 + 6;
|
|
24
|
+
},
|
|
25
|
+
flip: false,
|
|
26
|
+
shift: { crossAxis: true }
|
|
27
|
+
},
|
|
28
|
+
placement: "bottom",
|
|
29
|
+
trigger: "click",
|
|
30
|
+
children: (state, actions) => [createComponent(Popover.Trigger, { get children() {
|
|
31
|
+
return createComponent(TimeTrigger, {
|
|
32
|
+
get ["class"]() {
|
|
33
|
+
return classes().trigger;
|
|
34
|
+
},
|
|
35
|
+
get disabled() {
|
|
36
|
+
return props.disabled ?? false;
|
|
37
|
+
},
|
|
38
|
+
get hour() {
|
|
39
|
+
return props.hour ?? null;
|
|
40
|
+
},
|
|
41
|
+
get minute() {
|
|
42
|
+
return props.minute ?? null;
|
|
43
|
+
},
|
|
44
|
+
get second() {
|
|
45
|
+
return props.second ?? null;
|
|
46
|
+
},
|
|
47
|
+
get size() {
|
|
48
|
+
return props.size ?? "medium";
|
|
49
|
+
},
|
|
50
|
+
get style() {
|
|
51
|
+
return styles().trigger;
|
|
52
|
+
},
|
|
53
|
+
get type() {
|
|
54
|
+
return props.type ?? "hour";
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
} }), createComponent(Popover.Content, {
|
|
58
|
+
get ["class"]() {
|
|
59
|
+
return combineClass("tiny-time-picker-popover tiny-time-picker-popover-vars", classes().popover);
|
|
60
|
+
},
|
|
61
|
+
get ["data-size"]() {
|
|
62
|
+
return props.size || "medium";
|
|
63
|
+
},
|
|
64
|
+
get style() {
|
|
65
|
+
return styles().popover;
|
|
66
|
+
},
|
|
67
|
+
get children() {
|
|
68
|
+
return createComponent(TimePanel, {
|
|
69
|
+
get hour() {
|
|
70
|
+
return props.hour || getHours(Date.now());
|
|
71
|
+
},
|
|
72
|
+
get itemHeight() {
|
|
73
|
+
return state.refTrigger?.clientHeight || 32;
|
|
74
|
+
},
|
|
75
|
+
get minute() {
|
|
76
|
+
return props.minute || getMinutes(Date.now());
|
|
77
|
+
},
|
|
78
|
+
onCancel: () => {
|
|
79
|
+
actions.setOpen(false);
|
|
80
|
+
},
|
|
81
|
+
onChange: noop,
|
|
82
|
+
onConfirm: (hour, minute, second) => {
|
|
83
|
+
props.onChange?.({
|
|
84
|
+
hour,
|
|
85
|
+
minute,
|
|
86
|
+
second
|
|
87
|
+
});
|
|
88
|
+
actions.setOpen(false);
|
|
89
|
+
},
|
|
90
|
+
get second() {
|
|
91
|
+
return props.second || getSeconds(Date.now());
|
|
92
|
+
},
|
|
93
|
+
get type() {
|
|
94
|
+
return props.type || "hour";
|
|
95
|
+
},
|
|
96
|
+
get width() {
|
|
97
|
+
return state.refTrigger?.clientWidth || 128;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { TimePicker };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createClassStyles } from "../../../utils/index.jsx";
|
|
2
|
+
import { Popover } from "../../popover/index.jsx";
|
|
3
|
+
import time_picker_default from "../../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/form-components/time-picker/time-picker.jsx";
|
|
4
|
+
import { TimePanel } from "./panel.jsx";
|
|
5
|
+
import { TimeTrigger } from "./trigger.jsx";
|
|
6
|
+
import { combineClass, mountStyle, noop } from "solid-tiny-utils";
|
|
7
|
+
import { getHours, getMinutes, getSeconds } from "time-core";
|
|
8
|
+
|
|
9
|
+
//#region src/components/form-components/time-picker/index.tsx
|
|
10
|
+
function TimePicker(props) {
|
|
11
|
+
mountStyle(time_picker_default, "tiny-time-picker");
|
|
12
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({
|
|
13
|
+
disabled: props.disabled ?? false,
|
|
14
|
+
size: props.size ?? "medium"
|
|
15
|
+
}));
|
|
16
|
+
return <Popover disabled={props.disabled} floatingOption={{
|
|
17
|
+
offset: ({ rects }) => {
|
|
18
|
+
return -rects.reference.height * 4 + 6;
|
|
19
|
+
},
|
|
20
|
+
flip: false,
|
|
21
|
+
shift: { crossAxis: true }
|
|
22
|
+
}} placement="bottom" trigger="click">
|
|
23
|
+
{(state, actions) => <>
|
|
24
|
+
<Popover.Trigger>
|
|
25
|
+
<TimeTrigger class={classes().trigger} disabled={props.disabled ?? false} hour={props.hour ?? null} minute={props.minute ?? null} second={props.second ?? null} size={props.size ?? "medium"} style={styles().trigger} type={props.type ?? "hour"} />
|
|
26
|
+
</Popover.Trigger>
|
|
27
|
+
<Popover.Content class={combineClass("tiny-time-picker-popover tiny-time-picker-popover-vars", classes().popover)} data-size={props.size || "medium"} style={styles().popover}>
|
|
28
|
+
<TimePanel hour={props.hour || getHours(Date.now())} itemHeight={state.refTrigger?.clientHeight || 32} minute={props.minute || getMinutes(Date.now())} onCancel={() => {
|
|
29
|
+
actions.setOpen(false);
|
|
30
|
+
}} onChange={noop} onConfirm={(hour, minute, second) => {
|
|
31
|
+
props.onChange?.({
|
|
32
|
+
hour,
|
|
33
|
+
minute,
|
|
34
|
+
second
|
|
35
|
+
});
|
|
36
|
+
actions.setOpen(false);
|
|
37
|
+
}} second={props.second || getSeconds(Date.now())} type={props.type || "hour"} width={state.refTrigger?.clientWidth || 128} />
|
|
38
|
+
</Popover.Content>
|
|
39
|
+
</>}
|
|
40
|
+
</Popover>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { TimePicker };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { CheckLine } from "../../../icons/check-line.js";
|
|
2
|
+
import { CloseLine } from "../../../icons/close-line.js";
|
|
3
|
+
import "../../../icons/index.js";
|
|
4
|
+
import { FakeScrollListCore } from "../../../primitives/fake-scroll-list/index.js";
|
|
5
|
+
import "../../../primitives/index.js";
|
|
6
|
+
import { createComponent, delegateEvents, effect, insert, setStyleProperty, template } from "solid-js/web";
|
|
7
|
+
import { Show, createMemo } from "solid-js";
|
|
8
|
+
import { createWatch, list } from "solid-tiny-utils";
|
|
9
|
+
import { createStore } from "solid-js/store";
|
|
10
|
+
|
|
11
|
+
//#region src/components/form-components/time-picker/panel.tsx
|
|
12
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;position:relative><div class=tiny-time-picker__thumb></div><div style=width:100%;display:flex;position:relative></div><div class=tiny-time-picker__action><button type=button></button><button type=button>`);
|
|
13
|
+
function CommonTimeList(props) {
|
|
14
|
+
return createComponent(FakeScrollListCore, {
|
|
15
|
+
get inViewIndex() {
|
|
16
|
+
return props.inViewItem;
|
|
17
|
+
},
|
|
18
|
+
get itemHeight() {
|
|
19
|
+
return props.itemHeight;
|
|
20
|
+
},
|
|
21
|
+
get items() {
|
|
22
|
+
return props.items.map((v) => v.toString().padStart(2, "0"));
|
|
23
|
+
},
|
|
24
|
+
onInViewIndexChange: (i) => {
|
|
25
|
+
props.onChange(i);
|
|
26
|
+
},
|
|
27
|
+
visibleItemsCount: 7,
|
|
28
|
+
get children() {
|
|
29
|
+
return createComponent(FakeScrollListCore.Listbox, { children: (label, key) => createComponent(FakeScrollListCore.Item, {
|
|
30
|
+
"class": "tiny-time-picker__listbox-item",
|
|
31
|
+
key,
|
|
32
|
+
children: label
|
|
33
|
+
}) });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function HourList(props) {
|
|
38
|
+
return createComponent(CommonTimeList, {
|
|
39
|
+
get inViewItem() {
|
|
40
|
+
return props.hour;
|
|
41
|
+
},
|
|
42
|
+
get itemHeight() {
|
|
43
|
+
return props.itemHeight;
|
|
44
|
+
},
|
|
45
|
+
get items() {
|
|
46
|
+
return list(0, 23);
|
|
47
|
+
},
|
|
48
|
+
onChange: (hour) => {
|
|
49
|
+
props.onChange(hour);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function MinuteList(props) {
|
|
54
|
+
return createComponent(CommonTimeList, {
|
|
55
|
+
get inViewItem() {
|
|
56
|
+
return props.minute;
|
|
57
|
+
},
|
|
58
|
+
get itemHeight() {
|
|
59
|
+
return props.itemHeight;
|
|
60
|
+
},
|
|
61
|
+
get items() {
|
|
62
|
+
return list(0, 59);
|
|
63
|
+
},
|
|
64
|
+
onChange: (minute) => {
|
|
65
|
+
props.onChange(minute);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function SecondList(props) {
|
|
70
|
+
return createComponent(CommonTimeList, {
|
|
71
|
+
get inViewItem() {
|
|
72
|
+
return props.second;
|
|
73
|
+
},
|
|
74
|
+
get itemHeight() {
|
|
75
|
+
return props.itemHeight;
|
|
76
|
+
},
|
|
77
|
+
get items() {
|
|
78
|
+
return list(0, 59);
|
|
79
|
+
},
|
|
80
|
+
onChange: (second) => {
|
|
81
|
+
props.onChange(second);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function TimePanel(props) {
|
|
86
|
+
const [time, setTime] = createStore({
|
|
87
|
+
hour: 0,
|
|
88
|
+
minute: 0,
|
|
89
|
+
second: 0
|
|
90
|
+
});
|
|
91
|
+
createWatch(() => [
|
|
92
|
+
props.hour,
|
|
93
|
+
props.minute,
|
|
94
|
+
props.second
|
|
95
|
+
], ([hour, minute, second]) => {
|
|
96
|
+
setTime({
|
|
97
|
+
hour,
|
|
98
|
+
minute,
|
|
99
|
+
second
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
createWatch(() => [
|
|
103
|
+
time.hour,
|
|
104
|
+
time.minute,
|
|
105
|
+
time.second
|
|
106
|
+
], ([hour, minute, second]) => {
|
|
107
|
+
if (hour === props.hour && minute === props.minute && second === props.second) return;
|
|
108
|
+
props.onChange(hour, minute, second);
|
|
109
|
+
});
|
|
110
|
+
const typeIndex = createMemo(() => {
|
|
111
|
+
return [
|
|
112
|
+
"hour",
|
|
113
|
+
"minute",
|
|
114
|
+
"second"
|
|
115
|
+
].indexOf(props.type);
|
|
116
|
+
});
|
|
117
|
+
return (() => {
|
|
118
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$5 = _el$3.nextSibling.firstChild, _el$6 = _el$5.nextSibling;
|
|
119
|
+
insert(_el$3, createComponent(HourList, {
|
|
120
|
+
get hour() {
|
|
121
|
+
return time.hour;
|
|
122
|
+
},
|
|
123
|
+
get itemHeight() {
|
|
124
|
+
return props.itemHeight;
|
|
125
|
+
},
|
|
126
|
+
onChange: (hour) => setTime("hour", hour)
|
|
127
|
+
}), null);
|
|
128
|
+
insert(_el$3, createComponent(Show, {
|
|
129
|
+
get when() {
|
|
130
|
+
return typeIndex() > 0;
|
|
131
|
+
},
|
|
132
|
+
get children() {
|
|
133
|
+
return createComponent(MinuteList, {
|
|
134
|
+
get itemHeight() {
|
|
135
|
+
return props.itemHeight;
|
|
136
|
+
},
|
|
137
|
+
get minute() {
|
|
138
|
+
return time.minute;
|
|
139
|
+
},
|
|
140
|
+
onChange: (minute) => setTime("minute", minute)
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}), null);
|
|
144
|
+
insert(_el$3, createComponent(Show, {
|
|
145
|
+
get when() {
|
|
146
|
+
return typeIndex() > 1;
|
|
147
|
+
},
|
|
148
|
+
get children() {
|
|
149
|
+
return createComponent(SecondList, {
|
|
150
|
+
get itemHeight() {
|
|
151
|
+
return props.itemHeight;
|
|
152
|
+
},
|
|
153
|
+
onChange: (second) => setTime("second", second),
|
|
154
|
+
get second() {
|
|
155
|
+
return time.second;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}), null);
|
|
160
|
+
_el$5.$$click = () => {
|
|
161
|
+
props.onCancel(time.hour, time.minute, time.second);
|
|
162
|
+
};
|
|
163
|
+
insert(_el$5, createComponent(CloseLine, {}));
|
|
164
|
+
_el$6.$$click = () => {
|
|
165
|
+
props.onConfirm(time.hour, time.minute, time.second);
|
|
166
|
+
};
|
|
167
|
+
insert(_el$6, createComponent(CheckLine, {}));
|
|
168
|
+
effect((_p$) => {
|
|
169
|
+
var _v$ = `${props.width}px`, _v$2 = `${props.itemHeight}px`, _v$3 = `${props.itemHeight * 7 / 2 - props.itemHeight / 2}px`;
|
|
170
|
+
_v$ !== _p$.e && setStyleProperty(_el$, "width", _p$.e = _v$);
|
|
171
|
+
_v$2 !== _p$.t && setStyleProperty(_el$2, "--tiny-time-picker-thumb-height", _p$.t = _v$2);
|
|
172
|
+
_v$3 !== _p$.a && setStyleProperty(_el$2, "--tiny-time-picker-thumb-top", _p$.a = _v$3);
|
|
173
|
+
return _p$;
|
|
174
|
+
}, {
|
|
175
|
+
e: void 0,
|
|
176
|
+
t: void 0,
|
|
177
|
+
a: void 0
|
|
178
|
+
});
|
|
179
|
+
return _el$;
|
|
180
|
+
})();
|
|
181
|
+
}
|
|
182
|
+
delegateEvents(["click"]);
|
|
183
|
+
|
|
184
|
+
//#endregion
|
|
185
|
+
export { TimePanel };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { CheckLine } from "../../../icons/check-line.jsx";
|
|
2
|
+
import { CloseLine } from "../../../icons/close-line.jsx";
|
|
3
|
+
import "../../../icons/index.jsx";
|
|
4
|
+
import { FakeScrollListCore } from "../../../primitives/fake-scroll-list/index.jsx";
|
|
5
|
+
import "../../../primitives/index.jsx";
|
|
6
|
+
import { Show, createMemo } from "solid-js";
|
|
7
|
+
import { createWatch, list } from "solid-tiny-utils";
|
|
8
|
+
import { createStore } from "solid-js/store";
|
|
9
|
+
|
|
10
|
+
//#region src/components/form-components/time-picker/panel.tsx
|
|
11
|
+
function CommonTimeList(props) {
|
|
12
|
+
return <FakeScrollListCore inViewIndex={props.inViewItem} itemHeight={props.itemHeight} items={props.items.map((v) => v.toString().padStart(2, "0"))} onInViewIndexChange={(i) => {
|
|
13
|
+
props.onChange(i);
|
|
14
|
+
}} visibleItemsCount={7}>
|
|
15
|
+
<FakeScrollListCore.Listbox>
|
|
16
|
+
{(label, key) => <FakeScrollListCore.Item class="tiny-time-picker__listbox-item" key={key}>
|
|
17
|
+
{label}
|
|
18
|
+
</FakeScrollListCore.Item>}
|
|
19
|
+
</FakeScrollListCore.Listbox>
|
|
20
|
+
</FakeScrollListCore>;
|
|
21
|
+
}
|
|
22
|
+
function HourList(props) {
|
|
23
|
+
return <CommonTimeList inViewItem={props.hour} itemHeight={props.itemHeight} items={list(0, 23)} onChange={(hour) => {
|
|
24
|
+
props.onChange(hour);
|
|
25
|
+
}} />;
|
|
26
|
+
}
|
|
27
|
+
function MinuteList(props) {
|
|
28
|
+
return <CommonTimeList inViewItem={props.minute} itemHeight={props.itemHeight} items={list(0, 59)} onChange={(minute) => {
|
|
29
|
+
props.onChange(minute);
|
|
30
|
+
}} />;
|
|
31
|
+
}
|
|
32
|
+
function SecondList(props) {
|
|
33
|
+
return <CommonTimeList inViewItem={props.second} itemHeight={props.itemHeight} items={list(0, 59)} onChange={(second) => {
|
|
34
|
+
props.onChange(second);
|
|
35
|
+
}} />;
|
|
36
|
+
}
|
|
37
|
+
function TimePanel(props) {
|
|
38
|
+
const [time, setTime] = createStore({
|
|
39
|
+
hour: 0,
|
|
40
|
+
minute: 0,
|
|
41
|
+
second: 0
|
|
42
|
+
});
|
|
43
|
+
createWatch(() => [
|
|
44
|
+
props.hour,
|
|
45
|
+
props.minute,
|
|
46
|
+
props.second
|
|
47
|
+
], ([hour, minute, second]) => {
|
|
48
|
+
setTime({
|
|
49
|
+
hour,
|
|
50
|
+
minute,
|
|
51
|
+
second
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
createWatch(() => [
|
|
55
|
+
time.hour,
|
|
56
|
+
time.minute,
|
|
57
|
+
time.second
|
|
58
|
+
], ([hour, minute, second]) => {
|
|
59
|
+
if (hour === props.hour && minute === props.minute && second === props.second) return;
|
|
60
|
+
props.onChange(hour, minute, second);
|
|
61
|
+
});
|
|
62
|
+
const typeIndex = createMemo(() => {
|
|
63
|
+
return [
|
|
64
|
+
"hour",
|
|
65
|
+
"minute",
|
|
66
|
+
"second"
|
|
67
|
+
].indexOf(props.type);
|
|
68
|
+
});
|
|
69
|
+
return <div style={{
|
|
70
|
+
width: `${props.width}px`,
|
|
71
|
+
display: "flex",
|
|
72
|
+
"flex-direction": "column",
|
|
73
|
+
position: "relative"
|
|
74
|
+
}}>
|
|
75
|
+
<div class="tiny-time-picker__thumb" style={{
|
|
76
|
+
"--tiny-time-picker-thumb-height": `${props.itemHeight}px`,
|
|
77
|
+
"--tiny-time-picker-thumb-top": `${props.itemHeight * 7 / 2 - props.itemHeight / 2}px`
|
|
78
|
+
}} />
|
|
79
|
+
<div style={{
|
|
80
|
+
width: "100%",
|
|
81
|
+
display: "flex",
|
|
82
|
+
position: "relative"
|
|
83
|
+
}}>
|
|
84
|
+
<HourList hour={time.hour} itemHeight={props.itemHeight} onChange={(hour) => setTime("hour", hour)} />
|
|
85
|
+
<Show when={typeIndex() > 0}>
|
|
86
|
+
<MinuteList itemHeight={props.itemHeight} minute={time.minute} onChange={(minute) => setTime("minute", minute)} />
|
|
87
|
+
</Show>
|
|
88
|
+
<Show when={typeIndex() > 1}>
|
|
89
|
+
<SecondList itemHeight={props.itemHeight} onChange={(second) => setTime("second", second)} second={time.second} />
|
|
90
|
+
</Show>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="tiny-time-picker__action">
|
|
93
|
+
<button onClick={() => {
|
|
94
|
+
props.onCancel(time.hour, time.minute, time.second);
|
|
95
|
+
}} type="button">
|
|
96
|
+
<CloseLine />
|
|
97
|
+
</button>
|
|
98
|
+
<button onClick={() => {
|
|
99
|
+
props.onConfirm(time.hour, time.minute, time.second);
|
|
100
|
+
}} type="button">
|
|
101
|
+
<CheckLine />
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
</div>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { TimePanel };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { VisuallyHidden } from "../../visually-hidden/index.js";
|
|
2
|
+
import { className, createComponent, effect, insert, memo, setAttribute, style, template } from "solid-js/web";
|
|
3
|
+
import { Show, createMemo } from "solid-js";
|
|
4
|
+
import { combineClass, combineStyle, dataIf } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/components/form-components/time-picker/trigger.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<input readonly tabindex=-1 type=text>`), _tmpl$2 = /* @__PURE__ */ template(`<div class=tiny-time-picker-trigger__item>`), _tmpl$3 = /* @__PURE__ */ template(`<button type=button><div class=tiny-time-picker-trigger__item>`);
|
|
8
|
+
function TimeTrigger(props) {
|
|
9
|
+
const typeIndex = createMemo(() => [
|
|
10
|
+
"hour",
|
|
11
|
+
"minute",
|
|
12
|
+
"second"
|
|
13
|
+
].indexOf(props.type));
|
|
14
|
+
const toStr = (num) => {
|
|
15
|
+
if (num === null) return "";
|
|
16
|
+
return num.toString().padStart(2, "0");
|
|
17
|
+
};
|
|
18
|
+
return (() => {
|
|
19
|
+
var _el$ = _tmpl$3(), _el$3 = _el$.firstChild;
|
|
20
|
+
insert(_el$, createComponent(VisuallyHidden, { get children() {
|
|
21
|
+
var _el$2 = _tmpl$();
|
|
22
|
+
effect(() => _el$2.disabled = props.disabled);
|
|
23
|
+
return _el$2;
|
|
24
|
+
} }), _el$3);
|
|
25
|
+
insert(_el$3, () => toStr(props.hour) || "hh");
|
|
26
|
+
insert(_el$, createComponent(Show, {
|
|
27
|
+
get when() {
|
|
28
|
+
return typeIndex() > 0;
|
|
29
|
+
},
|
|
30
|
+
get children() {
|
|
31
|
+
var _el$4 = _tmpl$2();
|
|
32
|
+
insert(_el$4, () => toStr(props.minute) || "mm");
|
|
33
|
+
effect(() => setAttribute(_el$4, "data-empty", dataIf(props.minute === null)));
|
|
34
|
+
return _el$4;
|
|
35
|
+
}
|
|
36
|
+
}), null);
|
|
37
|
+
insert(_el$, createComponent(Show, {
|
|
38
|
+
get when() {
|
|
39
|
+
return typeIndex() > 1;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
var _el$5 = _tmpl$2();
|
|
43
|
+
insert(_el$5, () => toStr(props.second) || "ss");
|
|
44
|
+
effect(() => setAttribute(_el$5, "data-empty", dataIf(props.second === null)));
|
|
45
|
+
return _el$5;
|
|
46
|
+
}
|
|
47
|
+
}), null);
|
|
48
|
+
effect((_p$) => {
|
|
49
|
+
var _v$ = combineClass("tiny-time-picker-trigger tiny-time-picker-trigger-vars", props.class), _v$2 = dataIf(props.disabled), _v$3 = props.size, _v$4 = combineStyle({}, props.style), _v$5 = dataIf(props.hour === null);
|
|
50
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
51
|
+
_v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
|
|
52
|
+
_v$3 !== _p$.a && setAttribute(_el$, "data-size", _p$.a = _v$3);
|
|
53
|
+
_p$.o = style(_el$, _v$4, _p$.o);
|
|
54
|
+
_v$5 !== _p$.i && setAttribute(_el$3, "data-empty", _p$.i = _v$5);
|
|
55
|
+
return _p$;
|
|
56
|
+
}, {
|
|
57
|
+
e: void 0,
|
|
58
|
+
t: void 0,
|
|
59
|
+
a: void 0,
|
|
60
|
+
o: void 0,
|
|
61
|
+
i: void 0
|
|
62
|
+
});
|
|
63
|
+
return _el$;
|
|
64
|
+
})();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { TimeTrigger };
|