@proto.ui/prototypes-shadcn 0.3.0-alpha.1 → 0.3.0-rc.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/README.md +82 -4
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/dist/accordion/content.proto.d.ts +4 -0
- package/dist/accordion/content.proto.js +20 -0
- package/dist/accordion/heading.proto.d.ts +4 -0
- package/dist/accordion/heading.proto.js +13 -0
- package/dist/accordion/index.d.ts +7 -0
- package/dist/accordion/index.js +5 -0
- package/dist/accordion/item.proto.d.ts +4 -0
- package/dist/accordion/item.proto.js +33 -0
- package/dist/accordion/root.proto.d.ts +4 -0
- package/dist/accordion/root.proto.js +35 -0
- package/dist/accordion/trigger.proto.d.ts +4 -0
- package/dist/accordion/trigger.proto.js +130 -0
- package/dist/accordion/types.d.ts +7 -0
- package/dist/accordion/types.js +1 -0
- package/dist/accordion/visual.d.ts +4 -0
- package/dist/accordion/visual.js +38 -0
- package/dist/alert-dialog/action-paint.d.ts +18 -0
- package/dist/alert-dialog/action-paint.js +232 -0
- package/dist/alert-dialog/action.proto.d.ts +4 -0
- package/dist/alert-dialog/action.proto.js +19 -0
- package/dist/alert-dialog/cancel.proto.d.ts +4 -0
- package/dist/alert-dialog/cancel.proto.js +19 -0
- package/dist/alert-dialog/content.proto.d.ts +4 -0
- package/dist/alert-dialog/content.proto.js +39 -0
- package/dist/alert-dialog/description.proto.d.ts +4 -0
- package/dist/alert-dialog/description.proto.js +11 -0
- package/dist/alert-dialog/footer.proto.d.ts +4 -0
- package/dist/alert-dialog/footer.proto.js +14 -0
- package/dist/alert-dialog/header.proto.d.ts +4 -0
- package/dist/alert-dialog/header.proto.js +26 -0
- package/dist/alert-dialog/index.d.ts +13 -0
- package/dist/alert-dialog/index.js +11 -0
- package/dist/alert-dialog/mask.proto.d.ts +3 -0
- package/dist/alert-dialog/mask.proto.js +25 -0
- package/dist/alert-dialog/recipes.d.ts +60 -0
- package/dist/alert-dialog/recipes.js +61 -0
- package/dist/alert-dialog/root.proto.d.ts +4 -0
- package/dist/alert-dialog/root.proto.js +11 -0
- package/dist/alert-dialog/title.proto.d.ts +4 -0
- package/dist/alert-dialog/title.proto.js +11 -0
- package/dist/alert-dialog/trigger.proto.d.ts +4 -0
- package/dist/alert-dialog/trigger.proto.js +18 -0
- package/dist/alert-dialog/types.d.ts +38 -0
- package/dist/alert-dialog/types.js +1 -0
- package/dist/async-region/index.d.ts +2 -0
- package/dist/async-region/index.js +1 -0
- package/dist/async-region/root.proto.d.ts +4 -0
- package/dist/async-region/root.proto.js +14 -0
- package/dist/autocomplete/content.proto.d.ts +3 -0
- package/dist/autocomplete/content.proto.js +17 -0
- package/dist/autocomplete/empty.proto.d.ts +3 -0
- package/dist/autocomplete/empty.proto.js +13 -0
- package/dist/autocomplete/index.d.ts +15 -0
- package/dist/autocomplete/index.js +21 -0
- package/dist/autocomplete/input.proto.d.ts +3 -0
- package/dist/autocomplete/input.proto.js +43 -0
- package/dist/autocomplete/item.proto.d.ts +3 -0
- package/dist/autocomplete/item.proto.js +54 -0
- package/dist/autocomplete/root.proto.d.ts +3 -0
- package/dist/autocomplete/root.proto.js +13 -0
- package/dist/autocomplete/textarea.proto.d.ts +8 -0
- package/dist/autocomplete/textarea.proto.js +29 -0
- package/dist/autocomplete/trigger.proto.d.ts +3 -0
- package/dist/autocomplete/trigger.proto.js +140 -0
- package/dist/autocomplete/types.d.ts +14 -0
- package/dist/autocomplete/types.js +1 -0
- package/dist/button/button.proto.d.ts +4 -7
- package/dist/button/button.proto.js +222 -90
- package/dist/button/index.d.ts +3 -2
- package/dist/button/index.js +1 -1
- package/dist/button/new-york.d.ts +31 -0
- package/dist/button/new-york.js +31 -0
- package/dist/button/paint.d.ts +12 -0
- package/dist/button/paint.js +13 -0
- package/dist/button/profiles.d.ts +105 -0
- package/dist/button/profiles.js +190 -0
- package/dist/button/types.d.ts +10 -2
- package/dist/calendar/calendar.proto.d.ts +35 -0
- package/dist/calendar/calendar.proto.js +161 -0
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.js +1 -0
- package/dist/calendar/visual.d.ts +80 -0
- package/dist/calendar/visual.js +288 -0
- package/dist/card/content.proto.d.ts +2 -0
- package/dist/card/content.proto.js +9 -0
- package/dist/card/footer.proto.d.ts +2 -0
- package/dist/card/footer.proto.js +46 -0
- package/dist/card/header.proto.d.ts +2 -0
- package/dist/card/header.proto.js +50 -0
- package/dist/card/index.d.ts +5 -0
- package/dist/card/index.js +5 -0
- package/dist/card/root.proto.d.ts +2 -0
- package/dist/card/root.proto.js +46 -0
- package/dist/card/types.d.ts +20 -0
- package/dist/card/types.js +1 -0
- package/dist/card/visual.d.ts +14 -0
- package/dist/card/visual.js +70 -0
- package/dist/carousel/carousel.proto.d.ts +20 -0
- package/dist/carousel/carousel.proto.js +85 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/visual.d.ts +17 -0
- package/dist/carousel/visual.js +211 -0
- package/dist/checkbox/composition.d.ts +55 -0
- package/dist/checkbox/composition.js +45 -0
- package/dist/checkbox/index.d.ts +8 -6
- package/dist/checkbox/index.js +6 -5
- package/dist/checkbox/indicator.proto.d.ts +1 -1
- package/dist/checkbox/indicator.proto.js +1 -1
- package/dist/checkbox/root-visual.d.ts +4 -0
- package/dist/checkbox/root-visual.js +89 -0
- package/dist/checkbox/root.proto.d.ts +3 -8
- package/dist/checkbox/root.proto.js +8 -55
- package/dist/checkbox/types.d.ts +3 -1
- package/dist/checkbox-group/all.proto.d.ts +4 -0
- package/dist/checkbox-group/all.proto.js +27 -0
- package/dist/checkbox-group/index.d.ts +5 -0
- package/dist/checkbox-group/index.js +3 -0
- package/dist/checkbox-group/indicator-paint.d.ts +12 -0
- package/dist/checkbox-group/indicator-paint.js +101 -0
- package/dist/checkbox-group/item.proto.d.ts +4 -0
- package/dist/checkbox-group/item.proto.js +27 -0
- package/dist/checkbox-group/root.proto.d.ts +4 -0
- package/dist/checkbox-group/root.proto.js +20 -0
- package/dist/checkbox-group/types.d.ts +7 -0
- package/dist/checkbox-group/types.js +1 -0
- package/dist/collapsible/content.proto.d.ts +3 -0
- package/dist/collapsible/content.proto.js +56 -0
- package/dist/collapsible/index.d.ts +4 -0
- package/dist/collapsible/index.js +3 -0
- package/dist/collapsible/root.proto.d.ts +3 -0
- package/dist/collapsible/root.proto.js +20 -0
- package/dist/collapsible/trigger.proto.d.ts +3 -0
- package/dist/collapsible/trigger.proto.js +98 -0
- package/dist/collapsible/types.d.ts +19 -0
- package/dist/collapsible/types.js +1 -0
- package/dist/combobox/chip-remove.proto.d.ts +6 -0
- package/dist/combobox/chip-remove.proto.js +28 -0
- package/dist/combobox/chip.proto.d.ts +6 -0
- package/dist/combobox/chip.proto.js +18 -0
- package/dist/combobox/chips.proto.d.ts +6 -0
- package/dist/combobox/chips.proto.js +28 -0
- package/dist/combobox/content.proto.d.ts +3 -0
- package/dist/combobox/content.proto.js +12 -0
- package/dist/combobox/empty.proto.d.ts +3 -0
- package/dist/combobox/empty.proto.js +12 -0
- package/dist/combobox/index.d.ts +19 -0
- package/dist/combobox/index.js +23 -0
- package/dist/combobox/input.proto.d.ts +3 -0
- package/dist/combobox/input.proto.js +24 -0
- package/dist/combobox/item.proto.d.ts +3 -0
- package/dist/combobox/item.proto.js +16 -0
- package/dist/combobox/root.proto.d.ts +3 -0
- package/dist/combobox/root.proto.js +13 -0
- package/dist/combobox/trigger.proto.d.ts +3 -0
- package/dist/combobox/trigger.proto.js +16 -0
- package/dist/combobox/types.d.ts +11 -0
- package/dist/combobox/types.js +1 -0
- package/dist/combobox/visual.d.ts +18 -0
- package/dist/combobox/visual.js +234 -0
- package/dist/command/content.proto.d.ts +4 -0
- package/dist/command/content.proto.js +12 -0
- package/dist/command/dialog-content.proto.d.ts +12 -0
- package/dist/command/dialog-content.proto.js +75 -0
- package/dist/command/dialog-mask.proto.d.ts +10 -0
- package/dist/command/dialog-mask.proto.js +17 -0
- package/dist/command/empty.proto.d.ts +4 -0
- package/dist/command/empty.proto.js +16 -0
- package/dist/command/index.d.ts +18 -0
- package/dist/command/index.js +23 -0
- package/dist/command/input-wrapper.proto.d.ts +5 -0
- package/dist/command/input-wrapper.proto.js +25 -0
- package/dist/command/input.proto.d.ts +4 -0
- package/dist/command/input.proto.js +47 -0
- package/dist/command/item.proto.d.ts +4 -0
- package/dist/command/item.proto.js +28 -0
- package/dist/command/root.proto.d.ts +4 -0
- package/dist/command/root.proto.js +17 -0
- package/dist/command/types.d.ts +12 -0
- package/dist/command/types.js +1 -0
- package/dist/command/visual.d.ts +94 -0
- package/dist/command/visual.js +145 -0
- package/dist/component-presets.d.ts +4 -4
- package/dist/component-presets.js +3 -3
- package/dist/context-menu/content.proto.d.ts +3 -0
- package/dist/context-menu/content.proto.js +13 -0
- package/dist/context-menu/index.d.ts +17 -0
- package/dist/context-menu/index.js +31 -0
- package/dist/context-menu/item.proto.d.ts +3 -0
- package/dist/context-menu/item.proto.js +37 -0
- package/dist/context-menu/root.proto.d.ts +3 -0
- package/dist/context-menu/root.proto.js +12 -0
- package/dist/context-menu/trigger.proto.d.ts +3 -0
- package/dist/context-menu/trigger.proto.js +18 -0
- package/dist/context-menu/types.d.ts +10 -0
- package/dist/context-menu/types.js +1 -0
- package/dist/data-table/data-table.proto.d.ts +25 -0
- package/dist/data-table/data-table.proto.js +161 -0
- package/dist/data-table/header-row.proto.d.ts +5 -0
- package/dist/data-table/header-row.proto.js +14 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +1 -0
- package/dist/data-table/visual.d.ts +10 -0
- package/dist/data-table/visual.js +58 -0
- package/dist/date-picker/date-picker.proto.d.ts +18 -0
- package/dist/date-picker/date-picker.proto.js +186 -0
- package/dist/date-picker/index.d.ts +2 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/dialog/close-icon.proto.d.ts +2 -1
- package/dist/dialog/close-icon.proto.js +26 -4
- package/dist/dialog/close.proto.d.ts +2 -1
- package/dist/dialog/close.proto.js +4 -1
- package/dist/dialog/content.proto.d.ts +1 -1
- package/dist/dialog/content.proto.js +5 -1
- package/dist/dialog/description.proto.d.ts +2 -1
- package/dist/dialog/description.proto.js +4 -2
- package/dist/dialog/footer.proto.d.ts +2 -1
- package/dist/dialog/footer.proto.js +4 -1
- package/dist/dialog/header.proto.d.ts +2 -1
- package/dist/dialog/header.proto.js +4 -1
- package/dist/dialog/index.d.ts +22 -22
- package/dist/dialog/index.js +21 -21
- package/dist/dialog/overlay.proto.d.ts +1 -1
- package/dist/dialog/overlay.proto.js +8 -2
- package/dist/dialog/recipes.d.ts +71 -0
- package/dist/dialog/recipes.js +75 -0
- package/dist/dialog/root.proto.d.ts +2 -1
- package/dist/dialog/root.proto.js +2 -0
- package/dist/dialog/style.d.ts +17 -0
- package/dist/dialog/style.js +84 -0
- package/dist/dialog/title.proto.d.ts +2 -1
- package/dist/dialog/title.proto.js +4 -2
- package/dist/dialog/trigger.proto.d.ts +2 -1
- package/dist/dialog/trigger.proto.js +3 -1
- package/dist/dialog/types.d.ts +8 -7
- package/dist/drawer/close.proto.d.ts +4 -0
- package/dist/drawer/close.proto.js +15 -0
- package/dist/drawer/command-paint.d.ts +13 -0
- package/dist/drawer/command-paint.js +37 -0
- package/dist/drawer/content.proto.d.ts +4 -0
- package/dist/drawer/content.proto.js +92 -0
- package/dist/drawer/description.proto.d.ts +4 -0
- package/dist/drawer/description.proto.js +11 -0
- package/dist/drawer/footer.proto.d.ts +4 -0
- package/dist/drawer/footer.proto.js +13 -0
- package/dist/drawer/handle.proto.d.ts +4 -0
- package/dist/drawer/handle.proto.js +38 -0
- package/dist/drawer/header.proto.d.ts +4 -0
- package/dist/drawer/header.proto.js +25 -0
- package/dist/drawer/index.d.ts +15 -0
- package/dist/drawer/index.js +11 -0
- package/dist/drawer/mask.proto.d.ts +3 -0
- package/dist/drawer/mask.proto.js +21 -0
- package/dist/drawer/recipes.d.ts +68 -0
- package/dist/drawer/recipes.js +73 -0
- package/dist/drawer/root.proto.d.ts +4 -0
- package/dist/drawer/root.proto.js +11 -0
- package/dist/drawer/title.proto.d.ts +4 -0
- package/dist/drawer/title.proto.js +11 -0
- package/dist/drawer/trigger.proto.d.ts +4 -0
- package/dist/drawer/trigger.proto.js +15 -0
- package/dist/drawer/types.d.ts +17 -0
- package/dist/drawer/types.js +1 -0
- package/dist/dropdown/content.proto.d.ts +2 -1
- package/dist/dropdown/content.proto.js +6 -30
- package/dist/dropdown/group.proto.d.ts +4 -0
- package/dist/dropdown/group.proto.js +11 -0
- package/dist/dropdown/index.d.ts +21 -9
- package/dist/dropdown/index.js +32 -8
- package/dist/dropdown/item.proto.d.ts +1 -1
- package/dist/dropdown/item.proto.js +4 -38
- package/dist/dropdown/label.proto.d.ts +3 -0
- package/dist/dropdown/label.proto.js +30 -0
- package/dist/dropdown/root.proto.d.ts +2 -1
- package/dist/dropdown/root.proto.js +5 -0
- package/dist/dropdown/separator.proto.d.ts +4 -0
- package/dist/dropdown/separator.proto.js +19 -0
- package/dist/dropdown/shortcut.proto.d.ts +4 -0
- package/dist/dropdown/shortcut.proto.js +29 -0
- package/dist/dropdown/trigger.proto.d.ts +1 -1
- package/dist/dropdown/trigger.proto.js +27 -33
- package/dist/dropdown/types.d.ts +12 -5
- package/dist/dropdown/visual.d.ts +97 -0
- package/dist/dropdown/visual.js +219 -0
- package/dist/field/checkbox.proto.d.ts +6 -0
- package/dist/field/checkbox.proto.js +14 -0
- package/dist/field/control.proto.d.ts +4 -0
- package/dist/field/control.proto.js +15 -0
- package/dist/field/description.proto.d.ts +4 -0
- package/dist/field/description.proto.js +12 -0
- package/dist/field/error.proto.d.ts +4 -0
- package/dist/field/error.proto.js +12 -0
- package/dist/field/index.d.ts +18 -0
- package/dist/field/index.js +11 -0
- package/dist/field/label.proto.d.ts +4 -0
- package/dist/field/label.proto.js +12 -0
- package/dist/field/radio-group.proto.d.ts +6 -0
- package/dist/field/radio-group.proto.js +11 -0
- package/dist/field/root.proto.d.ts +4 -0
- package/dist/field/root.proto.js +24 -0
- package/dist/field/select-trigger.proto.d.ts +7 -0
- package/dist/field/select-trigger.proto.js +15 -0
- package/dist/field/switch.proto.d.ts +6 -0
- package/dist/field/switch.proto.js +15 -0
- package/dist/field/textarea.proto.d.ts +7 -0
- package/dist/field/textarea.proto.js +16 -0
- package/dist/field/types.d.ts +11 -0
- package/dist/field/types.js +1 -0
- package/dist/field/validity.proto.d.ts +4 -0
- package/dist/field/validity.proto.js +12 -0
- package/dist/field/visual.d.ts +6 -0
- package/dist/field/visual.js +68 -0
- package/dist/fieldset/description.proto.d.ts +4 -0
- package/dist/fieldset/description.proto.js +12 -0
- package/dist/fieldset/index.d.ts +5 -0
- package/dist/fieldset/index.js +3 -0
- package/dist/fieldset/legend.proto.d.ts +5 -0
- package/dist/fieldset/legend.proto.js +51 -0
- package/dist/fieldset/root.proto.d.ts +4 -0
- package/dist/fieldset/root.proto.js +23 -0
- package/dist/fieldset/types.d.ts +8 -0
- package/dist/fieldset/types.js +1 -0
- package/dist/form/action-visual.d.ts +8 -0
- package/dist/form/action-visual.js +200 -0
- package/dist/form/field.proto.d.ts +4 -0
- package/dist/form/field.proto.js +16 -0
- package/dist/form/index.d.ts +6 -0
- package/dist/form/index.js +4 -0
- package/dist/form/reset.proto.d.ts +4 -0
- package/dist/form/reset.proto.js +12 -0
- package/dist/form/root.proto.d.ts +4 -0
- package/dist/form/root.proto.js +20 -0
- package/dist/form/submit.proto.d.ts +4 -0
- package/dist/form/submit.proto.js +12 -0
- package/dist/form/types.d.ts +10 -0
- package/dist/form/types.js +1 -0
- package/dist/hover-card/content.proto.d.ts +2 -1
- package/dist/hover-card/content.proto.js +15 -19
- package/dist/hover-card/index.d.ts +7 -7
- package/dist/hover-card/index.js +6 -6
- package/dist/hover-card/recipes.d.ts +17 -0
- package/dist/hover-card/recipes.js +20 -0
- package/dist/hover-card/root.proto.d.ts +2 -1
- package/dist/hover-card/root.proto.js +2 -0
- package/dist/hover-card/trigger.proto.d.ts +2 -1
- package/dist/hover-card/trigger.proto.js +7 -3
- package/dist/hover-card/types.d.ts +4 -3
- package/dist/image/index.d.ts +3 -0
- package/dist/image/index.js +1 -0
- package/dist/image/root.proto.d.ts +10 -0
- package/dist/image/root.proto.js +57 -0
- package/dist/index.d.ts +113 -59
- package/dist/index.js +92 -46
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +1 -0
- package/dist/input/root.proto.d.ts +3 -0
- package/dist/input/root.proto.js +19 -0
- package/dist/input/types.d.ts +4 -0
- package/dist/input/types.js +1 -0
- package/dist/input/visual.d.ts +7 -0
- package/dist/input/visual.js +131 -0
- package/dist/input-otp/control.proto.d.ts +4 -0
- package/dist/input-otp/control.proto.js +20 -0
- package/dist/input-otp/index.d.ts +7 -0
- package/dist/input-otp/index.js +5 -0
- package/dist/input-otp/input.proto.d.ts +5 -0
- package/dist/input-otp/input.proto.js +31 -0
- package/dist/input-otp/root.proto.d.ts +4 -0
- package/dist/input-otp/root.proto.js +40 -0
- package/dist/input-otp/separator.proto.d.ts +3 -0
- package/dist/input-otp/separator.proto.js +14 -0
- package/dist/input-otp/slot.proto.d.ts +4 -0
- package/dist/input-otp/slot.proto.js +165 -0
- package/dist/input-otp/types.d.ts +16 -0
- package/dist/input-otp/types.js +1 -0
- package/dist/input-otp/visual.d.ts +6 -0
- package/dist/input-otp/visual.js +3 -0
- package/dist/input-shell/bind-control.d.ts +28 -0
- package/dist/input-shell/bind-control.js +235 -0
- package/dist/input-shell/context.d.ts +6 -0
- package/dist/input-shell/context.js +12 -0
- package/dist/input-shell/control.proto.d.ts +4 -0
- package/dist/input-shell/control.proto.js +16 -0
- package/dist/input-shell/index.d.ts +5 -0
- package/dist/input-shell/index.js +3 -0
- package/dist/input-shell/root.proto.d.ts +4 -0
- package/dist/input-shell/root.proto.js +26 -0
- package/dist/input-shell/types.d.ts +14 -0
- package/dist/input-shell/types.js +1 -0
- package/dist/input-shell/visual.d.ts +4 -0
- package/dist/input-shell/visual.js +166 -0
- package/dist/label/index.d.ts +3 -0
- package/dist/label/index.js +1 -0
- package/dist/label/root.proto.d.ts +5 -0
- package/dist/label/root.proto.js +32 -0
- package/dist/live-region/index.d.ts +2 -0
- package/dist/live-region/index.js +1 -0
- package/dist/live-region/root.proto.d.ts +4 -0
- package/dist/live-region/root.proto.js +14 -0
- package/dist/menu-extensions.d.ts +49 -0
- package/dist/menu-extensions.js +156 -0
- package/dist/menubar/content.proto.d.ts +3 -0
- package/dist/menubar/content.proto.js +13 -0
- package/dist/menubar/index.d.ts +17 -0
- package/dist/menubar/index.js +31 -0
- package/dist/menubar/item.proto.d.ts +3 -0
- package/dist/menubar/item.proto.js +16 -0
- package/dist/menubar/root.proto.d.ts +3 -0
- package/dist/menubar/root.proto.js +12 -0
- package/dist/menubar/trigger.proto.d.ts +3 -0
- package/dist/menubar/trigger.proto.js +17 -0
- package/dist/menubar/types.d.ts +10 -0
- package/dist/menubar/types.js +1 -0
- package/dist/menubar/visual.d.ts +9 -0
- package/dist/menubar/visual.js +83 -0
- package/dist/message-scroller/index.d.ts +1 -0
- package/dist/message-scroller/index.js +1 -0
- package/dist/message-scroller/message-scroller.proto.d.ts +16 -0
- package/dist/message-scroller/message-scroller.proto.js +64 -0
- package/dist/message-scroller/visual.d.ts +14 -0
- package/dist/message-scroller/visual.js +87 -0
- package/dist/meter/index.d.ts +7 -0
- package/dist/meter/index.js +5 -0
- package/dist/meter/indicator.proto.d.ts +3 -0
- package/dist/meter/indicator.proto.js +26 -0
- package/dist/meter/label.proto.d.ts +3 -0
- package/dist/meter/label.proto.js +12 -0
- package/dist/meter/root.proto.d.ts +4 -0
- package/dist/meter/root.proto.js +13 -0
- package/dist/meter/track.proto.d.ts +3 -0
- package/dist/meter/track.proto.js +12 -0
- package/dist/meter/types.d.ts +4 -0
- package/dist/meter/types.js +1 -0
- package/dist/meter/value.proto.d.ts +3 -0
- package/dist/meter/value.proto.js +12 -0
- package/dist/meter/visual.d.ts +6 -0
- package/dist/meter/visual.js +64 -0
- package/dist/navigation-menu/content.proto.d.ts +3 -0
- package/dist/navigation-menu/content.proto.js +13 -0
- package/dist/navigation-menu/index.d.ts +7 -0
- package/dist/navigation-menu/index.js +6 -0
- package/dist/navigation-menu/item.proto.d.ts +3 -0
- package/dist/navigation-menu/item.proto.js +18 -0
- package/dist/navigation-menu/link.proto.d.ts +3 -0
- package/dist/navigation-menu/link.proto.js +16 -0
- package/dist/navigation-menu/root.proto.d.ts +3 -0
- package/dist/navigation-menu/root.proto.js +15 -0
- package/dist/navigation-menu/trigger.proto.d.ts +3 -0
- package/dist/navigation-menu/trigger.proto.js +17 -0
- package/dist/navigation-menu/types.d.ts +8 -0
- package/dist/navigation-menu/types.js +1 -0
- package/dist/navigation-menu/visual.d.ts +15 -0
- package/dist/navigation-menu/visual.js +184 -0
- package/dist/number-field/control.proto.d.ts +4 -0
- package/dist/number-field/control.proto.js +21 -0
- package/dist/number-field/decrement.proto.d.ts +4 -0
- package/dist/number-field/decrement.proto.js +12 -0
- package/dist/number-field/increment.proto.d.ts +4 -0
- package/dist/number-field/increment.proto.js +12 -0
- package/dist/number-field/index.d.ts +8 -0
- package/dist/number-field/index.js +6 -0
- package/dist/number-field/input.proto.d.ts +5 -0
- package/dist/number-field/input.proto.js +23 -0
- package/dist/number-field/label.proto.d.ts +4 -0
- package/dist/number-field/label.proto.js +13 -0
- package/dist/number-field/root.proto.d.ts +4 -0
- package/dist/number-field/root.proto.js +14 -0
- package/dist/number-field/step-visual.d.ts +6 -0
- package/dist/number-field/step-visual.js +115 -0
- package/dist/number-field/types.d.ts +4 -0
- package/dist/number-field/types.js +1 -0
- package/dist/popover/close.proto.d.ts +4 -0
- package/dist/popover/close.proto.js +18 -0
- package/dist/popover/command-paint.d.ts +13 -0
- package/dist/popover/command-paint.js +127 -0
- package/dist/popover/content.proto.d.ts +4 -0
- package/dist/popover/content.proto.js +84 -0
- package/dist/popover/description.proto.d.ts +4 -0
- package/dist/popover/description.proto.js +13 -0
- package/dist/popover/index.d.ts +9 -0
- package/dist/popover/index.js +7 -0
- package/dist/popover/motion.d.ts +13 -0
- package/dist/popover/motion.js +33 -0
- package/dist/popover/recipes.d.ts +47 -0
- package/dist/popover/recipes.js +48 -0
- package/dist/popover/root.proto.d.ts +4 -0
- package/dist/popover/root.proto.js +13 -0
- package/dist/popover/title.proto.d.ts +4 -0
- package/dist/popover/title.proto.js +13 -0
- package/dist/popover/trigger.proto.d.ts +4 -0
- package/dist/popover/trigger.proto.js +24 -0
- package/dist/popover/types.d.ts +13 -0
- package/dist/popover/types.js +1 -0
- package/dist/progress/index.d.ts +7 -0
- package/dist/progress/index.js +5 -0
- package/dist/progress/indicator.proto.d.ts +3 -0
- package/dist/progress/indicator.proto.js +26 -0
- package/dist/progress/label.proto.d.ts +3 -0
- package/dist/progress/label.proto.js +12 -0
- package/dist/progress/root.proto.d.ts +4 -0
- package/dist/progress/root.proto.js +24 -0
- package/dist/progress/track.proto.d.ts +3 -0
- package/dist/progress/track.proto.js +12 -0
- package/dist/progress/types.d.ts +7 -0
- package/dist/progress/types.js +1 -0
- package/dist/progress/value.proto.d.ts +3 -0
- package/dist/progress/value.proto.js +12 -0
- package/dist/progress/visual.d.ts +6 -0
- package/dist/progress/visual.js +64 -0
- package/dist/radio-group/index.d.ts +4 -0
- package/dist/radio-group/index.js +3 -0
- package/dist/radio-group/indicator.proto.d.ts +3 -0
- package/dist/radio-group/indicator.proto.js +86 -0
- package/dist/radio-group/item.proto.d.ts +3 -0
- package/dist/radio-group/item.proto.js +92 -0
- package/dist/radio-group/root-visual.d.ts +3 -0
- package/dist/radio-group/root-visual.js +28 -0
- package/dist/radio-group/root.proto.d.ts +3 -0
- package/dist/radio-group/root.proto.js +11 -0
- package/dist/radio-group/types.d.ts +17 -0
- package/dist/radio-group/types.js +1 -0
- package/dist/radio-group/visual.d.ts +4 -0
- package/dist/radio-group/visual.js +4 -0
- package/dist/resizable/index.d.ts +1 -0
- package/dist/resizable/index.js +1 -0
- package/dist/resizable/resizable.proto.d.ts +15 -0
- package/dist/resizable/resizable.proto.js +161 -0
- package/dist/scroll-area/index.d.ts +5 -5
- package/dist/scroll-area/index.js +4 -4
- package/dist/scroll-area/root.proto.d.ts +2 -1
- package/dist/scroll-area/root.proto.js +5 -1
- package/dist/scroll-area/scrollbar.proto.d.ts +2 -1
- package/dist/scroll-area/scrollbar.proto.js +15 -4
- package/dist/scroll-area/thumb.proto.d.ts +2 -1
- package/dist/scroll-area/thumb.proto.js +23 -2
- package/dist/scroll-area/types.d.ts +5 -4
- package/dist/scroll-area/viewport.proto.d.ts +2 -1
- package/dist/scroll-area/viewport.proto.js +12 -4
- package/dist/search-extensions.d.ts +18 -0
- package/dist/search-extensions.js +50 -0
- package/dist/select/content.proto.d.ts +1 -2
- package/dist/select/content.proto.js +86 -22
- package/dist/select/group.proto.d.ts +2 -0
- package/dist/select/group.proto.js +17 -0
- package/dist/select/index.d.ts +21 -11
- package/dist/select/index.js +16 -10
- package/dist/select/item-text.proto.d.ts +2 -0
- package/dist/select/item-text.proto.js +15 -0
- package/dist/select/item.proto.d.ts +2 -1
- package/dist/select/item.proto.js +55 -9
- package/dist/select/label.proto.d.ts +2 -0
- package/dist/select/label.proto.js +21 -0
- package/dist/select/recipes.d.ts +56 -0
- package/dist/select/recipes.js +191 -0
- package/dist/select/root.proto.d.ts +2 -1
- package/dist/select/root.proto.js +3 -1
- package/dist/select/separator.proto.d.ts +2 -0
- package/dist/select/separator.proto.js +22 -0
- package/dist/select/style.d.ts +6 -0
- package/dist/select/style.js +32 -0
- package/dist/select/surface.proto.d.ts +2 -0
- package/dist/select/surface.proto.js +14 -0
- package/dist/select/trigger-visual.d.ts +4 -0
- package/dist/select/trigger-visual.js +201 -0
- package/dist/select/trigger.proto.d.ts +3 -4
- package/dist/select/trigger.proto.js +6 -60
- package/dist/select/types.d.ts +18 -5
- package/dist/select/value.proto.d.ts +2 -1
- package/dist/select/value.proto.js +17 -5
- package/dist/select/viewport.proto.d.ts +2 -0
- package/dist/select/viewport.proto.js +31 -0
- package/dist/select/visual.d.ts +9 -0
- package/dist/select/visual.js +94 -0
- package/dist/separator/index.d.ts +2 -2
- package/dist/separator/index.js +1 -1
- package/dist/separator/root.proto.d.ts +2 -2
- package/dist/separator/root.proto.js +9 -2
- package/dist/separator/types.d.ts +2 -1
- package/dist/slider/field-thumb.proto.d.ts +4 -0
- package/dist/slider/field-thumb.proto.js +41 -0
- package/dist/slider/index.d.ts +17 -0
- package/dist/slider/index.js +13 -0
- package/dist/slider/indicator.proto.d.ts +4 -0
- package/dist/slider/indicator.proto.js +32 -0
- package/dist/slider/label.proto.d.ts +4 -0
- package/dist/slider/label.proto.js +29 -0
- package/dist/slider/paint.d.ts +13 -0
- package/dist/slider/paint.js +39 -0
- package/dist/slider/root.proto.d.ts +4 -0
- package/dist/slider/root.proto.js +27 -0
- package/dist/slider/scalar-visual.d.ts +28 -0
- package/dist/slider/scalar-visual.js +128 -0
- package/dist/slider/thumb.proto.d.ts +4 -0
- package/dist/slider/thumb.proto.js +41 -0
- package/dist/slider/track.proto.d.ts +4 -0
- package/dist/slider/track.proto.js +56 -0
- package/dist/slider/value.proto.d.ts +4 -0
- package/dist/slider/value.proto.js +25 -0
- package/dist/slider/values-indicator.proto.d.ts +4 -0
- package/dist/slider/values-indicator.proto.js +31 -0
- package/dist/slider/values-label.proto.d.ts +3 -0
- package/dist/slider/values-label.proto.js +11 -0
- package/dist/slider/values-root.proto.d.ts +5 -0
- package/dist/slider/values-root.proto.js +16 -0
- package/dist/slider/values-thumb.proto.d.ts +4 -0
- package/dist/slider/values-thumb.proto.js +70 -0
- package/dist/slider/values-track.proto.d.ts +4 -0
- package/dist/slider/values-track.proto.js +50 -0
- package/dist/slider/values-value.proto.d.ts +3 -0
- package/dist/slider/values-value.proto.js +11 -0
- package/dist/slider/values-visual.d.ts +19 -0
- package/dist/slider/values-visual.js +147 -0
- package/dist/style-scope/context.d.ts +12 -0
- package/dist/style-scope/context.js +16 -0
- package/dist/style-scope/ids.d.ts +3 -0
- package/dist/style-scope/ids.js +12 -0
- package/dist/style-scope/index.d.ts +5 -0
- package/dist/style-scope/index.js +4 -0
- package/dist/style-scope/root.proto.d.ts +4 -0
- package/dist/style-scope/root.proto.js +8 -0
- package/dist/style-scope/selection.d.ts +8 -0
- package/dist/style-scope/selection.js +59 -0
- package/dist/surface/action-appearance.d.ts +20 -0
- package/dist/surface/action-appearance.js +78 -0
- package/dist/surface/index.d.ts +4 -0
- package/dist/surface/index.js +2 -0
- package/dist/surface/root.proto.d.ts +8 -0
- package/dist/surface/root.proto.js +206 -0
- package/dist/switch/hit-lease.d.ts +5 -0
- package/dist/switch/hit-lease.js +33 -0
- package/dist/switch/index.d.ts +6 -6
- package/dist/switch/index.js +5 -5
- package/dist/switch/root-visual.d.ts +6 -0
- package/dist/switch/root-visual.js +242 -0
- package/dist/switch/root.proto.d.ts +3 -8
- package/dist/switch/root.proto.js +10 -71
- package/dist/switch/thumb.proto.d.ts +1 -6
- package/dist/switch/thumb.proto.js +197 -32
- package/dist/switch/types.d.ts +10 -2
- package/dist/switch/visual.d.ts +7 -0
- package/dist/switch/visual.js +8 -0
- package/dist/table/caption.proto.d.ts +2 -0
- package/dist/table/caption.proto.js +15 -0
- package/dist/table/cell.proto.d.ts +3 -0
- package/dist/table/cell.proto.js +14 -0
- package/dist/table/header-cell.proto.d.ts +3 -0
- package/dist/table/header-cell.proto.js +17 -0
- package/dist/table/index.d.ts +7 -0
- package/dist/table/index.js +5 -0
- package/dist/table/root.proto.d.ts +2 -0
- package/dist/table/root.proto.js +20 -0
- package/dist/table/row.proto.d.ts +3 -0
- package/dist/table/row.proto.js +61 -0
- package/dist/table/types.d.ts +31 -0
- package/dist/table/types.js +1 -0
- package/dist/table/visual.d.ts +6 -0
- package/dist/table/visual.js +48 -0
- package/dist/tabs/content.proto.d.ts +1 -2
- package/dist/tabs/content.proto.js +13 -10
- package/dist/tabs/index.d.ts +14 -10
- package/dist/tabs/index.js +13 -9
- package/dist/tabs/indicator.proto.d.ts +3 -0
- package/dist/tabs/indicator.proto.js +20 -0
- package/dist/tabs/list.proto.d.ts +1 -2
- package/dist/tabs/list.proto.js +86 -4
- package/dist/tabs/root.proto.d.ts +1 -2
- package/dist/tabs/root.proto.js +12 -4
- package/dist/tabs/trigger.proto.d.ts +1 -2
- package/dist/tabs/trigger.proto.js +136 -37
- package/dist/tabs/types.d.ts +13 -5
- package/dist/tabs/visual.d.ts +59 -0
- package/dist/tabs/visual.js +147 -0
- package/dist/text/index.d.ts +4 -0
- package/dist/text/index.js +2 -0
- package/dist/text/root.proto.d.ts +8 -0
- package/dist/text/root.proto.js +180 -0
- package/dist/text/typography.d.ts +4 -0
- package/dist/text/typography.js +11 -0
- package/dist/textarea/index.d.ts +2 -2
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/root.proto.d.ts +2 -1
- package/dist/textarea/root.proto.js +8 -47
- package/dist/textarea/types.d.ts +2 -1
- package/dist/textarea/visual.d.ts +6 -0
- package/dist/textarea/visual.js +103 -0
- package/dist/toast/action.proto.d.ts +4 -0
- package/dist/toast/action.proto.js +37 -0
- package/dist/toast/close.proto.d.ts +4 -0
- package/dist/toast/close.proto.js +36 -0
- package/dist/toast/description.proto.d.ts +4 -0
- package/dist/toast/description.proto.js +12 -0
- package/dist/toast/index.d.ts +9 -0
- package/dist/toast/index.js +7 -0
- package/dist/toast/recipes.d.ts +71 -0
- package/dist/toast/recipes.js +72 -0
- package/dist/toast/root.proto.d.ts +4 -0
- package/dist/toast/root.proto.js +168 -0
- package/dist/toast/title.proto.d.ts +4 -0
- package/dist/toast/title.proto.js +12 -0
- package/dist/toast/types.d.ts +11 -0
- package/dist/toast/types.js +1 -0
- package/dist/toast/viewport.proto.d.ts +4 -0
- package/dist/toast/viewport.proto.js +51 -0
- package/dist/toggle/index.d.ts +2 -2
- package/dist/toggle/index.js +1 -1
- package/dist/toggle/profiles.d.ts +72 -0
- package/dist/toggle/profiles.js +73 -0
- package/dist/toggle/toggle.proto.d.ts +5 -8
- package/dist/toggle/toggle.proto.js +54 -43
- package/dist/toggle/types.d.ts +6 -3
- package/dist/toggle-group/index.d.ts +6 -0
- package/dist/toggle-group/index.js +3 -0
- package/dist/toggle-group/item.proto.d.ts +8 -0
- package/dist/toggle-group/item.proto.js +224 -0
- package/dist/toggle-group/root.proto.d.ts +8 -0
- package/dist/toggle-group/root.proto.js +112 -0
- package/dist/toggle-group/types.d.ts +16 -0
- package/dist/toggle-group/types.js +1 -0
- package/dist/toggle-group/visual.d.ts +10 -0
- package/dist/toggle-group/visual.js +3 -0
- package/dist/toolbar/action-visual.d.ts +12 -0
- package/dist/toolbar/action-visual.js +164 -0
- package/dist/toolbar/button.proto.d.ts +3 -0
- package/dist/toolbar/button.proto.js +259 -0
- package/dist/toolbar/index.d.ts +7 -0
- package/dist/toolbar/index.js +4 -0
- package/dist/toolbar/root.proto.d.ts +3 -0
- package/dist/toolbar/root.proto.js +83 -0
- package/dist/toolbar/separator.proto.d.ts +3 -0
- package/dist/toolbar/separator.proto.js +32 -0
- package/dist/toolbar/types.d.ts +16 -0
- package/dist/toolbar/types.js +1 -0
- package/dist/tooltip/content.proto.d.ts +2 -1
- package/dist/tooltip/content.proto.js +13 -14
- package/dist/tooltip/group.proto.d.ts +2 -1
- package/dist/tooltip/group.proto.js +2 -0
- package/dist/tooltip/index.d.ts +5 -5
- package/dist/tooltip/index.js +4 -4
- package/dist/tooltip/recipes.d.ts +17 -0
- package/dist/tooltip/recipes.js +18 -0
- package/dist/tooltip/root.proto.d.ts +2 -1
- package/dist/tooltip/root.proto.js +3 -1
- package/dist/tooltip/trigger.proto.d.ts +2 -1
- package/dist/tooltip/trigger.proto.js +10 -0
- package/dist/tooltip/types.d.ts +5 -4
- package/dist/transition/index.d.ts +2 -0
- package/dist/transition/index.js +1 -0
- package/dist/transition/transition.proto.d.ts +8 -0
- package/dist/transition/transition.proto.js +26 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +1 -0
- package/dist/tree/tree.proto.d.ts +24 -0
- package/dist/tree/tree.proto.js +307 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +1 -0
- package/dist/virtual-list/virtual-list.proto.d.ts +16 -0
- package/dist/virtual-list/virtual-list.proto.js +104 -0
- package/package.json +375 -5
- package/src/button/button.proto.ts +477 -0
- package/src/button/index.ts +8 -0
- package/src/button/new-york.ts +32 -0
- package/src/button/paint.ts +16 -0
- package/src/button/profiles.ts +222 -0
- package/src/button/types.ts +36 -0
- package/src/checkbox/composition.ts +57 -0
- package/src/checkbox/index.ts +24 -0
- package/src/checkbox/indicator.proto.ts +99 -0
- package/src/checkbox/preset.ts +18 -0
- package/src/checkbox/root-visual.ts +115 -0
- package/src/checkbox/root.proto.ts +14 -0
- package/src/checkbox/types.ts +28 -0
- package/src/collapsible/content.proto.ts +70 -0
- package/src/collapsible/index.ts +20 -0
- package/src/collapsible/root.proto.ts +23 -0
- package/src/collapsible/trigger.proto.ts +132 -0
- package/src/collapsible/types.ts +33 -0
- package/src/component-presets.types.ts +10 -0
- package/src/data-table/data-table.proto.ts +220 -0
- package/src/data-table/header-row.proto.ts +24 -0
- package/src/data-table/index.ts +11 -0
- package/src/data-table/visual.ts +79 -0
- package/src/dialog/close-icon.proto.ts +77 -0
- package/src/dialog/close.proto.ts +19 -0
- package/src/dialog/content.proto.ts +40 -0
- package/src/dialog/description.proto.ts +22 -0
- package/src/dialog/footer.proto.ts +17 -0
- package/src/dialog/header.proto.ts +17 -0
- package/src/dialog/index.ts +59 -0
- package/src/dialog/overlay.proto.ts +38 -0
- package/src/dialog/preset.ts +18 -0
- package/src/dialog/recipes.ts +118 -0
- package/src/dialog/root.proto.ts +19 -0
- package/src/dialog/style.ts +122 -0
- package/src/dialog/title.proto.ts +19 -0
- package/src/dialog/trigger.proto.ts +19 -0
- package/src/dialog/types.ts +56 -0
- package/src/drawer/close.proto.ts +18 -0
- package/src/drawer/command-paint.ts +59 -0
- package/src/drawer/content.proto.ts +96 -0
- package/src/drawer/description.proto.ts +16 -0
- package/src/drawer/footer.proto.ts +15 -0
- package/src/drawer/handle.proto.ts +48 -0
- package/src/drawer/header.proto.ts +31 -0
- package/src/drawer/index.ts +38 -0
- package/src/drawer/mask.proto.ts +23 -0
- package/src/drawer/recipes.ts +86 -0
- package/src/drawer/root.proto.ts +13 -0
- package/src/drawer/title.proto.ts +13 -0
- package/src/drawer/trigger.proto.ts +18 -0
- package/src/drawer/types.ts +25 -0
- package/src/field/visual.ts +93 -0
- package/src/input/index.ts +6 -0
- package/src/input/root.proto.ts +24 -0
- package/src/input/types.ts +5 -0
- package/src/input/visual.ts +169 -0
- package/src/label/index.ts +3 -0
- package/src/label/root.proto.ts +43 -0
- package/src/message-scroller/index.ts +1 -0
- package/src/message-scroller/message-scroller.proto.ts +124 -0
- package/src/message-scroller/visual.ts +155 -0
- package/src/number-field/control.proto.ts +24 -0
- package/src/number-field/decrement.proto.ts +15 -0
- package/src/number-field/increment.proto.ts +15 -0
- package/src/number-field/index.ts +8 -0
- package/src/number-field/input.proto.ts +26 -0
- package/src/number-field/label.proto.ts +15 -0
- package/src/number-field/root.proto.ts +16 -0
- package/src/number-field/step-visual.ts +137 -0
- package/src/number-field/types.ts +7 -0
- package/src/scroll-area/index.ts +28 -0
- package/src/scroll-area/root.proto.ts +17 -0
- package/src/scroll-area/scrollbar.proto.ts +53 -0
- package/src/scroll-area/thumb.proto.ts +34 -0
- package/src/scroll-area/types.ts +36 -0
- package/src/scroll-area/viewport.proto.ts +41 -0
- package/src/select/content.proto.ts +163 -0
- package/src/select/group.proto.ts +19 -0
- package/src/select/index.ts +59 -0
- package/src/select/item-text.proto.ts +18 -0
- package/src/select/item.proto.ts +136 -0
- package/src/select/label.proto.ts +23 -0
- package/src/select/recipes.ts +235 -0
- package/src/select/root.proto.ts +17 -0
- package/src/select/separator.proto.ts +24 -0
- package/src/select/style.ts +43 -0
- package/src/select/surface.proto.ts +17 -0
- package/src/select/trigger-visual.ts +321 -0
- package/src/select/trigger.proto.ts +12 -0
- package/src/select/types.ts +73 -0
- package/src/select/value.proto.ts +31 -0
- package/src/select/viewport.proto.ts +42 -0
- package/src/select/visual.ts +127 -0
- package/src/separator/index.ts +7 -0
- package/src/separator/root.proto.ts +61 -0
- package/src/separator/types.ts +15 -0
- package/src/style-scope/context.ts +19 -0
- package/src/style-scope/ids.ts +13 -0
- package/src/style-scope/index.ts +5 -0
- package/src/style-scope/root.proto.ts +10 -0
- package/src/style-scope/selection.ts +82 -0
- package/src/switch/hit-lease.ts +29 -0
- package/src/switch/index.ts +18 -0
- package/src/switch/preset.ts +18 -0
- package/src/switch/root-visual.ts +302 -0
- package/src/switch/root.proto.ts +15 -0
- package/src/switch/thumb.proto.ts +261 -0
- package/src/switch/types.ts +36 -0
- package/src/switch/visual.ts +15 -0
- package/src/tabs/content.proto.ts +26 -0
- package/src/tabs/index.ts +34 -0
- package/src/tabs/indicator.proto.ts +21 -0
- package/src/tabs/list.proto.ts +129 -0
- package/src/tabs/root.proto.ts +22 -0
- package/src/tabs/trigger.proto.ts +220 -0
- package/src/tabs/types.ts +45 -0
- package/src/tabs/visual.ts +184 -0
- package/src/textarea/index.ts +6 -0
- package/src/textarea/root.proto.ts +19 -0
- package/src/textarea/types.ts +6 -0
- package/src/textarea/visual.ts +144 -0
- package/src/toggle/index.ts +7 -0
- package/src/toggle/profiles.ts +76 -0
- package/src/toggle/toggle.proto.ts +128 -0
- package/src/toggle/types.ts +21 -0
- package/src/toggle-group/index.ts +12 -0
- package/src/toggle-group/item.proto.ts +328 -0
- package/src/toggle-group/root.proto.ts +128 -0
- package/src/toggle-group/types.ts +25 -0
- package/src/toggle-group/visual.ts +15 -0
- package/src/toolbar/action-visual.ts +229 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { definePrototype, tw } from '@proto.ui/core';
|
|
2
|
+
import { asSurfaceRoot, } from '@proto.ui/prototypes-base/surface';
|
|
3
|
+
import { SHADCN_ACTION_RADIUS, SHADCN_MODERN_ACTION_STYLES, SHADCN_ACTION_FOCUS, SHADCN_SECONDARY_HOVER, } from "../button/profiles.js";
|
|
4
|
+
import { SHADCN_STYLE_IDS } from "../style-scope/index.js";
|
|
5
|
+
export const ShadcnSurfaceRoot = definePrototype({
|
|
6
|
+
name: 'shadcn-surface-root',
|
|
7
|
+
setup(def) {
|
|
8
|
+
const inherited = asSurfaceRoot();
|
|
9
|
+
def.props.define({
|
|
10
|
+
actionProfile: {
|
|
11
|
+
type: 'enum',
|
|
12
|
+
empty: 'fallback',
|
|
13
|
+
options: ['none', ...SHADCN_STYLE_IDS, 'new-york'],
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
def.props.setDefaults({ actionProfile: 'none' });
|
|
17
|
+
def.rule({
|
|
18
|
+
when: (w) => w.all(w.not(w.prop('actionProfile').eq('none')), w.prop('fade').eq(false), w.meta('preference.reducedMotion').eq('no-preference')),
|
|
19
|
+
intent: (i) => i.feedback.style.use(tw('transition-[color,background-color,border-color,box-shadow,transform,opacity]')),
|
|
20
|
+
});
|
|
21
|
+
def.rule({
|
|
22
|
+
when: (w) => w.all(w.not(w.prop('actionProfile').eq('none')), w.prop('fade').eq(false), w.not(w.meta('preference.reducedMotion').eq('no-preference'))),
|
|
23
|
+
intent: (i) => i.feedback.style.use(tw('transition-none')),
|
|
24
|
+
});
|
|
25
|
+
def.rule({
|
|
26
|
+
when: (w) => w.prop('variant').eq('scrim'),
|
|
27
|
+
intent: (i) => i.feedback.style.use(tw('bg-black/80')),
|
|
28
|
+
});
|
|
29
|
+
def.rule({
|
|
30
|
+
when: (w) => w.prop('fade').eq(true),
|
|
31
|
+
intent: (i) => i.feedback.style.use(tw('surface-fade')),
|
|
32
|
+
});
|
|
33
|
+
def.rule({
|
|
34
|
+
when: (w) => w.all(w.prop('fade').eq(true), w.any(w.prop('transitionState').eq('closed'), w.prop('transitionState').eq('preparing'), w.prop('transitionState').eq('leaving'))),
|
|
35
|
+
intent: (i) => i.feedback.style.use(tw('opacity-0')),
|
|
36
|
+
});
|
|
37
|
+
def.rule({
|
|
38
|
+
when: (w) => w.all(w.prop('fade').eq(true), w.any(w.prop('transitionState').eq('entering'), w.prop('transitionState').eq('entered'))),
|
|
39
|
+
intent: (i) => i.feedback.style.use(tw('opacity-100')),
|
|
40
|
+
});
|
|
41
|
+
def.rule({
|
|
42
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('default')),
|
|
43
|
+
intent: (i) => i.feedback.style.use(tw('rounded-xl')),
|
|
44
|
+
});
|
|
45
|
+
def.rule({
|
|
46
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('none')),
|
|
47
|
+
intent: (i) => i.feedback.style.use(tw('rounded-none')),
|
|
48
|
+
});
|
|
49
|
+
def.rule({
|
|
50
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('sm')),
|
|
51
|
+
intent: (i) => i.feedback.style.use(tw('rounded-sm')),
|
|
52
|
+
});
|
|
53
|
+
def.rule({
|
|
54
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('md')),
|
|
55
|
+
intent: (i) => i.feedback.style.use(tw('rounded-md')),
|
|
56
|
+
});
|
|
57
|
+
def.rule({
|
|
58
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('lg')),
|
|
59
|
+
intent: (i) => i.feedback.style.use(tw('rounded-lg')),
|
|
60
|
+
});
|
|
61
|
+
def.rule({
|
|
62
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('xl')),
|
|
63
|
+
intent: (i) => i.feedback.style.use(tw('rounded-xl')),
|
|
64
|
+
});
|
|
65
|
+
def.rule({
|
|
66
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('radius').eq('full')),
|
|
67
|
+
intent: (i) => i.feedback.style.use(tw('rounded-full')),
|
|
68
|
+
});
|
|
69
|
+
def.rule({
|
|
70
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('border').eq('all')),
|
|
71
|
+
intent: (i) => i.feedback.style.use(tw('border border-border')),
|
|
72
|
+
});
|
|
73
|
+
def.rule({
|
|
74
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('border').eq('bottom')),
|
|
75
|
+
intent: (i) => i.feedback.style.use(tw('border-b border-border')),
|
|
76
|
+
});
|
|
77
|
+
def.rule({
|
|
78
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('border').eq('none')),
|
|
79
|
+
intent: (i) => i.feedback.style.use(tw('border-0')),
|
|
80
|
+
});
|
|
81
|
+
def.rule({
|
|
82
|
+
when: (w) => w.prop('variant').eq('transparent'),
|
|
83
|
+
intent: (i) => i.feedback.style.use(tw('bg-transparent text-foreground')),
|
|
84
|
+
});
|
|
85
|
+
def.rule({
|
|
86
|
+
when: (w) => w.prop('variant').eq('outline'),
|
|
87
|
+
intent: (i) => i.feedback.style.use(tw('bg-background text-foreground')),
|
|
88
|
+
});
|
|
89
|
+
def.rule({
|
|
90
|
+
when: (w) => w.prop('variant').eq('secondary'),
|
|
91
|
+
intent: (i) => i.feedback.style.use(tw('bg-secondary text-secondary-foreground')),
|
|
92
|
+
});
|
|
93
|
+
def.rule({
|
|
94
|
+
when: (w) => w.prop('variant').eq('muted'),
|
|
95
|
+
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
96
|
+
});
|
|
97
|
+
def.rule({
|
|
98
|
+
when: (w) => w.prop('variant').eq('accent'),
|
|
99
|
+
intent: (i) => i.feedback.style.use(tw('bg-accent text-accent-foreground')),
|
|
100
|
+
});
|
|
101
|
+
def.rule({
|
|
102
|
+
when: (w) => w.prop('variant').eq('solid'),
|
|
103
|
+
intent: (i) => i.feedback.style.use(tw('bg-primary text-primary-foreground')),
|
|
104
|
+
});
|
|
105
|
+
def.rule({
|
|
106
|
+
when: (w) => w.prop('elevation').eq('raised'),
|
|
107
|
+
intent: (i) => i.feedback.style.use(tw('shadow-sm')),
|
|
108
|
+
});
|
|
109
|
+
def.rule({
|
|
110
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('focusVisible').eq(true)),
|
|
111
|
+
intent: (i) => i.feedback.style.use(tw('forced-colors-focus-outline ring-2 ring-ring ring-offset-2 ring-offset-background')),
|
|
112
|
+
});
|
|
113
|
+
def.rule({
|
|
114
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('variant').eq('solid'), w.prop('hovered').eq(true)),
|
|
115
|
+
intent: (i) => i.feedback.style.use(tw('bg-primary/80')),
|
|
116
|
+
});
|
|
117
|
+
def.rule({
|
|
118
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.prop('variant').eq('secondary'), w.prop('hovered').eq(true)),
|
|
119
|
+
intent: (i) => i.feedback.style.use(tw('bg-secondary/80')),
|
|
120
|
+
});
|
|
121
|
+
def.rule({
|
|
122
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.any(w.prop('variant').eq('outline'), w.prop('variant').eq('transparent')), w.any(w.prop('hovered').eq(true), w.prop('current').eq(true))),
|
|
123
|
+
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
124
|
+
});
|
|
125
|
+
def.rule({
|
|
126
|
+
when: (w) => w.all(w.prop('actionProfile').eq('none'), w.any(w.prop('variant').eq('outline'), w.prop('variant').eq('transparent')), w.any(w.prop('hovered').eq(true), w.prop('current').eq(true)), w.meta('colorScheme').eq('dark')),
|
|
127
|
+
intent: (i) => i.feedback.style.use(tw('bg-muted/50')),
|
|
128
|
+
});
|
|
129
|
+
// Explicit source-bound appearance only. No interaction owner is created.
|
|
130
|
+
for (const profile of SHADCN_MODERN_ACTION_STYLES) {
|
|
131
|
+
def.rule({
|
|
132
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('pressed').eq(true)),
|
|
133
|
+
intent: (i) => i.feedback.style.use(tw('translate-y-px')),
|
|
134
|
+
});
|
|
135
|
+
def.rule({
|
|
136
|
+
when: (w) => w.prop('actionProfile').eq(profile),
|
|
137
|
+
intent: (i) => i.feedback.style.use(tw('border border-transparent bg-clip-padding outline-none', SHADCN_ACTION_RADIUS[profile])),
|
|
138
|
+
});
|
|
139
|
+
def.rule({
|
|
140
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('outline'), w.prop('border').eq('all'), w.prop('focusVisible').eq(false)),
|
|
141
|
+
intent: (i) => i.feedback.style.use(tw('border-border')),
|
|
142
|
+
});
|
|
143
|
+
def.rule({
|
|
144
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('border').eq('bottom'), w.prop('focusVisible').eq(false)),
|
|
145
|
+
intent: (i) => i.feedback.style.use(tw('border-b border-border')),
|
|
146
|
+
});
|
|
147
|
+
def.rule({
|
|
148
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('focusVisible').eq(true)),
|
|
149
|
+
intent: (i) => i.feedback.style.use(tw('forced-colors-focus-outline', SHADCN_ACTION_FOCUS[profile])),
|
|
150
|
+
});
|
|
151
|
+
def.rule({
|
|
152
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('solid'), w.prop('hovered').eq(true)),
|
|
153
|
+
intent: (i) => i.feedback.style.use(tw('bg-primary/80')),
|
|
154
|
+
});
|
|
155
|
+
def.rule({
|
|
156
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('secondary'), w.prop('hovered').eq(true)),
|
|
157
|
+
intent: (i) => i.feedback.style.use(tw(SHADCN_SECONDARY_HOVER)),
|
|
158
|
+
});
|
|
159
|
+
def.rule({
|
|
160
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.any(w.prop('variant').eq('transparent'), w.prop('variant').eq('outline')), w.prop('hovered').eq(true)),
|
|
161
|
+
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
162
|
+
});
|
|
163
|
+
def.rule({
|
|
164
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.any(w.prop('variant').eq('transparent'), w.prop('variant').eq('outline')), w.prop('hovered').eq(true), w.meta('colorScheme').eq('dark')),
|
|
165
|
+
intent: (i) => i.feedback.style.use(tw('bg-muted/50')),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
// Legacy appearance has its own paint and never inherits modern motion.
|
|
169
|
+
for (const profile of ['new-york-v4', 'new-york']) {
|
|
170
|
+
def.rule({
|
|
171
|
+
when: (w) => w.prop('actionProfile').eq(profile),
|
|
172
|
+
intent: (i) => i.feedback.style.use(tw('rounded-md outline-none')),
|
|
173
|
+
});
|
|
174
|
+
def.rule({
|
|
175
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('outline'), w.prop('border').eq('all'), w.prop('focusVisible').eq(false)),
|
|
176
|
+
intent: (i) => i.feedback.style.use(tw('border border-border')),
|
|
177
|
+
});
|
|
178
|
+
def.rule({
|
|
179
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('border').eq('bottom'), w.prop('focusVisible').eq(false)),
|
|
180
|
+
intent: (i) => i.feedback.style.use(tw('border-b border-border')),
|
|
181
|
+
});
|
|
182
|
+
def.rule({
|
|
183
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('focusVisible').eq(true)),
|
|
184
|
+
intent: (i) => i.feedback.style.use(tw('forced-colors-focus-outline', SHADCN_ACTION_FOCUS[profile])),
|
|
185
|
+
});
|
|
186
|
+
def.rule({
|
|
187
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('solid'), w.prop('hovered').eq(true)),
|
|
188
|
+
intent: (i) => i.feedback.style.use(tw('bg-primary/90')),
|
|
189
|
+
});
|
|
190
|
+
def.rule({
|
|
191
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.prop('variant').eq('secondary'), w.prop('hovered').eq(true)),
|
|
192
|
+
intent: (i) => i.feedback.style.use(tw('bg-secondary/80')),
|
|
193
|
+
});
|
|
194
|
+
def.rule({
|
|
195
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.any(w.prop('variant').eq('transparent'), w.prop('variant').eq('outline')), w.prop('hovered').eq(true)),
|
|
196
|
+
intent: (i) => i.feedback.style.use(tw('bg-accent text-accent-foreground')),
|
|
197
|
+
});
|
|
198
|
+
def.rule({
|
|
199
|
+
when: (w) => w.all(w.prop('actionProfile').eq(profile), w.any(w.prop('variant').eq('transparent'), w.prop('variant').eq('outline')), w.prop('hovered').eq(true), w.meta('colorScheme').eq('dark')),
|
|
200
|
+
intent: (i) => i.feedback.style.use(tw('bg-accent/50')),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return inherited.render;
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
export default ShadcnSurfaceRoot;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Private lifecycle glue for the family-owned visual acquisition lease. */
|
|
2
|
+
export function createSwitchHitLease(shouldAcquire, register) {
|
|
3
|
+
let current = null;
|
|
4
|
+
let acquiring = false;
|
|
5
|
+
const release = () => {
|
|
6
|
+
const previous = current;
|
|
7
|
+
current = null;
|
|
8
|
+
previous?.();
|
|
9
|
+
};
|
|
10
|
+
const sync = () => {
|
|
11
|
+
if (!shouldAcquire()) {
|
|
12
|
+
release();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (current || acquiring)
|
|
16
|
+
return;
|
|
17
|
+
acquiring = true;
|
|
18
|
+
let acquired;
|
|
19
|
+
try {
|
|
20
|
+
acquired = register();
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
acquiring = false;
|
|
24
|
+
}
|
|
25
|
+
// Host materialization is synchronous but may reenter user-provided host
|
|
26
|
+
// callbacks. Never publish a lease whose source retired during acquisition.
|
|
27
|
+
if (shouldAcquire())
|
|
28
|
+
current = acquired;
|
|
29
|
+
else
|
|
30
|
+
acquired();
|
|
31
|
+
};
|
|
32
|
+
return { sync, release };
|
|
33
|
+
}
|
package/dist/switch/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import switchRoot from
|
|
2
|
-
import switchThumb from
|
|
3
|
-
export type { ShadcnSwitchRootProps, ShadcnSwitchRootExposes, ShadcnSwitchRootStateHandles, ShadcnSwitchRootAsHookContract, ShadcnSwitchThumbProps, ShadcnSwitchThumbExposes, ShadcnSwitchThumbAsHookContract, } from
|
|
1
|
+
import switchRoot from "./root.proto.js";
|
|
2
|
+
import switchThumb from "./thumb.proto.js";
|
|
3
|
+
export type { ShadcnSwitchSize, ShadcnSwitchRootProps, ShadcnSwitchRootExposes, ShadcnSwitchRootStateHandles, ShadcnSwitchRootAsHookContract, ShadcnSwitchThumbProps, ShadcnSwitchThumbExposes, ShadcnSwitchThumbAsHookContract, } from "./types.js";
|
|
4
4
|
export { switchRoot, switchThumb };
|
|
5
|
-
export { default as shadcnSwitchRoot } from
|
|
6
|
-
export { default as shadcnSwitchThumb } from
|
|
7
|
-
export { default as componentPreset, shadcnSwitchComponentPreset } from
|
|
5
|
+
export { default as shadcnSwitchRoot } from "./root.proto.js";
|
|
6
|
+
export { default as shadcnSwitchThumb } from "./thumb.proto.js";
|
|
7
|
+
export { default as componentPreset, shadcnSwitchComponentPreset } from "./preset.js";
|
package/dist/switch/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import switchRoot from
|
|
2
|
-
import switchThumb from
|
|
1
|
+
import switchRoot from "./root.proto.js";
|
|
2
|
+
import switchThumb from "./thumb.proto.js";
|
|
3
3
|
export { switchRoot, switchThumb };
|
|
4
|
-
export { default as shadcnSwitchRoot } from
|
|
5
|
-
export { default as shadcnSwitchThumb } from
|
|
6
|
-
export { default as componentPreset, shadcnSwitchComponentPreset } from
|
|
4
|
+
export { default as shadcnSwitchRoot } from "./root.proto.js";
|
|
5
|
+
export { default as shadcnSwitchThumb } from "./thumb.proto.js";
|
|
6
|
+
export { default as componentPreset, shadcnSwitchComponentPreset } from "./preset.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DefHandle, type State } from '@proto.ui/core';
|
|
2
|
+
import type { SwitchRootStateHandles } from '@proto.ui/prototypes-base/switch';
|
|
3
|
+
import type { ShadcnSwitchRootProps } from "./types.js";
|
|
4
|
+
export declare const SWITCH_PROJECTED_STYLES: readonly ["vega", "nova", "maia", "lyra", "mira", "luma", "sera", "rhea", "new-york-v4"];
|
|
5
|
+
/** Paint and hit projection only; checked, activation and Field validity retain their Base owners. */
|
|
6
|
+
export declare function setupSwitchRootVisual(def: DefHandle<ShadcnSwitchRootProps>, state: SwitchRootStateHandles, invalid?: State<boolean>): void;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { tw } from '@proto.ui/core';
|
|
2
|
+
import { asHitParticipation } from '@proto.ui/hooks';
|
|
3
|
+
import { setupShadcnStyleSelection, SHADCN_STYLE_IDS, SHADCN_STYLE_SCOPE, } from "../style-scope/index.js";
|
|
4
|
+
import { SWITCH_VISUAL, normalizeSwitchSize } from "./visual.js";
|
|
5
|
+
import { createSwitchHitLease } from "./hit-lease.js";
|
|
6
|
+
export const SWITCH_PROJECTED_STYLES = SHADCN_STYLE_IDS;
|
|
7
|
+
/**
|
|
8
|
+
* Per-profile surface carrier tokens from the pinned upstream recipes:
|
|
9
|
+
* apps/v4/registry/styles/style-{vega,nova,maia,lyra,mira,luma,sera,rhea}.css
|
|
10
|
+
* `.cn-switch` (radius/border/shadow carriers), plus the retained new-york-v4
|
|
11
|
+
* component baseline.
|
|
12
|
+
*/
|
|
13
|
+
const PROFILE_SURFACE = {
|
|
14
|
+
'new-york-v4': 'rounded-full border border-transparent shadow-xs',
|
|
15
|
+
vega: 'rounded-full border border-transparent shadow-xs',
|
|
16
|
+
nova: 'rounded-full border border-transparent',
|
|
17
|
+
maia: 'rounded-full border border-transparent',
|
|
18
|
+
lyra: 'rounded-full border border-transparent',
|
|
19
|
+
mira: 'rounded-full border border-transparent',
|
|
20
|
+
luma: 'rounded-full border-2',
|
|
21
|
+
sera: 'rounded-none border',
|
|
22
|
+
rhea: 'rounded-[var(--pui-radius-2xl)] border-2 border-transparent',
|
|
23
|
+
};
|
|
24
|
+
/** data-[size=default|sm] geometry per recipe. New York keeps rem units. */
|
|
25
|
+
const PROFILE_SIZE = {
|
|
26
|
+
'new-york-v4-default': 'w-8 h-[1.15rem]',
|
|
27
|
+
'new-york-v4-sm': 'w-6 h-3.5',
|
|
28
|
+
'vega-default': 'w-[32px] h-[18.4px]',
|
|
29
|
+
'vega-sm': 'w-[24px] h-[14px]',
|
|
30
|
+
'nova-default': 'w-[32px] h-[18.4px]',
|
|
31
|
+
'nova-sm': 'w-[24px] h-[14px]',
|
|
32
|
+
'maia-default': 'w-[32px] h-[18.4px]',
|
|
33
|
+
'maia-sm': 'w-[24px] h-[14px]',
|
|
34
|
+
'lyra-default': 'w-[32px] h-[18.4px]',
|
|
35
|
+
'lyra-sm': 'w-[24px] h-[14px]',
|
|
36
|
+
'mira-default': 'w-[28px] h-[16.6px]',
|
|
37
|
+
'mira-sm': 'w-[24px] h-[14px]',
|
|
38
|
+
'luma-default': 'w-11 h-5',
|
|
39
|
+
'luma-sm': 'w-7 h-4',
|
|
40
|
+
'sera-default': 'w-8.25 h-4.5',
|
|
41
|
+
'sera-sm': 'w-6.25 h-3.5',
|
|
42
|
+
'rhea-default': 'w-8 h-5',
|
|
43
|
+
'rhea-sm': 'w-6 h-4',
|
|
44
|
+
};
|
|
45
|
+
/** Unchecked track tint (light); `data-unchecked:bg-*` per recipe. */
|
|
46
|
+
const PROFILE_UNCHECKED_BG = {
|
|
47
|
+
'new-york-v4': 'bg-input',
|
|
48
|
+
vega: 'bg-input',
|
|
49
|
+
nova: 'bg-input',
|
|
50
|
+
maia: 'bg-input',
|
|
51
|
+
lyra: 'bg-input',
|
|
52
|
+
mira: 'bg-input',
|
|
53
|
+
luma: 'bg-input/90',
|
|
54
|
+
sera: 'bg-input',
|
|
55
|
+
rhea: 'bg-input/90',
|
|
56
|
+
};
|
|
57
|
+
/** `dark:data-unchecked:bg-*`; remaining profiles retain their ordinary track tint. */
|
|
58
|
+
const PROFILE_UNCHECKED_DARK_BG = {
|
|
59
|
+
'new-york-v4': 'bg-input/80',
|
|
60
|
+
vega: 'bg-input/80',
|
|
61
|
+
nova: 'bg-input/80',
|
|
62
|
+
maia: 'bg-input/80',
|
|
63
|
+
lyra: 'bg-input/80',
|
|
64
|
+
mira: 'bg-input/80',
|
|
65
|
+
luma: 'bg-input/90',
|
|
66
|
+
sera: 'bg-input',
|
|
67
|
+
rhea: 'bg-input/90',
|
|
68
|
+
};
|
|
69
|
+
/** `focus-visible:border-ring focus-visible:ring-ring/*` + ring width per recipe. */
|
|
70
|
+
const PROFILE_FOCUS = {
|
|
71
|
+
'new-york-v4': 'border-ring ring-3 ring-ring/50',
|
|
72
|
+
vega: 'border-ring ring-3 ring-ring/50',
|
|
73
|
+
nova: 'border-ring ring-3 ring-ring/50',
|
|
74
|
+
maia: 'border-ring ring-[3px] ring-ring/50',
|
|
75
|
+
lyra: 'border-ring ring-1 ring-ring/50',
|
|
76
|
+
mira: 'border-ring ring-2 ring-ring/30',
|
|
77
|
+
luma: 'border-ring ring-3 ring-ring/30',
|
|
78
|
+
sera: 'border-ring ring-2 ring-ring/30',
|
|
79
|
+
rhea: 'border-ring ring-3 ring-ring/30',
|
|
80
|
+
};
|
|
81
|
+
/** `aria-invalid:ring-*` widths match each profile's focus ring width. */
|
|
82
|
+
const PROFILE_INVALID_RING = {
|
|
83
|
+
vega: 'ring-3',
|
|
84
|
+
nova: 'ring-3',
|
|
85
|
+
maia: 'ring-[3px]',
|
|
86
|
+
lyra: 'ring-1',
|
|
87
|
+
mira: 'ring-2',
|
|
88
|
+
luma: 'ring-3',
|
|
89
|
+
sera: 'ring-2',
|
|
90
|
+
rhea: 'ring-3',
|
|
91
|
+
};
|
|
92
|
+
/** Profiles whose unchecked track paints a recipe border color. */
|
|
93
|
+
const PROFILE_UNCHECKED_BORDER = {
|
|
94
|
+
luma: 'border-transparent',
|
|
95
|
+
sera: 'border-input/50',
|
|
96
|
+
};
|
|
97
|
+
/** Profiles whose checked track paints `data-checked:border-primary`. */
|
|
98
|
+
const PROFILE_CHECKED_BORDER = {
|
|
99
|
+
luma: true,
|
|
100
|
+
sera: true,
|
|
101
|
+
rhea: true,
|
|
102
|
+
};
|
|
103
|
+
/** Paint and hit projection only; checked, activation and Field validity retain their Base owners. */
|
|
104
|
+
export function setupSwitchRootVisual(def, state, invalid) {
|
|
105
|
+
const style = setupShadcnStyleSelection(def, 'new-york-v4', {
|
|
106
|
+
supportedStyles: SWITCH_PROJECTED_STYLES,
|
|
107
|
+
});
|
|
108
|
+
const hit = asHitParticipation();
|
|
109
|
+
def.props.define({ size: { type: 'enum', options: ['default', 'sm'], empty: 'fallback' } });
|
|
110
|
+
def.props.setDefaults({ size: 'default' });
|
|
111
|
+
const size = def.state.enum('switchVisualSize', 'default', { options: ['default', 'sm'] });
|
|
112
|
+
def.expose.method('getVisualSize', () => size.get());
|
|
113
|
+
def.expose.method('getVisualStyle', () => style.get());
|
|
114
|
+
def.context.provide(SWITCH_VISUAL, { size: 'default', style: 'new-york-v4' });
|
|
115
|
+
let mounted = false;
|
|
116
|
+
// The bounded hit lease stays a Rhea-only acquisition: it compensates the
|
|
117
|
+
// compact h-5/w-8 (sm h-4/w-6) track and remains the only measured
|
|
118
|
+
// owner-relative self-region extension for this family. Other profiles keep
|
|
119
|
+
// their border-box hit region; widening the lease is a separate acceptance.
|
|
120
|
+
const hitLease = createSwitchHitLease(() => mounted && style.get() === 'rhea', () => hit.registerSelfRegion({
|
|
121
|
+
role: 'switch-hit',
|
|
122
|
+
staticHitInset: {
|
|
123
|
+
top: { value: 0.5, unit: 'rem' },
|
|
124
|
+
right: { value: 0.75, unit: 'rem' },
|
|
125
|
+
bottom: { value: 0.5, unit: 'rem' },
|
|
126
|
+
left: { value: 0.75, unit: 'rem' },
|
|
127
|
+
},
|
|
128
|
+
}));
|
|
129
|
+
const sync = (run) => {
|
|
130
|
+
const nextSize = normalizeSwitchSize(run.props.get().size);
|
|
131
|
+
size.set(nextSize, 'reason: Switch Root visual size');
|
|
132
|
+
run.context.update(SWITCH_VISUAL, { size: nextSize, style: style.get() });
|
|
133
|
+
hitLease.sync();
|
|
134
|
+
};
|
|
135
|
+
def.lifecycle.onCreated(sync);
|
|
136
|
+
def.lifecycle.onMounted((run) => {
|
|
137
|
+
mounted = true;
|
|
138
|
+
sync(run);
|
|
139
|
+
});
|
|
140
|
+
def.lifecycle.onUnmounted(() => {
|
|
141
|
+
mounted = false;
|
|
142
|
+
hitLease.release();
|
|
143
|
+
});
|
|
144
|
+
def.lifecycle.onBeforeDispose(() => {
|
|
145
|
+
mounted = false;
|
|
146
|
+
hitLease.release();
|
|
147
|
+
});
|
|
148
|
+
def.props.watch(['size'], sync);
|
|
149
|
+
// Observe the public selector inputs after the shared resolver, never watch
|
|
150
|
+
// owned style state or duplicate the explicit/ancestor precedence algorithm.
|
|
151
|
+
def.context.trySubscribe(SHADCN_STYLE_SCOPE, sync);
|
|
152
|
+
def.props.watchRaw(['styleProfile'], sync);
|
|
153
|
+
def.lifecycle.onUpdated(sync);
|
|
154
|
+
def.feedback.style.use(tw('peer relative inline-flex shrink-0 items-center p-0 outline-none select-none transition-all duration-150 ease-in-out'));
|
|
155
|
+
def.rule({
|
|
156
|
+
when: (w) => w.meta('preference.reducedMotion').eq('reduce'),
|
|
157
|
+
intent: (i) => i.feedback.style.use(tw('transition-none')),
|
|
158
|
+
});
|
|
159
|
+
// Ordinary and draggable paint share the Base Root's canonical direction.
|
|
160
|
+
// Fix the flex origin explicitly so document direction cannot reverse it again.
|
|
161
|
+
def.rule({
|
|
162
|
+
when: (w) => w.state(state.direction).eq('ltr'),
|
|
163
|
+
intent: (i) => i.feedback.style.use(tw('direction-ltr')),
|
|
164
|
+
});
|
|
165
|
+
def.rule({
|
|
166
|
+
when: (w) => w.state(state.direction).eq('rtl'),
|
|
167
|
+
intent: (i) => i.feedback.style.use(tw('direction-rtl')),
|
|
168
|
+
});
|
|
169
|
+
for (const profile of SWITCH_PROJECTED_STYLES) {
|
|
170
|
+
def.rule({
|
|
171
|
+
when: (w) => w.state(style).eq(profile),
|
|
172
|
+
intent: (i) => i.feedback.style.use(tw(PROFILE_SURFACE[profile])),
|
|
173
|
+
});
|
|
174
|
+
for (const named of ['default', 'sm']) {
|
|
175
|
+
def.rule({
|
|
176
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(size).eq(named)),
|
|
177
|
+
intent: (i) => i.feedback.style.use(tw(PROFILE_SIZE[`${profile}-${named}`])),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// Unchecked track tint; guards mirror the upstream data-unchecked variant so
|
|
181
|
+
// the checked fill always wins the same semantic group.
|
|
182
|
+
def.rule({
|
|
183
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.checked).eq(false), w.not(w.meta('colorScheme').eq('dark'))),
|
|
184
|
+
intent: (i) => i.feedback.style.use(tw(PROFILE_UNCHECKED_BG[profile])),
|
|
185
|
+
});
|
|
186
|
+
def.rule({
|
|
187
|
+
when: (w) => w.all(w.state(style).eq(profile), w.meta('colorScheme').eq('dark'), w.state(state.checked).eq(false)),
|
|
188
|
+
intent: (i) => i.feedback.style.use(tw(PROFILE_UNCHECKED_DARK_BG[profile])),
|
|
189
|
+
});
|
|
190
|
+
const uncheckedBorder = PROFILE_UNCHECKED_BORDER[profile];
|
|
191
|
+
if (uncheckedBorder) {
|
|
192
|
+
def.rule({
|
|
193
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.checked).eq(false), ...(invalid ? [w.state(invalid).eq(false)] : [])),
|
|
194
|
+
intent: (i) => i.feedback.style.use(tw(uncheckedBorder)),
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
def.rule({
|
|
198
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.checked).eq(true)),
|
|
199
|
+
intent: (i) => i.feedback.style.use(tw('bg-primary')),
|
|
200
|
+
});
|
|
201
|
+
if (PROFILE_CHECKED_BORDER[profile]) {
|
|
202
|
+
def.rule({
|
|
203
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.checked).eq(true), w.state(state.focusVisible).eq(false), ...(invalid ? [w.state(invalid).eq(false)] : [])),
|
|
204
|
+
intent: (i) => i.feedback.style.use(tw('border-primary')),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
// Disabled affordance is the shared component-level treatment carried by
|
|
208
|
+
// the retained baseline; the modern recipes state no disabled tokens.
|
|
209
|
+
def.rule({
|
|
210
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.disabled).eq(true)),
|
|
211
|
+
intent: (i) => i.feedback.style.use(tw('cursor-not-allowed opacity-50')),
|
|
212
|
+
});
|
|
213
|
+
def.rule({
|
|
214
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(state.focusVisible).eq(true), ...(invalid && profile !== 'new-york-v4' ? [w.state(invalid).eq(false)] : [])),
|
|
215
|
+
intent: (i) => i.feedback.style.use(tw(PROFILE_FOCUS[profile])),
|
|
216
|
+
});
|
|
217
|
+
if (invalid && profile !== 'new-york-v4') {
|
|
218
|
+
const ring = PROFILE_INVALID_RING[profile];
|
|
219
|
+
// aria-invalid:border-destructive + ring tokens; upstream also keeps the
|
|
220
|
+
// checked border transparent under invalid, so invalid paint wins.
|
|
221
|
+
def.rule({
|
|
222
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(invalid).eq(true)),
|
|
223
|
+
intent: (i) => i.feedback.style.use(tw('border-destructive ring-destructive/20'), tw(ring)),
|
|
224
|
+
});
|
|
225
|
+
def.rule({
|
|
226
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(invalid).eq(true), w.meta('colorScheme').eq('dark')),
|
|
227
|
+
intent: (i) => i.feedback.style.use(tw('border-destructive/50 ring-destructive/40')),
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// The retained New York baseline alone suppresses pointer events while
|
|
232
|
+
// disabled; other profiles keep the recipe surface without it.
|
|
233
|
+
def.rule({
|
|
234
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(state.disabled).eq(true)),
|
|
235
|
+
intent: (i) => i.feedback.style.use(tw('pointer-events-none')),
|
|
236
|
+
});
|
|
237
|
+
// Retained gaps: upstream group-has-[:focus-visible]/field-label ring/border
|
|
238
|
+
// clears inside a wrapping FieldLabel composition have no Proto host-ancestor
|
|
239
|
+
// selector; the wrapped-label ring contract remains an acceptance gap.
|
|
240
|
+
// New York intentionally keeps no invalid paint, matching the established
|
|
241
|
+
// fieldSwitch parity boundary.
|
|
242
|
+
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import type { ShadcnSwitchRootProps } from
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
* P-SHADCN-SWITCH-DIRECT-ENTRY exposes the current Root projection.
|
|
5
|
-
* P-SHADCN-SWITCH-COMPATIBILITY-SUBSET and P-SHADCN-SWITCH-AS-CHILD-OMISSION
|
|
6
|
-
* keep upstream parity outside the passing claim unless it is implemented and tested.
|
|
7
|
-
*/
|
|
8
|
-
export default switchRoot;
|
|
1
|
+
import type { ShadcnSwitchRootExposes, ShadcnSwitchRootProps } from "./types.js";
|
|
2
|
+
declare const _default: import("@proto.ui/core").Prototype<ShadcnSwitchRootProps, ShadcnSwitchRootExposes>;
|
|
3
|
+
export default _default;
|
|
@@ -1,76 +1,15 @@
|
|
|
1
|
-
import { definePrototype
|
|
1
|
+
import { definePrototype } from '@proto.ui/core';
|
|
2
2
|
import { asSwitchRoot } from '@proto.ui/prototypes-base/switch';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
'inline-flex',
|
|
6
|
-
'h-6',
|
|
7
|
-
'w-11',
|
|
8
|
-
'shrink-0',
|
|
9
|
-
'items-center',
|
|
10
|
-
'rounded-full',
|
|
11
|
-
'border',
|
|
12
|
-
'border-transparent',
|
|
13
|
-
'px-0.5',
|
|
14
|
-
'shadow-xs',
|
|
15
|
-
'transition-all',
|
|
16
|
-
'duration-200',
|
|
17
|
-
'ease-in-out',
|
|
18
|
-
'outline-none',
|
|
19
|
-
'bg-input/80',
|
|
20
|
-
'select-none',
|
|
21
|
-
].join(' ');
|
|
22
|
-
const switchRoot = definePrototype({
|
|
3
|
+
import { setupSwitchRootVisual } from "./root-visual.js";
|
|
4
|
+
export default definePrototype({
|
|
23
5
|
name: 'shadcn-switch-root',
|
|
6
|
+
modules: asSwitchRoot.modules,
|
|
24
7
|
setup(def) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const { checked, disabled, hovered, focusVisible, pressed } = switchState;
|
|
32
|
-
// P-SHADCN-SWITCH-CURRENT-VISUAL-SURFACE
|
|
33
|
-
def.feedback.style.use(tw(ROOT_BASE_TOKENS));
|
|
34
|
-
// P-SHADCN-SWITCH-STATE-DRIVEN-STYLES
|
|
35
|
-
def.rule({
|
|
36
|
-
when: (w) => w.state(checked).eq(true),
|
|
37
|
-
intent: (i) => i.feedback.style.use(tw('bg-primary text-primary-foreground')),
|
|
38
|
-
});
|
|
39
|
-
def.rule({
|
|
40
|
-
when: (w) => w.all(w.state(checked).eq(false), w.state(hovered).eq(true)),
|
|
41
|
-
intent: (i) => i.feedback.style.use(tw('bg-input')),
|
|
42
|
-
});
|
|
43
|
-
def.rule({
|
|
44
|
-
when: (w) => w.all(w.state(checked).eq(true), w.state(hovered).eq(true)),
|
|
45
|
-
intent: (i) => i.feedback.style.use(tw('bg-primary/90')),
|
|
46
|
-
});
|
|
47
|
-
def.rule({
|
|
48
|
-
when: (w) => w.state(pressed).eq(true),
|
|
49
|
-
intent: (i) => i.feedback.style.use(tw('scale-[0.98]')),
|
|
50
|
-
});
|
|
51
|
-
def.rule({
|
|
52
|
-
// Use the Switch-root focusVisible handle so web style projection can emit
|
|
53
|
-
// data-[focus-visible] tokens for custom-element focus.
|
|
54
|
-
when: (w) => w.state(focusVisible).eq(true),
|
|
55
|
-
intent: (i) => i.feedback.style.use(tw('ring-3 ring-ring/50 ring-offset-2 ring-offset-background')),
|
|
56
|
-
});
|
|
57
|
-
def.rule({
|
|
58
|
-
when: (w) => w.state(disabled).eq(true),
|
|
59
|
-
intent: (i) => i.feedback.style.use(tw('pointer-events-none opacity-50')),
|
|
60
|
-
});
|
|
61
|
-
def.rule({
|
|
62
|
-
when: (w) => w.all(w.meta('colorScheme').eq('dark'), w.state(checked).eq(false)),
|
|
63
|
-
intent: (i) => i.feedback.style.use(tw('bg-input/50')),
|
|
64
|
-
});
|
|
65
|
-
def.rule({
|
|
66
|
-
when: (w) => w.all(w.meta('colorScheme').eq('dark'), w.state(checked).eq(true)),
|
|
67
|
-
intent: (i) => i.feedback.style.use(tw('bg-primary')),
|
|
68
|
-
});
|
|
8
|
+
const inherited = asSwitchRoot();
|
|
9
|
+
const state = inherited.stateHandles;
|
|
10
|
+
if (!state)
|
|
11
|
+
throw new Error('[shadcn-switch-root] Missing Base Switch facts');
|
|
12
|
+
setupSwitchRootVisual(def, state);
|
|
13
|
+
return inherited.render;
|
|
69
14
|
},
|
|
70
15
|
});
|
|
71
|
-
/**
|
|
72
|
-
* P-SHADCN-SWITCH-DIRECT-ENTRY exposes the current Root projection.
|
|
73
|
-
* P-SHADCN-SWITCH-COMPATIBILITY-SUBSET and P-SHADCN-SWITCH-AS-CHILD-OMISSION
|
|
74
|
-
* keep upstream parity outside the passing claim unless it is implemented and tested.
|
|
75
|
-
*/
|
|
76
|
-
export default switchRoot;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import type { ShadcnSwitchThumbProps } from
|
|
1
|
+
import type { ShadcnSwitchThumbProps } from "./types.js";
|
|
2
2
|
declare const switchThumb: import("@proto.ui/core").Prototype<ShadcnSwitchThumbProps, import("@proto.ui/prototypes-base").SwitchThumbExposes>;
|
|
3
|
-
/**
|
|
4
|
-
* P-SHADCN-SWITCH-THUMB-DIRECT-ENTRY exposes the current anatomy part.
|
|
5
|
-
* P-SHADCN-SWITCH-THUMB-COMPATIBILITY-SUBSET keeps the upstream composition
|
|
6
|
-
* and token differences outside the passing claim.
|
|
7
|
-
*/
|
|
8
3
|
export default switchThumb;
|