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
|
@@ -14,7 +14,7 @@ function Trigger(props) {
|
|
|
14
14
|
state.trigger === "hover" && actions.setOpen(false);
|
|
15
15
|
});
|
|
16
16
|
makeEventListener(refTrigger, "click", () => {
|
|
17
|
-
state.trigger === "click" && actions.setOpen(staticData.
|
|
17
|
+
state.trigger === "click" && actions.setOpen(staticData.presencePhase() === "idle");
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
return <Ref ref={mergeRefs(props.ref, (el) => {
|
|
@@ -16,5 +16,6 @@ interface FloatingUiCoreProps {
|
|
|
16
16
|
size?: SizeOptions | Derivable<SizeOptions>;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
type CloseableStatus = "closing" | "closed" | "opening" | "opened";
|
|
19
20
|
//#endregion
|
|
20
|
-
export { FloatingUiCoreProps, Placement$1 as Placement };
|
|
21
|
+
export { CloseableStatus, FloatingUiCoreProps, Placement$1 as Placement };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ModalCore } from "./modal/index.js";
|
|
2
|
+
import { CloseableStatus, FloatingUiCoreProps, Placement } from "./floating/types.js";
|
|
3
|
+
import { FloatingUiCore } from "./floating/index.js";
|
|
2
4
|
import { AnimatedGroup } from "./animated-group/index.js";
|
|
5
|
+
import { CheckboxCore } from "./checkbox/index.js";
|
|
6
|
+
import { FakeScrollListCore } from "./fake-scroll-list/index.js";
|
|
3
7
|
import { Listbox } from "./listbox/listbox.js";
|
|
4
8
|
import "./listbox/index.js";
|
|
5
|
-
|
|
9
|
+
import { PaginationPageType, PaginationPager } from "./pagination/context.js";
|
|
10
|
+
import { PaginationCore } from "./pagination/index.js";
|
|
11
|
+
import { RadioGroupCore } from "./radio-group/index.js";
|
|
12
|
+
export { AnimatedGroup, CheckboxCore, CloseableStatus, FakeScrollListCore, FloatingUiCore, FloatingUiCoreProps, Listbox, ModalCore, PaginationCore, PaginationPageType, PaginationPager, Placement, RadioGroupCore };
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./listbox/index.js";
|
|
1
|
+
import { FloatingUiCore } from "./floating/index.js";
|
|
3
2
|
import { ModalCore } from "./modal/index.js";
|
|
4
3
|
import { AnimatedGroup } from "./animated-group/index.js";
|
|
4
|
+
import { CheckboxCore } from "./checkbox/index.js";
|
|
5
|
+
import { FakeScrollListCore } from "./fake-scroll-list/index.js";
|
|
6
|
+
import { Listbox } from "./listbox/listbox.js";
|
|
7
|
+
import "./listbox/index.js";
|
|
8
|
+
import { PaginationCore } from "./pagination/index.js";
|
|
9
|
+
import { RadioGroupCore } from "./radio-group/index.js";
|
|
5
10
|
|
|
6
|
-
export { AnimatedGroup, Listbox, ModalCore };
|
|
11
|
+
export { AnimatedGroup, CheckboxCore, FakeScrollListCore, FloatingUiCore, Listbox, ModalCore, PaginationCore, RadioGroupCore };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./listbox/index.jsx";
|
|
1
|
+
import { FloatingUiCore } from "./floating/index.jsx";
|
|
3
2
|
import { ModalCore } from "./modal/index.jsx";
|
|
4
3
|
import { AnimatedGroup } from "./animated-group/index.jsx";
|
|
4
|
+
import { CheckboxCore } from "./checkbox/index.jsx";
|
|
5
|
+
import { FakeScrollListCore } from "./fake-scroll-list/index.jsx";
|
|
6
|
+
import { Listbox } from "./listbox/listbox.jsx";
|
|
7
|
+
import "./listbox/index.jsx";
|
|
8
|
+
import { PaginationCore } from "./pagination/index.jsx";
|
|
9
|
+
import { RadioGroupCore } from "./radio-group/index.jsx";
|
|
5
10
|
|
|
6
|
-
export { AnimatedGroup, Listbox, ModalCore };
|
|
11
|
+
export { AnimatedGroup, CheckboxCore, FakeScrollListCore, FloatingUiCore, Listbox, ModalCore, PaginationCore, RadioGroupCore };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as solid_js1 from "solid-js";
|
|
2
2
|
import { ComponentProps } from "solid-js";
|
|
3
3
|
|
|
4
4
|
//#region src/primitives/listbox/listbox.d.ts
|
|
5
5
|
declare function Root(props: Omit<ComponentProps<"div">, "role" | "tabIndex" | "tabindex"> & {
|
|
6
6
|
autofocus?: boolean;
|
|
7
|
-
}):
|
|
7
|
+
}): solid_js1.JSX.Element;
|
|
8
8
|
declare function Item(props: Omit<ComponentProps<"div">, "role" | "tabIndex" | "tabindex"> & {
|
|
9
9
|
focus?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
}):
|
|
11
|
+
}): solid_js1.JSX.Element;
|
|
12
12
|
declare const Listbox: typeof Root & {
|
|
13
13
|
Item: typeof Item;
|
|
14
14
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as solid_js5 from "solid-js";
|
|
2
2
|
import { ComponentProps } from "solid-js";
|
|
3
3
|
|
|
4
4
|
//#region src/primitives/modal/content.d.ts
|
|
5
|
-
declare function ContentWrapper(props: ComponentProps<"div">):
|
|
6
|
-
declare function Content(props: ComponentProps<"div">):
|
|
5
|
+
declare function ContentWrapper(props: ComponentProps<"div">): solid_js5.JSX.Element;
|
|
6
|
+
declare function Content(props: ComponentProps<"div">): solid_js5.JSX.Element;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { Content, ContentWrapper };
|
|
@@ -5,7 +5,7 @@ import { combineStyle, runSolidEventHandler } from "solid-tiny-utils";
|
|
|
5
5
|
import { mergeRefs } from "@solid-primitives/refs";
|
|
6
6
|
|
|
7
7
|
//#region src/primitives/modal/content.tsx
|
|
8
|
-
/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions:
|
|
8
|
+
/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions: The modal overlay needs to be interactive to handle close events (click outside, Escape key). */
|
|
9
9
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`), _tmpl$2 = /* @__PURE__ */ template(`<div role=dialog>`);
|
|
10
10
|
function ContentWrapper(props) {
|
|
11
11
|
const [local, others] = splitProps(props, [
|
|
@@ -39,8 +39,7 @@ function ContentWrapper(props) {
|
|
|
39
39
|
get style() {
|
|
40
40
|
return combineStyle({
|
|
41
41
|
position: "fixed",
|
|
42
|
-
inset: 0
|
|
43
|
-
overflow: "auto"
|
|
42
|
+
inset: 0
|
|
44
43
|
}, local.style);
|
|
45
44
|
},
|
|
46
45
|
"tabIndex": -1
|
|
@@ -4,7 +4,7 @@ import { combineStyle, runSolidEventHandler } from "solid-tiny-utils";
|
|
|
4
4
|
import { mergeRefs } from "@solid-primitives/refs";
|
|
5
5
|
|
|
6
6
|
//#region src/primitives/modal/content.tsx
|
|
7
|
-
/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions:
|
|
7
|
+
/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions: The modal overlay needs to be interactive to handle close events (click outside, Escape key). */
|
|
8
8
|
function ContentWrapper(props) {
|
|
9
9
|
const [local, others] = splitProps(props, [
|
|
10
10
|
"style",
|
|
@@ -29,8 +29,7 @@ function ContentWrapper(props) {
|
|
|
29
29
|
refWrapper = el;
|
|
30
30
|
})} style={combineStyle({
|
|
31
31
|
position: "fixed",
|
|
32
|
-
inset: 0
|
|
33
|
-
overflow: "auto"
|
|
32
|
+
inset: 0
|
|
34
33
|
}, local.style)} tabIndex={-1} />;
|
|
35
34
|
}
|
|
36
35
|
function Content(props) {
|
|
@@ -1,76 +1,63 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
1
|
+
import * as solid_js37 from "solid-js";
|
|
2
|
+
import { PresencePhase } from "solid-tiny-utils";
|
|
3
|
+
import * as solid_tiny_context7 from "solid-tiny-context";
|
|
4
|
+
import * as solid_js_store17 from "solid-js/store";
|
|
4
5
|
|
|
5
6
|
//#region src/primitives/modal/context.d.ts
|
|
6
7
|
declare const context: {
|
|
7
8
|
useContext: () => [Readonly<{
|
|
8
|
-
id: string;
|
|
9
9
|
open: boolean;
|
|
10
10
|
refContent: HTMLElement | null;
|
|
11
|
-
preventScroll: boolean;
|
|
12
11
|
closeOnClickMask: boolean;
|
|
13
12
|
closeOnEsc: boolean;
|
|
14
13
|
} & {}>, Omit<{}, "setState"> & {
|
|
15
|
-
setState:
|
|
16
|
-
id: string;
|
|
14
|
+
setState: solid_js_store17.SetStoreFunction<{
|
|
17
15
|
open: boolean;
|
|
18
16
|
refContent: HTMLElement | null;
|
|
19
|
-
preventScroll: boolean;
|
|
20
17
|
closeOnClickMask: boolean;
|
|
21
18
|
closeOnEsc: boolean;
|
|
22
19
|
}>;
|
|
23
20
|
}, {
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
isMounted: () => boolean;
|
|
22
|
+
presencePhase: () => PresencePhase;
|
|
26
23
|
}];
|
|
27
|
-
initial(initialState?: Partial<
|
|
28
|
-
id: string;
|
|
24
|
+
initial(initialState?: Partial<solid_tiny_context7.MaybeSignals<{
|
|
29
25
|
open: boolean;
|
|
30
26
|
refContent: HTMLElement | null;
|
|
31
|
-
preventScroll: boolean;
|
|
32
27
|
closeOnClickMask: boolean;
|
|
33
28
|
closeOnEsc: boolean;
|
|
34
29
|
}>> | undefined): {
|
|
35
30
|
Provider(props: {
|
|
36
|
-
children?:
|
|
37
|
-
}):
|
|
31
|
+
children?: solid_js37.JSX.Element;
|
|
32
|
+
}): solid_js37.JSX.Element;
|
|
38
33
|
value: [Readonly<{
|
|
39
|
-
id: string;
|
|
40
34
|
open: boolean;
|
|
41
35
|
refContent: HTMLElement | null;
|
|
42
|
-
preventScroll: boolean;
|
|
43
36
|
closeOnClickMask: boolean;
|
|
44
37
|
closeOnEsc: boolean;
|
|
45
|
-
} & {}>, Omit<ThisType<
|
|
46
|
-
id: string;
|
|
38
|
+
} & {}>, Omit<ThisType<solid_tiny_context7.RealContextThis<{
|
|
47
39
|
open: boolean;
|
|
48
40
|
refContent: HTMLElement | null;
|
|
49
|
-
preventScroll: boolean;
|
|
50
41
|
closeOnClickMask: boolean;
|
|
51
42
|
closeOnEsc: boolean;
|
|
52
43
|
}, {
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
isMounted: () => boolean;
|
|
45
|
+
presencePhase: () => PresencePhase;
|
|
55
46
|
}, {}, {}>>, "setState"> & {
|
|
56
|
-
setState:
|
|
57
|
-
id: string;
|
|
47
|
+
setState: solid_js_store17.SetStoreFunction<{
|
|
58
48
|
open: boolean;
|
|
59
49
|
refContent: HTMLElement | null;
|
|
60
|
-
preventScroll: boolean;
|
|
61
50
|
closeOnClickMask: boolean;
|
|
62
51
|
closeOnEsc: boolean;
|
|
63
52
|
}>;
|
|
64
53
|
}, {
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
isMounted: () => boolean;
|
|
55
|
+
presencePhase: () => PresencePhase;
|
|
67
56
|
}];
|
|
68
57
|
};
|
|
69
58
|
defaultValue: () => {
|
|
70
|
-
id: string;
|
|
71
59
|
open: boolean;
|
|
72
60
|
refContent: HTMLElement | null;
|
|
73
|
-
preventScroll: boolean;
|
|
74
61
|
closeOnClickMask: boolean;
|
|
75
62
|
closeOnEsc: boolean;
|
|
76
63
|
};
|
|
@@ -3,17 +3,15 @@ import { createComponentState } from "solid-tiny-context";
|
|
|
3
3
|
//#region src/primitives/modal/context.ts
|
|
4
4
|
const context = createComponentState({
|
|
5
5
|
state: () => ({
|
|
6
|
-
id: "",
|
|
7
6
|
open: false,
|
|
8
7
|
refContent: null,
|
|
9
|
-
preventScroll: true,
|
|
10
8
|
closeOnClickMask: false,
|
|
11
9
|
closeOnEsc: false
|
|
12
10
|
}),
|
|
13
11
|
methods: {},
|
|
14
12
|
nowrapData: () => ({
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
isMounted: () => false,
|
|
14
|
+
presencePhase: () => "idle"
|
|
17
15
|
})
|
|
18
16
|
});
|
|
19
17
|
|
|
@@ -3,17 +3,15 @@ import { createComponentState } from "solid-tiny-context";
|
|
|
3
3
|
//#region src/primitives/modal/context.ts
|
|
4
4
|
const context = createComponentState({
|
|
5
5
|
state: () => ({
|
|
6
|
-
id: "",
|
|
7
6
|
open: false,
|
|
8
7
|
refContent: null,
|
|
9
|
-
preventScroll: true,
|
|
10
8
|
closeOnClickMask: false,
|
|
11
9
|
closeOnEsc: false
|
|
12
10
|
}),
|
|
13
11
|
methods: {},
|
|
14
12
|
nowrapData: () => ({
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
isMounted: () => false,
|
|
14
|
+
presencePhase: () => "idle"
|
|
17
15
|
})
|
|
18
16
|
});
|
|
19
17
|
|
|
@@ -3,7 +3,8 @@ import { Content, ContentWrapper } from "./content.js";
|
|
|
3
3
|
import { Mask } from "./mask.js";
|
|
4
4
|
import { Portal } from "./portal.js";
|
|
5
5
|
import { Root } from "./root.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as solid_tiny_utils0 from "solid-tiny-utils";
|
|
7
|
+
import * as solid_js_store3 from "solid-js/store";
|
|
7
8
|
|
|
8
9
|
//#region src/primitives/modal/index.d.ts
|
|
9
10
|
declare const ModalCore: typeof Root & {
|
|
@@ -13,24 +14,20 @@ declare const ModalCore: typeof Root & {
|
|
|
13
14
|
Content: typeof Content;
|
|
14
15
|
Mask: typeof Mask;
|
|
15
16
|
useContext: () => [Readonly<{
|
|
16
|
-
id: string;
|
|
17
17
|
open: boolean;
|
|
18
18
|
refContent: HTMLElement | null;
|
|
19
|
-
preventScroll: boolean;
|
|
20
19
|
closeOnClickMask: boolean;
|
|
21
20
|
closeOnEsc: boolean;
|
|
22
21
|
} & {}>, Omit<{}, "setState"> & {
|
|
23
|
-
setState:
|
|
24
|
-
id: string;
|
|
22
|
+
setState: solid_js_store3.SetStoreFunction<{
|
|
25
23
|
open: boolean;
|
|
26
24
|
refContent: HTMLElement | null;
|
|
27
|
-
preventScroll: boolean;
|
|
28
25
|
closeOnClickMask: boolean;
|
|
29
26
|
closeOnEsc: boolean;
|
|
30
27
|
}>;
|
|
31
28
|
}, {
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
isMounted: () => boolean;
|
|
30
|
+
presencePhase: () => solid_tiny_utils0.PresencePhase;
|
|
34
31
|
}];
|
|
35
32
|
};
|
|
36
33
|
//#endregion
|
|
@@ -5,7 +5,7 @@ import { Portal } from "solid-js/web";
|
|
|
5
5
|
//#region src/primitives/modal/portal.tsx
|
|
6
6
|
function Portal$1(props) {
|
|
7
7
|
const [, , staticData] = context.useContext();
|
|
8
|
-
return <Show when={staticData.
|
|
8
|
+
return <Show when={staticData.isMounted()}>
|
|
9
9
|
<Portal mount={props.mount} ref={props.ref}>
|
|
10
10
|
{props.children}
|
|
11
11
|
</Portal>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { context } from "./context.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as solid_js7 from "solid-js";
|
|
3
3
|
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/primitives/modal/root.d.ts
|
|
@@ -7,9 +7,8 @@ declare function Root(props: {
|
|
|
7
7
|
children: MaybeCallableChild<ReturnType<typeof context.useContext>>;
|
|
8
8
|
open?: boolean;
|
|
9
9
|
onOpenChange?: (open: boolean) => void;
|
|
10
|
-
preventScroll?: boolean;
|
|
11
10
|
closeOnClickMask?: boolean;
|
|
12
11
|
closeOnEsc?: boolean;
|
|
13
|
-
}):
|
|
12
|
+
}): solid_js7.JSX.Element;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { Root };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAnimationDurationMs } from "../../utils/duration.js";
|
|
1
2
|
import { context } from "./context.js";
|
|
2
3
|
import { createComponent } from "solid-js/web";
|
|
3
4
|
import { createUniqueId } from "solid-js";
|
|
@@ -6,22 +7,21 @@ import { callMaybeCallableChild, createPresence, createWatch, mountStyle } from
|
|
|
6
7
|
//#region src/primitives/modal/root.tsx
|
|
7
8
|
function Root(props) {
|
|
8
9
|
const Context = context.initial({
|
|
9
|
-
id: () => `tiny-modal_${createUniqueId()}`,
|
|
10
|
-
preventScroll: () => props.preventScroll,
|
|
11
10
|
closeOnClickMask: () => props.closeOnClickMask,
|
|
12
11
|
closeOnEsc: () => props.closeOnEsc,
|
|
13
12
|
open: () => props.open
|
|
14
13
|
});
|
|
15
14
|
const [state, _, staticData] = Context.value;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const presence = createPresence(() => state.open, {
|
|
16
|
+
enterDuration: () => getAnimationDurationMs(state.refContent),
|
|
17
|
+
exitDuration: () => getAnimationDurationMs(state.refContent)
|
|
19
18
|
});
|
|
20
|
-
staticData.
|
|
21
|
-
staticData.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
staticData.isMounted = presence.isMounted;
|
|
20
|
+
staticData.presencePhase = presence.phase;
|
|
21
|
+
const id = `ps__${createUniqueId()}`;
|
|
22
|
+
createWatch(() => [presence.isMounted()], ([mounted]) => {
|
|
23
|
+
if (mounted) mountStyle("html body{overflow:hidden}", id);
|
|
24
|
+
else document.querySelector(`#${id}`)?.remove();
|
|
25
25
|
});
|
|
26
26
|
return createComponent(Context.Provider, { get children() {
|
|
27
27
|
return callMaybeCallableChild(props.children, ...Context.value);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAnimationDurationMs } from "../../utils/duration.jsx";
|
|
1
2
|
import { context } from "./context.jsx";
|
|
2
3
|
import { createUniqueId } from "solid-js";
|
|
3
4
|
import { callMaybeCallableChild, createPresence, createWatch, mountStyle } from "solid-tiny-utils";
|
|
@@ -5,22 +6,21 @@ import { callMaybeCallableChild, createPresence, createWatch, mountStyle } from
|
|
|
5
6
|
//#region src/primitives/modal/root.tsx
|
|
6
7
|
function Root(props) {
|
|
7
8
|
const Context = context.initial({
|
|
8
|
-
id: () => `tiny-modal_${createUniqueId()}`,
|
|
9
|
-
preventScroll: () => props.preventScroll,
|
|
10
9
|
closeOnClickMask: () => props.closeOnClickMask,
|
|
11
10
|
closeOnEsc: () => props.closeOnEsc,
|
|
12
11
|
open: () => props.open
|
|
13
12
|
});
|
|
14
13
|
const [state, _, staticData] = Context.value;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const presence = createPresence(() => state.open, {
|
|
15
|
+
enterDuration: () => getAnimationDurationMs(state.refContent),
|
|
16
|
+
exitDuration: () => getAnimationDurationMs(state.refContent)
|
|
18
17
|
});
|
|
19
|
-
staticData.
|
|
20
|
-
staticData.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
staticData.isMounted = presence.isMounted;
|
|
19
|
+
staticData.presencePhase = presence.phase;
|
|
20
|
+
const id = `ps__${createUniqueId()}`;
|
|
21
|
+
createWatch(() => [presence.isMounted()], ([mounted]) => {
|
|
22
|
+
if (mounted) mountStyle("html body{overflow:hidden}", id);
|
|
23
|
+
else document.querySelector(`#${id}`)?.remove();
|
|
24
24
|
});
|
|
25
25
|
return <Context.Provider>
|
|
26
26
|
{callMaybeCallableChild(props.children, ...Context.value)}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as solid_js10 from "solid-js";
|
|
2
|
+
import * as solid_tiny_context0 from "solid-tiny-context";
|
|
3
|
+
import * as solid_js_store7 from "solid-js/store";
|
|
4
|
+
|
|
5
|
+
//#region src/primitives/pagination/context.d.ts
|
|
6
|
+
type PaginationPageType = "page" | "ellipsis-left" | "ellipsis-right";
|
|
7
|
+
interface PaginationPager {
|
|
8
|
+
type: PaginationPageType;
|
|
9
|
+
page: number;
|
|
10
|
+
}
|
|
11
|
+
declare const context: {
|
|
12
|
+
useContext: () => [Readonly<{
|
|
13
|
+
current: number;
|
|
14
|
+
total: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
maxVisiblePages: number;
|
|
18
|
+
} & {
|
|
19
|
+
totalPages: number;
|
|
20
|
+
renderedPages: PaginationPager[];
|
|
21
|
+
}>, Omit<{
|
|
22
|
+
gotoPage(page: number): void;
|
|
23
|
+
next(): void;
|
|
24
|
+
prev(): void;
|
|
25
|
+
}, "setState" | "totalPages" | "renderedPages"> & {
|
|
26
|
+
setState: solid_js_store7.SetStoreFunction<{
|
|
27
|
+
current: number;
|
|
28
|
+
total: number;
|
|
29
|
+
pageSize: number;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
maxVisiblePages: number;
|
|
32
|
+
}>;
|
|
33
|
+
}, {}];
|
|
34
|
+
initial(initialState?: Partial<solid_tiny_context0.MaybeSignals<{
|
|
35
|
+
current: number;
|
|
36
|
+
total: number;
|
|
37
|
+
pageSize: number;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
maxVisiblePages: number;
|
|
40
|
+
}>> | undefined): {
|
|
41
|
+
Provider(props: {
|
|
42
|
+
children?: solid_js10.JSX.Element;
|
|
43
|
+
}): solid_js10.JSX.Element;
|
|
44
|
+
value: [Readonly<{
|
|
45
|
+
current: number;
|
|
46
|
+
total: number;
|
|
47
|
+
pageSize: number;
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
maxVisiblePages: number;
|
|
50
|
+
} & {
|
|
51
|
+
totalPages: number;
|
|
52
|
+
renderedPages: PaginationPager[];
|
|
53
|
+
}>, Omit<{
|
|
54
|
+
gotoPage(page: number): void;
|
|
55
|
+
next(): void;
|
|
56
|
+
prev(): void;
|
|
57
|
+
} & ThisType<solid_tiny_context0.RealContextThis<{
|
|
58
|
+
current: number;
|
|
59
|
+
total: number;
|
|
60
|
+
pageSize: number;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
maxVisiblePages: number;
|
|
63
|
+
}, {}, {
|
|
64
|
+
totalPages(): number;
|
|
65
|
+
renderedPages(): PaginationPager[];
|
|
66
|
+
}, {
|
|
67
|
+
gotoPage(page: number): void;
|
|
68
|
+
next(): void;
|
|
69
|
+
prev(): void;
|
|
70
|
+
}>>, "setState" | "totalPages" | "renderedPages"> & {
|
|
71
|
+
setState: solid_js_store7.SetStoreFunction<{
|
|
72
|
+
current: number;
|
|
73
|
+
total: number;
|
|
74
|
+
pageSize: number;
|
|
75
|
+
disabled: boolean;
|
|
76
|
+
maxVisiblePages: number;
|
|
77
|
+
}>;
|
|
78
|
+
}, {}];
|
|
79
|
+
};
|
|
80
|
+
defaultValue: () => {
|
|
81
|
+
current: number;
|
|
82
|
+
total: number;
|
|
83
|
+
pageSize: number;
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
maxVisiblePages: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { PaginationPageType, PaginationPager, context };
|
|
@@ -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 };
|