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,88 @@
|
|
|
1
|
+
import { inRange, max } from "solid-tiny-utils";
|
|
2
|
+
import { createComponentState } from "solid-tiny-context";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/pagination/context.ts
|
|
5
|
+
const context = createComponentState({
|
|
6
|
+
state: () => ({
|
|
7
|
+
current: 1,
|
|
8
|
+
total: 1,
|
|
9
|
+
pageSize: 10,
|
|
10
|
+
disabled: false,
|
|
11
|
+
maxVisiblePages: 7
|
|
12
|
+
}),
|
|
13
|
+
getters: {
|
|
14
|
+
totalPages() {
|
|
15
|
+
return Math.ceil(this.state.total / this.state.pageSize);
|
|
16
|
+
},
|
|
17
|
+
renderedPages() {
|
|
18
|
+
const total = this.state.totalPages;
|
|
19
|
+
const current = this.state.current;
|
|
20
|
+
const maxVisiblePages = this.state.maxVisiblePages;
|
|
21
|
+
const pages = [];
|
|
22
|
+
if (total <= 1) return [{
|
|
23
|
+
type: "page",
|
|
24
|
+
page: 1
|
|
25
|
+
}];
|
|
26
|
+
if (total <= maxVisiblePages) {
|
|
27
|
+
for (let i = 1; i <= total; i++) pages.push({
|
|
28
|
+
type: "page",
|
|
29
|
+
page: i
|
|
30
|
+
});
|
|
31
|
+
return pages;
|
|
32
|
+
}
|
|
33
|
+
pages.push({
|
|
34
|
+
type: "page",
|
|
35
|
+
page: 1
|
|
36
|
+
});
|
|
37
|
+
const centerCount = maxVisiblePages - 2;
|
|
38
|
+
let start = max(2, current - Math.floor(centerCount / 2));
|
|
39
|
+
let end = start + centerCount - 1;
|
|
40
|
+
if (end >= total) {
|
|
41
|
+
end = total - 1;
|
|
42
|
+
start = end - centerCount + 1;
|
|
43
|
+
}
|
|
44
|
+
if (start > 2) pages.push({
|
|
45
|
+
type: "ellipsis-left",
|
|
46
|
+
page: start - 1
|
|
47
|
+
});
|
|
48
|
+
else pages.push({
|
|
49
|
+
type: "page",
|
|
50
|
+
page: 2
|
|
51
|
+
});
|
|
52
|
+
for (let i = start + 1; i <= end - 1; i++) pages.push({
|
|
53
|
+
type: "page",
|
|
54
|
+
page: i
|
|
55
|
+
});
|
|
56
|
+
if (end < total - 1) pages.push({
|
|
57
|
+
type: "ellipsis-right",
|
|
58
|
+
page: end + 1
|
|
59
|
+
});
|
|
60
|
+
else pages.push({
|
|
61
|
+
type: "page",
|
|
62
|
+
page: total - 1
|
|
63
|
+
});
|
|
64
|
+
pages.push({
|
|
65
|
+
type: "page",
|
|
66
|
+
page: total
|
|
67
|
+
});
|
|
68
|
+
return pages;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
gotoPage(page) {
|
|
73
|
+
if (this.state.disabled) return;
|
|
74
|
+
const safePage = Math.floor(page);
|
|
75
|
+
const total = this.state.totalPages;
|
|
76
|
+
if (inRange(safePage, 1, total)) this.actions.setState("current", safePage);
|
|
77
|
+
},
|
|
78
|
+
next() {
|
|
79
|
+
this.actions.gotoPage(this.state.current + 1);
|
|
80
|
+
},
|
|
81
|
+
prev() {
|
|
82
|
+
this.actions.gotoPage(this.state.current - 1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { context };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PaginationPageType, PaginationPager } from "./context.js";
|
|
2
|
+
import { Items } from "./items.js";
|
|
3
|
+
import { Root } from "./root.js";
|
|
4
|
+
import * as solid_js_store4 from "solid-js/store";
|
|
5
|
+
|
|
6
|
+
//#region src/primitives/pagination/index.d.ts
|
|
7
|
+
declare const PaginationCore: typeof Root & {
|
|
8
|
+
Items: typeof Items;
|
|
9
|
+
useContext: () => [Readonly<{
|
|
10
|
+
current: number;
|
|
11
|
+
total: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
maxVisiblePages: number;
|
|
15
|
+
} & {
|
|
16
|
+
totalPages: number;
|
|
17
|
+
renderedPages: PaginationPager[];
|
|
18
|
+
}>, Omit<{
|
|
19
|
+
gotoPage(page: number): void;
|
|
20
|
+
next(): void;
|
|
21
|
+
prev(): void;
|
|
22
|
+
}, "setState" | "totalPages" | "renderedPages"> & {
|
|
23
|
+
setState: solid_js_store4.SetStoreFunction<{
|
|
24
|
+
current: number;
|
|
25
|
+
total: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
maxVisiblePages: number;
|
|
29
|
+
}>;
|
|
30
|
+
}, {}];
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { PaginationCore };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import { Items } from "./items.js";
|
|
3
|
+
import { Root } from "./root.js";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/index.ts
|
|
6
|
+
const PaginationCore = Object.assign(Root, {
|
|
7
|
+
Items,
|
|
8
|
+
useContext: context.useContext
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PaginationCore };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { context } from "./context.jsx";
|
|
2
|
+
import { Items } from "./items.jsx";
|
|
3
|
+
import { Root } from "./root.jsx";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/index.ts
|
|
6
|
+
const PaginationCore = Object.assign(Root, {
|
|
7
|
+
Items,
|
|
8
|
+
useContext: context.useContext
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PaginationCore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaginationPager } from "./context.js";
|
|
2
|
+
import { JSX } from "solid-js";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/pagination/items.d.ts
|
|
5
|
+
declare function Items(props: {
|
|
6
|
+
render: (page: PaginationPager) => JSX.Element;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Items };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import { createComponent } from "solid-js/web";
|
|
3
|
+
import { For as For$1 } from "solid-js";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/items.tsx
|
|
6
|
+
function Items(props) {
|
|
7
|
+
const [state] = context.useContext();
|
|
8
|
+
return createComponent(For$1, {
|
|
9
|
+
get each() {
|
|
10
|
+
return state.renderedPages;
|
|
11
|
+
},
|
|
12
|
+
get children() {
|
|
13
|
+
return props.render;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Items };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { context } from "./context.jsx";
|
|
2
|
+
import { For } from "solid-js";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/pagination/items.tsx
|
|
5
|
+
function Items(props) {
|
|
6
|
+
const [state] = context.useContext();
|
|
7
|
+
return <For each={state.renderedPages}>{props.render}</For>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Items };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import * as solid_js8 from "solid-js";
|
|
3
|
+
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/root.d.ts
|
|
6
|
+
declare function Root(props: {
|
|
7
|
+
current?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
onChange?: (page: number) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
maxVisiblePages?: number;
|
|
13
|
+
children?: MaybeCallableChild<ReturnType<typeof context.useContext>>;
|
|
14
|
+
}): solid_js8.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Root };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import { createComponent } from "solid-js/web";
|
|
3
|
+
import { callMaybeCallableChild, createWatch, isDefined, max } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/root.tsx
|
|
6
|
+
function Root(props) {
|
|
7
|
+
const Context = context.initial({
|
|
8
|
+
current: () => props.current,
|
|
9
|
+
total: () => props.total,
|
|
10
|
+
pageSize: () => max(props.pageSize ?? 10, 1),
|
|
11
|
+
disabled: () => props.disabled,
|
|
12
|
+
maxVisiblePages: () => max(props.maxVisiblePages ?? 7, 5)
|
|
13
|
+
});
|
|
14
|
+
const [state] = Context.value;
|
|
15
|
+
createWatch(() => state.current, (v) => {
|
|
16
|
+
if (isDefined(v) && v !== props.current) props.onChange?.(v);
|
|
17
|
+
});
|
|
18
|
+
return createComponent(Context.Provider, { get children() {
|
|
19
|
+
return callMaybeCallableChild(props.children, ...Context.value);
|
|
20
|
+
} });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Root };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { context } from "./context.jsx";
|
|
2
|
+
import { callMaybeCallableChild, createWatch, isDefined, max } from "solid-tiny-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/pagination/root.tsx
|
|
5
|
+
function Root(props) {
|
|
6
|
+
const Context = context.initial({
|
|
7
|
+
current: () => props.current,
|
|
8
|
+
total: () => props.total,
|
|
9
|
+
pageSize: () => max(props.pageSize ?? 10, 1),
|
|
10
|
+
disabled: () => props.disabled,
|
|
11
|
+
maxVisiblePages: () => max(props.maxVisiblePages ?? 7, 5)
|
|
12
|
+
});
|
|
13
|
+
const [state] = Context.value;
|
|
14
|
+
createWatch(() => state.current, (v) => {
|
|
15
|
+
if (isDefined(v) && v !== props.current) props.onChange?.(v);
|
|
16
|
+
});
|
|
17
|
+
return <Context.Provider>
|
|
18
|
+
{callMaybeCallableChild(props.children, ...Context.value)}
|
|
19
|
+
</Context.Provider>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Root };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as solid_js39 from "solid-js";
|
|
2
|
+
import * as solid_tiny_context9 from "solid-tiny-context";
|
|
3
|
+
import * as solid_js_store19 from "solid-js/store";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/context.d.ts
|
|
6
|
+
declare const rootContext: {
|
|
7
|
+
useContext: () => [Readonly<{
|
|
8
|
+
value: unknown;
|
|
9
|
+
name: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
} & {}>, Omit<{}, "setState"> & {
|
|
12
|
+
setState: solid_js_store19.SetStoreFunction<{
|
|
13
|
+
value: unknown;
|
|
14
|
+
name: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
}, {}];
|
|
18
|
+
initial(initialState?: Partial<solid_tiny_context9.MaybeSignals<{
|
|
19
|
+
value: unknown;
|
|
20
|
+
name: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
}>> | undefined): {
|
|
23
|
+
Provider(props: {
|
|
24
|
+
children?: solid_js39.JSX.Element;
|
|
25
|
+
}): solid_js39.JSX.Element;
|
|
26
|
+
value: [Readonly<{
|
|
27
|
+
value: unknown;
|
|
28
|
+
name: string;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
} & {}>, Omit<ThisType<solid_tiny_context9.RealContextThis<{
|
|
31
|
+
value: unknown;
|
|
32
|
+
name: string;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
}, {}, {}, {}>>, "setState"> & {
|
|
35
|
+
setState: solid_js_store19.SetStoreFunction<{
|
|
36
|
+
value: unknown;
|
|
37
|
+
name: string;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
}, {}];
|
|
41
|
+
};
|
|
42
|
+
defaultValue: () => {
|
|
43
|
+
value: unknown;
|
|
44
|
+
name: string;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
declare const itemContext: {
|
|
49
|
+
useContext: () => [Readonly<{
|
|
50
|
+
value: unknown;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
checked: boolean;
|
|
53
|
+
} & {}>, Omit<{}, "setState"> & {
|
|
54
|
+
setState: solid_js_store19.SetStoreFunction<{
|
|
55
|
+
value: unknown;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
checked: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
}, {}];
|
|
60
|
+
initial(initialState?: Partial<solid_tiny_context9.MaybeSignals<{
|
|
61
|
+
value: unknown;
|
|
62
|
+
disabled: boolean;
|
|
63
|
+
checked: boolean;
|
|
64
|
+
}>> | undefined): {
|
|
65
|
+
Provider(props: {
|
|
66
|
+
children?: solid_js39.JSX.Element;
|
|
67
|
+
}): solid_js39.JSX.Element;
|
|
68
|
+
value: [Readonly<{
|
|
69
|
+
value: unknown;
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
checked: boolean;
|
|
72
|
+
} & {}>, Omit<ThisType<solid_tiny_context9.RealContextThis<{
|
|
73
|
+
value: unknown;
|
|
74
|
+
disabled: boolean;
|
|
75
|
+
checked: boolean;
|
|
76
|
+
}, {}, {}, {}>>, "setState"> & {
|
|
77
|
+
setState: solid_js_store19.SetStoreFunction<{
|
|
78
|
+
value: unknown;
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
checked: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
}, {}];
|
|
83
|
+
};
|
|
84
|
+
defaultValue: () => {
|
|
85
|
+
value: unknown;
|
|
86
|
+
disabled: boolean;
|
|
87
|
+
checked: boolean;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
export { itemContext, rootContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createComponentState } from "solid-tiny-context";
|
|
2
|
+
|
|
3
|
+
//#region src/primitives/radio-group/context.ts
|
|
4
|
+
const rootContext = createComponentState({ state: () => ({
|
|
5
|
+
value: void 0,
|
|
6
|
+
name: "",
|
|
7
|
+
disabled: false
|
|
8
|
+
}) });
|
|
9
|
+
const itemContext = createComponentState({ state: () => ({
|
|
10
|
+
value: void 0,
|
|
11
|
+
disabled: false,
|
|
12
|
+
checked: false
|
|
13
|
+
}) });
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { itemContext, rootContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createComponentState } from "solid-tiny-context";
|
|
2
|
+
|
|
3
|
+
//#region src/primitives/radio-group/context.ts
|
|
4
|
+
const rootContext = createComponentState({ state: () => ({
|
|
5
|
+
value: void 0,
|
|
6
|
+
name: "",
|
|
7
|
+
disabled: false
|
|
8
|
+
}) });
|
|
9
|
+
const itemContext = createComponentState({ state: () => ({
|
|
10
|
+
value: void 0,
|
|
11
|
+
disabled: false,
|
|
12
|
+
checked: false
|
|
13
|
+
}) });
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { itemContext, rootContext };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Item, ItemInput, ItemLabel } from "./item.js";
|
|
2
|
+
import { Root } from "./root.js";
|
|
3
|
+
import * as solid_js_store5 from "solid-js/store";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/index.d.ts
|
|
6
|
+
declare const RadioGroupCore: typeof Root & {
|
|
7
|
+
Item: typeof Item;
|
|
8
|
+
ItemInput: typeof ItemInput;
|
|
9
|
+
ItemLabel: typeof ItemLabel;
|
|
10
|
+
useRootContext: () => [Readonly<{
|
|
11
|
+
value: unknown;
|
|
12
|
+
name: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
} & {}>, Omit<{}, "setState"> & {
|
|
15
|
+
setState: solid_js_store5.SetStoreFunction<{
|
|
16
|
+
value: unknown;
|
|
17
|
+
name: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
}, {}];
|
|
21
|
+
useItemContext: () => [Readonly<{
|
|
22
|
+
value: unknown;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
checked: boolean;
|
|
25
|
+
} & {}>, Omit<{}, "setState"> & {
|
|
26
|
+
setState: solid_js_store5.SetStoreFunction<{
|
|
27
|
+
value: unknown;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
checked: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
}, {}];
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { RadioGroupCore };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { itemContext, rootContext } from "./context.js";
|
|
2
|
+
import { Item, ItemInput, ItemLabel } from "./item.js";
|
|
3
|
+
import { Root } from "./root.js";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/index.ts
|
|
6
|
+
const RadioGroupCore = Object.assign(Root, {
|
|
7
|
+
Item,
|
|
8
|
+
ItemInput,
|
|
9
|
+
ItemLabel,
|
|
10
|
+
useRootContext: rootContext.useContext,
|
|
11
|
+
useItemContext: itemContext.useContext
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { RadioGroupCore };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { itemContext, rootContext } from "./context.jsx";
|
|
2
|
+
import { Item, ItemInput, ItemLabel } from "./item.jsx";
|
|
3
|
+
import { Root } from "./root.jsx";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/index.ts
|
|
6
|
+
const RadioGroupCore = Object.assign(Root, {
|
|
7
|
+
Item,
|
|
8
|
+
ItemInput,
|
|
9
|
+
ItemLabel,
|
|
10
|
+
useRootContext: rootContext.useContext,
|
|
11
|
+
useItemContext: itemContext.useContext
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { RadioGroupCore };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OmitComponentProps } from "../../utils/types.js";
|
|
2
|
+
import { itemContext } from "./context.js";
|
|
3
|
+
import * as solid_js13 from "solid-js";
|
|
4
|
+
import { ComponentProps } from "solid-js";
|
|
5
|
+
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
6
|
+
|
|
7
|
+
//#region src/primitives/radio-group/item.d.ts
|
|
8
|
+
declare function Item<T>(props: OmitComponentProps<"div", "children"> & {
|
|
9
|
+
value: T;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
children?: MaybeCallableChild<ReturnType<typeof itemContext.useContext>>;
|
|
12
|
+
}): solid_js13.JSX.Element;
|
|
13
|
+
declare function ItemLabel(props: ComponentProps<"label">): solid_js13.JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* visually hidden radio input for the radio item
|
|
16
|
+
*/
|
|
17
|
+
declare function ItemInput(props: Omit<ComponentProps<"input">, "name" | "type">): solid_js13.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Item, ItemInput, ItemLabel };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { VisuallyHidden } from "../../components/visually-hidden/index.js";
|
|
2
|
+
import { itemContext, rootContext } from "./context.js";
|
|
3
|
+
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
4
|
+
import { splitProps } from "solid-js";
|
|
5
|
+
import { callMaybeCallableChild, dataIf, isUndefined } from "solid-tiny-utils";
|
|
6
|
+
|
|
7
|
+
//#region src/primitives/radio-group/item.tsx
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`), _tmpl$2 = /* @__PURE__ */ template(`<label>`);
|
|
9
|
+
function Item(props) {
|
|
10
|
+
const [local, others] = splitProps(props, [
|
|
11
|
+
"children",
|
|
12
|
+
"value",
|
|
13
|
+
"disabled"
|
|
14
|
+
]);
|
|
15
|
+
const [rootState] = rootContext.useContext();
|
|
16
|
+
const Context = itemContext.initial({
|
|
17
|
+
value: () => local.value,
|
|
18
|
+
disabled: () => rootState.disabled || local.disabled,
|
|
19
|
+
checked: () => {
|
|
20
|
+
if (isUndefined(rootState.value)) return false;
|
|
21
|
+
return rootState.value === local.value;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const [state] = Context.value;
|
|
25
|
+
return createComponent(Context.Provider, { get children() {
|
|
26
|
+
var _el$ = _tmpl$();
|
|
27
|
+
spread(_el$, mergeProps({
|
|
28
|
+
get ["data-checked"]() {
|
|
29
|
+
return dataIf(state.checked);
|
|
30
|
+
},
|
|
31
|
+
get ["data-disabled"]() {
|
|
32
|
+
return dataIf(state.disabled);
|
|
33
|
+
}
|
|
34
|
+
}, others), false, true);
|
|
35
|
+
insert(_el$, () => callMaybeCallableChild(local.children, ...Context.value));
|
|
36
|
+
return _el$;
|
|
37
|
+
} });
|
|
38
|
+
}
|
|
39
|
+
function ItemLabel(props) {
|
|
40
|
+
return (() => {
|
|
41
|
+
var _el$2 = _tmpl$2();
|
|
42
|
+
spread(_el$2, props, false, false);
|
|
43
|
+
return _el$2;
|
|
44
|
+
})();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* visually hidden radio input for the radio item
|
|
48
|
+
*/
|
|
49
|
+
function ItemInput(props) {
|
|
50
|
+
const [rootState, rootActs] = rootContext.useContext();
|
|
51
|
+
const [itemState] = itemContext.useContext();
|
|
52
|
+
return createComponent(VisuallyHidden, mergeProps({
|
|
53
|
+
as: "input",
|
|
54
|
+
get checked() {
|
|
55
|
+
return itemState.checked;
|
|
56
|
+
},
|
|
57
|
+
get disabled() {
|
|
58
|
+
return itemState.disabled;
|
|
59
|
+
},
|
|
60
|
+
get name() {
|
|
61
|
+
return rootState.name;
|
|
62
|
+
},
|
|
63
|
+
onChange: (e) => {
|
|
64
|
+
if (e.currentTarget.checked) rootActs.setState("value", () => itemState.value);
|
|
65
|
+
},
|
|
66
|
+
type: "radio",
|
|
67
|
+
get value() {
|
|
68
|
+
return String(itemState.value);
|
|
69
|
+
}
|
|
70
|
+
}, props));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { Item, ItemInput, ItemLabel };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VisuallyHidden } from "../../components/visually-hidden/index.jsx";
|
|
2
|
+
import { itemContext, rootContext } from "./context.jsx";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { callMaybeCallableChild, dataIf, isUndefined } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/primitives/radio-group/item.tsx
|
|
7
|
+
function Item(props) {
|
|
8
|
+
const [local, others] = splitProps(props, [
|
|
9
|
+
"children",
|
|
10
|
+
"value",
|
|
11
|
+
"disabled"
|
|
12
|
+
]);
|
|
13
|
+
const [rootState] = rootContext.useContext();
|
|
14
|
+
const Context = itemContext.initial({
|
|
15
|
+
value: () => local.value,
|
|
16
|
+
disabled: () => rootState.disabled || local.disabled,
|
|
17
|
+
checked: () => {
|
|
18
|
+
if (isUndefined(rootState.value)) return false;
|
|
19
|
+
return rootState.value === local.value;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const [state] = Context.value;
|
|
23
|
+
return <Context.Provider>
|
|
24
|
+
<div data-checked={dataIf(state.checked)} data-disabled={dataIf(state.disabled)} {...others}>
|
|
25
|
+
{callMaybeCallableChild(local.children, ...Context.value)}
|
|
26
|
+
</div>
|
|
27
|
+
</Context.Provider>;
|
|
28
|
+
}
|
|
29
|
+
function ItemLabel(props) {
|
|
30
|
+
return <label {...props} />;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* visually hidden radio input for the radio item
|
|
34
|
+
*/
|
|
35
|
+
function ItemInput(props) {
|
|
36
|
+
const [rootState, rootActs] = rootContext.useContext();
|
|
37
|
+
const [itemState] = itemContext.useContext();
|
|
38
|
+
return <VisuallyHidden as="input" checked={itemState.checked} disabled={itemState.disabled} name={rootState.name} onChange={(e) => {
|
|
39
|
+
if (e.currentTarget.checked) rootActs.setState("value", () => itemState.value);
|
|
40
|
+
}} type="radio" value={String(itemState.value)} {...props} />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Item, ItemInput, ItemLabel };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { rootContext } from "./context.js";
|
|
2
|
+
import * as solid_js9 from "solid-js";
|
|
3
|
+
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/root.d.ts
|
|
6
|
+
declare function Root<T>(props: {
|
|
7
|
+
value?: T;
|
|
8
|
+
onChange?: (value: T) => void;
|
|
9
|
+
name?: string;
|
|
10
|
+
children?: MaybeCallableChild<ReturnType<typeof rootContext.useContext>>;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}): solid_js9.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Root };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { rootContext } from "./context.js";
|
|
2
|
+
import { createComponent } from "solid-js/web";
|
|
3
|
+
import { createUniqueId } from "solid-js";
|
|
4
|
+
import { callMaybeCallableChild, createWatch, isDefined } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/primitives/radio-group/root.tsx
|
|
7
|
+
function Root(props) {
|
|
8
|
+
const Context = rootContext.initial({
|
|
9
|
+
value: () => props.value,
|
|
10
|
+
name: () => props.name || `radio-group_${createUniqueId()}`,
|
|
11
|
+
disabled: () => props.disabled
|
|
12
|
+
});
|
|
13
|
+
const [state] = Context.value;
|
|
14
|
+
createWatch(() => state.value, (v) => {
|
|
15
|
+
if (isDefined(v) && v !== props.value) props.onChange?.(v);
|
|
16
|
+
});
|
|
17
|
+
return createComponent(Context.Provider, { get children() {
|
|
18
|
+
return callMaybeCallableChild(props.children, ...Context.value);
|
|
19
|
+
} });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Root };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { rootContext } from "./context.jsx";
|
|
2
|
+
import { createUniqueId } from "solid-js";
|
|
3
|
+
import { callMaybeCallableChild, createWatch, isDefined } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/radio-group/root.tsx
|
|
6
|
+
function Root(props) {
|
|
7
|
+
const Context = rootContext.initial({
|
|
8
|
+
value: () => props.value,
|
|
9
|
+
name: () => props.name || `radio-group_${createUniqueId()}`,
|
|
10
|
+
disabled: () => props.disabled
|
|
11
|
+
});
|
|
12
|
+
const [state] = Context.value;
|
|
13
|
+
createWatch(() => state.value, (v) => {
|
|
14
|
+
if (isDefined(v) && v !== props.value) props.onChange?.(v);
|
|
15
|
+
});
|
|
16
|
+
return <Context.Provider>
|
|
17
|
+
{callMaybeCallableChild(props.children, ...Context.value)}
|
|
18
|
+
</Context.Provider>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Root };
|