@locus-ui/components 0.0.16 → 0.1.1
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/components/accordion/accordion-context.d.mts +15 -0
- package/dist/components/accordion/accordion-context.d.ts +15 -0
- package/dist/components/accordion/accordion-context.js +52 -0
- package/dist/components/accordion/accordion-context.js.map +1 -0
- package/dist/components/accordion/accordion-context.mjs +17 -0
- package/dist/components/accordion/accordion-context.mjs.map +1 -0
- package/dist/components/accordion/accordion.d.mts +22 -0
- package/dist/components/accordion/accordion.d.ts +22 -0
- package/dist/components/accordion/accordion.js +38 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/accordion.mjs +14 -0
- package/dist/components/accordion/accordion.mjs.map +1 -0
- package/dist/components/accordion/accordion.props.d.mts +40 -0
- package/dist/components/accordion/accordion.props.d.ts +40 -0
- package/dist/components/accordion/accordion.props.js +65 -0
- package/dist/components/accordion/accordion.props.js.map +1 -0
- package/dist/components/accordion/accordion.props.mjs +40 -0
- package/dist/components/accordion/accordion.props.mjs.map +1 -0
- package/dist/components/accordion/content/accordion-content.d.mts +14 -0
- package/dist/components/accordion/content/accordion-content.d.ts +14 -0
- package/dist/components/accordion/content/accordion-content.js +61 -0
- package/dist/components/accordion/content/accordion-content.js.map +1 -0
- package/dist/components/accordion/content/accordion-content.mjs +29 -0
- package/dist/components/accordion/content/accordion-content.mjs.map +1 -0
- package/dist/components/accordion/content/accordion-content.props.d.mts +6 -0
- package/dist/components/accordion/content/accordion-content.props.d.ts +6 -0
- package/dist/components/accordion/content/accordion-content.props.js +31 -0
- package/dist/components/accordion/content/accordion-content.props.js.map +1 -0
- package/dist/components/accordion/content/accordion-content.props.mjs +7 -0
- package/dist/components/accordion/content/accordion-content.props.mjs.map +1 -0
- package/dist/components/accordion/header/accordion-header.d.mts +14 -0
- package/dist/components/accordion/header/accordion-header.d.ts +14 -0
- package/dist/components/accordion/header/accordion-header.js +86 -0
- package/dist/components/accordion/header/accordion-header.js.map +1 -0
- package/dist/components/accordion/header/accordion-header.mjs +54 -0
- package/dist/components/accordion/header/accordion-header.mjs.map +1 -0
- package/dist/components/accordion/header/accordion-header.props.d.mts +11 -0
- package/dist/components/accordion/header/accordion-header.props.d.ts +11 -0
- package/dist/components/accordion/header/accordion-header.props.js +34 -0
- package/dist/components/accordion/header/accordion-header.props.js.map +1 -0
- package/dist/components/accordion/header/accordion-header.props.mjs +10 -0
- package/dist/components/accordion/header/accordion-header.props.mjs.map +1 -0
- package/dist/components/accordion/index.d.mts +14 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.js +29 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/accordion/index.mjs +5 -0
- package/dist/components/accordion/index.mjs.map +1 -0
- package/dist/components/accordion/item/accordion-item.d.mts +15 -0
- package/dist/components/accordion/item/accordion-item.d.ts +15 -0
- package/dist/components/accordion/item/accordion-item.js +97 -0
- package/dist/components/accordion/item/accordion-item.js.map +1 -0
- package/dist/components/accordion/item/accordion-item.mjs +68 -0
- package/dist/components/accordion/item/accordion-item.mjs.map +1 -0
- package/dist/components/accordion/item/accordion-item.props.d.mts +19 -0
- package/dist/components/accordion/item/accordion-item.props.d.ts +19 -0
- package/dist/components/accordion/item/accordion-item.props.js +42 -0
- package/dist/components/accordion/item/accordion-item.props.js.map +1 -0
- package/dist/components/accordion/item/accordion-item.props.mjs +18 -0
- package/dist/components/accordion/item/accordion-item.props.mjs.map +1 -0
- package/dist/components/accordion/root/accordion-root.d.mts +17 -0
- package/dist/components/accordion/root/accordion-root.d.ts +17 -0
- package/dist/components/accordion/root/accordion-root.js +102 -0
- package/dist/components/accordion/root/accordion-root.js.map +1 -0
- package/dist/components/accordion/root/accordion-root.mjs +72 -0
- package/dist/components/accordion/root/accordion-root.mjs.map +1 -0
- package/dist/components/accordion/root/accordion-root.props.d.mts +30 -0
- package/dist/components/accordion/root/accordion-root.props.d.ts +30 -0
- package/dist/components/accordion/root/accordion-root.props.js +59 -0
- package/dist/components/accordion/root/accordion-root.props.js.map +1 -0
- package/dist/components/accordion/root/accordion-root.props.mjs +34 -0
- package/dist/components/accordion/root/accordion-root.props.mjs.map +1 -0
- package/dist/components/badge/badge.d.mts +15 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +64 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.mjs +35 -0
- package/dist/components/badge/badge.mjs.map +1 -0
- package/dist/components/badge/badge.props.d.mts +16 -0
- package/dist/components/badge/badge.props.d.ts +16 -0
- package/dist/components/badge/badge.props.js +41 -0
- package/dist/components/badge/badge.props.js.map +1 -0
- package/dist/components/badge/badge.props.mjs +16 -0
- package/dist/components/badge/badge.props.mjs.map +1 -0
- package/dist/components/badge/index.d.mts +9 -0
- package/dist/components/badge/index.d.ts +9 -0
- package/dist/components/badge/index.js +29 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/badge/index.mjs +5 -0
- package/dist/components/badge/index.mjs.map +1 -0
- package/dist/components/box/box.d.mts +16 -0
- package/dist/components/box/box.d.ts +16 -0
- package/dist/components/box/box.js +66 -0
- package/dist/components/box/box.js.map +1 -0
- package/dist/components/box/box.mjs +38 -0
- package/dist/components/box/box.mjs.map +1 -0
- package/dist/components/box/box.props.d.mts +6 -0
- package/dist/components/box/box.props.d.ts +6 -0
- package/dist/components/box/box.props.js +43 -0
- package/dist/components/box/box.props.js.map +1 -0
- package/dist/components/box/box.props.mjs +19 -0
- package/dist/components/box/box.props.mjs.map +1 -0
- package/dist/components/box/index.d.mts +8 -0
- package/dist/components/box/index.d.ts +8 -0
- package/dist/components/box/index.js +29 -0
- package/dist/components/box/index.js.map +1 -0
- package/dist/components/box/index.mjs +5 -0
- package/dist/components/box/index.mjs.map +1 -0
- package/dist/components/button/button.d.mts +16 -0
- package/dist/components/button/button.d.ts +16 -0
- package/dist/components/button/button.js +85 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.mjs +57 -0
- package/dist/components/button/button.mjs.map +1 -0
- package/dist/components/button/button.props.d.mts +40 -0
- package/dist/components/button/button.props.d.ts +40 -0
- package/dist/components/button/button.props.js +65 -0
- package/dist/components/button/button.props.js.map +1 -0
- package/dist/components/button/button.props.mjs +40 -0
- package/dist/components/button/button.props.mjs.map +1 -0
- package/dist/components/button/index.d.mts +10 -0
- package/dist/components/button/index.d.ts +10 -0
- package/dist/components/button/index.js +29 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button/index.mjs +5 -0
- package/dist/components/button/index.mjs.map +1 -0
- package/dist/components/checkbox/checkbox-context.d.mts +26 -0
- package/dist/components/checkbox/checkbox-context.d.ts +26 -0
- package/dist/components/checkbox/checkbox-context.js +52 -0
- package/dist/components/checkbox/checkbox-context.js.map +1 -0
- package/dist/components/checkbox/checkbox-context.mjs +17 -0
- package/dist/components/checkbox/checkbox-context.mjs.map +1 -0
- package/dist/components/checkbox/checkbox.d.mts +24 -0
- package/dist/components/checkbox/checkbox.d.ts +24 -0
- package/dist/components/checkbox/checkbox.js +36 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.mjs +12 -0
- package/dist/components/checkbox/checkbox.mjs.map +1 -0
- package/dist/components/checkbox/index.d.mts +15 -0
- package/dist/components/checkbox/index.d.ts +15 -0
- package/dist/components/checkbox/index.js +29 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/checkbox/index.mjs +5 -0
- package/dist/components/checkbox/index.mjs.map +1 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.d.mts +15 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.d.ts +15 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.js +114 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.js.map +1 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.mjs +82 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.mjs.map +1 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.d.mts +15 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.d.ts +15 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.js +39 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.js.map +1 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.mjs +15 -0
- package/dist/components/checkbox/indicator/checkbox-indicator.props.mjs.map +1 -0
- package/dist/components/checkbox/label/checkbox-label.d.mts +15 -0
- package/dist/components/checkbox/label/checkbox-label.d.ts +15 -0
- package/dist/components/checkbox/label/checkbox-label.js +69 -0
- package/dist/components/checkbox/label/checkbox-label.js.map +1 -0
- package/dist/components/checkbox/label/checkbox-label.mjs +37 -0
- package/dist/components/checkbox/label/checkbox-label.mjs.map +1 -0
- package/dist/components/checkbox/label/checkbox-label.props.d.mts +20 -0
- package/dist/components/checkbox/label/checkbox-label.props.d.ts +20 -0
- package/dist/components/checkbox/label/checkbox-label.props.js +44 -0
- package/dist/components/checkbox/label/checkbox-label.props.js.map +1 -0
- package/dist/components/checkbox/label/checkbox-label.props.mjs +19 -0
- package/dist/components/checkbox/label/checkbox-label.props.mjs.map +1 -0
- package/dist/components/checkbox/root/checkbox-root.d.mts +23 -0
- package/dist/components/checkbox/root/checkbox-root.d.ts +23 -0
- package/dist/components/checkbox/root/checkbox-root.js +160 -0
- package/dist/components/checkbox/root/checkbox-root.js.map +1 -0
- package/dist/components/checkbox/root/checkbox-root.mjs +142 -0
- package/dist/components/checkbox/root/checkbox-root.mjs.map +1 -0
- package/dist/components/checkbox/root/checkbox-root.props.d.mts +92 -0
- package/dist/components/checkbox/root/checkbox-root.props.d.ts +92 -0
- package/dist/components/checkbox/root/checkbox-root.props.js +119 -0
- package/dist/components/checkbox/root/checkbox-root.props.js.map +1 -0
- package/dist/components/checkbox/root/checkbox-root.props.mjs +94 -0
- package/dist/components/checkbox/root/checkbox-root.props.mjs.map +1 -0
- package/dist/components/container/container.d.mts +11 -0
- package/dist/components/container/container.d.ts +11 -0
- package/dist/components/container/container.js +55 -0
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/container/container.mjs +21 -0
- package/dist/components/container/container.mjs.map +1 -0
- package/dist/components/container/container.props.d.mts +10 -0
- package/dist/components/container/container.props.d.ts +10 -0
- package/dist/components/container/container.props.js +32 -0
- package/dist/components/container/container.props.js.map +1 -0
- package/dist/components/container/container.props.mjs +8 -0
- package/dist/components/container/container.props.mjs.map +1 -0
- package/dist/components/container/index.d.mts +5 -0
- package/dist/components/container/index.d.ts +5 -0
- package/dist/components/container/index.js +29 -0
- package/dist/components/container/index.js.map +1 -0
- package/dist/components/container/index.mjs +5 -0
- package/dist/components/container/index.mjs.map +1 -0
- package/dist/components/flex/flex.d.mts +45 -0
- package/dist/components/flex/flex.d.ts +45 -0
- package/dist/components/flex/flex.js +55 -0
- package/dist/components/flex/flex.js.map +1 -0
- package/dist/components/flex/flex.mjs +25 -0
- package/dist/components/flex/flex.mjs.map +1 -0
- package/dist/components/flex/flex.props.d.mts +52 -0
- package/dist/components/flex/flex.props.d.ts +52 -0
- package/dist/components/flex/flex.props.js +98 -0
- package/dist/components/flex/flex.props.js.map +1 -0
- package/dist/components/flex/flex.props.mjs +74 -0
- package/dist/components/flex/flex.props.mjs.map +1 -0
- package/dist/components/flex/index.d.mts +6 -0
- package/dist/components/flex/index.d.ts +6 -0
- package/dist/components/flex/index.js +29 -0
- package/dist/components/flex/index.js.map +1 -0
- package/dist/components/flex/index.mjs +5 -0
- package/dist/components/flex/index.mjs.map +1 -0
- package/dist/components/index.d.mts +81 -0
- package/dist/components/index.d.ts +81 -0
- package/dist/components/index.js +75 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +35 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/panel/index.d.mts +10 -0
- package/dist/components/panel/index.d.ts +10 -0
- package/dist/components/panel/index.js +29 -0
- package/dist/components/panel/index.js.map +1 -0
- package/dist/components/panel/index.mjs +5 -0
- package/dist/components/panel/index.mjs.map +1 -0
- package/dist/components/panel/panel.d.mts +29 -0
- package/dist/components/panel/panel.d.ts +29 -0
- package/dist/components/panel/panel.js +67 -0
- package/dist/components/panel/panel.js.map +1 -0
- package/dist/components/panel/panel.mjs +40 -0
- package/dist/components/panel/panel.mjs.map +1 -0
- package/dist/components/panel/panel.props.d.mts +27 -0
- package/dist/components/panel/panel.props.d.ts +27 -0
- package/dist/components/panel/panel.props.js +52 -0
- package/dist/components/panel/panel.props.js.map +1 -0
- package/dist/components/panel/panel.props.mjs +27 -0
- package/dist/components/panel/panel.props.mjs.map +1 -0
- package/dist/components/portal/backdrop/portal-backdrop.d.mts +10 -0
- package/dist/components/portal/backdrop/portal-backdrop.d.ts +10 -0
- package/dist/components/portal/backdrop/portal-backdrop.js +71 -0
- package/dist/components/portal/backdrop/portal-backdrop.js.map +1 -0
- package/dist/components/portal/backdrop/portal-backdrop.mjs +39 -0
- package/dist/components/portal/backdrop/portal-backdrop.mjs.map +1 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.d.mts +62 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.d.ts +62 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.js +65 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.js.map +1 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.mjs +41 -0
- package/dist/components/portal/backdrop/portal-backdrop.props.mjs.map +1 -0
- package/dist/components/portal/content/portal-content.d.mts +12 -0
- package/dist/components/portal/content/portal-content.d.ts +12 -0
- package/dist/components/portal/content/portal-content.js +163 -0
- package/dist/components/portal/content/portal-content.js.map +1 -0
- package/dist/components/portal/content/portal-content.mjs +133 -0
- package/dist/components/portal/content/portal-content.mjs.map +1 -0
- package/dist/components/portal/content/portal-content.props.d.mts +45 -0
- package/dist/components/portal/content/portal-content.props.d.ts +45 -0
- package/dist/components/portal/content/portal-content.props.js +80 -0
- package/dist/components/portal/content/portal-content.props.js.map +1 -0
- package/dist/components/portal/content/portal-content.props.mjs +56 -0
- package/dist/components/portal/content/portal-content.props.mjs.map +1 -0
- package/dist/components/portal/index.d.mts +14 -0
- package/dist/components/portal/index.d.ts +14 -0
- package/dist/components/portal/index.js +47 -0
- package/dist/components/portal/index.js.map +1 -0
- package/dist/components/portal/index.mjs +25 -0
- package/dist/components/portal/index.mjs.map +1 -0
- package/dist/components/portal/portal-context.d.mts +16 -0
- package/dist/components/portal/portal-context.d.ts +16 -0
- package/dist/components/portal/portal-context.js +52 -0
- package/dist/components/portal/portal-context.js.map +1 -0
- package/dist/components/portal/portal-context.mjs +17 -0
- package/dist/components/portal/portal-context.mjs.map +1 -0
- package/dist/components/portal/portal.d.mts +24 -0
- package/dist/components/portal/portal.d.ts +24 -0
- package/dist/components/portal/portal.js +42 -0
- package/dist/components/portal/portal.js.map +1 -0
- package/dist/components/portal/portal.mjs +18 -0
- package/dist/components/portal/portal.mjs.map +1 -0
- package/dist/components/portal/root/portal-root.d.mts +18 -0
- package/dist/components/portal/root/portal-root.d.ts +18 -0
- package/dist/components/portal/root/portal-root.js +74 -0
- package/dist/components/portal/root/portal-root.js.map +1 -0
- package/dist/components/portal/root/portal-root.mjs +56 -0
- package/dist/components/portal/root/portal-root.mjs.map +1 -0
- package/dist/components/portal/root/portal-root.props.d.mts +23 -0
- package/dist/components/portal/root/portal-root.props.d.ts +23 -0
- package/dist/components/portal/root/portal-root.props.js +48 -0
- package/dist/components/portal/root/portal-root.props.js.map +1 -0
- package/dist/components/portal/root/portal-root.props.mjs +24 -0
- package/dist/components/portal/root/portal-root.props.mjs.map +1 -0
- package/dist/components/portal/trigger/portal-trigger.d.mts +9 -0
- package/dist/components/portal/trigger/portal-trigger.d.ts +9 -0
- package/dist/components/portal/trigger/portal-trigger.js +89 -0
- package/dist/components/portal/trigger/portal-trigger.js.map +1 -0
- package/dist/components/portal/trigger/portal-trigger.mjs +55 -0
- package/dist/components/portal/trigger/portal-trigger.mjs.map +1 -0
- package/dist/components/portal/utils/use-anchor-position.d.mts +31 -0
- package/dist/components/portal/utils/use-anchor-position.d.ts +31 -0
- package/dist/components/portal/utils/use-anchor-position.js +137 -0
- package/dist/components/portal/utils/use-anchor-position.js.map +1 -0
- package/dist/components/portal/utils/use-anchor-position.mjs +103 -0
- package/dist/components/portal/utils/use-anchor-position.mjs.map +1 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.d.mts +17 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.d.ts +17 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.js +61 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.js.map +1 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.mjs +29 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.mjs.map +1 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.d.mts +14 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.d.ts +14 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.js +37 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.js.map +1 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.mjs +13 -0
- package/dist/components/progress-bar/fill/progress-bar-fill.props.mjs.map +1 -0
- package/dist/components/progress-bar/index.d.mts +12 -0
- package/dist/components/progress-bar/index.d.ts +12 -0
- package/dist/components/progress-bar/index.js +29 -0
- package/dist/components/progress-bar/index.js.map +1 -0
- package/dist/components/progress-bar/index.mjs +5 -0
- package/dist/components/progress-bar/index.mjs.map +1 -0
- package/dist/components/progress-bar/progress-bar-context.d.mts +11 -0
- package/dist/components/progress-bar/progress-bar-context.d.ts +11 -0
- package/dist/components/progress-bar/progress-bar-context.js +52 -0
- package/dist/components/progress-bar/progress-bar-context.js.map +1 -0
- package/dist/components/progress-bar/progress-bar-context.mjs +17 -0
- package/dist/components/progress-bar/progress-bar-context.mjs.map +1 -0
- package/dist/components/progress-bar/progress-bar.d.mts +27 -0
- package/dist/components/progress-bar/progress-bar.d.ts +27 -0
- package/dist/components/progress-bar/progress-bar.js +40 -0
- package/dist/components/progress-bar/progress-bar.js.map +1 -0
- package/dist/components/progress-bar/progress-bar.mjs +16 -0
- package/dist/components/progress-bar/progress-bar.mjs.map +1 -0
- package/dist/components/progress-bar/root/progress-bar-root.d.mts +17 -0
- package/dist/components/progress-bar/root/progress-bar-root.d.ts +17 -0
- package/dist/components/progress-bar/root/progress-bar-root.js +93 -0
- package/dist/components/progress-bar/root/progress-bar-root.js.map +1 -0
- package/dist/components/progress-bar/root/progress-bar-root.mjs +69 -0
- package/dist/components/progress-bar/root/progress-bar-root.mjs.map +1 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.d.mts +23 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.d.ts +23 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.js +48 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.js.map +1 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.mjs +23 -0
- package/dist/components/progress-bar/root/progress-bar-root.props.mjs.map +1 -0
- package/dist/components/select/content/select-content.d.mts +16 -0
- package/dist/components/select/content/select-content.d.ts +16 -0
- package/dist/components/select/content/select-content.js +163 -0
- package/dist/components/select/content/select-content.js.map +1 -0
- package/dist/components/select/content/select-content.mjs +129 -0
- package/dist/components/select/content/select-content.mjs.map +1 -0
- package/dist/components/select/content/select-content.props.d.mts +28 -0
- package/dist/components/select/content/select-content.props.d.ts +28 -0
- package/dist/components/select/content/select-content.props.js +54 -0
- package/dist/components/select/content/select-content.props.js.map +1 -0
- package/dist/components/select/content/select-content.props.mjs +30 -0
- package/dist/components/select/content/select-content.props.mjs.map +1 -0
- package/dist/components/select/group/select-group.d.mts +10 -0
- package/dist/components/select/group/select-group.d.ts +10 -0
- package/dist/components/select/group/select-group.js +67 -0
- package/dist/components/select/group/select-group.js.map +1 -0
- package/dist/components/select/group/select-group.mjs +35 -0
- package/dist/components/select/group/select-group.mjs.map +1 -0
- package/dist/components/select/group/select-group.props.d.mts +10 -0
- package/dist/components/select/group/select-group.props.d.ts +10 -0
- package/dist/components/select/group/select-group.props.js +33 -0
- package/dist/components/select/group/select-group.props.js.map +1 -0
- package/dist/components/select/group/select-group.props.mjs +9 -0
- package/dist/components/select/group/select-group.props.mjs.map +1 -0
- package/dist/components/select/index.d.mts +22 -0
- package/dist/components/select/index.d.ts +22 -0
- package/dist/components/select/index.js +29 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/index.mjs +5 -0
- package/dist/components/select/index.mjs.map +1 -0
- package/dist/components/select/item/select-item-indicator.d.mts +5 -0
- package/dist/components/select/item/select-item-indicator.d.ts +5 -0
- package/dist/components/select/item/select-item-indicator.js +50 -0
- package/dist/components/select/item/select-item-indicator.js.map +1 -0
- package/dist/components/select/item/select-item-indicator.mjs +26 -0
- package/dist/components/select/item/select-item-indicator.mjs.map +1 -0
- package/dist/components/select/item/select-item.d.mts +14 -0
- package/dist/components/select/item/select-item.d.ts +14 -0
- package/dist/components/select/item/select-item.js +120 -0
- package/dist/components/select/item/select-item.js.map +1 -0
- package/dist/components/select/item/select-item.mjs +88 -0
- package/dist/components/select/item/select-item.mjs.map +1 -0
- package/dist/components/select/item/select-item.props.d.mts +14 -0
- package/dist/components/select/item/select-item.props.d.ts +14 -0
- package/dist/components/select/item/select-item.props.js +37 -0
- package/dist/components/select/item/select-item.props.js.map +1 -0
- package/dist/components/select/item/select-item.props.mjs +13 -0
- package/dist/components/select/item/select-item.props.mjs.map +1 -0
- package/dist/components/select/label/select-label.d.mts +15 -0
- package/dist/components/select/label/select-label.d.ts +15 -0
- package/dist/components/select/label/select-label.js +69 -0
- package/dist/components/select/label/select-label.js.map +1 -0
- package/dist/components/select/label/select-label.mjs +37 -0
- package/dist/components/select/label/select-label.mjs.map +1 -0
- package/dist/components/select/label/select-label.props.d.mts +15 -0
- package/dist/components/select/label/select-label.props.d.ts +15 -0
- package/dist/components/select/label/select-label.props.js +39 -0
- package/dist/components/select/label/select-label.props.js.map +1 -0
- package/dist/components/select/label/select-label.props.mjs +14 -0
- package/dist/components/select/label/select-label.props.mjs.map +1 -0
- package/dist/components/select/root/select-root.d.mts +21 -0
- package/dist/components/select/root/select-root.d.ts +21 -0
- package/dist/components/select/root/select-root.js +195 -0
- package/dist/components/select/root/select-root.js.map +1 -0
- package/dist/components/select/root/select-root.mjs +175 -0
- package/dist/components/select/root/select-root.mjs.map +1 -0
- package/dist/components/select/root/select-root.props.d.mts +33 -0
- package/dist/components/select/root/select-root.props.d.ts +33 -0
- package/dist/components/select/root/select-root.props.js +57 -0
- package/dist/components/select/root/select-root.props.js.map +1 -0
- package/dist/components/select/root/select-root.props.mjs +33 -0
- package/dist/components/select/root/select-root.props.mjs.map +1 -0
- package/dist/components/select/select-context.d.mts +33 -0
- package/dist/components/select/select-context.d.ts +33 -0
- package/dist/components/select/select-context.js +52 -0
- package/dist/components/select/select-context.js.map +1 -0
- package/dist/components/select/select-context.mjs +17 -0
- package/dist/components/select/select-context.mjs.map +1 -0
- package/dist/components/select/select.d.mts +43 -0
- package/dist/components/select/select.d.ts +43 -0
- package/dist/components/select/select.js +46 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.mjs +22 -0
- package/dist/components/select/select.mjs.map +1 -0
- package/dist/components/select/separator/select-separator.d.mts +7 -0
- package/dist/components/select/separator/select-separator.d.ts +7 -0
- package/dist/components/select/separator/select-separator.js +55 -0
- package/dist/components/select/separator/select-separator.js.map +1 -0
- package/dist/components/select/separator/select-separator.mjs +21 -0
- package/dist/components/select/separator/select-separator.mjs.map +1 -0
- package/dist/components/select/trigger/select-trigger-icon.d.mts +5 -0
- package/dist/components/select/trigger/select-trigger-icon.d.ts +5 -0
- package/dist/components/select/trigger/select-trigger-icon.js +64 -0
- package/dist/components/select/trigger/select-trigger-icon.js.map +1 -0
- package/dist/components/select/trigger/select-trigger-icon.mjs +30 -0
- package/dist/components/select/trigger/select-trigger-icon.mjs.map +1 -0
- package/dist/components/select/trigger/select-trigger.d.mts +18 -0
- package/dist/components/select/trigger/select-trigger.d.ts +18 -0
- package/dist/components/select/trigger/select-trigger.js +119 -0
- package/dist/components/select/trigger/select-trigger.js.map +1 -0
- package/dist/components/select/trigger/select-trigger.mjs +87 -0
- package/dist/components/select/trigger/select-trigger.mjs.map +1 -0
- package/dist/components/select/trigger/select-trigger.props.d.mts +7 -0
- package/dist/components/select/trigger/select-trigger.props.d.ts +7 -0
- package/dist/components/select/trigger/select-trigger.props.js +29 -0
- package/dist/components/select/trigger/select-trigger.props.js.map +1 -0
- package/dist/components/select/trigger/select-trigger.props.mjs +5 -0
- package/dist/components/select/trigger/select-trigger.props.mjs.map +1 -0
- package/dist/components/select/utils/user-composed-refs.d.mts +5 -0
- package/dist/components/select/utils/user-composed-refs.d.ts +5 -0
- package/dist/components/select/utils/user-composed-refs.js +53 -0
- package/dist/components/select/utils/user-composed-refs.js.map +1 -0
- package/dist/components/select/utils/user-composed-refs.mjs +19 -0
- package/dist/components/select/utils/user-composed-refs.mjs.map +1 -0
- package/dist/components/select/value/select-value.d.mts +8 -0
- package/dist/components/select/value/select-value.d.ts +8 -0
- package/dist/components/select/value/select-value.js +61 -0
- package/dist/components/select/value/select-value.js.map +1 -0
- package/dist/components/select/value/select-value.mjs +27 -0
- package/dist/components/select/value/select-value.mjs.map +1 -0
- package/dist/components/select/viewport/select-viewport.d.mts +7 -0
- package/dist/components/select/viewport/select-viewport.d.ts +7 -0
- package/dist/components/select/viewport/select-viewport.js +49 -0
- package/dist/components/select/viewport/select-viewport.js.map +1 -0
- package/dist/components/select/viewport/select-viewport.mjs +15 -0
- package/dist/components/select/viewport/select-viewport.mjs.map +1 -0
- package/dist/components/separator/index.d.mts +6 -0
- package/dist/components/separator/index.d.ts +6 -0
- package/dist/components/separator/index.js +29 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/separator/index.mjs +5 -0
- package/dist/components/separator/index.mjs.map +1 -0
- package/dist/components/separator/separator.d.mts +15 -0
- package/dist/components/separator/separator.d.ts +15 -0
- package/dist/components/separator/separator.js +57 -0
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/separator/separator.mjs +23 -0
- package/dist/components/separator/separator.mjs.map +1 -0
- package/dist/components/separator/separator.props.d.mts +29 -0
- package/dist/components/separator/separator.props.d.ts +29 -0
- package/dist/components/separator/separator.props.js +54 -0
- package/dist/components/separator/separator.props.js.map +1 -0
- package/dist/components/separator/separator.props.mjs +30 -0
- package/dist/components/separator/separator.props.mjs.map +1 -0
- package/dist/components/switch/index.d.mts +15 -0
- package/dist/components/switch/index.d.ts +15 -0
- package/dist/components/switch/index.js +29 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/index.mjs +5 -0
- package/dist/components/switch/index.mjs.map +1 -0
- package/dist/components/switch/indicator/switch-indicator.d.mts +15 -0
- package/dist/components/switch/indicator/switch-indicator.d.ts +15 -0
- package/dist/components/switch/indicator/switch-indicator.js +97 -0
- package/dist/components/switch/indicator/switch-indicator.js.map +1 -0
- package/dist/components/switch/indicator/switch-indicator.mjs +65 -0
- package/dist/components/switch/indicator/switch-indicator.mjs.map +1 -0
- package/dist/components/switch/indicator/switch-indicator.props.d.mts +15 -0
- package/dist/components/switch/indicator/switch-indicator.props.d.ts +15 -0
- package/dist/components/switch/indicator/switch-indicator.props.js +39 -0
- package/dist/components/switch/indicator/switch-indicator.props.js.map +1 -0
- package/dist/components/switch/indicator/switch-indicator.props.mjs +15 -0
- package/dist/components/switch/indicator/switch-indicator.props.mjs.map +1 -0
- package/dist/components/switch/label/switch-label.d.mts +15 -0
- package/dist/components/switch/label/switch-label.d.ts +15 -0
- package/dist/components/switch/label/switch-label.js +69 -0
- package/dist/components/switch/label/switch-label.js.map +1 -0
- package/dist/components/switch/label/switch-label.mjs +37 -0
- package/dist/components/switch/label/switch-label.mjs.map +1 -0
- package/dist/components/switch/label/switch-label.props.d.mts +20 -0
- package/dist/components/switch/label/switch-label.props.d.ts +20 -0
- package/dist/components/switch/label/switch-label.props.js +44 -0
- package/dist/components/switch/label/switch-label.props.js.map +1 -0
- package/dist/components/switch/label/switch-label.props.mjs +19 -0
- package/dist/components/switch/label/switch-label.props.mjs.map +1 -0
- package/dist/components/switch/root/switch-root.d.mts +23 -0
- package/dist/components/switch/root/switch-root.d.ts +23 -0
- package/dist/components/switch/root/switch-root.js +180 -0
- package/dist/components/switch/root/switch-root.js.map +1 -0
- package/dist/components/switch/root/switch-root.mjs +163 -0
- package/dist/components/switch/root/switch-root.mjs.map +1 -0
- package/dist/components/switch/root/switch-root.props.d.mts +76 -0
- package/dist/components/switch/root/switch-root.props.d.ts +76 -0
- package/dist/components/switch/root/switch-root.props.js +103 -0
- package/dist/components/switch/root/switch-root.props.js.map +1 -0
- package/dist/components/switch/root/switch-root.props.mjs +78 -0
- package/dist/components/switch/root/switch-root.props.mjs.map +1 -0
- package/dist/components/switch/switch-context.d.mts +26 -0
- package/dist/components/switch/switch-context.d.ts +26 -0
- package/dist/components/switch/switch-context.js +52 -0
- package/dist/components/switch/switch-context.js.map +1 -0
- package/dist/components/switch/switch-context.mjs +17 -0
- package/dist/components/switch/switch-context.mjs.map +1 -0
- package/dist/components/switch/switch.d.mts +24 -0
- package/dist/components/switch/switch.d.ts +24 -0
- package/dist/components/switch/switch.js +36 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/switch.mjs +12 -0
- package/dist/components/switch/switch.mjs.map +1 -0
- package/dist/components/text/index.d.mts +7 -0
- package/dist/components/text/index.d.ts +7 -0
- package/dist/components/text/index.js +29 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text/index.mjs +5 -0
- package/dist/components/text/index.mjs.map +1 -0
- package/dist/components/text/text.d.mts +25 -0
- package/dist/components/text/text.d.ts +25 -0
- package/dist/components/text/text.js +66 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text/text.mjs +36 -0
- package/dist/components/text/text.mjs.map +1 -0
- package/dist/components/text/text.props.d.mts +24 -0
- package/dist/components/text/text.props.d.ts +24 -0
- package/dist/components/text/text.props.js +48 -0
- package/dist/components/text/text.props.js.map +1 -0
- package/dist/components/text/text.props.mjs +24 -0
- package/dist/components/text/text.props.mjs.map +1 -0
- package/dist/components/theme/index.d.mts +8 -0
- package/dist/components/theme/index.d.ts +8 -0
- package/dist/components/theme/index.js +35 -0
- package/dist/components/theme/index.js.map +1 -0
- package/dist/components/theme/index.mjs +9 -0
- package/dist/components/theme/index.mjs.map +1 -0
- package/dist/components/theme/theme-context.d.mts +25 -0
- package/dist/components/theme/theme-context.d.ts +25 -0
- package/dist/components/theme/theme-context.js +52 -0
- package/dist/components/theme/theme-context.js.map +1 -0
- package/dist/components/theme/theme-context.mjs +17 -0
- package/dist/components/theme/theme-context.mjs.map +1 -0
- package/dist/components/theme/theme-control.d.mts +9 -0
- package/dist/components/theme/theme-control.d.ts +9 -0
- package/dist/components/theme/theme-control.js +156 -0
- package/dist/components/theme/theme-control.js.map +1 -0
- package/dist/components/theme/theme-control.mjs +132 -0
- package/dist/components/theme/theme-control.mjs.map +1 -0
- package/dist/components/theme/theme.d.mts +14 -0
- package/dist/components/theme/theme.d.ts +14 -0
- package/dist/components/theme/theme.js +132 -0
- package/dist/components/theme/theme.js.map +1 -0
- package/dist/components/theme/theme.mjs +100 -0
- package/dist/components/theme/theme.mjs.map +1 -0
- package/dist/components/theme/theme.props.d.mts +24 -0
- package/dist/components/theme/theme.props.d.ts +24 -0
- package/dist/components/theme/theme.props.js +54 -0
- package/dist/components/theme/theme.props.js.map +1 -0
- package/dist/components/theme/theme.props.mjs +30 -0
- package/dist/components/theme/theme.props.mjs.map +1 -0
- package/dist/icons/check-mark.icon.d.mts +6 -0
- package/dist/icons/check-mark.icon.d.ts +6 -0
- package/dist/icons/check-mark.icon.js +51 -0
- package/dist/icons/check-mark.icon.js.map +1 -0
- package/dist/icons/check-mark.icon.mjs +27 -0
- package/dist/icons/check-mark.icon.mjs.map +1 -0
- package/dist/icons/chevron-down.icon.d.mts +6 -0
- package/dist/icons/chevron-down.icon.d.ts +6 -0
- package/dist/icons/chevron-down.icon.js +53 -0
- package/dist/icons/chevron-down.icon.js.map +1 -0
- package/dist/icons/chevron-down.icon.mjs +29 -0
- package/dist/icons/chevron-down.icon.mjs.map +1 -0
- package/dist/icons/chevron-left.icon.d.mts +6 -0
- package/dist/icons/chevron-left.icon.d.ts +6 -0
- package/dist/icons/chevron-left.icon.js +53 -0
- package/dist/icons/chevron-left.icon.js.map +1 -0
- package/dist/icons/chevron-left.icon.mjs +29 -0
- package/dist/icons/chevron-left.icon.mjs.map +1 -0
- package/dist/icons/chevron-right.icon.d.mts +6 -0
- package/dist/icons/chevron-right.icon.d.ts +6 -0
- package/dist/icons/chevron-right.icon.js +53 -0
- package/dist/icons/chevron-right.icon.js.map +1 -0
- package/dist/icons/chevron-right.icon.mjs +29 -0
- package/dist/icons/chevron-right.icon.mjs.map +1 -0
- package/dist/icons/chevron-up.icon.d.mts +6 -0
- package/dist/icons/chevron-up.icon.d.ts +6 -0
- package/dist/icons/chevron-up.icon.js +51 -0
- package/dist/icons/chevron-up.icon.js.map +1 -0
- package/dist/icons/chevron-up.icon.mjs +27 -0
- package/dist/icons/chevron-up.icon.mjs.map +1 -0
- package/dist/icons/icon-colors.d.mts +7 -0
- package/dist/icons/icon-colors.d.ts +7 -0
- package/dist/icons/icon-colors.js +34 -0
- package/dist/icons/icon-colors.js.map +1 -0
- package/dist/icons/icon-colors.mjs +10 -0
- package/dist/icons/icon-colors.mjs.map +1 -0
- package/dist/icons/index.d.mts +4 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +32 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/index.mjs +7 -0
- package/dist/icons/index.mjs.map +1 -0
- package/dist/icons/minus.icon.d.mts +6 -0
- package/dist/icons/minus.icon.d.ts +6 -0
- package/dist/icons/minus.icon.js +51 -0
- package/dist/icons/minus.icon.js.map +1 -0
- package/dist/icons/minus.icon.mjs +27 -0
- package/dist/icons/minus.icon.mjs.map +1 -0
- package/dist/index.css +79 -67
- package/dist/index.d.mts +81 -1524
- package/dist/index.d.ts +81 -1524
- package/dist/index.js +59 -3757
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -3738
- package/dist/index.mjs.map +1 -1
- package/dist/props/align.prop.d.mts +16 -0
- package/dist/props/align.prop.d.ts +16 -0
- package/dist/props/align.prop.js +41 -0
- package/dist/props/align.prop.js.map +1 -0
- package/dist/props/align.prop.mjs +16 -0
- package/dist/props/align.prop.mjs.map +1 -0
- package/dist/props/color.prop.d.mts +26 -0
- package/dist/props/color.prop.d.ts +26 -0
- package/dist/props/color.prop.js +60 -0
- package/dist/props/color.prop.js.map +1 -0
- package/dist/props/color.prop.mjs +35 -0
- package/dist/props/color.prop.mjs.map +1 -0
- package/dist/props/direction.prop.d.mts +11 -0
- package/dist/props/direction.prop.d.ts +11 -0
- package/dist/props/direction.prop.js +39 -0
- package/dist/props/direction.prop.js.map +1 -0
- package/dist/props/direction.prop.mjs +14 -0
- package/dist/props/direction.prop.mjs.map +1 -0
- package/dist/props/index.d.mts +11 -0
- package/dist/props/index.d.ts +11 -0
- package/dist/props/index.js +82 -0
- package/dist/props/index.js.map +1 -0
- package/dist/props/index.mjs +43 -0
- package/dist/props/index.mjs.map +1 -0
- package/dist/props/margin.prop.d.mts +135 -0
- package/dist/props/margin.prop.d.ts +135 -0
- package/dist/props/margin.prop.js +177 -0
- package/dist/props/margin.prop.js.map +1 -0
- package/dist/props/margin.prop.mjs +153 -0
- package/dist/props/margin.prop.mjs.map +1 -0
- package/dist/props/padding.prop.d.mts +135 -0
- package/dist/props/padding.prop.d.ts +135 -0
- package/dist/props/padding.prop.js +169 -0
- package/dist/props/padding.prop.js.map +1 -0
- package/dist/props/padding.prop.mjs +145 -0
- package/dist/props/padding.prop.mjs.map +1 -0
- package/dist/props/prop-def.d.mts +66 -0
- package/dist/props/prop-def.d.ts +66 -0
- package/dist/props/prop-def.js +18 -0
- package/dist/props/prop-def.js.map +1 -0
- package/dist/props/prop-def.mjs +2 -0
- package/dist/props/prop-def.mjs.map +1 -0
- package/dist/props/radius.prop.d.mts +177 -0
- package/dist/props/radius.prop.d.ts +177 -0
- package/dist/props/radius.prop.js +211 -0
- package/dist/props/radius.prop.js.map +1 -0
- package/dist/props/radius.prop.mjs +186 -0
- package/dist/props/radius.prop.mjs.map +1 -0
- package/dist/props/roundness.prop.d.mts +23 -0
- package/dist/props/roundness.prop.d.ts +23 -0
- package/dist/props/roundness.prop.js +48 -0
- package/dist/props/roundness.prop.js.map +1 -0
- package/dist/props/roundness.prop.mjs +23 -0
- package/dist/props/roundness.prop.mjs.map +1 -0
- package/dist/props/size.prop.d.mts +19 -0
- package/dist/props/size.prop.d.ts +19 -0
- package/dist/props/size.prop.js +44 -0
- package/dist/props/size.prop.js.map +1 -0
- package/dist/props/size.prop.mjs +19 -0
- package/dist/props/size.prop.mjs.map +1 -0
- package/dist/props/spacing.prop.d.mts +24 -0
- package/dist/props/spacing.prop.d.ts +24 -0
- package/dist/props/spacing.prop.js +49 -0
- package/dist/props/spacing.prop.js.map +1 -0
- package/dist/props/spacing.prop.mjs +24 -0
- package/dist/props/spacing.prop.mjs.map +1 -0
- package/dist/utils/filter-children.d.mts +50 -0
- package/dist/utils/filter-children.d.ts +50 -0
- package/dist/utils/filter-children.js +121 -0
- package/dist/utils/filter-children.js.map +1 -0
- package/dist/utils/filter-children.mjs +86 -0
- package/dist/utils/filter-children.mjs.map +1 -0
- package/dist/utils/get-component-props.d.mts +14 -0
- package/dist/utils/get-component-props.d.ts +14 -0
- package/dist/utils/get-component-props.js +126 -0
- package/dist/utils/get-component-props.js.map +1 -0
- package/dist/utils/get-component-props.mjs +92 -0
- package/dist/utils/get-component-props.mjs.map +1 -0
- package/dist/utils/get-props.d.mts +29 -0
- package/dist/utils/get-props.d.ts +29 -0
- package/dist/utils/get-props.js +17 -0
- package/dist/utils/get-props.js.map +1 -0
- package/dist/utils/get-props.mjs +1 -0
- package/dist/utils/get-props.mjs.map +1 -0
- package/dist/utils/parse-color.d.mts +14 -0
- package/dist/utils/parse-color.d.ts +14 -0
- package/dist/utils/parse-color.js +49 -0
- package/dist/utils/parse-color.js.map +1 -0
- package/dist/utils/parse-color.mjs +25 -0
- package/dist/utils/parse-color.mjs.map +1 -0
- package/dist/utils/use-controllable-state.d.mts +7 -0
- package/dist/utils/use-controllable-state.d.ts +7 -0
- package/dist/utils/use-controllable-state.js +58 -0
- package/dist/utils/use-controllable-state.js.map +1 -0
- package/dist/utils/use-controllable-state.mjs +24 -0
- package/dist/utils/use-controllable-state.mjs.map +1 -0
- package/package.json +2 -1
- package/dist/index.css.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { SwitchLabelInternalProps } from './switch-label.props.mjs';
|
|
3
|
+
import '../../../props/prop-def.mjs';
|
|
4
|
+
|
|
5
|
+
interface AllSwitchLabelProps extends SwitchLabelInternalProps {
|
|
6
|
+
}
|
|
7
|
+
type SwitchLabelProps = AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
|
|
8
|
+
children?: React__default.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** Label for a switch component. */
|
|
11
|
+
declare const SwitchLabel: React__default.ForwardRefExoticComponent<AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
|
|
12
|
+
children?: React__default.ReactNode;
|
|
13
|
+
} & React__default.RefAttributes<HTMLLabelElement>>;
|
|
14
|
+
|
|
15
|
+
export { type AllSwitchLabelProps, SwitchLabel, type SwitchLabelProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { SwitchLabelInternalProps } from './switch-label.props.js';
|
|
3
|
+
import '../../../props/prop-def.js';
|
|
4
|
+
|
|
5
|
+
interface AllSwitchLabelProps extends SwitchLabelInternalProps {
|
|
6
|
+
}
|
|
7
|
+
type SwitchLabelProps = AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
|
|
8
|
+
children?: React__default.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** Label for a switch component. */
|
|
11
|
+
declare const SwitchLabel: React__default.ForwardRefExoticComponent<AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
|
|
12
|
+
children?: React__default.ReactNode;
|
|
13
|
+
} & React__default.RefAttributes<HTMLLabelElement>>;
|
|
14
|
+
|
|
15
|
+
export { type AllSwitchLabelProps, SwitchLabel, type SwitchLabelProps };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var switch_label_exports = {};
|
|
31
|
+
__export(switch_label_exports, {
|
|
32
|
+
SwitchLabel: () => SwitchLabel
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(switch_label_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_get_component_props = require("../../../utils/get-component-props");
|
|
39
|
+
var import_text = require("../../text");
|
|
40
|
+
var import_switch_context = require("../switch-context");
|
|
41
|
+
var import_switch_label = require("./switch-label.props");
|
|
42
|
+
const SwitchLabel = import_react.default.forwardRef(
|
|
43
|
+
(props, ref) => {
|
|
44
|
+
const context = (0, import_switch_context.useSwitchContext)();
|
|
45
|
+
const { className, children, position } = (0, import_get_component_props.getComponentProps)(
|
|
46
|
+
props,
|
|
47
|
+
import_switch_label.SwitchLabelPropDefs
|
|
48
|
+
);
|
|
49
|
+
import_react.default.useLayoutEffect(() => {
|
|
50
|
+
context.setLabelPosition?.(position ?? "right");
|
|
51
|
+
}, [position, context.setLabelPosition]);
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
"label",
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
htmlFor: context.labelId,
|
|
57
|
+
className: (0, import_clsx.default)("switch-label", className),
|
|
58
|
+
...position && { [`data-position`]: position },
|
|
59
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { children })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
SwitchLabel.displayName = "Switch.Label";
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
SwitchLabel
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=switch-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/switch/label/switch-label.tsx"],"sourcesContent":["\"use client\";\n\nimport clsx from \"clsx\";\nimport React from \"react\";\nimport { getComponentProps } from \"../../../utils/get-component-props\";\nimport { Text } from \"../../text\";\nimport { useSwitchContext } from \"../switch-context\";\nimport {\n SwitchLabelInternalProps,\n SwitchLabelPropDefs,\n} from \"./switch-label.props\";\n\ninterface AllSwitchLabelProps extends SwitchLabelInternalProps {}\n\ntype SwitchLabelProps = AllSwitchLabelProps &\n Omit<React.HTMLAttributes<HTMLLabelElement>, \"children\"> & {\n children?: React.ReactNode;\n };\n\n/** Label for a switch component. */\nconst SwitchLabel = React.forwardRef<HTMLLabelElement, SwitchLabelProps>(\n (props, ref) => {\n const context = useSwitchContext();\n const { className, children, position } = getComponentProps(\n props,\n SwitchLabelPropDefs,\n );\n\n React.useLayoutEffect(() => {\n context.setLabelPosition?.(position ?? \"right\");\n }, [position, context.setLabelPosition]);\n\n return (\n <label\n ref={ref}\n htmlFor={context.labelId}\n className={clsx(\"switch-label\", className)}\n {...(position && { [`data-position`]: position })}\n >\n <Text>{children}</Text>\n </label>\n );\n },\n);\nSwitchLabel.displayName = \"Switch.Label\";\n\nexport { AllSwitchLabelProps, SwitchLabel, SwitchLabelProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCQ;AArCR,kBAAiB;AACjB,mBAAkB;AAClB,iCAAkC;AAClC,kBAAqB;AACrB,4BAAiC;AACjC,0BAGO;AAUP,MAAM,cAAc,aAAAA,QAAM;AAAA,EACxB,CAAC,OAAO,QAAQ;AACd,UAAM,cAAU,wCAAiB;AACjC,UAAM,EAAE,WAAW,UAAU,SAAS,QAAI;AAAA,MACxC;AAAA,MACA;AAAA,IACF;AAEA,iBAAAA,QAAM,gBAAgB,MAAM;AAC1B,cAAQ,mBAAmB,YAAY,OAAO;AAAA,IAChD,GAAG,CAAC,UAAU,QAAQ,gBAAgB,CAAC;AAEvC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,eAAW,YAAAC,SAAK,gBAAgB,SAAS;AAAA,QACxC,GAAI,YAAY,EAAE,CAAC,eAAe,GAAG,SAAS;AAAA,QAE/C,sDAAC,oBAAM,UAAS;AAAA;AAAA,IAClB;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;","names":["React","clsx"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { getComponentProps } from "../../../utils/get-component-props";
|
|
6
|
+
import { Text } from "../../text";
|
|
7
|
+
import { useSwitchContext } from "../switch-context";
|
|
8
|
+
import {
|
|
9
|
+
SwitchLabelPropDefs
|
|
10
|
+
} from "./switch-label.props";
|
|
11
|
+
const SwitchLabel = React.forwardRef(
|
|
12
|
+
(props, ref) => {
|
|
13
|
+
const context = useSwitchContext();
|
|
14
|
+
const { className, children, position } = getComponentProps(
|
|
15
|
+
props,
|
|
16
|
+
SwitchLabelPropDefs
|
|
17
|
+
);
|
|
18
|
+
React.useLayoutEffect(() => {
|
|
19
|
+
context.setLabelPosition?.(position ?? "right");
|
|
20
|
+
}, [position, context.setLabelPosition]);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"label",
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
htmlFor: context.labelId,
|
|
26
|
+
className: clsx("switch-label", className),
|
|
27
|
+
...position && { [`data-position`]: position },
|
|
28
|
+
children: /* @__PURE__ */ jsx(Text, { children })
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
SwitchLabel.displayName = "Switch.Label";
|
|
34
|
+
export {
|
|
35
|
+
SwitchLabel
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=switch-label.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/switch/label/switch-label.tsx"],"sourcesContent":["\"use client\";\n\nimport clsx from \"clsx\";\nimport React from \"react\";\nimport { getComponentProps } from \"../../../utils/get-component-props\";\nimport { Text } from \"../../text\";\nimport { useSwitchContext } from \"../switch-context\";\nimport {\n SwitchLabelInternalProps,\n SwitchLabelPropDefs,\n} from \"./switch-label.props\";\n\ninterface AllSwitchLabelProps extends SwitchLabelInternalProps {}\n\ntype SwitchLabelProps = AllSwitchLabelProps &\n Omit<React.HTMLAttributes<HTMLLabelElement>, \"children\"> & {\n children?: React.ReactNode;\n };\n\n/** Label for a switch component. */\nconst SwitchLabel = React.forwardRef<HTMLLabelElement, SwitchLabelProps>(\n (props, ref) => {\n const context = useSwitchContext();\n const { className, children, position } = getComponentProps(\n props,\n SwitchLabelPropDefs,\n );\n\n React.useLayoutEffect(() => {\n context.setLabelPosition?.(position ?? \"right\");\n }, [position, context.setLabelPosition]);\n\n return (\n <label\n ref={ref}\n htmlFor={context.labelId}\n className={clsx(\"switch-label\", className)}\n {...(position && { [`data-position`]: position })}\n >\n <Text>{children}</Text>\n </label>\n );\n },\n);\nSwitchLabel.displayName = \"Switch.Label\";\n\nexport { AllSwitchLabelProps, SwitchLabel, SwitchLabelProps };\n"],"mappings":";AAuCQ;AArCR,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,YAAY;AACrB,SAAS,wBAAwB;AACjC;AAAA,EAEE;AAAA,OACK;AAUP,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,OAAO,QAAQ;AACd,UAAM,UAAU,iBAAiB;AACjC,UAAM,EAAE,WAAW,UAAU,SAAS,IAAI;AAAA,MACxC;AAAA,MACA;AAAA,IACF;AAEA,UAAM,gBAAgB,MAAM;AAC1B,cAAQ,mBAAmB,YAAY,OAAO;AAAA,IAChD,GAAG,CAAC,UAAU,QAAQ,gBAAgB,CAAC;AAEvC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,WAAW,KAAK,gBAAgB,SAAS;AAAA,QACxC,GAAI,YAAY,EAAE,CAAC,eAAe,GAAG,SAAS;AAAA,QAE/C,8BAAC,QAAM,UAAS;AAAA;AAAA,IAClB;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GetPropDefTypes } from '../../../props/prop-def.mjs';
|
|
2
|
+
|
|
3
|
+
declare const labelPositions: readonly ["top", "left", "right", "bottom"];
|
|
4
|
+
type LabelPosition = (typeof labelPositions)[number];
|
|
5
|
+
declare const SwitchLabelPropDefs: {
|
|
6
|
+
/**
|
|
7
|
+
* Sets the position of the label relative to the switch.
|
|
8
|
+
*
|
|
9
|
+
* @example position="left" // positions the label to the left of the switch
|
|
10
|
+
* @example position="top" // positions the label above the switch
|
|
11
|
+
*/
|
|
12
|
+
readonly position: {
|
|
13
|
+
type: "enum";
|
|
14
|
+
values: readonly ["top", "left", "right", "bottom"];
|
|
15
|
+
dataAttr: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;
|
|
19
|
+
|
|
20
|
+
export { type LabelPosition, type SwitchLabelInternalProps, SwitchLabelPropDefs, labelPositions };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GetPropDefTypes } from '../../../props/prop-def.js';
|
|
2
|
+
|
|
3
|
+
declare const labelPositions: readonly ["top", "left", "right", "bottom"];
|
|
4
|
+
type LabelPosition = (typeof labelPositions)[number];
|
|
5
|
+
declare const SwitchLabelPropDefs: {
|
|
6
|
+
/**
|
|
7
|
+
* Sets the position of the label relative to the switch.
|
|
8
|
+
*
|
|
9
|
+
* @example position="left" // positions the label to the left of the switch
|
|
10
|
+
* @example position="top" // positions the label above the switch
|
|
11
|
+
*/
|
|
12
|
+
readonly position: {
|
|
13
|
+
type: "enum";
|
|
14
|
+
values: readonly ["top", "left", "right", "bottom"];
|
|
15
|
+
dataAttr: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;
|
|
19
|
+
|
|
20
|
+
export { type LabelPosition, type SwitchLabelInternalProps, SwitchLabelPropDefs, labelPositions };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var switch_label_props_exports = {};
|
|
20
|
+
__export(switch_label_props_exports, {
|
|
21
|
+
SwitchLabelPropDefs: () => SwitchLabelPropDefs,
|
|
22
|
+
labelPositions: () => labelPositions
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(switch_label_props_exports);
|
|
25
|
+
const labelPositions = ["top", "left", "right", "bottom"];
|
|
26
|
+
const SwitchLabelPropDefs = {
|
|
27
|
+
/**
|
|
28
|
+
* Sets the position of the label relative to the switch.
|
|
29
|
+
*
|
|
30
|
+
* @example position="left" // positions the label to the left of the switch
|
|
31
|
+
* @example position="top" // positions the label above the switch
|
|
32
|
+
*/
|
|
33
|
+
position: {
|
|
34
|
+
type: "enum",
|
|
35
|
+
values: labelPositions,
|
|
36
|
+
dataAttr: "position"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
SwitchLabelPropDefs,
|
|
42
|
+
labelPositions
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=switch-label.props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/switch/label/switch-label.props.ts"],"sourcesContent":["import { GetPropDefTypes, PropDef } from \"../../../props\";\n\nconst labelPositions = [\"top\", \"left\", \"right\", \"bottom\"] as const;\ntype LabelPosition = (typeof labelPositions)[number];\n\nconst SwitchLabelPropDefs = {\n /**\n * Sets the position of the label relative to the switch.\n *\n * @example position=\"left\" // positions the label to the left of the switch\n * @example position=\"top\" // positions the label above the switch\n */\n position: {\n type: \"enum\",\n values: labelPositions,\n dataAttr: \"position\",\n } satisfies PropDef<LabelPosition>,\n} as const;\n\ntype SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;\n\nexport {\n LabelPosition,\n labelPositions,\n SwitchLabelInternalProps,\n SwitchLabelPropDefs,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,iBAAiB,CAAC,OAAO,QAAQ,SAAS,QAAQ;AAGxD,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1B,UAAU;AAAA,IACR,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const labelPositions = ["top", "left", "right", "bottom"];
|
|
2
|
+
const SwitchLabelPropDefs = {
|
|
3
|
+
/**
|
|
4
|
+
* Sets the position of the label relative to the switch.
|
|
5
|
+
*
|
|
6
|
+
* @example position="left" // positions the label to the left of the switch
|
|
7
|
+
* @example position="top" // positions the label above the switch
|
|
8
|
+
*/
|
|
9
|
+
position: {
|
|
10
|
+
type: "enum",
|
|
11
|
+
values: labelPositions,
|
|
12
|
+
dataAttr: "position"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
SwitchLabelPropDefs,
|
|
17
|
+
labelPositions
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=switch-label.props.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/switch/label/switch-label.props.ts"],"sourcesContent":["import { GetPropDefTypes, PropDef } from \"../../../props\";\n\nconst labelPositions = [\"top\", \"left\", \"right\", \"bottom\"] as const;\ntype LabelPosition = (typeof labelPositions)[number];\n\nconst SwitchLabelPropDefs = {\n /**\n * Sets the position of the label relative to the switch.\n *\n * @example position=\"left\" // positions the label to the left of the switch\n * @example position=\"top\" // positions the label above the switch\n */\n position: {\n type: \"enum\",\n values: labelPositions,\n dataAttr: \"position\",\n } satisfies PropDef<LabelPosition>,\n} as const;\n\ntype SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;\n\nexport {\n LabelPosition,\n labelPositions,\n SwitchLabelInternalProps,\n SwitchLabelPropDefs,\n};\n"],"mappings":"AAEA,MAAM,iBAAiB,CAAC,OAAO,QAAQ,SAAS,QAAQ;AAGxD,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1B,UAAU;AAAA,IACR,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes, FC } from 'react';
|
|
2
|
+
import { AlignProp } from '../../../props/align.prop.mjs';
|
|
3
|
+
import { ColorProp } from '../../../props/color.prop.mjs';
|
|
4
|
+
import { MarginProps } from '../../../props/margin.prop.mjs';
|
|
5
|
+
import { SizeProp } from '../../../props/size.prop.mjs';
|
|
6
|
+
import { WithStrictChildren } from '../../../utils/filter-children.mjs';
|
|
7
|
+
import { SwitchIndicatorProps } from '../indicator/switch-indicator.mjs';
|
|
8
|
+
import { SwitchLabelProps } from '../label/switch-label.mjs';
|
|
9
|
+
import { SwitchRootInternalProps } from './switch-root.props.mjs';
|
|
10
|
+
import '../../../props/prop-def.mjs';
|
|
11
|
+
import '../../../utils/parse-color.mjs';
|
|
12
|
+
import '../indicator/switch-indicator.props.mjs';
|
|
13
|
+
import '../label/switch-label.props.mjs';
|
|
14
|
+
|
|
15
|
+
interface AllSwitchRootProps extends SwitchRootInternalProps, AlignProp, ColorProp, MarginProps, SizeProp {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A versatile Switch, managing state, context, and styling.
|
|
19
|
+
*/
|
|
20
|
+
type SwitchRootProps = AllSwitchRootProps & WithStrictChildren<HTMLAttributes<HTMLDivElement>, SwitchLabelProps | SwitchIndicatorProps>;
|
|
21
|
+
declare const SwitchRoot: FC<SwitchRootProps>;
|
|
22
|
+
|
|
23
|
+
export { type AllSwitchRootProps, SwitchRoot, type SwitchRootProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes, FC } from 'react';
|
|
2
|
+
import { AlignProp } from '../../../props/align.prop.js';
|
|
3
|
+
import { ColorProp } from '../../../props/color.prop.js';
|
|
4
|
+
import { MarginProps } from '../../../props/margin.prop.js';
|
|
5
|
+
import { SizeProp } from '../../../props/size.prop.js';
|
|
6
|
+
import { WithStrictChildren } from '../../../utils/filter-children.js';
|
|
7
|
+
import { SwitchIndicatorProps } from '../indicator/switch-indicator.js';
|
|
8
|
+
import { SwitchLabelProps } from '../label/switch-label.js';
|
|
9
|
+
import { SwitchRootInternalProps } from './switch-root.props.js';
|
|
10
|
+
import '../../../props/prop-def.js';
|
|
11
|
+
import '../../../utils/parse-color.js';
|
|
12
|
+
import '../indicator/switch-indicator.props.js';
|
|
13
|
+
import '../label/switch-label.props.js';
|
|
14
|
+
|
|
15
|
+
interface AllSwitchRootProps extends SwitchRootInternalProps, AlignProp, ColorProp, MarginProps, SizeProp {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A versatile Switch, managing state, context, and styling.
|
|
19
|
+
*/
|
|
20
|
+
type SwitchRootProps = AllSwitchRootProps & WithStrictChildren<HTMLAttributes<HTMLDivElement>, SwitchLabelProps | SwitchIndicatorProps>;
|
|
21
|
+
declare const SwitchRoot: FC<SwitchRootProps>;
|
|
22
|
+
|
|
23
|
+
export { type AllSwitchRootProps, SwitchRoot, type SwitchRootProps };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var switch_root_exports = {};
|
|
31
|
+
__export(switch_root_exports, {
|
|
32
|
+
SwitchRoot: () => SwitchRoot
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(switch_root_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_props = require("../../../props");
|
|
39
|
+
var import_filter_children = require("../../../utils/filter-children");
|
|
40
|
+
var import_get_component_props = require("../../../utils/get-component-props");
|
|
41
|
+
var import_use_controllable_state = require("../../../utils/use-controllable-state");
|
|
42
|
+
var import_switch_indicator = require("../indicator/switch-indicator");
|
|
43
|
+
var import_switch_label = require("../label/switch-label");
|
|
44
|
+
var import_switch_context = require("../switch-context");
|
|
45
|
+
var import_switch_root = require("./switch-root.props");
|
|
46
|
+
const ALLOWED_CHILDREN = [
|
|
47
|
+
import_switch_label.SwitchLabel.displayName,
|
|
48
|
+
import_switch_indicator.SwitchIndicator.displayName
|
|
49
|
+
];
|
|
50
|
+
const SwitchRoot = (props) => {
|
|
51
|
+
const {
|
|
52
|
+
name,
|
|
53
|
+
size,
|
|
54
|
+
color,
|
|
55
|
+
variant,
|
|
56
|
+
checked,
|
|
57
|
+
dataAttrs,
|
|
58
|
+
style,
|
|
59
|
+
className,
|
|
60
|
+
onCheckedChange,
|
|
61
|
+
value: valueProp,
|
|
62
|
+
disabled = false,
|
|
63
|
+
required = false,
|
|
64
|
+
readonly = false,
|
|
65
|
+
defaultChecked = false
|
|
66
|
+
} = (0, import_get_component_props.getComponentProps)(
|
|
67
|
+
props,
|
|
68
|
+
import_switch_root.SwitchRootPropsDefs,
|
|
69
|
+
import_props.AlignPropDef,
|
|
70
|
+
import_props.MarginPropDefs,
|
|
71
|
+
import_props.SizePropDef,
|
|
72
|
+
import_props.ColorPropDef
|
|
73
|
+
);
|
|
74
|
+
const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
75
|
+
value: valueProp || checked,
|
|
76
|
+
defaultValue: defaultChecked,
|
|
77
|
+
onChange: onCheckedChange
|
|
78
|
+
});
|
|
79
|
+
const labelId = (0, import_react.useId)();
|
|
80
|
+
const [labelPosition, setLabelPosition] = (0, import_react.useState)("right");
|
|
81
|
+
const [hovered, setHovered] = (0, import_react.useState)(false);
|
|
82
|
+
const [focused, setFocused] = (0, import_react.useState)(false);
|
|
83
|
+
const validChildren = (0, import_filter_children.filterChildren)(props.children, ALLOWED_CHILDREN, {
|
|
84
|
+
parentDisplayName: SwitchRoot.displayName,
|
|
85
|
+
allowedTypes: [import_switch_label.SwitchLabel, import_switch_indicator.SwitchIndicator]
|
|
86
|
+
});
|
|
87
|
+
const { restDataAttrs } = (0, import_react.useMemo)(() => {
|
|
88
|
+
const { ["data-color"]: _, ...restDataAttrs2 } = dataAttrs || {};
|
|
89
|
+
return { restDataAttrs: restDataAttrs2 };
|
|
90
|
+
}, [dataAttrs]);
|
|
91
|
+
const { indicator, otherChildren } = (0, import_react.useMemo)(() => {
|
|
92
|
+
const indicatorIndex = validChildren.findIndex(
|
|
93
|
+
(child) => (0, import_react.isValidElement)(child) && (0, import_filter_children.matchesComponent)(child.type, import_switch_indicator.SwitchIndicator)
|
|
94
|
+
);
|
|
95
|
+
if (indicatorIndex > -1) {
|
|
96
|
+
return {
|
|
97
|
+
indicator: validChildren[indicatorIndex],
|
|
98
|
+
otherChildren: validChildren.filter((_, i) => i !== indicatorIndex)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
indicator: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_switch_indicator.SwitchIndicator, { size }),
|
|
103
|
+
otherChildren: validChildren
|
|
104
|
+
};
|
|
105
|
+
}, [validChildren, size]);
|
|
106
|
+
const contextValue = (0, import_react.useMemo)(
|
|
107
|
+
() => ({
|
|
108
|
+
name,
|
|
109
|
+
value,
|
|
110
|
+
color,
|
|
111
|
+
setValue,
|
|
112
|
+
onCheckedChange,
|
|
113
|
+
labelId,
|
|
114
|
+
labelPosition,
|
|
115
|
+
setLabelPosition,
|
|
116
|
+
variant,
|
|
117
|
+
hovered,
|
|
118
|
+
setHovered,
|
|
119
|
+
focused,
|
|
120
|
+
setFocused,
|
|
121
|
+
disabled,
|
|
122
|
+
readonly,
|
|
123
|
+
required
|
|
124
|
+
}),
|
|
125
|
+
[
|
|
126
|
+
name,
|
|
127
|
+
value,
|
|
128
|
+
color,
|
|
129
|
+
onCheckedChange,
|
|
130
|
+
setValue,
|
|
131
|
+
labelId,
|
|
132
|
+
labelPosition,
|
|
133
|
+
hovered,
|
|
134
|
+
focused,
|
|
135
|
+
disabled,
|
|
136
|
+
readonly,
|
|
137
|
+
required
|
|
138
|
+
]
|
|
139
|
+
);
|
|
140
|
+
const handleClick = () => {
|
|
141
|
+
if (disabled || readonly) return;
|
|
142
|
+
setValue(!value);
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_switch_context.SwitchContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
className: (0, import_clsx.default)("switch-root", className),
|
|
148
|
+
onClick: () => handleClick(),
|
|
149
|
+
onFocus: () => setFocused(true),
|
|
150
|
+
onBlur: () => setFocused(false),
|
|
151
|
+
onMouseEnter: () => setHovered(true),
|
|
152
|
+
onMouseLeave: () => setHovered(false),
|
|
153
|
+
...restDataAttrs,
|
|
154
|
+
children: [
|
|
155
|
+
otherChildren,
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
className: (0, import_clsx.default)("switch-container", className),
|
|
160
|
+
"data-size": size,
|
|
161
|
+
"data-color": color,
|
|
162
|
+
"data-checked": value,
|
|
163
|
+
"data-hovered": hovered,
|
|
164
|
+
"data-focused": focused,
|
|
165
|
+
"data-variant": variant,
|
|
166
|
+
style,
|
|
167
|
+
children: indicator
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "hidden", name, value: String(value) })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
) });
|
|
174
|
+
};
|
|
175
|
+
SwitchRoot.displayName = "Switch";
|
|
176
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
177
|
+
0 && (module.exports = {
|
|
178
|
+
SwitchRoot
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=switch-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/switch/root/switch-root.tsx"],"sourcesContent":["\"use client\";\n\nimport clsx from \"clsx\";\nimport {\n FC,\n HTMLAttributes,\n isValidElement,\n useId,\n useMemo,\n useState,\n} from \"react\";\nimport {\n AlignProp,\n AlignPropDef,\n ColorProp,\n ColorPropDef,\n MarginPropDefs,\n MarginProps,\n SizeProp,\n SizePropDef,\n} from \"../../../props\";\nimport {\n filterChildren,\n matchesComponent,\n WithStrictChildren,\n} from \"../../../utils/filter-children\";\nimport { getComponentProps } from \"../../../utils/get-component-props\";\nimport { useControllableState } from \"../../../utils/use-controllable-state\";\nimport {\n SwitchIndicator,\n SwitchIndicatorProps,\n} from \"../indicator/switch-indicator\";\nimport { SwitchLabel, SwitchLabelProps } from \"../label/switch-label\";\nimport { LabelPosition } from \"../label/switch-label.props\";\nimport { SwitchContext } from \"../switch-context\";\nimport {\n SwitchRootInternalProps,\n SwitchRootPropsDefs,\n} from \"./switch-root.props\";\n\ninterface AllSwitchRootProps\n extends\n SwitchRootInternalProps,\n AlignProp,\n ColorProp,\n MarginProps,\n SizeProp {}\n\nconst ALLOWED_CHILDREN = [\n SwitchLabel.displayName!,\n SwitchIndicator.displayName!,\n];\n\n/**\n * A versatile Switch, managing state, context, and styling.\n */\ntype SwitchRootProps = AllSwitchRootProps &\n WithStrictChildren<\n HTMLAttributes<HTMLDivElement>,\n SwitchLabelProps | SwitchIndicatorProps\n >;\n\nconst SwitchRoot: FC<SwitchRootProps> = (props) => {\n const {\n name,\n size,\n color,\n variant,\n checked,\n dataAttrs,\n style,\n className,\n onCheckedChange,\n value: valueProp,\n disabled = false,\n required = false,\n readonly = false,\n defaultChecked = false,\n } = getComponentProps(\n props,\n SwitchRootPropsDefs,\n AlignPropDef,\n MarginPropDefs,\n SizePropDef,\n ColorPropDef,\n );\n\n const [value, setValue] = useControllableState<boolean>({\n value: valueProp || checked,\n defaultValue: defaultChecked,\n onChange: onCheckedChange,\n });\n\n const labelId = useId();\n const [labelPosition, setLabelPosition] = useState<LabelPosition>(\"right\");\n\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n\n const validChildren = filterChildren(props.children, ALLOWED_CHILDREN, {\n parentDisplayName: SwitchRoot.displayName,\n allowedTypes: [SwitchLabel, SwitchIndicator],\n });\n\n const { restDataAttrs } = useMemo(() => {\n const { [\"data-color\"]: _, ...restDataAttrs } = dataAttrs || {};\n return { restDataAttrs };\n }, [dataAttrs]);\n\n const { indicator, otherChildren } = useMemo(() => {\n const indicatorIndex = validChildren.findIndex(\n (child) =>\n isValidElement(child) && matchesComponent(child.type, SwitchIndicator),\n );\n\n if (indicatorIndex > -1) {\n return {\n indicator: validChildren[indicatorIndex],\n otherChildren: validChildren.filter((_, i) => i !== indicatorIndex),\n };\n }\n\n return {\n indicator: <SwitchIndicator size={size} />,\n otherChildren: validChildren,\n };\n }, [validChildren, size]);\n\n const contextValue = useMemo(\n () => ({\n name,\n value,\n color,\n setValue,\n onCheckedChange,\n labelId,\n labelPosition,\n setLabelPosition,\n variant,\n hovered,\n setHovered,\n focused,\n setFocused,\n disabled,\n readonly,\n required,\n }),\n [\n name,\n value,\n color,\n onCheckedChange,\n setValue,\n labelId,\n labelPosition,\n hovered,\n focused,\n disabled,\n readonly,\n required,\n ],\n );\n\n const handleClick = () => {\n if (disabled || readonly) return;\n setValue(!value);\n };\n\n return (\n <SwitchContext.Provider value={contextValue}>\n <div\n className={clsx(\"switch-root\", className)}\n onClick={() => handleClick()}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n {...restDataAttrs}\n >\n {otherChildren}\n\n <div\n className={clsx(\"switch-container\", className)}\n data-size={size}\n data-color={color}\n data-checked={value}\n data-hovered={hovered}\n data-focused={focused}\n data-variant={variant}\n style={style}\n >\n {indicator}\n </div>\n\n {name && <input type=\"hidden\" name={name} value={String(value)} />}\n </div>\n </SwitchContext.Provider>\n );\n};\nSwitchRoot.displayName = \"Switch\";\n\nexport { AllSwitchRootProps, SwitchRoot, SwitchRootProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2HiB;AAzHjB,kBAAiB;AACjB,mBAOO;AACP,mBASO;AACP,6BAIO;AACP,iCAAkC;AAClC,oCAAqC;AACrC,8BAGO;AACP,0BAA8C;AAE9C,4BAA8B;AAC9B,yBAGO;AAUP,MAAM,mBAAmB;AAAA,EACvB,gCAAY;AAAA,EACZ,wCAAgB;AAClB;AAWA,MAAM,aAAkC,CAAC,UAAU;AACjD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,iBAAiB;AAAA,EACnB,QAAI;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,CAAC,OAAO,QAAQ,QAAI,oDAA8B;AAAA,IACtD,OAAO,aAAa;AAAA,IACpB,cAAc;AAAA,IACd,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,cAAU,oBAAM;AACtB,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAwB,OAAO;AAEzE,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,KAAK;AAC5C,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,KAAK;AAE5C,QAAM,oBAAgB,uCAAe,MAAM,UAAU,kBAAkB;AAAA,IACrE,mBAAmB,WAAW;AAAA,IAC9B,cAAc,CAAC,iCAAa,uCAAe;AAAA,EAC7C,CAAC;AAED,QAAM,EAAE,cAAc,QAAI,sBAAQ,MAAM;AACtC,UAAM,EAAE,CAAC,YAAY,GAAG,GAAG,GAAGA,eAAc,IAAI,aAAa,CAAC;AAC9D,WAAO,EAAE,eAAAA,eAAc;AAAA,EACzB,GAAG,CAAC,SAAS,CAAC;AAEd,QAAM,EAAE,WAAW,cAAc,QAAI,sBAAQ,MAAM;AACjD,UAAM,iBAAiB,cAAc;AAAA,MACnC,CAAC,cACC,6BAAe,KAAK,SAAK,yCAAiB,MAAM,MAAM,uCAAe;AAAA,IACzE;AAEA,QAAI,iBAAiB,IAAI;AACvB,aAAO;AAAA,QACL,WAAW,cAAc,cAAc;AAAA,QACvC,eAAe,cAAc,OAAO,CAAC,GAAG,MAAM,MAAM,cAAc;AAAA,MACpE;AAAA,IACF;AAEA,WAAO;AAAA,MACL,WAAW,4CAAC,2CAAgB,MAAY;AAAA,MACxC,eAAe;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,eAAe,IAAI,CAAC;AAExB,QAAM,mBAAe;AAAA,IACnB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,MAAM;AACxB,QAAI,YAAY,SAAU;AAC1B,aAAS,CAAC,KAAK;AAAA,EACjB;AAEA,SACE,4CAAC,oCAAc,UAAd,EAAuB,OAAO,cAC7B;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,YAAAC,SAAK,eAAe,SAAS;AAAA,MACxC,SAAS,MAAM,YAAY;AAAA,MAC3B,SAAS,MAAM,WAAW,IAAI;AAAA,MAC9B,QAAQ,MAAM,WAAW,KAAK;AAAA,MAC9B,cAAc,MAAM,WAAW,IAAI;AAAA,MACnC,cAAc,MAAM,WAAW,KAAK;AAAA,MACnC,GAAG;AAAA,MAEH;AAAA;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACC,eAAW,YAAAA,SAAK,oBAAoB,SAAS;AAAA,YAC7C,aAAW;AAAA,YACX,cAAY;AAAA,YACZ,gBAAc;AAAA,YACd,gBAAc;AAAA,YACd,gBAAc;AAAA,YACd,gBAAc;AAAA,YACd;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,QAAQ,4CAAC,WAAM,MAAK,UAAS,MAAY,OAAO,OAAO,KAAK,GAAG;AAAA;AAAA;AAAA,EAClE,GACF;AAEJ;AACA,WAAW,cAAc;","names":["restDataAttrs","clsx"]}
|