solid-tiny-ui 0.5.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/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/{time-picker → form-components/time-picker}/index.js +21 -5
- package/dist/components/{time-picker → form-components/time-picker}/index.jsx +11 -6
- package/dist/components/{time-picker → form-components/time-picker}/panel.js +6 -6
- package/dist/components/{time-picker → form-components/time-picker}/panel.jsx +6 -6
- package/dist/components/{time-picker → form-components/time-picker}/trigger.js +14 -10
- package/dist/components/{time-picker → form-components/time-picker}/trigger.jsx +4 -4
- 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/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 +10 -8
- package/dist/components/visually-hidden/index.jsx +3 -2
- 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 +3 -2
- package/dist/icons/check-line.js +4 -4
- package/dist/icons/check-line.jsx +2 -2
- 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 +12 -1
- package/dist/icons/index.js +12 -1
- package/dist/icons/index.jsx +12 -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 -9
- package/dist/index.js +23 -10
- package/dist/index.jsx +23 -10
- 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 +6 -6
- 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/index.d.ts +2 -2
- package/dist/primitives/fake-scroll-list/listbox.js +2 -2
- 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 +5 -4
- 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 +7 -1
- package/dist/primitives/index.js +7 -3
- package/dist/primitives/index.jsx +7 -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 +4 -4
- 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/components/time-picker/time-picker.js +0 -5
- package/dist/_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/time-picker/time-picker.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/components/time-picker/index.d.ts +0 -18
- 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,146 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import { ToasterIcon } from "./icon.js";
|
|
3
|
+
import { addEventListener, createComponent, effect, insert, memo, setAttribute, setStyleProperty, template, use } from "solid-js/web";
|
|
4
|
+
import { Show, children, createSignal, onMount } from "solid-js";
|
|
5
|
+
import { callMaybeCallableChild, createPresence, createWatch, dataIf } from "solid-tiny-utils";
|
|
6
|
+
|
|
7
|
+
//#region src/components/toaster/one-toaster.tsx
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div style=width:100%;position:absolute>`), _tmpl$2 = /* @__PURE__ */ template(`<div class=tiny-toast__icon>`), _tmpl$3 = /* @__PURE__ */ template(`<div class=tiny-toast-wrapper role=presentation><div class=tiny-toast><div class=tiny-toast__content>`);
|
|
9
|
+
function HiddenAutoDismiss(props) {
|
|
10
|
+
let ref;
|
|
11
|
+
onMount(() => {
|
|
12
|
+
ref.offsetHeight;
|
|
13
|
+
createWatch(() => [props.duration, props.pause], ([duration, pause], prevInput) => {
|
|
14
|
+
if (prevInput) {
|
|
15
|
+
const [prevDuration] = prevInput;
|
|
16
|
+
if (duration !== prevDuration) ref.style.width = "100%";
|
|
17
|
+
}
|
|
18
|
+
const percent = ref.offsetWidth / ref.parentElement.offsetWidth;
|
|
19
|
+
if (percent === 0 && duration > 0) {
|
|
20
|
+
props.onEnd();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (pause) {
|
|
24
|
+
ref.style.width = `${percent * 100}%`;
|
|
25
|
+
ref.style.transition = "none";
|
|
26
|
+
} else {
|
|
27
|
+
ref.style.width = "0";
|
|
28
|
+
ref.style.transition = `width ${duration * percent}ms linear`;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return (() => {
|
|
33
|
+
var _el$ = _tmpl$();
|
|
34
|
+
var _ref$ = ref;
|
|
35
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
36
|
+
addEventListener(_el$, "transitionend", props.onEnd);
|
|
37
|
+
return _el$;
|
|
38
|
+
})();
|
|
39
|
+
}
|
|
40
|
+
function getElRealHeight(el) {
|
|
41
|
+
const prevAnimationName = el.style.animationName;
|
|
42
|
+
el.style.animationName = "none";
|
|
43
|
+
const height = el.offsetHeight;
|
|
44
|
+
el.style.animationName = prevAnimationName;
|
|
45
|
+
return height;
|
|
46
|
+
}
|
|
47
|
+
function OneToaster(props) {
|
|
48
|
+
const [state, actions] = context.useContext();
|
|
49
|
+
const [show, setShow] = createSignal(true);
|
|
50
|
+
const [height, setHeight] = createSignal(0);
|
|
51
|
+
const presence = createPresence(show, {
|
|
52
|
+
enterDuration: 400,
|
|
53
|
+
exitDuration: 350,
|
|
54
|
+
initialEnter: true
|
|
55
|
+
});
|
|
56
|
+
createWatch(presence.isMounted, (shouldMount) => {
|
|
57
|
+
if (!shouldMount) actions.removeToast(props.id);
|
|
58
|
+
});
|
|
59
|
+
createWatch(() => state.dismissSignal[props.id], (signal) => {
|
|
60
|
+
if (signal) setShow(false);
|
|
61
|
+
});
|
|
62
|
+
let ref;
|
|
63
|
+
onMount(() => {
|
|
64
|
+
createWatch(presence.phase, (phase) => {
|
|
65
|
+
if (["pre-enter", "exiting"].includes(phase)) setHeight(getElRealHeight(ref));
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const icon = children(() => callMaybeCallableChild(props.icon, {
|
|
69
|
+
id: props.id,
|
|
70
|
+
type: props.type,
|
|
71
|
+
duration: props.duration,
|
|
72
|
+
position: props.position
|
|
73
|
+
}));
|
|
74
|
+
return createComponent(Show, {
|
|
75
|
+
get when() {
|
|
76
|
+
return presence.isMounted();
|
|
77
|
+
},
|
|
78
|
+
get children() {
|
|
79
|
+
var _el$2 = _tmpl$3(), _el$3 = _el$2.firstChild, _el$5 = _el$3.firstChild;
|
|
80
|
+
var _ref$2 = ref;
|
|
81
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : ref = _el$2;
|
|
82
|
+
_el$2.addEventListener("mouseleave", () => {
|
|
83
|
+
actions.setState("pauseRemoval", false);
|
|
84
|
+
});
|
|
85
|
+
_el$2.addEventListener("mouseenter", () => {
|
|
86
|
+
actions.setState("pauseRemoval", true);
|
|
87
|
+
});
|
|
88
|
+
insert(_el$3, createComponent(Show, {
|
|
89
|
+
get when() {
|
|
90
|
+
return icon() || [
|
|
91
|
+
"info",
|
|
92
|
+
"success",
|
|
93
|
+
"warning",
|
|
94
|
+
"error",
|
|
95
|
+
"loading"
|
|
96
|
+
].includes(props.type);
|
|
97
|
+
},
|
|
98
|
+
get children() {
|
|
99
|
+
var _el$4 = _tmpl$2();
|
|
100
|
+
insert(_el$4, () => icon() || createComponent(ToasterIcon, { get type() {
|
|
101
|
+
return props.type;
|
|
102
|
+
} }));
|
|
103
|
+
return _el$4;
|
|
104
|
+
}
|
|
105
|
+
}), _el$5);
|
|
106
|
+
insert(_el$5, () => callMaybeCallableChild(props.message, {
|
|
107
|
+
id: props.id,
|
|
108
|
+
type: props.type,
|
|
109
|
+
duration: props.duration,
|
|
110
|
+
position: props.position
|
|
111
|
+
}));
|
|
112
|
+
insert(_el$2, createComponent(HiddenAutoDismiss, {
|
|
113
|
+
get duration() {
|
|
114
|
+
return props.duration;
|
|
115
|
+
},
|
|
116
|
+
onEnd: () => {
|
|
117
|
+
setShow(false);
|
|
118
|
+
},
|
|
119
|
+
get pause() {
|
|
120
|
+
return state.pauseRemoval;
|
|
121
|
+
}
|
|
122
|
+
}), null);
|
|
123
|
+
effect((_p$) => {
|
|
124
|
+
var _v$ = dataIf(["entering", "pre-enter"].includes(presence.phase())), _v$2 = dataIf(["exiting"].includes(presence.phase())), _v$3 = presence.phase(), _v$4 = `${height()}px`, _v$5 = props.type, _v$6 = props.position.startsWith("top") ? "-20%" : "20%";
|
|
125
|
+
_v$ !== _p$.e && setAttribute(_el$2, "data-entering", _p$.e = _v$);
|
|
126
|
+
_v$2 !== _p$.t && setAttribute(_el$2, "data-exiting", _p$.t = _v$2);
|
|
127
|
+
_v$3 !== _p$.a && setAttribute(_el$2, "data-presence-phase", _p$.a = _v$3);
|
|
128
|
+
_v$4 !== _p$.o && setStyleProperty(_el$2, "--height", _p$.o = _v$4);
|
|
129
|
+
_v$5 !== _p$.i && setAttribute(_el$3, "data-type", _p$.i = _v$5);
|
|
130
|
+
_v$6 !== _p$.n && setStyleProperty(_el$3, "--from-y", _p$.n = _v$6);
|
|
131
|
+
return _p$;
|
|
132
|
+
}, {
|
|
133
|
+
e: void 0,
|
|
134
|
+
t: void 0,
|
|
135
|
+
a: void 0,
|
|
136
|
+
o: void 0,
|
|
137
|
+
i: void 0,
|
|
138
|
+
n: void 0
|
|
139
|
+
});
|
|
140
|
+
return _el$2;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
export { OneToaster };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { context } from "./context.jsx";
|
|
2
|
+
import { ToasterIcon } from "./icon.jsx";
|
|
3
|
+
import { Show, children, createSignal, onMount } from "solid-js";
|
|
4
|
+
import { callMaybeCallableChild, createPresence, createWatch, dataIf } from "solid-tiny-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/components/toaster/one-toaster.tsx
|
|
7
|
+
function HiddenAutoDismiss(props) {
|
|
8
|
+
let ref;
|
|
9
|
+
onMount(() => {
|
|
10
|
+
ref.offsetHeight;
|
|
11
|
+
createWatch(() => [props.duration, props.pause], ([duration, pause], prevInput) => {
|
|
12
|
+
if (prevInput) {
|
|
13
|
+
const [prevDuration] = prevInput;
|
|
14
|
+
if (duration !== prevDuration) ref.style.width = "100%";
|
|
15
|
+
}
|
|
16
|
+
const percent = ref.offsetWidth / ref.parentElement.offsetWidth;
|
|
17
|
+
if (percent === 0 && duration > 0) {
|
|
18
|
+
props.onEnd();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (pause) {
|
|
22
|
+
ref.style.width = `${percent * 100}%`;
|
|
23
|
+
ref.style.transition = "none";
|
|
24
|
+
} else {
|
|
25
|
+
ref.style.width = "0";
|
|
26
|
+
ref.style.transition = `width ${duration * percent}ms linear`;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return <div onTransitionEnd={props.onEnd} ref={ref} style={{
|
|
31
|
+
width: "100%",
|
|
32
|
+
position: "absolute"
|
|
33
|
+
}} />;
|
|
34
|
+
}
|
|
35
|
+
function getElRealHeight(el) {
|
|
36
|
+
const prevAnimationName = el.style.animationName;
|
|
37
|
+
el.style.animationName = "none";
|
|
38
|
+
const height = el.offsetHeight;
|
|
39
|
+
el.style.animationName = prevAnimationName;
|
|
40
|
+
return height;
|
|
41
|
+
}
|
|
42
|
+
function OneToaster(props) {
|
|
43
|
+
const [state, actions] = context.useContext();
|
|
44
|
+
const [show, setShow] = createSignal(true);
|
|
45
|
+
const [height, setHeight] = createSignal(0);
|
|
46
|
+
const presence = createPresence(show, {
|
|
47
|
+
enterDuration: 400,
|
|
48
|
+
exitDuration: 350,
|
|
49
|
+
initialEnter: true
|
|
50
|
+
});
|
|
51
|
+
createWatch(presence.isMounted, (shouldMount) => {
|
|
52
|
+
if (!shouldMount) actions.removeToast(props.id);
|
|
53
|
+
});
|
|
54
|
+
createWatch(() => state.dismissSignal[props.id], (signal) => {
|
|
55
|
+
if (signal) setShow(false);
|
|
56
|
+
});
|
|
57
|
+
let ref;
|
|
58
|
+
onMount(() => {
|
|
59
|
+
createWatch(presence.phase, (phase) => {
|
|
60
|
+
if (["pre-enter", "exiting"].includes(phase)) setHeight(getElRealHeight(ref));
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const icon = children(() => callMaybeCallableChild(props.icon, {
|
|
64
|
+
id: props.id,
|
|
65
|
+
type: props.type,
|
|
66
|
+
duration: props.duration,
|
|
67
|
+
position: props.position
|
|
68
|
+
}));
|
|
69
|
+
return <Show when={presence.isMounted()}>
|
|
70
|
+
<div class="tiny-toast-wrapper" data-entering={dataIf(["entering", "pre-enter"].includes(presence.phase()))} data-exiting={dataIf(["exiting"].includes(presence.phase()))} data-presence-phase={presence.phase()} onMouseEnter={() => {
|
|
71
|
+
actions.setState("pauseRemoval", true);
|
|
72
|
+
}} onMouseLeave={() => {
|
|
73
|
+
actions.setState("pauseRemoval", false);
|
|
74
|
+
}} ref={ref} role="presentation" style={{ "--height": `${height()}px` }}>
|
|
75
|
+
<div class="tiny-toast" data-type={props.type} style={{ "--from-y": props.position.startsWith("top") ? "-20%" : "20%" }}>
|
|
76
|
+
<Show when={icon() || [
|
|
77
|
+
"info",
|
|
78
|
+
"success",
|
|
79
|
+
"warning",
|
|
80
|
+
"error",
|
|
81
|
+
"loading"
|
|
82
|
+
].includes(props.type)}>
|
|
83
|
+
<div class="tiny-toast__icon">
|
|
84
|
+
{icon() || <ToasterIcon type={props.type} />}
|
|
85
|
+
</div>
|
|
86
|
+
</Show>
|
|
87
|
+
<div class="tiny-toast__content">
|
|
88
|
+
{callMaybeCallableChild(props.message, {
|
|
89
|
+
id: props.id,
|
|
90
|
+
type: props.type,
|
|
91
|
+
duration: props.duration,
|
|
92
|
+
position: props.position
|
|
93
|
+
})}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<HiddenAutoDismiss duration={props.duration} onEnd={() => {
|
|
97
|
+
setShow(false);
|
|
98
|
+
}} pause={state.pauseRemoval} />
|
|
99
|
+
</div>
|
|
100
|
+
</Show>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
export { OneToaster };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToastPosition } from "./type.js";
|
|
2
|
+
import { JSX } from "solid-js/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/toaster/provider.d.ts
|
|
5
|
+
declare function TinyToasterProvider(props: {
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
defaultDuration?: number;
|
|
8
|
+
defaultPosition?: ToastPosition;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { TinyToasterProvider };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import toaster_default from "../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/toaster/toaster.js";
|
|
2
|
+
import { context } from "./context.js";
|
|
3
|
+
import { ToasterLocator } from "./locator.js";
|
|
4
|
+
import { OneToaster } from "./one-toaster.js";
|
|
5
|
+
import { For, Portal, createComponent, effect, insert, memo, setStyleProperty, template } from "solid-js/web";
|
|
6
|
+
import { mountStyle } from "solid-tiny-utils";
|
|
7
|
+
|
|
8
|
+
//#region src/components/toaster/provider.tsx
|
|
9
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div style=position:fixed;pointer-events:none>`);
|
|
10
|
+
function ToasterContainer(props) {
|
|
11
|
+
return (() => {
|
|
12
|
+
var _el$ = _tmpl$();
|
|
13
|
+
insert(_el$, () => props.children);
|
|
14
|
+
effect((_p$) => {
|
|
15
|
+
var _v$ = props.zIndex ?? 9999, _v$2 = props.padding ? `${props.padding}px` : "16px";
|
|
16
|
+
_v$ !== _p$.e && setStyleProperty(_el$, "z-index", _p$.e = _v$);
|
|
17
|
+
_v$2 !== _p$.t && setStyleProperty(_el$, "inset", _p$.t = _v$2);
|
|
18
|
+
return _p$;
|
|
19
|
+
}, {
|
|
20
|
+
e: void 0,
|
|
21
|
+
t: void 0
|
|
22
|
+
});
|
|
23
|
+
return _el$;
|
|
24
|
+
})();
|
|
25
|
+
}
|
|
26
|
+
function TinyToasterProvider(props) {
|
|
27
|
+
mountStyle(toaster_default, "tiny-toaster");
|
|
28
|
+
const Context = context.initial({
|
|
29
|
+
defaultDuration: () => props.defaultDuration,
|
|
30
|
+
defaultPosition: () => props.defaultPosition
|
|
31
|
+
});
|
|
32
|
+
const [, actions] = Context.value;
|
|
33
|
+
const positions = [
|
|
34
|
+
"top-left",
|
|
35
|
+
"top-center",
|
|
36
|
+
"top-right",
|
|
37
|
+
"bottom-left",
|
|
38
|
+
"bottom-center",
|
|
39
|
+
"bottom-right"
|
|
40
|
+
];
|
|
41
|
+
return createComponent(Context.Provider, { get children() {
|
|
42
|
+
return [createComponent(Portal, { get children() {
|
|
43
|
+
return createComponent(ToasterContainer, { get children() {
|
|
44
|
+
return createComponent(For, {
|
|
45
|
+
each: positions,
|
|
46
|
+
children: (pos) => createComponent(ToasterLocator, {
|
|
47
|
+
position: pos,
|
|
48
|
+
get children() {
|
|
49
|
+
return createComponent(For, {
|
|
50
|
+
get each() {
|
|
51
|
+
return actions.getToastsByPosition(pos);
|
|
52
|
+
},
|
|
53
|
+
children: (toast) => createComponent(OneToaster, toast)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
} });
|
|
59
|
+
} }), memo(() => props.children)];
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { TinyToasterProvider };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import toaster_default from "../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/toaster/toaster.jsx";
|
|
2
|
+
import { context } from "./context.jsx";
|
|
3
|
+
import { ToasterLocator } from "./locator.jsx";
|
|
4
|
+
import { OneToaster } from "./one-toaster.jsx";
|
|
5
|
+
import { mountStyle } from "solid-tiny-utils";
|
|
6
|
+
import { For, Portal } from "solid-js/web";
|
|
7
|
+
|
|
8
|
+
//#region src/components/toaster/provider.tsx
|
|
9
|
+
function ToasterContainer(props) {
|
|
10
|
+
return <div style={{
|
|
11
|
+
"z-index": props.zIndex ?? 9999,
|
|
12
|
+
position: "fixed",
|
|
13
|
+
inset: props.padding ? `${props.padding}px` : "16px",
|
|
14
|
+
"pointer-events": "none"
|
|
15
|
+
}}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>;
|
|
18
|
+
}
|
|
19
|
+
function TinyToasterProvider(props) {
|
|
20
|
+
mountStyle(toaster_default, "tiny-toaster");
|
|
21
|
+
const Context = context.initial({
|
|
22
|
+
defaultDuration: () => props.defaultDuration,
|
|
23
|
+
defaultPosition: () => props.defaultPosition
|
|
24
|
+
});
|
|
25
|
+
const [, actions] = Context.value;
|
|
26
|
+
const positions = [
|
|
27
|
+
"top-left",
|
|
28
|
+
"top-center",
|
|
29
|
+
"top-right",
|
|
30
|
+
"bottom-left",
|
|
31
|
+
"bottom-center",
|
|
32
|
+
"bottom-right"
|
|
33
|
+
];
|
|
34
|
+
return <Context.Provider>
|
|
35
|
+
<Portal>
|
|
36
|
+
<ToasterContainer>
|
|
37
|
+
<For each={positions}>
|
|
38
|
+
{(pos) => <ToasterLocator position={pos}>
|
|
39
|
+
<For each={actions.getToastsByPosition(pos)}>
|
|
40
|
+
{(toast) => <OneToaster {...toast} />}
|
|
41
|
+
</For>
|
|
42
|
+
</ToasterLocator>}
|
|
43
|
+
</For>
|
|
44
|
+
</ToasterContainer>
|
|
45
|
+
</Portal>
|
|
46
|
+
{props.children}
|
|
47
|
+
</Context.Provider>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { TinyToasterProvider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
2
|
+
|
|
3
|
+
//#region src/components/toaster/type.d.ts
|
|
4
|
+
interface Toast {
|
|
5
|
+
id: string;
|
|
6
|
+
type: ToastType;
|
|
7
|
+
duration: number;
|
|
8
|
+
position: ToastPosition;
|
|
9
|
+
message: MaybeCallableChild<[Omit<Toast, "icon" | "message">]>;
|
|
10
|
+
icon: MaybeCallableChild<[Omit<Toast, "icon" | "message">]>;
|
|
11
|
+
}
|
|
12
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
13
|
+
type ToastType = "success" | "error" | "warning" | "info" | "blank" | "loading";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Toast, ToastPosition, ToastType };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Toast } from "./type.js";
|
|
2
|
+
import { MaybeCallableChild } from "solid-tiny-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/components/toaster/use-toaster.d.ts
|
|
5
|
+
declare function useToaster(): ((msg: MaybeCallableChild<[{
|
|
6
|
+
id: string;
|
|
7
|
+
}]>, opt?: {
|
|
8
|
+
duration?: number;
|
|
9
|
+
position?: Toast["position"];
|
|
10
|
+
type?: Toast["type"];
|
|
11
|
+
icon?: Toast["icon"];
|
|
12
|
+
}) => string) & {
|
|
13
|
+
blank: (msg: MaybeCallableChild<[{
|
|
14
|
+
id: string;
|
|
15
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type"> | undefined) => string;
|
|
16
|
+
loading: (msg: MaybeCallableChild<[{
|
|
17
|
+
id: string;
|
|
18
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type" | "duration"> | undefined) => string;
|
|
19
|
+
success: (msg: MaybeCallableChild<[{
|
|
20
|
+
id: string;
|
|
21
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type"> | undefined) => string;
|
|
22
|
+
error: (msg: MaybeCallableChild<[{
|
|
23
|
+
id: string;
|
|
24
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type"> | undefined) => string;
|
|
25
|
+
info: (msg: MaybeCallableChild<[{
|
|
26
|
+
id: string;
|
|
27
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type"> | undefined) => string;
|
|
28
|
+
warning: (msg: MaybeCallableChild<[{
|
|
29
|
+
id: string;
|
|
30
|
+
}]>, opt?: Omit<Partial<Omit<Toast, "message" | "id">>, "type"> | undefined) => string;
|
|
31
|
+
promise: <T>(promise: Promise<T>, phase: {
|
|
32
|
+
loading: MaybeCallableChild<[{
|
|
33
|
+
id: string;
|
|
34
|
+
}]>;
|
|
35
|
+
success: MaybeCallableChild<[{
|
|
36
|
+
id: string;
|
|
37
|
+
data: T;
|
|
38
|
+
}]>;
|
|
39
|
+
error: MaybeCallableChild<[{
|
|
40
|
+
id: string;
|
|
41
|
+
error: unknown;
|
|
42
|
+
}]>;
|
|
43
|
+
}) => void;
|
|
44
|
+
dismiss: (id: string) => void;
|
|
45
|
+
update: (id: string, updatedProps: Partial<Toast>) => void;
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { useToaster };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { context } from "./context.js";
|
|
2
|
+
import { createUniqueId } from "solid-js";
|
|
3
|
+
import { callMaybeCallableChild } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/components/toaster/use-toaster.ts
|
|
6
|
+
function createPreset(presets, toast) {
|
|
7
|
+
return (msg, opt) => {
|
|
8
|
+
return toast(msg, {
|
|
9
|
+
...presets,
|
|
10
|
+
...opt
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function useToaster() {
|
|
15
|
+
const [state, actions] = context.useContext();
|
|
16
|
+
const toast = (msg, opt) => {
|
|
17
|
+
const id = `toast-${createUniqueId()}`;
|
|
18
|
+
actions.setState("toasts", (toasts) => [{
|
|
19
|
+
id,
|
|
20
|
+
type: opt?.type || "blank",
|
|
21
|
+
duration: opt?.duration ?? state.defaultDuration,
|
|
22
|
+
position: opt?.position || state.defaultPosition,
|
|
23
|
+
message: msg,
|
|
24
|
+
icon: opt?.icon ?? null
|
|
25
|
+
}, ...toasts]);
|
|
26
|
+
return id;
|
|
27
|
+
};
|
|
28
|
+
return Object.assign(toast, {
|
|
29
|
+
blank: createPreset({ type: "blank" }, toast),
|
|
30
|
+
loading: createPreset({
|
|
31
|
+
type: "loading",
|
|
32
|
+
duration: 0
|
|
33
|
+
}, toast),
|
|
34
|
+
success: createPreset({ type: "success" }, toast),
|
|
35
|
+
error: createPreset({ type: "error" }, toast),
|
|
36
|
+
info: createPreset({ type: "info" }, toast),
|
|
37
|
+
warning: createPreset({ type: "warning" }, toast),
|
|
38
|
+
promise: createPromiseToast(toast, actions.updateToast),
|
|
39
|
+
dismiss: actions.dismissToast,
|
|
40
|
+
update: actions.updateToast
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function createPromiseToast(toast, update) {
|
|
44
|
+
return (promise, phase) => {
|
|
45
|
+
const id = toast((params) => callMaybeCallableChild(phase.loading, { ...params }), {
|
|
46
|
+
type: "loading",
|
|
47
|
+
duration: 0
|
|
48
|
+
});
|
|
49
|
+
promise.then((data) => {
|
|
50
|
+
update(id, {
|
|
51
|
+
type: "success",
|
|
52
|
+
duration: 5e3,
|
|
53
|
+
message: ({ id: id$1 }) => callMaybeCallableChild(phase.success, {
|
|
54
|
+
id: id$1,
|
|
55
|
+
data
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}).catch((error) => {
|
|
59
|
+
update(id, {
|
|
60
|
+
type: "error",
|
|
61
|
+
duration: 5e3,
|
|
62
|
+
message: ({ id: id$1 }) => callMaybeCallableChild(phase.error, {
|
|
63
|
+
id: id$1,
|
|
64
|
+
error
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { useToaster };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { context } from "./context.jsx";
|
|
2
|
+
import { createUniqueId } from "solid-js";
|
|
3
|
+
import { callMaybeCallableChild } from "solid-tiny-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/components/toaster/use-toaster.ts
|
|
6
|
+
function createPreset(presets, toast) {
|
|
7
|
+
return (msg, opt) => {
|
|
8
|
+
return toast(msg, {
|
|
9
|
+
...presets,
|
|
10
|
+
...opt
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function useToaster() {
|
|
15
|
+
const [state, actions] = context.useContext();
|
|
16
|
+
const toast = (msg, opt) => {
|
|
17
|
+
const id = `toast-${createUniqueId()}`;
|
|
18
|
+
actions.setState("toasts", (toasts) => [{
|
|
19
|
+
id,
|
|
20
|
+
type: opt?.type || "blank",
|
|
21
|
+
duration: opt?.duration ?? state.defaultDuration,
|
|
22
|
+
position: opt?.position || state.defaultPosition,
|
|
23
|
+
message: msg,
|
|
24
|
+
icon: opt?.icon ?? null
|
|
25
|
+
}, ...toasts]);
|
|
26
|
+
return id;
|
|
27
|
+
};
|
|
28
|
+
return Object.assign(toast, {
|
|
29
|
+
blank: createPreset({ type: "blank" }, toast),
|
|
30
|
+
loading: createPreset({
|
|
31
|
+
type: "loading",
|
|
32
|
+
duration: 0
|
|
33
|
+
}, toast),
|
|
34
|
+
success: createPreset({ type: "success" }, toast),
|
|
35
|
+
error: createPreset({ type: "error" }, toast),
|
|
36
|
+
info: createPreset({ type: "info" }, toast),
|
|
37
|
+
warning: createPreset({ type: "warning" }, toast),
|
|
38
|
+
promise: createPromiseToast(toast, actions.updateToast),
|
|
39
|
+
dismiss: actions.dismissToast,
|
|
40
|
+
update: actions.updateToast
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function createPromiseToast(toast, update) {
|
|
44
|
+
return (promise, phase) => {
|
|
45
|
+
const id = toast((params) => callMaybeCallableChild(phase.loading, { ...params }), {
|
|
46
|
+
type: "loading",
|
|
47
|
+
duration: 0
|
|
48
|
+
});
|
|
49
|
+
promise.then((data) => {
|
|
50
|
+
update(id, {
|
|
51
|
+
type: "success",
|
|
52
|
+
duration: 5e3,
|
|
53
|
+
message: ({ id: id$1 }) => callMaybeCallableChild(phase.success, {
|
|
54
|
+
id: id$1,
|
|
55
|
+
data
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}).catch((error) => {
|
|
59
|
+
update(id, {
|
|
60
|
+
type: "error",
|
|
61
|
+
duration: 5e3,
|
|
62
|
+
message: ({ id: id$1 }) => callMaybeCallableChild(phase.error, {
|
|
63
|
+
id: id$1,
|
|
64
|
+
error
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { useToaster };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassNames, Styles } from "../../utils/types.js";
|
|
1
2
|
import { JSX } from "solid-js";
|
|
2
3
|
|
|
3
4
|
//#region src/components/tooltip/tooltip.d.ts
|
|
@@ -6,6 +7,12 @@ interface TooltipProps {
|
|
|
6
7
|
content: string;
|
|
7
8
|
children: JSX.Element;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
classNames?: ClassNames<"content", {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
styles?: Styles<"content", {
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
}>;
|
|
9
16
|
}
|
|
10
17
|
declare function Tooltip(props: TooltipProps): JSX.Element;
|
|
11
18
|
//#endregion
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { createClassStyles } from "../../utils/index.js";
|
|
1
2
|
import tooltip_default from "../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tooltip/tooltip.js";
|
|
2
3
|
import { FloatingUiCore } from "../../primitives/floating/index.js";
|
|
3
4
|
import { createComponent, memo } from "solid-js/web";
|
|
4
|
-
import { mountStyle } from "solid-tiny-utils";
|
|
5
|
+
import { combineClass, combineStyle, mountStyle } from "solid-tiny-utils";
|
|
5
6
|
|
|
6
7
|
//#region src/components/tooltip/tooltip.tsx
|
|
7
8
|
function Tooltip(props) {
|
|
8
9
|
mountStyle(tooltip_default, "tiny-tooltip");
|
|
10
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({ disabled: props.disabled ?? false }));
|
|
9
11
|
return createComponent(FloatingUiCore, {
|
|
10
12
|
get disabled() {
|
|
11
13
|
return props.disabled;
|
|
@@ -18,7 +20,12 @@ function Tooltip(props) {
|
|
|
18
20
|
return [createComponent(FloatingUiCore.Trigger, { get children() {
|
|
19
21
|
return props.children;
|
|
20
22
|
} }), createComponent(FloatingUiCore.Content, {
|
|
21
|
-
"class"
|
|
23
|
+
get ["class"]() {
|
|
24
|
+
return combineClass("tiny-tooltip__content", classes().content);
|
|
25
|
+
},
|
|
26
|
+
get style() {
|
|
27
|
+
return combineStyle({}, styles().content);
|
|
28
|
+
},
|
|
22
29
|
get children() {
|
|
23
30
|
return props.content;
|
|
24
31
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { createClassStyles } from "../../utils/index.jsx";
|
|
1
2
|
import tooltip_default from "../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/tooltip/tooltip.jsx";
|
|
2
3
|
import { FloatingUiCore } from "../../primitives/floating/index.jsx";
|
|
3
|
-
import { mountStyle } from "solid-tiny-utils";
|
|
4
|
+
import { combineClass, combineStyle, mountStyle } from "solid-tiny-utils";
|
|
4
5
|
|
|
5
6
|
//#region src/components/tooltip/tooltip.tsx
|
|
6
7
|
function Tooltip(props) {
|
|
7
8
|
mountStyle(tooltip_default, "tiny-tooltip");
|
|
9
|
+
const [classes, styles] = createClassStyles(() => props.classNames, () => props.styles, () => ({ disabled: props.disabled ?? false }));
|
|
8
10
|
return <FloatingUiCore disabled={props.disabled} placement={props.placement ?? "top"} trigger="hover">
|
|
9
11
|
<FloatingUiCore.Trigger>{props.children}</FloatingUiCore.Trigger>
|
|
10
|
-
<FloatingUiCore.Content class="tiny-tooltip__content">
|
|
12
|
+
<FloatingUiCore.Content class={combineClass("tiny-tooltip__content", classes().content)} style={combineStyle({}, styles().content)}>
|
|
11
13
|
{props.content}
|
|
12
14
|
</FloatingUiCore.Content>
|
|
13
15
|
</FloatingUiCore>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import visually_hidden_default from "../../_virtual/__viteSafe__/home/runner/work/solid-tiny-ui/solid-tiny-ui/packages/core/src/components/visually-hidden/visually-hidden.js";
|
|
2
|
-
import {
|
|
3
|
-
import { mountStyle } from "solid-tiny-utils";
|
|
2
|
+
import { Dynamic, createComponent, memo, mergeProps } from "solid-js/web";
|
|
3
|
+
import { combineClass, mountStyle } from "solid-tiny-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/components/visually-hidden/index.tsx
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template(`<span class=tiny-visually-hidden>`);
|
|
7
6
|
function VisuallyHidden(props) {
|
|
8
7
|
mountStyle(visually_hidden_default, "tiny-visually-hidden");
|
|
9
|
-
return ((
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
return createComponent(Dynamic, mergeProps(props, {
|
|
9
|
+
get ["class"]() {
|
|
10
|
+
return combineClass("tiny-visually-hidden", props.class);
|
|
11
|
+
},
|
|
12
|
+
get component() {
|
|
13
|
+
return props.as ?? "span";
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
//#endregion
|