@proto.ui/prototypes-shadcn 0.3.0-alpha.1 → 0.3.0-rc.2
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,201 @@
|
|
|
1
|
+
import { delay, tw, } from '@proto.ui/core';
|
|
2
|
+
import { setupSelectStyle } from "./style.js";
|
|
3
|
+
import { SHADCN_STYLE_SCOPE } from "../style-scope/index.js";
|
|
4
|
+
import { SELECT_TRANSLUCENT_STYLES, SELECT_TRIGGER_FOCUS, SELECT_TRIGGER_INVALID, SELECT_TRIGGER_SIZE, SELECT_TRIGGER_SM_RADIUS, SELECT_TRIGGER_SURFACE, SELECT_TRIGGER_SURFACE_BG, } from "./recipes.js";
|
|
5
|
+
/** New York keeps its size-4 opacity-50 chevron; modern profiles size the icon per recipe. */
|
|
6
|
+
function renderChevron(renderer, style) {
|
|
7
|
+
const px = style === 'mira' || style === 'sera' ? 14 : 16;
|
|
8
|
+
return renderer.el('span', {
|
|
9
|
+
style: tw(style === 'new-york-v4'
|
|
10
|
+
? 'pointer-events-none flex shrink-0 items-center text-muted-foreground opacity-50'
|
|
11
|
+
: 'pointer-events-none flex shrink-0 items-center text-muted-foreground'),
|
|
12
|
+
}, renderer.svg.root({
|
|
13
|
+
viewBox: '0 0 24 24',
|
|
14
|
+
'aria-hidden': 'true',
|
|
15
|
+
width: px,
|
|
16
|
+
height: px,
|
|
17
|
+
fill: 'none',
|
|
18
|
+
stroke: 'currentColor',
|
|
19
|
+
strokeWidth: 2,
|
|
20
|
+
strokeLinecap: 'round',
|
|
21
|
+
strokeLinejoin: 'round',
|
|
22
|
+
}, renderer.svg.path({ d: 'm6 9 6 6 6-6' })));
|
|
23
|
+
}
|
|
24
|
+
export function setupSelectTriggerVisual(def, state, invalid) {
|
|
25
|
+
// P-SHADCN-SELECT-TRIGGER-SIZE-PROP
|
|
26
|
+
def.props.define({
|
|
27
|
+
size: { type: 'enum', empty: 'fallback', options: ['sm', 'default'] },
|
|
28
|
+
appearance: {
|
|
29
|
+
type: 'enum',
|
|
30
|
+
empty: 'fallback',
|
|
31
|
+
options: ['default', 'ghost'],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
def.props.setDefaults({ size: 'default', appearance: 'default' });
|
|
35
|
+
const style = setupSelectStyle(def);
|
|
36
|
+
const { disabled, hovered, focusVisible, pressed, placeholder } = state;
|
|
37
|
+
// P-SHADCN-SELECT-TRIGGER-CURRENT-VISUAL-SURFACE
|
|
38
|
+
def.feedback.style.use(tw('flex w-fit items-center justify-between whitespace-nowrap outline-none select-none'));
|
|
39
|
+
// P-SHADCN-SELECT-TRIGGER-APPEARANCE: visual delta only; Base owns behavior.
|
|
40
|
+
def.rule({
|
|
41
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.prop('appearance').eq('default')),
|
|
42
|
+
intent: (i) => i.feedback.style.use(tw('gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow]')),
|
|
43
|
+
});
|
|
44
|
+
def.rule({
|
|
45
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.prop('appearance').eq('ghost')),
|
|
46
|
+
intent: (i) => i.feedback.style.use(tw('gap-2 rounded-md border border-transparent bg-transparent px-3 py-2 text-sm shadow-none transition-[color,box-shadow]')),
|
|
47
|
+
});
|
|
48
|
+
// P-SHADCN-SELECT-STYLE: pinned cn-select-trigger recipes for the seven
|
|
49
|
+
// modern styles plus retained Rhea; ghost is rejected outside New York.
|
|
50
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
51
|
+
def.rule({
|
|
52
|
+
when: (w) => w.state(style).eq(profile),
|
|
53
|
+
intent: (i) => i.feedback.style.use(tw(SELECT_TRIGGER_SURFACE[profile])),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// P-SHADCN-SELECT-TRIGGER-STATE-DRIVEN-STYLES
|
|
57
|
+
def.rule({
|
|
58
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.prop('size').eq('default')),
|
|
59
|
+
intent: (i) => i.feedback.style.use(tw('h-9')),
|
|
60
|
+
});
|
|
61
|
+
def.rule({
|
|
62
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.prop('size').eq('sm')),
|
|
63
|
+
intent: (i) => i.feedback.style.use(tw('h-8')),
|
|
64
|
+
});
|
|
65
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
66
|
+
def.rule({
|
|
67
|
+
when: (w) => w.all(w.state(style).eq(profile), w.prop('size').eq('default')),
|
|
68
|
+
intent: (i) => i.feedback.style.use(tw(SELECT_TRIGGER_SIZE[profile].default)),
|
|
69
|
+
});
|
|
70
|
+
def.rule({
|
|
71
|
+
when: (w) => w.all(w.state(style).eq(profile), w.prop('size').eq('sm')),
|
|
72
|
+
intent: (i) => i.feedback.style.use(tw(SELECT_TRIGGER_SIZE[profile].sm)),
|
|
73
|
+
});
|
|
74
|
+
const smRadius = SELECT_TRIGGER_SM_RADIUS[profile];
|
|
75
|
+
if (smRadius)
|
|
76
|
+
def.rule({
|
|
77
|
+
when: (w) => w.all(w.state(style).eq(profile), w.prop('size').eq('sm')),
|
|
78
|
+
intent: (i) => i.feedback.style.use(smRadius),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
def.rule({
|
|
82
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.all(w.state(placeholder).eq(true), w.any(w.prop('appearance').eq('default'), w.all(w.state(hovered).eq(false), w.state(pressed).eq(false))))),
|
|
83
|
+
intent: (i) => i.feedback.style.use(tw('text-muted-foreground')),
|
|
84
|
+
});
|
|
85
|
+
// data-placeholder:text-muted-foreground is unconditional in modern recipes.
|
|
86
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
87
|
+
def.rule({
|
|
88
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(placeholder).eq(true)),
|
|
89
|
+
intent: (i) => i.feedback.style.use(tw('text-muted-foreground')),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
def.rule({
|
|
93
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.all(w.prop('appearance').eq('default'), w.meta('colorScheme').eq('dark'))),
|
|
94
|
+
intent: (i) => i.feedback.style.use(tw('bg-input/30')),
|
|
95
|
+
});
|
|
96
|
+
def.rule({
|
|
97
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.all(w.prop('appearance').eq('default'), w.meta('colorScheme').eq('dark'), w.state(hovered).eq(true))),
|
|
98
|
+
intent: (i) => i.feedback.style.use(tw('bg-input/50')),
|
|
99
|
+
});
|
|
100
|
+
// Per-style input-surface backgrounds: several modern recipes apply the dark
|
|
101
|
+
// fill unconditionally in dark mode plus a dark-only hover delta.
|
|
102
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
103
|
+
const { dark, darkHover } = SELECT_TRIGGER_SURFACE_BG[profile];
|
|
104
|
+
if (dark)
|
|
105
|
+
def.rule({
|
|
106
|
+
when: (w) => w.all(w.state(style).eq(profile), w.meta('colorScheme').eq('dark')),
|
|
107
|
+
intent: (i) => i.feedback.style.use(dark),
|
|
108
|
+
});
|
|
109
|
+
if (darkHover)
|
|
110
|
+
def.rule({
|
|
111
|
+
when: (w) => w.all(w.state(style).eq(profile), w.meta('colorScheme').eq('dark'), w.state(hovered).eq(true)),
|
|
112
|
+
intent: (i) => i.feedback.style.use(darkHover),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
def.rule({
|
|
116
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(focusVisible).eq(true), ...(invalid ? [w.state(invalid).eq(false)] : [])),
|
|
117
|
+
intent: (i) => i.feedback.style.use(tw('border-ring ring-3 ring-ring/50')),
|
|
118
|
+
});
|
|
119
|
+
def.rule({
|
|
120
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.all(w.prop('appearance').eq('ghost'), w.any(w.state(hovered).eq(true), w.state(pressed).eq(true)))),
|
|
121
|
+
intent: (i) => i.feedback.style.use(tw('bg-accent text-accent-foreground')),
|
|
122
|
+
});
|
|
123
|
+
def.rule({
|
|
124
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(disabled).eq(true)),
|
|
125
|
+
intent: (i) => i.feedback.style.use(tw('cursor-not-allowed opacity-50')),
|
|
126
|
+
});
|
|
127
|
+
// focus-visible per pinned recipe; Field invalid suppresses the focus ring.
|
|
128
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
129
|
+
def.rule({
|
|
130
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(focusVisible).eq(true), ...(invalid ? [w.state(invalid).eq(false)] : [])),
|
|
131
|
+
intent: (i) => i.feedback.style.use(tw(SELECT_TRIGGER_FOCUS[profile])),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
// disabled:cursor-not-allowed disabled:opacity-50 from upstream select.tsx.
|
|
135
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
136
|
+
def.rule({
|
|
137
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(disabled).eq(true)),
|
|
138
|
+
intent: (i) => i.feedback.style.use(tw('cursor-not-allowed opacity-50')),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (invalid) {
|
|
142
|
+
def.rule({
|
|
143
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(invalid).eq(true), w.meta('colorScheme').eq('dark')),
|
|
144
|
+
intent: (i) => i.feedback.style.use(tw('border-destructive ring-destructive/40')),
|
|
145
|
+
});
|
|
146
|
+
def.rule({
|
|
147
|
+
when: (w) => w.all(w.state(invalid).eq(true), w.state(style).eq('new-york-v4'), w.not(w.meta('colorScheme').eq('dark'))),
|
|
148
|
+
intent: (i) => i.feedback.style.use(tw('border-destructive ring-destructive/20')),
|
|
149
|
+
});
|
|
150
|
+
// aria-invalid recipes are unconditional in every modern profile.
|
|
151
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
152
|
+
const recipe = SELECT_TRIGGER_INVALID[profile];
|
|
153
|
+
def.rule({
|
|
154
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(invalid).eq(true), w.not(w.meta('colorScheme').eq('dark'))),
|
|
155
|
+
intent: (i) => i.feedback.style.use(recipe.light),
|
|
156
|
+
});
|
|
157
|
+
def.rule({
|
|
158
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(invalid).eq(true), w.meta('colorScheme').eq('dark')),
|
|
159
|
+
intent: (i) => i.feedback.style.use(recipe.dark),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
def.rule({
|
|
163
|
+
when: (w) => w.all(w.state(invalid).eq(true), w.state(style).eq('new-york-v4'), w.state(focusVisible).eq(true)),
|
|
164
|
+
intent: (i) => i.feedback.style.use(tw('ring-3')),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const validate = (run) => {
|
|
168
|
+
if (style.get() !== 'new-york-v4' && run.props.get().appearance === 'ghost')
|
|
169
|
+
throw new Error(`[shadcn-select-trigger] ${style.get()} does not define ghost appearance`);
|
|
170
|
+
};
|
|
171
|
+
def.props.watch(['appearance'], validate);
|
|
172
|
+
def.lifecycle.onCreated(validate);
|
|
173
|
+
def.lifecycle.onUpdated(validate);
|
|
174
|
+
let task = null;
|
|
175
|
+
let renderedStyle = style.get();
|
|
176
|
+
const scheduleGlyph = (run) => {
|
|
177
|
+
validate(run);
|
|
178
|
+
if (style.get() === renderedStyle)
|
|
179
|
+
return;
|
|
180
|
+
task?.cancel();
|
|
181
|
+
task = delay(0, () => {
|
|
182
|
+
task = null;
|
|
183
|
+
run.update();
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
def.context.trySubscribe(SHADCN_STYLE_SCOPE, scheduleGlyph);
|
|
187
|
+
def.props.watchRaw(['styleProfile'], scheduleGlyph);
|
|
188
|
+
def.lifecycle.onMounted(scheduleGlyph);
|
|
189
|
+
def.lifecycle.onUpdated(scheduleGlyph);
|
|
190
|
+
const cancel = () => {
|
|
191
|
+
task?.cancel();
|
|
192
|
+
task = null;
|
|
193
|
+
};
|
|
194
|
+
def.lifecycle.onUnmounted(cancel);
|
|
195
|
+
def.lifecycle.onBeforeDispose(cancel);
|
|
196
|
+
const render = (renderer) => {
|
|
197
|
+
renderedStyle = style.get();
|
|
198
|
+
return [renderer.r.slot(), renderChevron(renderer, renderedStyle)];
|
|
199
|
+
};
|
|
200
|
+
return render;
|
|
201
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ShadcnSelectTriggerProps } from
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
export default selectTrigger;
|
|
1
|
+
import type { ShadcnSelectTriggerProps } from "./types.js";
|
|
2
|
+
declare const _default: import("@proto.ui/core").Prototype<ShadcnSelectTriggerProps, import("@proto.ui/prototypes-base").SelectTriggerExposes>;
|
|
3
|
+
export default _default;
|
|
@@ -1,66 +1,12 @@
|
|
|
1
|
-
import { definePrototype
|
|
1
|
+
import { definePrototype } from '@proto.ui/core';
|
|
2
2
|
import { asSelectTrigger } from '@proto.ui/prototypes-base/select';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
viewBox: '0 0 24 24',
|
|
6
|
-
width: 16,
|
|
7
|
-
height: 16,
|
|
8
|
-
fill: 'none',
|
|
9
|
-
stroke: 'currentColor',
|
|
10
|
-
strokeWidth: 2,
|
|
11
|
-
strokeLinecap: 'round',
|
|
12
|
-
strokeLinejoin: 'round',
|
|
13
|
-
}, renderer.svg.path({ d: 'm6 9 6 6 6-6' })));
|
|
14
|
-
}
|
|
15
|
-
const selectTrigger = definePrototype({
|
|
3
|
+
import { setupSelectTriggerVisual } from "./trigger-visual.js";
|
|
4
|
+
export default definePrototype({
|
|
16
5
|
name: 'shadcn-select-trigger',
|
|
17
6
|
setup(def) {
|
|
18
|
-
// P-SHADCN-SELECT-TRIGGER-SIZE-PROP
|
|
19
|
-
def.props.define({
|
|
20
|
-
size: { type: 'enum', empty: 'fallback', options: ['sm', 'default'] },
|
|
21
|
-
});
|
|
22
|
-
def.props.setDefaults({ size: 'default' });
|
|
23
|
-
// P-SHADCN-SELECT-TRIGGER-BASE-INHERITANCE,
|
|
24
|
-
// P-SHADCN-SELECT-TRIGGER-CURRENT-BASE-DEVIATIONS
|
|
25
7
|
const state = asSelectTrigger().stateHandles;
|
|
26
|
-
if (!state)
|
|
27
|
-
throw new Error('[shadcn-select-trigger]
|
|
28
|
-
|
|
29
|
-
const { disabled, hovered, focusVisible, pressed, placeholder } = state;
|
|
30
|
-
// P-SHADCN-SELECT-TRIGGER-CURRENT-VISUAL-SURFACE
|
|
31
|
-
def.feedback.style.use(tw('flex items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-colors outline-none select-none'));
|
|
32
|
-
// P-SHADCN-SELECT-TRIGGER-STATE-DRIVEN-STYLES
|
|
33
|
-
def.rule({
|
|
34
|
-
when: (w) => w.prop('size').eq('default'),
|
|
35
|
-
intent: (i) => i.feedback.style.use(tw('h-9')),
|
|
36
|
-
});
|
|
37
|
-
def.rule({
|
|
38
|
-
when: (w) => w.prop('size').eq('sm'),
|
|
39
|
-
intent: (i) => i.feedback.style.use(tw('h-8')),
|
|
40
|
-
});
|
|
41
|
-
def.rule({
|
|
42
|
-
when: (w) => w.state(placeholder).eq(true),
|
|
43
|
-
intent: (i) => i.feedback.style.use(tw('text-muted-foreground')),
|
|
44
|
-
});
|
|
45
|
-
def.rule({
|
|
46
|
-
when: (w) => w.state(hovered).eq(true),
|
|
47
|
-
intent: (i) => i.feedback.style.use(tw('bg-input/50')),
|
|
48
|
-
});
|
|
49
|
-
def.rule({
|
|
50
|
-
when: (w) => w.state(focusVisible).eq(true),
|
|
51
|
-
intent: (i) => i.feedback.style.use(tw('border-ring ring-3 ring-ring/50')),
|
|
52
|
-
});
|
|
53
|
-
def.rule({
|
|
54
|
-
when: (w) => w.state(pressed).eq(true),
|
|
55
|
-
intent: (i) => i.feedback.style.use(tw('bg-input/70 translate-y-px')),
|
|
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
|
-
// P-SHADCN-SELECT-TRIGGER-CHEVRON
|
|
62
|
-
return (renderer) => [renderer.r.slot(), renderChevron(renderer)];
|
|
8
|
+
if (!state)
|
|
9
|
+
throw new Error('[shadcn-select-trigger] Missing Base command facts');
|
|
10
|
+
return setupSelectTriggerVisual(def, state);
|
|
63
11
|
},
|
|
64
12
|
});
|
|
65
|
-
/** P-SHADCN-SELECT-TRIGGER-DIRECT-ENTRY; parity is bounded by P-SHADCN-SELECT-TRIGGER-COMPATIBILITY-SUBSET. */
|
|
66
|
-
export default selectTrigger;
|
package/dist/select/types.d.ts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
+
import type { ShadcnStyleProps } from "../style-scope/index.js";
|
|
1
2
|
import type { SelectContentAsHookContract, SelectContentExposes, SelectContentProps, SelectItemAsHookContract, SelectItemExposes, SelectItemProps, SelectRootAsHookContract, SelectRootExposes, SelectRootProps, SelectTriggerAsHookContract, SelectTriggerExposes, SelectTriggerProps, SelectValueAsHookContract, SelectValueExposes, SelectValueProps } from '@proto.ui/prototypes-base/select';
|
|
2
|
-
export type ShadcnSelectRootProps = SelectRootProps;
|
|
3
|
+
export type ShadcnSelectRootProps = SelectRootProps & ShadcnStyleProps;
|
|
3
4
|
export type ShadcnSelectRootExposes = SelectRootExposes;
|
|
4
5
|
export type ShadcnSelectRootAsHookContract = SelectRootAsHookContract;
|
|
5
|
-
export interface ShadcnSelectTriggerProps extends SelectTriggerProps {
|
|
6
|
+
export interface ShadcnSelectTriggerProps extends SelectTriggerProps, ShadcnStyleProps {
|
|
6
7
|
size?: 'sm' | 'default';
|
|
8
|
+
/** Additive presentation; omitted values retain the existing field surface. */
|
|
9
|
+
appearance?: 'default' | 'ghost';
|
|
7
10
|
}
|
|
8
11
|
export type ShadcnSelectTriggerExposes = SelectTriggerExposes;
|
|
9
12
|
export type ShadcnSelectTriggerAsHookContract = SelectTriggerAsHookContract;
|
|
10
|
-
export type ShadcnSelectValueProps = SelectValueProps;
|
|
13
|
+
export type ShadcnSelectValueProps = SelectValueProps & ShadcnStyleProps;
|
|
11
14
|
export type ShadcnSelectValueExposes = SelectValueExposes;
|
|
12
15
|
export type ShadcnSelectValueAsHookContract = SelectValueAsHookContract;
|
|
13
|
-
export interface ShadcnSelectContentProps extends SelectContentProps {
|
|
16
|
+
export interface ShadcnSelectContentProps extends SelectContentProps, ShadcnStyleProps {
|
|
14
17
|
position?: 'item-aligned' | 'popper';
|
|
15
18
|
}
|
|
16
19
|
export type ShadcnSelectContentExposes = SelectContentExposes;
|
|
17
20
|
export type ShadcnSelectContentAsHookContract = SelectContentAsHookContract;
|
|
18
|
-
export type ShadcnSelectItemProps = SelectItemProps;
|
|
21
|
+
export type ShadcnSelectItemProps = SelectItemProps & ShadcnStyleProps;
|
|
19
22
|
export type ShadcnSelectItemExposes = SelectItemExposes;
|
|
20
23
|
export type ShadcnSelectItemAsHookContract = SelectItemAsHookContract;
|
|
24
|
+
export type { SelectGroupExposes as ShadcnSelectGroupExposes, SelectGroupAsHookContract as ShadcnSelectGroupAsHookContract, } from '@proto.ui/prototypes-base/select';
|
|
25
|
+
export type { SelectLabelExposes as ShadcnSelectLabelExposes, SelectLabelAsHookContract as ShadcnSelectLabelAsHookContract, } from '@proto.ui/prototypes-base/select';
|
|
26
|
+
export type { SelectSeparatorExposes as ShadcnSelectSeparatorExposes, SelectSeparatorAsHookContract as ShadcnSelectSeparatorAsHookContract, } from '@proto.ui/prototypes-base/select';
|
|
27
|
+
export type ShadcnSelectGroupProps = import('@proto.ui/prototypes-base/select').SelectGroupProps & ShadcnStyleProps;
|
|
28
|
+
export type ShadcnSelectLabelProps = import('@proto.ui/prototypes-base/select').SelectLabelProps & ShadcnStyleProps;
|
|
29
|
+
export type ShadcnSelectSeparatorProps = import('@proto.ui/prototypes-base/select').SelectSeparatorProps & ShadcnStyleProps;
|
|
30
|
+
/** Existing structural parts accept the same public family selection. */
|
|
31
|
+
export type ShadcnSelectSurfaceProps = ShadcnStyleProps;
|
|
32
|
+
export type ShadcnSelectViewportProps = ShadcnStyleProps;
|
|
33
|
+
export type ShadcnSelectItemTextProps = ShadcnStyleProps;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ShadcnSelectValueProps } from "./types.js";
|
|
2
|
+
declare const selectValue: import("@proto.ui/core").Prototype<ShadcnSelectValueProps, import("@proto.ui/prototypes-base").SelectValueExposes>;
|
|
2
3
|
/** P-SHADCN-SELECT-VALUE-DIRECT-ENTRY; parity is bounded by P-SHADCN-SELECT-VALUE-COMPATIBILITY-SUBSET. */
|
|
3
4
|
export default selectValue;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { setupSelectStyle } from "./style.js";
|
|
2
|
+
import { definePrototype, tw } from '@proto.ui/core';
|
|
2
3
|
import { asSelectValue } from '@proto.ui/prototypes-base/select';
|
|
3
4
|
const selectValue = definePrototype({
|
|
4
5
|
name: 'shadcn-select-value',
|
|
5
|
-
setup() {
|
|
6
|
+
setup(def) {
|
|
7
|
+
const style = setupSelectStyle(def);
|
|
8
|
+
def.feedback.style.use(tw('line-clamp-1 flex items-center'));
|
|
9
|
+
def.rule({
|
|
10
|
+
when: (w) => w.state(style).eq('new-york-v4'),
|
|
11
|
+
intent: (i) => i.feedback.style.use(tw('gap-2')),
|
|
12
|
+
});
|
|
13
|
+
def.rule({
|
|
14
|
+
when: (w) => w.not(w.state(style).eq('new-york-v4')),
|
|
15
|
+
intent: (i) => i.feedback.style.use(tw('flex-1 text-left gap-1.5')),
|
|
16
|
+
});
|
|
6
17
|
// P-SHADCN-SELECT-VALUE-BASE-INHERITANCE,
|
|
7
18
|
// P-SHADCN-SELECT-VALUE-CURRENT-BASE-DEVIATIONS,
|
|
8
19
|
// P-SHADCN-SELECT-VALUE-DISPLAY-RENDER
|
|
9
|
-
const value = asSelectValue()
|
|
10
|
-
|
|
20
|
+
const value = asSelectValue();
|
|
21
|
+
const handles = value.stateHandles;
|
|
22
|
+
if (!handles)
|
|
11
23
|
throw new Error('[shadcn-select-value] Select Value must project displayValue.');
|
|
12
|
-
return () => (
|
|
24
|
+
return value.render ?? (() => (handles.displayValue.get() ? [handles.displayValue.get()] : null));
|
|
13
25
|
},
|
|
14
26
|
});
|
|
15
27
|
/** P-SHADCN-SELECT-VALUE-DIRECT-ENTRY; parity is bounded by P-SHADCN-SELECT-VALUE-COMPATIBILITY-SUBSET. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { definePrototype, tw } from '@proto.ui/core';
|
|
2
|
+
import { asSelectViewport } from '@proto.ui/prototypes-base/select';
|
|
3
|
+
import { SELECT_VISUAL } from "./visual.js";
|
|
4
|
+
import { setupSelectStyle } from "./style.js";
|
|
5
|
+
export default definePrototype({
|
|
6
|
+
name: 'shadcn-select-viewport',
|
|
7
|
+
setup(def) {
|
|
8
|
+
const inherited = asSelectViewport();
|
|
9
|
+
const style = setupSelectStyle(def);
|
|
10
|
+
const position = def.state.string('selectViewportPosition', 'item-aligned');
|
|
11
|
+
def.context.subscribe(SELECT_VISUAL, (_run, next) => position.set(next.position, 'reason: select viewport position'));
|
|
12
|
+
def.lifecycle.onCreated((run) => position.set(run.context.read(SELECT_VISUAL).position, 'reason: select viewport initial position'));
|
|
13
|
+
def.feedback.style.use(tw('relative flex-1 min-h-0 overflow-hidden overflow-y-auto'));
|
|
14
|
+
def.rule({
|
|
15
|
+
when: (w) => w.state(style).eq('new-york-v4'),
|
|
16
|
+
intent: (i) => i.feedback.style.use(tw('p-1')),
|
|
17
|
+
});
|
|
18
|
+
def.rule({
|
|
19
|
+
when: (w) => w.not(w.state(style).eq('new-york-v4')),
|
|
20
|
+
intent: (i) => i.feedback.style.use(tw('p-0')),
|
|
21
|
+
});
|
|
22
|
+
def.rule({
|
|
23
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(position).eq('popper')),
|
|
24
|
+
intent: (i) => i.feedback.style.use(
|
|
25
|
+
// Upstream v4 has no viewport: the List is the popup's unpadded flex
|
|
26
|
+
// child, so the popup never derives its height from the anchor.
|
|
27
|
+
tw('w-full min-w-[var(--proto-ui-anchor-width)] scroll-my-1')),
|
|
28
|
+
});
|
|
29
|
+
return inherited.render;
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DefHandle } from '@proto.ui/core';
|
|
2
|
+
import type { ShadcnStyleProps } from "../style-scope/index.js";
|
|
3
|
+
/** Private visual projection; Base Content is the sole presence owner. */
|
|
4
|
+
export declare const SELECT_VISUAL: import("@proto.ui/types").ContextKey<{
|
|
5
|
+
phase: string;
|
|
6
|
+
side: string;
|
|
7
|
+
position: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function setupSelectPaint<Props extends ShadcnStyleProps, Exposes = Record<string, unknown>>(def: DefHandle<Props, Exposes>): import("@proto.ui/core").OwnedDecorationTarget;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { createContextKey, tw } from '@proto.ui/core';
|
|
2
|
+
import { setupSelectStyle } from "./style.js";
|
|
3
|
+
import { SELECT_SURFACE_STYLE, SELECT_TRANSLUCENT_STYLES } from "./recipes.js";
|
|
4
|
+
/** Private visual projection; Base Content is the sole presence owner. */
|
|
5
|
+
export const SELECT_VISUAL = createContextKey('shadcn-select-visual');
|
|
6
|
+
export function setupSelectPaint(def) {
|
|
7
|
+
const style = setupSelectStyle(def);
|
|
8
|
+
const backdrop = setupSelectBackdrop(def, style);
|
|
9
|
+
const phase = def.state.string('selectPaintPhase', 'closed');
|
|
10
|
+
const side = def.state.string('selectPaintSide', 'bottom');
|
|
11
|
+
const position = def.state.string('selectPaintPosition', 'item-aligned');
|
|
12
|
+
const sync = (next) => {
|
|
13
|
+
phase.set(next.phase, 'reason: select visual phase');
|
|
14
|
+
side.set(next.side, 'reason: select visual side');
|
|
15
|
+
position.set(next.position, 'reason: select visual position');
|
|
16
|
+
};
|
|
17
|
+
def.context.subscribe(SELECT_VISUAL, (_run, next) => sync(next));
|
|
18
|
+
def.lifecycle.onCreated((run) => sync(run.context.read(SELECT_VISUAL)));
|
|
19
|
+
def.rule({
|
|
20
|
+
when: (w) => w.state(style).eq('new-york-v4'),
|
|
21
|
+
intent: (i) => i.feedback.style.use(tw('relative z-50 flex flex-col box-border max-h-full overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover text-popover-foreground shadow-md outline-none duration-150')),
|
|
22
|
+
});
|
|
23
|
+
// P-SHADCN-SELECT-STYLE: pinned cn-select-content + cn-menu-translucent per style.
|
|
24
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
25
|
+
def.rule({
|
|
26
|
+
when: (w) => w.state(style).eq(profile),
|
|
27
|
+
intent: (i) => i.feedback.style.use(SELECT_SURFACE_STYLE[profile]),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
def.rule({
|
|
31
|
+
when: (w) => w.all(w.state(position).eq('popper'), w.state(style).eq('new-york-v4')),
|
|
32
|
+
intent: (i) => i.feedback.style.use(tw('min-w-[8rem]')),
|
|
33
|
+
});
|
|
34
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
35
|
+
def.rule({
|
|
36
|
+
when: (w) => w.all(w.state(position).eq('popper'), w.state(style).eq(profile)),
|
|
37
|
+
intent: (i) => i.feedback.style.use(profile === 'mira'
|
|
38
|
+
? tw('min-w-32 w-[var(--proto-ui-anchor-width)]')
|
|
39
|
+
: tw('min-w-36 w-[var(--proto-ui-anchor-width)]')),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// In-place sizing belongs to the selected row. The host includes Group,
|
|
43
|
+
// Viewport and border gutters in the containing frame, outside that row.
|
|
44
|
+
// A family minimum popup width must not enlarge a narrower Trigger's row.
|
|
45
|
+
def.rule({
|
|
46
|
+
when: (w) => w.state(position).eq('item-aligned'),
|
|
47
|
+
intent: (i) => i.feedback.style.use(tw('min-w-0 w-full')),
|
|
48
|
+
});
|
|
49
|
+
for (const profile of ['luma', 'rhea']) {
|
|
50
|
+
def.rule({
|
|
51
|
+
when: (w) => w.all(w.state(style).eq(profile), w.meta('colorScheme').eq('dark')),
|
|
52
|
+
intent: (i) => i.feedback.style.use(tw('ring-foreground/10')),
|
|
53
|
+
});
|
|
54
|
+
def.rule({
|
|
55
|
+
when: (w) => w.all(w.state(style).eq(profile), w.not(w.meta('colorScheme').eq('dark'))),
|
|
56
|
+
intent: (i) => i.feedback.style.use(tw('ring-foreground/5')),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
def.rule({
|
|
60
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.any(w.state(phase).eq('entering'), w.state(phase).eq('entered'))),
|
|
61
|
+
intent: (i) => i.feedback.style.use(tw('animate-in fade-in-0 zoom-in-95')),
|
|
62
|
+
});
|
|
63
|
+
for (const [value, animation, translation] of [
|
|
64
|
+
['bottom', tw('slide-in-from-top-2'), tw('translate-y-1')],
|
|
65
|
+
['top', tw('slide-in-from-bottom-2'), tw('-translate-y-1')],
|
|
66
|
+
['left', tw('slide-in-from-right-2'), tw('-translate-x-1')],
|
|
67
|
+
['right', tw('slide-in-from-left-2'), tw('translate-x-1')],
|
|
68
|
+
]) {
|
|
69
|
+
def.rule({
|
|
70
|
+
when: (w) => w.all(w.state(style).eq('new-york-v4'), w.state(position).eq('popper'), w.state(side).eq(value)),
|
|
71
|
+
intent: (i) => i.feedback.style.use(animation),
|
|
72
|
+
});
|
|
73
|
+
def.rule({
|
|
74
|
+
when: (w) => w.all(w.state(side).eq(value), w.state(position).eq('popper')),
|
|
75
|
+
intent: (i) => i.feedback.style.use(translation),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return backdrop;
|
|
79
|
+
}
|
|
80
|
+
/** Translucent is part of the fixed upstream Select Content composition, not an opt-in skin. */
|
|
81
|
+
function setupSelectBackdrop(def, style) {
|
|
82
|
+
const target = def.feedback.style.declareDecoration();
|
|
83
|
+
// cn-menu-translucent before: backdrop-blur-2xl backdrop-saturate-150 on every
|
|
84
|
+
// modern profile; New York v4 has no translucent decoration upstream.
|
|
85
|
+
for (const profile of SELECT_TRANSLUCENT_STYLES) {
|
|
86
|
+
def.rule({
|
|
87
|
+
when: (w) => w.state(style).eq(profile),
|
|
88
|
+
intent: (i) => i.feedback.style
|
|
89
|
+
.to(target)
|
|
90
|
+
.use(tw('absolute inset-0 -z-1 rounded-[inherit] backdrop-filter-[blur(40px)_saturate(1.5)]')),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return target;
|
|
94
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default, default as shadcnSeparatorRoot } from
|
|
2
|
-
export type { ShadcnSeparatorRootProps, ShadcnSeparatorRootExposes, ShadcnSeparatorRootStateHandles, ShadcnSeparatorRootAsHookContract, } from
|
|
1
|
+
export { default, default as shadcnSeparatorRoot } from "./root.proto.js";
|
|
2
|
+
export type { ShadcnSeparatorRootProps, ShadcnSeparatorRootExposes, ShadcnSeparatorRootStateHandles, ShadcnSeparatorRootAsHookContract, } from "./root.proto.js";
|
package/dist/separator/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, default as shadcnSeparatorRoot } from
|
|
1
|
+
export { default, default as shadcnSeparatorRoot } from "./root.proto.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadcnSeparatorRootProps } from
|
|
1
|
+
import type { ShadcnSeparatorRootProps } from "./types.js";
|
|
2
2
|
declare const separatorRoot: import("@proto.ui/core").Prototype<ShadcnSeparatorRootProps, import("@proto.ui/prototypes-base").SeparatorRootExposes>;
|
|
3
3
|
/**
|
|
4
4
|
* P-SHADCN-SEPARATOR-DIRECT-ENTRY exposes the current Root projection.
|
|
@@ -6,5 +6,5 @@ declare const separatorRoot: import("@proto.ui/core").Prototype<ShadcnSeparatorR
|
|
|
6
6
|
* P-SHADCN-SEPARATOR-AS-CHILD-OMISSION is intentional under D-AS-CHILD-OMISSION-0001,
|
|
7
7
|
* while data-slot, className and native prop forwarding remain parity gaps.
|
|
8
8
|
*/
|
|
9
|
-
export type { ShadcnSeparatorRootProps, ShadcnSeparatorRootExposes, ShadcnSeparatorRootStateHandles, ShadcnSeparatorRootAsHookContract, } from
|
|
9
|
+
export type { ShadcnSeparatorRootProps, ShadcnSeparatorRootExposes, ShadcnSeparatorRootStateHandles, ShadcnSeparatorRootAsHookContract, } from "./types.js";
|
|
10
10
|
export default separatorRoot;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { definePrototype, tw } from '@proto.ui/core';
|
|
2
2
|
import { asSeparatorRoot } from '@proto.ui/prototypes-base/separator';
|
|
3
|
-
|
|
3
|
+
import { setupShadcnStyleSelection } from "../style-scope/index.js";
|
|
4
|
+
const ROOT_BASE_TOKENS = ['block', 'shrink-0', 'bg-border'].join(' ');
|
|
4
5
|
const separatorRoot = definePrototype({
|
|
5
6
|
name: 'shadcn-separator-root',
|
|
7
|
+
modules: asSeparatorRoot.modules,
|
|
6
8
|
setup(def) {
|
|
7
9
|
// P-SHADCN-SEPARATOR-BASE-INHERITANCE,
|
|
8
10
|
// P-SHADCN-SEPARATOR-CURRENT-BASE-DEVIATIONS
|
|
@@ -11,6 +13,7 @@ const separatorRoot = definePrototype({
|
|
|
11
13
|
throw new Error('[shadcn-separator-root] asSeparatorRoot must project Separator root state handles.');
|
|
12
14
|
}
|
|
13
15
|
const { orientation } = separatorState;
|
|
16
|
+
const style = setupShadcnStyleSelection(def, 'new-york-v4');
|
|
14
17
|
// P-SHADCN-SEPARATOR-CURRENT-VISUAL-SURFACE
|
|
15
18
|
def.feedback.style.use(tw(ROOT_BASE_TOKENS));
|
|
16
19
|
// P-SHADCN-SEPARATOR-STATE-DRIVEN-GEOMETRY
|
|
@@ -19,9 +22,13 @@ const separatorRoot = definePrototype({
|
|
|
19
22
|
intent: (i) => i.feedback.style.use(tw('h-px w-full')),
|
|
20
23
|
});
|
|
21
24
|
def.rule({
|
|
22
|
-
when: (w) => w.state(orientation).eq('vertical'),
|
|
25
|
+
when: (w) => w.all(w.state(orientation).eq('vertical'), w.state(style).eq('new-york-v4')),
|
|
23
26
|
intent: (i) => i.feedback.style.use(tw('h-full w-px')),
|
|
24
27
|
});
|
|
28
|
+
def.rule({
|
|
29
|
+
when: (w) => w.all(w.state(orientation).eq('vertical'), w.not(w.state(style).eq('new-york-v4'))),
|
|
30
|
+
intent: (i) => i.feedback.style.use(tw('w-px self-stretch')),
|
|
31
|
+
});
|
|
25
32
|
// P-SHADCN-SEPARATOR-CONTENTLESS: the caller prototype owns its own renderer,
|
|
26
33
|
// so the inherited Base contentless renderer has to be restated here.
|
|
27
34
|
return () => null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SeparatorRootAsHookContract, SeparatorRootExposes, SeparatorRootProps, SeparatorRootStateHandles } from '@proto.ui/prototypes-base/separator';
|
|
2
|
-
|
|
2
|
+
import type { ShadcnStyleProps } from "../style-scope/index.js";
|
|
3
|
+
export interface ShadcnSeparatorRootProps extends SeparatorRootProps, ShadcnStyleProps {
|
|
3
4
|
}
|
|
4
5
|
export type ShadcnSeparatorRootExposes = SeparatorRootExposes;
|
|
5
6
|
export type ShadcnSeparatorRootStateHandles = SeparatorRootStateHandles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SliderFieldThumbExposes } from '@proto.ui/prototypes-base/slider';
|
|
2
|
+
import { type ShadcnSliderPartProps } from "./scalar-visual.js";
|
|
3
|
+
declare const _default: import("@proto.ui/core").Prototype<ShadcnSliderPartProps, SliderFieldThumbExposes>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { sliderThumbPaint } from "./paint.js";
|
|
2
|
+
import { definePrototype, tw } from '@proto.ui/core';
|
|
3
|
+
import { asSliderFieldThumb } from '@proto.ui/prototypes-base/slider';
|
|
4
|
+
import { SHADCN_STYLE_IDS } from "../style-scope/index.js";
|
|
5
|
+
import { setupScalarSliderStyle, SCALAR_THUMB_HIT, } from "./scalar-visual.js";
|
|
6
|
+
export default definePrototype({
|
|
7
|
+
name: 'shadcn-slider-field-thumb',
|
|
8
|
+
modules: asSliderFieldThumb.modules,
|
|
9
|
+
setup(def) {
|
|
10
|
+
const inherited = asSliderFieldThumb();
|
|
11
|
+
const style = setupScalarSliderStyle(def);
|
|
12
|
+
def.feedback.style.use(tw('absolute left-[calc(var(--pui-display-percentage)*1%)] top-1/2 flex items-center justify-center -translate-x-1/2 -translate-y-1/2 outline-none select-none'));
|
|
13
|
+
for (const profile of SHADCN_STYLE_IDS) {
|
|
14
|
+
def.rule({
|
|
15
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(inherited.stateHandles.orientation).eq('horizontal')),
|
|
16
|
+
intent: (i) => i.feedback.style.use(SCALAR_THUMB_HIT[profile].horizontal),
|
|
17
|
+
});
|
|
18
|
+
def.rule({
|
|
19
|
+
when: (w) => w.all(w.state(style).eq(profile), w.state(inherited.stateHandles.orientation).eq('vertical')),
|
|
20
|
+
intent: (i) => i.feedback.style.use(SCALAR_THUMB_HIT[profile].vertical),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
def.rule({
|
|
24
|
+
when: (w) => w.state(inherited.stateHandles.disabled).eq(true),
|
|
25
|
+
intent: (i) => i.feedback.style.use(tw('pointer-events-none')),
|
|
26
|
+
});
|
|
27
|
+
def.rule({
|
|
28
|
+
when: (w) => w.state(inherited.stateHandles.orientation).eq('vertical'),
|
|
29
|
+
intent: (i) => i.feedback.style.use(tw('left-1/2 top-auto bottom-[calc(var(--pui-display-percentage)*1%)] translate-y-1/2')),
|
|
30
|
+
});
|
|
31
|
+
def.rule({
|
|
32
|
+
when: (w) => w.all(w.state(inherited.stateHandles.direction).eq('rtl'), w.state(inherited.stateHandles.orientation).eq('horizontal')),
|
|
33
|
+
intent: (i) => i.feedback.style.use(tw('left-auto right-[calc(var(--pui-display-percentage)*1%)] translate-x-1/2')),
|
|
34
|
+
});
|
|
35
|
+
const paint = sliderThumbPaint(def, inherited.stateHandles, style);
|
|
36
|
+
return (r) => [
|
|
37
|
+
r.decoration(paint),
|
|
38
|
+
inherited.render ? inherited.render(r) : r.slot(),
|
|
39
|
+
];
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { default as sliderRoot } from "./root.proto.js";
|
|
2
|
+
export { default as sliderLabel } from "./label.proto.js";
|
|
3
|
+
export { default as sliderTrack } from "./track.proto.js";
|
|
4
|
+
export { default as sliderIndicator } from "./indicator.proto.js";
|
|
5
|
+
export { default as sliderThumb } from "./thumb.proto.js";
|
|
6
|
+
export { default as sliderValue } from "./value.proto.js";
|
|
7
|
+
export type { ShadcnSliderRootProps, ShadcnSliderPartProps } from "./scalar-visual.js";
|
|
8
|
+
export type * from '@proto.ui/prototypes-base/slider';
|
|
9
|
+
export { default as sliderFieldThumb } from "./field-thumb.proto.js";
|
|
10
|
+
export { default as sliderValuesRoot } from "./values-root.proto.js";
|
|
11
|
+
export { default as sliderValuesTrack } from "./values-track.proto.js";
|
|
12
|
+
export { default as sliderValuesThumb } from "./values-thumb.proto.js";
|
|
13
|
+
export { default as sliderValuesIndicator } from "./values-indicator.proto.js";
|
|
14
|
+
export { default as sliderValuesLabel } from "./values-label.proto.js";
|
|
15
|
+
export { default as sliderValuesValue } from "./values-value.proto.js";
|
|
16
|
+
export type { ShadcnSliderValuesRootProps } from "./values-root.proto.js";
|
|
17
|
+
export type { ShadcnSliderValuesPartProps } from "./values-visual.js";
|