@edo-w/flatline-solid 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/index.css +124 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +51 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card/index.css +112 -0
- package/dist/card/index.d.ts +68 -0
- package/dist/card/index.js +181 -0
- package/dist/card/index.js.map +1 -0
- package/dist/checkbox/index.css +75 -0
- package/dist/checkbox/index.d.ts +55 -0
- package/dist/checkbox/index.js +156 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/combobox/index.css +184 -0
- package/dist/combobox/index.d.ts +145 -0
- package/dist/combobox/index.js +894 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/dialog/index.css +218 -0
- package/dist/dialog/index.d.ts +65 -0
- package/dist/dialog/index.js +124 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/dropdown-menu/index.css +238 -0
- package/dist/dropdown-menu/index.d.ts +122 -0
- package/dist/dropdown-menu/index.js +199 -0
- package/dist/dropdown-menu/index.js.map +1 -0
- package/dist/flatline.css +467 -0
- package/dist/icons-CH4ghH8L.js +41 -0
- package/dist/icons-CH4ghH8L.js.map +1 -0
- package/dist/index-D-CV7Jz5.d.ts +30 -0
- package/dist/input/index.css +23 -0
- package/dist/input/index.d.ts +14 -0
- package/dist/input/index.js +24 -0
- package/dist/input/index.js.map +1 -0
- package/dist/label/index.css +11 -0
- package/dist/label/index.d.ts +14 -0
- package/dist/label/index.js +25 -0
- package/dist/label/index.js.map +1 -0
- package/dist/lite-CiFvU804.js +9 -0
- package/dist/lite-CiFvU804.js.map +1 -0
- package/dist/progress-bar/index.css +34 -0
- package/dist/progress-bar/index.d.ts +19 -0
- package/dist/progress-bar/index.js +61 -0
- package/dist/progress-bar/index.js.map +1 -0
- package/dist/radio/index.css +64 -0
- package/dist/radio/index.d.ts +55 -0
- package/dist/radio/index.js +143 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/select/index.css +53 -0
- package/dist/select/index.d.ts +16 -0
- package/dist/select/index.js +51 -0
- package/dist/select/index.js.map +1 -0
- package/dist/slider/index.css +59 -0
- package/dist/slider/index.d.ts +16 -0
- package/dist/slider/index.js +37 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/spinner/index.css +44 -0
- package/dist/spinner/index.d.ts +24 -0
- package/dist/spinner/index.js +48 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/switch/index.css +69 -0
- package/dist/switch/index.d.ts +22 -0
- package/dist/switch/index.js +75 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/table/index.css +50 -0
- package/dist/table/index.d.ts +64 -0
- package/dist/table/index.js +142 -0
- package/dist/table/index.js.map +1 -0
- package/dist/tabs/index.css +114 -0
- package/dist/tabs/index.d.ts +40 -0
- package/dist/tabs/index.js +67 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/textarea/index.css +35 -0
- package/dist/textarea/index.d.ts +14 -0
- package/dist/textarea/index.js +24 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/xstack/index.d.ts +1 -0
- package/dist/xstack/index.js +0 -0
- package/dist/ystack/index.css +26 -0
- package/dist/ystack/index.d.ts +25 -0
- package/dist/ystack/index.js +47 -0
- package/dist/ystack/index.js.map +1 -0
- package/package.json +30 -5
- package/dist/src/components/button/button.css +0 -156
- package/dist/src/components/button/button.d.ts +0 -9
- package/dist/src/components/button/button.jsx +0 -21
- package/dist/src/components/button/button.jsx.map +0 -1
- package/dist/src/components/button/class.d.ts +0 -16
- package/dist/src/components/button/class.js +0 -15
- package/dist/src/components/button/class.js.map +0 -1
- package/dist/src/components/button/index.d.ts +0 -2
- package/dist/src/components/button/index.js +0 -3
- package/dist/src/components/button/index.js.map +0 -1
- package/dist/src/components/card/card-action.css +0 -15
- package/dist/src/components/card/card-content.css +0 -13
- package/dist/src/components/card/card-footer.css +0 -39
- package/dist/src/components/card/card-header.css +0 -13
- package/dist/src/components/card/card-root.css +0 -31
- package/dist/src/components/card/card-subtitle.css +0 -12
- package/dist/src/components/card/card-title.css +0 -33
- package/dist/src/components/card/card.d.ts +0 -42
- package/dist/src/components/card/card.jsx +0 -86
- package/dist/src/components/card/card.jsx.map +0 -1
- package/dist/src/components/card/class.d.ts +0 -28
- package/dist/src/components/card/class.js +0 -27
- package/dist/src/components/card/class.js.map +0 -1
- package/dist/src/components/card/index.d.ts +0 -2
- package/dist/src/components/card/index.js +0 -3
- package/dist/src/components/card/index.js.map +0 -1
- package/dist/src/components/checkbox/checkbox-group.css +0 -9
- package/dist/src/components/checkbox/checkbox-group.d.ts +0 -3
- package/dist/src/components/checkbox/checkbox-group.jsx +0 -43
- package/dist/src/components/checkbox/checkbox-group.jsx.map +0 -1
- package/dist/src/components/checkbox/checkbox-root.css +0 -85
- package/dist/src/components/checkbox/checkbox-root.d.ts +0 -4
- package/dist/src/components/checkbox/checkbox-root.jsx +0 -55
- package/dist/src/components/checkbox/checkbox-root.jsx.map +0 -1
- package/dist/src/components/checkbox/checkbox.d.ts +0 -9
- package/dist/src/components/checkbox/checkbox.jsx +0 -6
- package/dist/src/components/checkbox/checkbox.jsx.map +0 -1
- package/dist/src/components/checkbox/class.d.ts +0 -8
- package/dist/src/components/checkbox/class.js +0 -9
- package/dist/src/components/checkbox/class.js.map +0 -1
- package/dist/src/components/checkbox/context.d.ts +0 -9
- package/dist/src/components/checkbox/context.js +0 -6
- package/dist/src/components/checkbox/context.js.map +0 -1
- package/dist/src/components/checkbox/index.d.ts +0 -6
- package/dist/src/components/checkbox/index.js +0 -7
- package/dist/src/components/checkbox/index.js.map +0 -1
- package/dist/src/components/checkbox/types.d.ts +0 -16
- package/dist/src/components/checkbox/types.js +0 -1
- package/dist/src/components/checkbox/types.js.map +0 -1
- package/dist/src/components/combobox/class.d.ts +0 -13
- package/dist/src/components/combobox/class.js +0 -14
- package/dist/src/components/combobox/class.js.map +0 -1
- package/dist/src/components/combobox/combobox-content.css +0 -20
- package/dist/src/components/combobox/combobox-content.d.ts +0 -2
- package/dist/src/components/combobox/combobox-content.jsx +0 -15
- package/dist/src/components/combobox/combobox-content.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-control.css +0 -29
- package/dist/src/components/combobox/combobox-control.d.ts +0 -3
- package/dist/src/components/combobox/combobox-control.jsx +0 -19
- package/dist/src/components/combobox/combobox-control.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-group.css +0 -32
- package/dist/src/components/combobox/combobox-group.d.ts +0 -2
- package/dist/src/components/combobox/combobox-group.jsx +0 -12
- package/dist/src/components/combobox/combobox-group.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-hidden-select.d.ts +0 -2
- package/dist/src/components/combobox/combobox-hidden-select.jsx +0 -8
- package/dist/src/components/combobox/combobox-hidden-select.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-icon.css +0 -11
- package/dist/src/components/combobox/combobox-icon.d.ts +0 -2
- package/dist/src/components/combobox/combobox-icon.jsx +0 -12
- package/dist/src/components/combobox/combobox-icon.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-input.css +0 -32
- package/dist/src/components/combobox/combobox-input.d.ts +0 -3
- package/dist/src/components/combobox/combobox-input.jsx +0 -101
- package/dist/src/components/combobox/combobox-input.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-item-indicator.css +0 -11
- package/dist/src/components/combobox/combobox-item-indicator.d.ts +0 -2
- package/dist/src/components/combobox/combobox-item-indicator.jsx +0 -16
- package/dist/src/components/combobox/combobox-item-indicator.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-item-label.d.ts +0 -2
- package/dist/src/components/combobox/combobox-item-label.jsx +0 -13
- package/dist/src/components/combobox/combobox-item-label.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-item.css +0 -48
- package/dist/src/components/combobox/combobox-item.d.ts +0 -3
- package/dist/src/components/combobox/combobox-item.jsx +0 -37
- package/dist/src/components/combobox/combobox-item.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-listbox.css +0 -21
- package/dist/src/components/combobox/combobox-listbox.d.ts +0 -2
- package/dist/src/components/combobox/combobox-listbox.jsx +0 -39
- package/dist/src/components/combobox/combobox-listbox.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-portal.d.ts +0 -2
- package/dist/src/components/combobox/combobox-portal.jsx +0 -6
- package/dist/src/components/combobox/combobox-portal.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-root.css +0 -12
- package/dist/src/components/combobox/combobox-root.d.ts +0 -3
- package/dist/src/components/combobox/combobox-root.jsx +0 -407
- package/dist/src/components/combobox/combobox-root.jsx.map +0 -1
- package/dist/src/components/combobox/combobox-trigger.css +0 -31
- package/dist/src/components/combobox/combobox-trigger.d.ts +0 -3
- package/dist/src/components/combobox/combobox-trigger.jsx +0 -30
- package/dist/src/components/combobox/combobox-trigger.jsx.map +0 -1
- package/dist/src/components/combobox/combobox.d.ts +0 -43
- package/dist/src/components/combobox/combobox.jsx +0 -39
- package/dist/src/components/combobox/combobox.jsx.map +0 -1
- package/dist/src/components/combobox/context.d.ts +0 -47
- package/dist/src/components/combobox/context.js +0 -18
- package/dist/src/components/combobox/context.js.map +0 -1
- package/dist/src/components/combobox/index.d.ts +0 -2
- package/dist/src/components/combobox/index.js +0 -3
- package/dist/src/components/combobox/index.js.map +0 -1
- package/dist/src/components/combobox/types.d.ts +0 -68
- package/dist/src/components/combobox/types.js +0 -1
- package/dist/src/components/combobox/types.js.map +0 -1
- package/dist/src/components/combobox/util.d.ts +0 -6
- package/dist/src/components/combobox/util.js +0 -58
- package/dist/src/components/combobox/util.js.map +0 -1
- package/dist/src/components/dialog/class.d.ts +0 -18
- package/dist/src/components/dialog/class.js +0 -18
- package/dist/src/components/dialog/class.js.map +0 -1
- package/dist/src/components/dialog/dialog-close-button.css +0 -48
- package/dist/src/components/dialog/dialog-content.css +0 -89
- package/dist/src/components/dialog/dialog-description.css +0 -6
- package/dist/src/components/dialog/dialog-header.css +0 -12
- package/dist/src/components/dialog/dialog-overlay.css +0 -43
- package/dist/src/components/dialog/dialog-positioner.css +0 -14
- package/dist/src/components/dialog/dialog-title.css +0 -6
- package/dist/src/components/dialog/dialog-trigger.css +0 -63
- package/dist/src/components/dialog/dialog.d.ts +0 -50
- package/dist/src/components/dialog/dialog.jsx +0 -89
- package/dist/src/components/dialog/dialog.jsx.map +0 -1
- package/dist/src/components/dialog/index.d.ts +0 -2
- package/dist/src/components/dialog/index.js +0 -3
- package/dist/src/components/dialog/index.js.map +0 -1
- package/dist/src/components/dropdown-menu/class.d.ts +0 -16
- package/dist/src/components/dropdown-menu/class.js +0 -17
- package/dist/src/components/dropdown-menu/class.js.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-arrow.css +0 -7
- package/dist/src/components/dropdown-menu/dropdown-menu-arrow.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-arrow.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-arrow.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-checkbox-item.css +0 -38
- package/dist/src/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-checkbox-item.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-checkbox-item.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-content.css +0 -50
- package/dist/src/components/dropdown-menu/dropdown-menu-content.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-content.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-content.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-group-label.css +0 -15
- package/dist/src/components/dropdown-menu/dropdown-menu-group-label.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-group-label.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-group-label.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-group.d.ts +0 -2
- package/dist/src/components/dropdown-menu/dropdown-menu-group.jsx +0 -7
- package/dist/src/components/dropdown-menu/dropdown-menu-group.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-icon.css +0 -21
- package/dist/src/components/dropdown-menu/dropdown-menu-icon.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-icon.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-icon.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-item-indicator.css +0 -12
- package/dist/src/components/dropdown-menu/dropdown-menu-item-indicator.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-item-indicator.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-item-indicator.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-item-right-slot.css +0 -18
- package/dist/src/components/dropdown-menu/dropdown-menu-item-right-slot.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-item-right-slot.jsx +0 -11
- package/dist/src/components/dropdown-menu/dropdown-menu-item-right-slot.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-item.css +0 -37
- package/dist/src/components/dropdown-menu/dropdown-menu-item.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-item.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-item.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-portal.d.ts +0 -2
- package/dist/src/components/dropdown-menu/dropdown-menu-portal.jsx +0 -5
- package/dist/src/components/dropdown-menu/dropdown-menu-portal.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-group.d.ts +0 -2
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-group.jsx +0 -7
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-group.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-item.css +0 -38
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-item.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-item.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-radio-item.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-root.d.ts +0 -2
- package/dist/src/components/dropdown-menu/dropdown-menu-root.jsx +0 -5
- package/dist/src/components/dropdown-menu/dropdown-menu-root.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-separator.css +0 -11
- package/dist/src/components/dropdown-menu/dropdown-menu-separator.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-separator.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-separator.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-content.css +0 -26
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-content.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-content.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-content.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-trigger.css +0 -43
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-trigger.jsx +0 -10
- package/dist/src/components/dropdown-menu/dropdown-menu-sub-trigger.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-sub.d.ts +0 -2
- package/dist/src/components/dropdown-menu/dropdown-menu-sub.jsx +0 -5
- package/dist/src/components/dropdown-menu/dropdown-menu-sub.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu-trigger.css +0 -7
- package/dist/src/components/dropdown-menu/dropdown-menu-trigger.d.ts +0 -3
- package/dist/src/components/dropdown-menu/dropdown-menu-trigger.jsx +0 -16
- package/dist/src/components/dropdown-menu/dropdown-menu-trigger.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/dropdown-menu.d.ts +0 -43
- package/dist/src/components/dropdown-menu/dropdown-menu.jsx +0 -39
- package/dist/src/components/dropdown-menu/dropdown-menu.jsx.map +0 -1
- package/dist/src/components/dropdown-menu/index.d.ts +0 -21
- package/dist/src/components/dropdown-menu/index.js +0 -22
- package/dist/src/components/dropdown-menu/index.js.map +0 -1
- package/dist/src/components/dropdown-menu/types.d.ts +0 -21
- package/dist/src/components/dropdown-menu/types.js +0 -1
- package/dist/src/components/dropdown-menu/types.js.map +0 -1
- package/dist/src/components/input/class.d.ts +0 -3
- package/dist/src/components/input/class.js +0 -4
- package/dist/src/components/input/class.js.map +0 -1
- package/dist/src/components/input/index.d.ts +0 -2
- package/dist/src/components/input/index.js +0 -3
- package/dist/src/components/input/index.js.map +0 -1
- package/dist/src/components/input/input.css +0 -34
- package/dist/src/components/input/input.d.ts +0 -6
- package/dist/src/components/input/input.jsx +0 -10
- package/dist/src/components/input/input.jsx.map +0 -1
- package/dist/src/components/label/class.d.ts +0 -3
- package/dist/src/components/label/class.js +0 -4
- package/dist/src/components/label/class.js.map +0 -1
- package/dist/src/components/label/index.d.ts +0 -2
- package/dist/src/components/label/index.js +0 -3
- package/dist/src/components/label/index.js.map +0 -1
- package/dist/src/components/label/label.css +0 -16
- package/dist/src/components/label/label.d.ts +0 -6
- package/dist/src/components/label/label.jsx +0 -12
- package/dist/src/components/label/label.jsx.map +0 -1
- package/dist/src/components/progress-bar/class.d.ts +0 -4
- package/dist/src/components/progress-bar/class.js +0 -5
- package/dist/src/components/progress-bar/class.js.map +0 -1
- package/dist/src/components/progress-bar/index.d.ts +0 -2
- package/dist/src/components/progress-bar/index.js +0 -3
- package/dist/src/components/progress-bar/index.js.map +0 -1
- package/dist/src/components/progress-bar/progress-bar.css +0 -43
- package/dist/src/components/progress-bar/progress-bar.d.ts +0 -9
- package/dist/src/components/progress-bar/progress-bar.jsx +0 -24
- package/dist/src/components/progress-bar/progress-bar.jsx.map +0 -1
- package/dist/src/components/radio/class.d.ts +0 -8
- package/dist/src/components/radio/class.js +0 -9
- package/dist/src/components/radio/class.js.map +0 -1
- package/dist/src/components/radio/context.d.ts +0 -9
- package/dist/src/components/radio/context.js +0 -6
- package/dist/src/components/radio/context.js.map +0 -1
- package/dist/src/components/radio/index.d.ts +0 -6
- package/dist/src/components/radio/index.js +0 -7
- package/dist/src/components/radio/index.js.map +0 -1
- package/dist/src/components/radio/radio-group.css +0 -9
- package/dist/src/components/radio/radio-group.d.ts +0 -3
- package/dist/src/components/radio/radio-group.jsx +0 -33
- package/dist/src/components/radio/radio-group.jsx.map +0 -1
- package/dist/src/components/radio/radio-root.css +0 -75
- package/dist/src/components/radio/radio-root.d.ts +0 -4
- package/dist/src/components/radio/radio-root.jsx +0 -51
- package/dist/src/components/radio/radio-root.jsx.map +0 -1
- package/dist/src/components/radio/radio.d.ts +0 -11
- package/dist/src/components/radio/radio.jsx +0 -7
- package/dist/src/components/radio/radio.jsx.map +0 -1
- package/dist/src/components/radio/types.d.ts +0 -16
- package/dist/src/components/radio/types.js +0 -1
- package/dist/src/components/radio/types.js.map +0 -1
- package/dist/src/components/select/class.d.ts +0 -5
- package/dist/src/components/select/class.js +0 -6
- package/dist/src/components/select/class.js.map +0 -1
- package/dist/src/components/select/index.d.ts +0 -2
- package/dist/src/components/select/index.js +0 -3
- package/dist/src/components/select/index.js.map +0 -1
- package/dist/src/components/select/select.css +0 -76
- package/dist/src/components/select/select.d.ts +0 -6
- package/dist/src/components/select/select.jsx +0 -16
- package/dist/src/components/select/select.jsx.map +0 -1
- package/dist/src/components/slider/class.d.ts +0 -3
- package/dist/src/components/slider/class.js +0 -4
- package/dist/src/components/slider/class.js.map +0 -1
- package/dist/src/components/slider/index.d.ts +0 -2
- package/dist/src/components/slider/index.js +0 -3
- package/dist/src/components/slider/index.js.map +0 -1
- package/dist/src/components/slider/slider.css +0 -83
- package/dist/src/components/slider/slider.d.ts +0 -7
- package/dist/src/components/slider/slider.jsx +0 -19
- package/dist/src/components/slider/slider.jsx.map +0 -1
- package/dist/src/components/spinner/class.d.ts +0 -10
- package/dist/src/components/spinner/class.js +0 -10
- package/dist/src/components/spinner/class.js.map +0 -1
- package/dist/src/components/spinner/index.d.ts +0 -2
- package/dist/src/components/spinner/index.js +0 -3
- package/dist/src/components/spinner/index.js.map +0 -1
- package/dist/src/components/spinner/spinner.css +0 -51
- package/dist/src/components/spinner/spinner.d.ts +0 -9
- package/dist/src/components/spinner/spinner.jsx +0 -22
- package/dist/src/components/spinner/spinner.jsx.map +0 -1
- package/dist/src/components/switch/class.d.ts +0 -7
- package/dist/src/components/switch/class.js +0 -8
- package/dist/src/components/switch/class.js.map +0 -1
- package/dist/src/components/switch/index.d.ts +0 -2
- package/dist/src/components/switch/index.js +0 -3
- package/dist/src/components/switch/index.js.map +0 -1
- package/dist/src/components/switch/switch.css +0 -90
- package/dist/src/components/switch/switch.d.ts +0 -9
- package/dist/src/components/switch/switch.jsx +0 -28
- package/dist/src/components/switch/switch.jsx.map +0 -1
- package/dist/src/components/table/class.d.ts +0 -10
- package/dist/src/components/table/class.js +0 -11
- package/dist/src/components/table/class.js.map +0 -1
- package/dist/src/components/table/index.d.ts +0 -11
- package/dist/src/components/table/index.js +0 -12
- package/dist/src/components/table/index.js.map +0 -1
- package/dist/src/components/table/table-body.d.ts +0 -2
- package/dist/src/components/table/table-body.jsx +0 -10
- package/dist/src/components/table/table-body.jsx.map +0 -1
- package/dist/src/components/table/table-caption.css +0 -11
- package/dist/src/components/table/table-caption.d.ts +0 -3
- package/dist/src/components/table/table-caption.jsx +0 -11
- package/dist/src/components/table/table-caption.jsx.map +0 -1
- package/dist/src/components/table/table-cell.css +0 -12
- package/dist/src/components/table/table-cell.d.ts +0 -3
- package/dist/src/components/table/table-cell.jsx +0 -11
- package/dist/src/components/table/table-cell.jsx.map +0 -1
- package/dist/src/components/table/table-footer.css +0 -15
- package/dist/src/components/table/table-footer.d.ts +0 -3
- package/dist/src/components/table/table-footer.jsx +0 -11
- package/dist/src/components/table/table-footer.jsx.map +0 -1
- package/dist/src/components/table/table-head.css +0 -16
- package/dist/src/components/table/table-head.d.ts +0 -3
- package/dist/src/components/table/table-head.jsx +0 -11
- package/dist/src/components/table/table-head.jsx.map +0 -1
- package/dist/src/components/table/table-header.d.ts +0 -2
- package/dist/src/components/table/table-header.jsx +0 -10
- package/dist/src/components/table/table-header.jsx.map +0 -1
- package/dist/src/components/table/table-root.css +0 -12
- package/dist/src/components/table/table-root.d.ts +0 -3
- package/dist/src/components/table/table-root.jsx +0 -11
- package/dist/src/components/table/table-root.jsx.map +0 -1
- package/dist/src/components/table/table-row.css +0 -6
- package/dist/src/components/table/table-row.d.ts +0 -3
- package/dist/src/components/table/table-row.jsx +0 -11
- package/dist/src/components/table/table-row.jsx.map +0 -1
- package/dist/src/components/table/table.d.ts +0 -23
- package/dist/src/components/table/table.jsx +0 -19
- package/dist/src/components/table/table.jsx.map +0 -1
- package/dist/src/components/table/types.d.ts +0 -9
- package/dist/src/components/table/types.js +0 -1
- package/dist/src/components/table/types.js.map +0 -1
- package/dist/src/components/tabs/class.d.ts +0 -12
- package/dist/src/components/tabs/class.js +0 -12
- package/dist/src/components/tabs/class.js.map +0 -1
- package/dist/src/components/tabs/index.d.ts +0 -2
- package/dist/src/components/tabs/index.js +0 -3
- package/dist/src/components/tabs/index.js.map +0 -1
- package/dist/src/components/tabs/tabs-content.css +0 -24
- package/dist/src/components/tabs/tabs-indicator.css +0 -32
- package/dist/src/components/tabs/tabs-list.css +0 -26
- package/dist/src/components/tabs/tabs-root.css +0 -34
- package/dist/src/components/tabs/tabs-trigger.css +0 -58
- package/dist/src/components/tabs/tabs.d.ts +0 -27
- package/dist/src/components/tabs/tabs.jsx +0 -47
- package/dist/src/components/tabs/tabs.jsx.map +0 -1
- package/dist/src/components/textarea/class.d.ts +0 -3
- package/dist/src/components/textarea/class.js +0 -4
- package/dist/src/components/textarea/class.js.map +0 -1
- package/dist/src/components/textarea/index.d.ts +0 -2
- package/dist/src/components/textarea/index.js +0 -3
- package/dist/src/components/textarea/index.js.map +0 -1
- package/dist/src/components/textarea/textarea.css +0 -46
- package/dist/src/components/textarea/textarea.d.ts +0 -6
- package/dist/src/components/textarea/textarea.jsx +0 -10
- package/dist/src/components/textarea/textarea.jsx.map +0 -1
- package/dist/src/components/xstack/class.d.ts +0 -12
- package/dist/src/components/xstack/class.js +0 -12
- package/dist/src/components/xstack/class.js.map +0 -1
- package/dist/src/components/xstack/index.d.ts +0 -1
- package/dist/src/components/xstack/index.js +0 -1
- package/dist/src/components/xstack/index.js.map +0 -1
- package/dist/src/components/xstack/xstack.css +0 -34
- package/dist/src/components/xstack/xstack.d.ts +0 -9
- package/dist/src/components/xstack/xstack.jsx +0 -15
- package/dist/src/components/xstack/xstack.jsx.map +0 -1
- package/dist/src/components/ystack/class.d.ts +0 -11
- package/dist/src/components/ystack/class.js +0 -11
- package/dist/src/components/ystack/class.js.map +0 -1
- package/dist/src/components/ystack/index.d.ts +0 -2
- package/dist/src/components/ystack/index.js +0 -3
- package/dist/src/components/ystack/index.js.map +0 -1
- package/dist/src/components/ystack/ystack.css +0 -31
- package/dist/src/components/ystack/ystack.d.ts +0 -9
- package/dist/src/components/ystack/ystack.jsx +0 -15
- package/dist/src/components/ystack/ystack.jsx.map +0 -1
- package/dist/src/icons/check-icon.d.ts +0 -2
- package/dist/src/icons/check-icon.jsx +0 -8
- package/dist/src/icons/check-icon.jsx.map +0 -1
- package/dist/src/icons/chevron-down-icon.d.ts +0 -2
- package/dist/src/icons/chevron-down-icon.jsx +0 -8
- package/dist/src/icons/chevron-down-icon.jsx.map +0 -1
- package/dist/src/icons/chevron-right-icon.d.ts +0 -2
- package/dist/src/icons/chevron-right-icon.jsx +0 -8
- package/dist/src/icons/chevron-right-icon.jsx.map +0 -1
- package/dist/src/icons/dot-filled-icon.d.ts +0 -2
- package/dist/src/icons/dot-filled-icon.jsx +0 -8
- package/dist/src/icons/dot-filled-icon.jsx.map +0 -1
- package/dist/src/icons/index.d.ts +0 -5
- package/dist/src/icons/index.js +0 -6
- package/dist/src/icons/index.js.map +0 -1
- package/dist/src/icons/types.d.ts +0 -5
- package/dist/src/icons/types.js +0 -1
- package/dist/src/icons/types.js.map +0 -1
- package/dist/src/index.d.ts +0 -19
- package/dist/src/index.js +0 -20
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/reflect.d.ts +0 -1
- package/dist/src/lib/reflect.js +0 -4
- package/dist/src/lib/reflect.js.map +0 -1
- package/dist/src/style/colors.css +0 -267
- package/dist/src/style/flatline.css +0 -12
- package/dist/src/style/reset.css +0 -175
- package/dist/src/style/tokens.css +0 -139
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx/lite';
|
|
2
|
-
import { Show, splitProps } from 'solid-js';
|
|
3
|
-
import { CheckIcon } from '#src/icons';
|
|
4
|
-
import { comboboxClass } from './class';
|
|
5
|
-
import { useComboboxItemContext } from './context';
|
|
6
|
-
export function ComboboxItemIndicator(props) {
|
|
7
|
-
const item = useComboboxItemContext();
|
|
8
|
-
const [local, rest] = splitProps(props, ['class', 'children']);
|
|
9
|
-
const rootClass = () => clsx(comboboxClass.itemIndicator, local.class);
|
|
10
|
-
return (<Show when={item.selected}>
|
|
11
|
-
<div class={rootClass()} {...rest}>
|
|
12
|
-
{local.children ?? <CheckIcon />}
|
|
13
|
-
</div>
|
|
14
|
-
</Show>);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=combobox-item-indicator.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-item-indicator.jsx","sourceRoot":"","sources":["../../../../src/components/combobox/combobox-item-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAGnD,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACtE,MAAM,IAAI,GAAG,sBAAsB,EAAO,CAAC;IAC3C,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAEvE,OAAO,CACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACzB;GAAA,CAAC,GAAG,CACH,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CACnB,IAAI,IAAI,CAAC,CAET;IAAA,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,AAAD,EAAG,CACjC;GAAA,EAAE,GAAG,CACN;EAAA,EAAE,IAAI,CAAC,CACP,CAAC;AACH,CAAC","sourcesContent":["import clsx from 'clsx/lite';\nimport { Show, splitProps } from 'solid-js';\nimport { CheckIcon } from '#src/icons';\nimport { comboboxClass } from './class';\nimport { useComboboxItemContext } from './context';\nimport type { ComboboxItemIndicatorProps } from './types';\n\nexport function ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\n\tconst item = useComboboxItemContext<any>();\n\tconst [local, rest] = splitProps(props, ['class', 'children']);\n\tconst rootClass = () => clsx(comboboxClass.itemIndicator, local.class);\n\n\treturn (\n\t\t<Show when={item.selected}>\n\t\t\t<div\n\t\t\t\tclass={rootClass()}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{local.children ?? <CheckIcon />}\n\t\t\t</div>\n\t\t</Show>\n\t);\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx/lite';
|
|
2
|
-
import { splitProps } from 'solid-js';
|
|
3
|
-
import { comboboxClass } from './class';
|
|
4
|
-
import { useComboboxItemContext } from './context';
|
|
5
|
-
export function ComboboxItemLabel(props) {
|
|
6
|
-
const item = useComboboxItemContext();
|
|
7
|
-
const [local, rest] = splitProps(props, ['class', 'children']);
|
|
8
|
-
const rootClass = () => clsx(comboboxClass.itemLabel, local.class);
|
|
9
|
-
return (<div class={rootClass()} {...rest}>
|
|
10
|
-
{local.children ?? item.item.textValue}
|
|
11
|
-
</div>);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=combobox-item-label.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-item-label.jsx","sourceRoot":"","sources":["../../../../src/components/combobox/combobox-item-label.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAGnD,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC9D,MAAM,IAAI,GAAG,sBAAsB,EAAO,CAAC;IAC3C,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAEnE,OAAO,CACN,CAAC,GAAG,CACH,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CACnB,IAAI,IAAI,CAAC,CAET;GAAA,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CACvC;EAAA,EAAE,GAAG,CAAC,CACN,CAAC;AACH,CAAC","sourcesContent":["import clsx from 'clsx/lite';\nimport { splitProps } from 'solid-js';\nimport { comboboxClass } from './class';\nimport { useComboboxItemContext } from './context';\nimport type { ComboboxItemLabelProps } from './types';\n\nexport function ComboboxItemLabel(props: ComboboxItemLabelProps) {\n\tconst item = useComboboxItemContext<any>();\n\tconst [local, rest] = splitProps(props, ['class', 'children']);\n\tconst rootClass = () => clsx(comboboxClass.itemLabel, local.class);\n\n\treturn (\n\t\t<div\n\t\t\tclass={rootClass()}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{local.children ?? item.item.textValue}\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.fl-combobox_item {
|
|
3
|
-
/* reset */
|
|
4
|
-
outline: none;
|
|
5
|
-
|
|
6
|
-
/* layout */
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: space-between;
|
|
10
|
-
min-height: var(--fl-size-8);
|
|
11
|
-
|
|
12
|
-
/* spacing */
|
|
13
|
-
gap: var(--fl-size-2);
|
|
14
|
-
padding-inline: var(--fl-size-2);
|
|
15
|
-
padding-block: var(--fl-size-1-5);
|
|
16
|
-
|
|
17
|
-
/* background */
|
|
18
|
-
border-radius: var(--fl-radius-sm);
|
|
19
|
-
|
|
20
|
-
/* text */
|
|
21
|
-
color: var(--fl-body-text-color);
|
|
22
|
-
font: var(--fl-font-body);
|
|
23
|
-
|
|
24
|
-
/* pointer */
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
user-select: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.fl-combobox_item[data-disabled] {
|
|
30
|
-
cursor: var(--fl-disabled-cursor);
|
|
31
|
-
opacity: var(--fl-disabled-opacity);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.fl-combobox_item[data-selected] {
|
|
35
|
-
background: color-mix(in srgb, var(--fl-body-bg-color), var(--fl-primary-color) 15%);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.fl-combobox_item[data-highlighted] {
|
|
39
|
-
background: var(--fl-primary-color);
|
|
40
|
-
color: var(--fl-primary-text-color);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.fl-combobox_item .fl-combobox_item-label {
|
|
44
|
-
/* layout */
|
|
45
|
-
flex: 1 1 auto;
|
|
46
|
-
min-width: 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx/lite';
|
|
2
|
-
import { createEffect, splitProps } from 'solid-js';
|
|
3
|
-
import { comboboxClass } from './class';
|
|
4
|
-
import { ComboboxItemContext, useComboboxContext } from './context';
|
|
5
|
-
import { callEventHandler } from './util';
|
|
6
|
-
export function ComboboxItem(props) {
|
|
7
|
-
const context = useComboboxContext();
|
|
8
|
-
const [local, rest] = splitProps(props, ['class', 'item', 'children', 'onMouseEnter', 'onMouseDown', 'onClick']);
|
|
9
|
-
const rootClass = () => clsx(comboboxClass.item, local.class);
|
|
10
|
-
const selected = () => context.selectedItem()?.key === local.item.key;
|
|
11
|
-
const highlighted = () => context.highlightedKey() === local.item.key;
|
|
12
|
-
let itemRef;
|
|
13
|
-
createEffect(() => {
|
|
14
|
-
if (!highlighted() || !itemRef || !context.shouldScrollHighlightedItem()) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
itemRef.scrollIntoView({ block: 'nearest' });
|
|
18
|
-
});
|
|
19
|
-
const handleMouseEnter = (event) => {
|
|
20
|
-
callEventHandler(local.onMouseEnter, event);
|
|
21
|
-
context.setHighlightedKey(local.item.key);
|
|
22
|
-
};
|
|
23
|
-
const handleMouseDown = (event) => {
|
|
24
|
-
callEventHandler(local.onMouseDown, event);
|
|
25
|
-
event.preventDefault();
|
|
26
|
-
};
|
|
27
|
-
const handleClick = (event) => {
|
|
28
|
-
callEventHandler(local.onClick, event);
|
|
29
|
-
context.selectItem(local.item);
|
|
30
|
-
};
|
|
31
|
-
return (<ComboboxItemContext.Provider value={{ item: local.item, selected: selected(), highlighted: highlighted() }}>
|
|
32
|
-
<li id={context.getItemId(local.item.key)} ref={itemRef} class={rootClass()} role="option" aria-selected={selected()} data-selected={selected() ? '' : undefined} data-highlighted={highlighted() ? '' : undefined} data-disabled={local.item.disabled ? '' : undefined} onMouseEnter={handleMouseEnter} onMouseDown={handleMouseDown} onClick={handleClick} {...rest}>
|
|
33
|
-
{local.children}
|
|
34
|
-
</li>
|
|
35
|
-
</ComboboxItemContext.Provider>);
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=combobox-item.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-item.jsx","sourceRoot":"","sources":["../../../../src/components/combobox/combobox-item.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAY,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,UAAU,YAAY,CAAgB,KAAiC;IAC5E,MAAM,OAAO,GAAG,kBAAkB,EAAgB,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IACjH,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,GAAG,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACtE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACtE,IAAI,OAAkC,CAAC;IAEvC,YAAY,CAAC,GAAG,EAAE;QACjB,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;YAC1E,OAAO;QACR,CAAC;QAED,OAAO,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAqD,CAAC,KAAK,EAAE,EAAE;QACpF,gBAAgB,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAM,eAAe,GAAqD,CAAC,KAAK,EAAE,EAAE;QACnF,gBAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC3C,KAAK,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAqD,CAAC,KAAK,EAAE,EAAE;QAC/E,gBAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO,CACN,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,CAAC,CAC3G;GAAA,CAAC,EAAE,CACF,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACtC,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CACnB,IAAI,CAAC,QAAQ,CACb,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,CAC1B,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3C,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CACjD,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CACpD,YAAY,CAAC,CAAC,gBAAgB,CAAC,CAC/B,WAAW,CAAC,CAAC,eAAe,CAAC,CAC7B,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,IAAI,IAAI,CAAC,CAET;IAAA,CAAC,KAAK,CAAC,QAAQ,CAChB;GAAA,EAAE,EAAE,CACL;EAAA,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAC/B,CAAC;AACH,CAAC","sourcesContent":["import clsx from 'clsx/lite';\nimport { createEffect, type JSX, splitProps } from 'solid-js';\nimport { comboboxClass } from './class';\nimport { ComboboxItemContext, useComboboxContext } from './context';\nimport type { ComboboxItemProps } from './types';\nimport { callEventHandler } from './util';\n\nexport function ComboboxItem<TOption = any>(props: ComboboxItemProps<TOption>) {\n\tconst context = useComboboxContext<TOption, any>();\n\tconst [local, rest] = splitProps(props, ['class', 'item', 'children', 'onMouseEnter', 'onMouseDown', 'onClick']);\n\tconst rootClass = () => clsx(comboboxClass.item, local.class);\n\tconst selected = () => context.selectedItem()?.key === local.item.key;\n\tconst highlighted = () => context.highlightedKey() === local.item.key;\n\tlet itemRef: HTMLLIElement | undefined;\n\n\tcreateEffect(() => {\n\t\tif (!highlighted() || !itemRef || !context.shouldScrollHighlightedItem()) {\n\t\t\treturn;\n\t\t}\n\n\t\titemRef.scrollIntoView({ block: 'nearest' });\n\t});\n\n\tconst handleMouseEnter: JSX.EventHandlerUnion<HTMLLIElement, MouseEvent> = (event) => {\n\t\tcallEventHandler(local.onMouseEnter, event);\n\t\tcontext.setHighlightedKey(local.item.key);\n\t};\n\n\tconst handleMouseDown: JSX.EventHandlerUnion<HTMLLIElement, MouseEvent> = (event) => {\n\t\tcallEventHandler(local.onMouseDown, event);\n\t\tevent.preventDefault();\n\t};\n\n\tconst handleClick: JSX.EventHandlerUnion<HTMLLIElement, MouseEvent> = (event) => {\n\t\tcallEventHandler(local.onClick, event);\n\t\tcontext.selectItem(local.item);\n\t};\n\n\treturn (\n\t\t<ComboboxItemContext.Provider value={{ item: local.item, selected: selected(), highlighted: highlighted() }}>\n\t\t\t<li\n\t\t\t\tid={context.getItemId(local.item.key)}\n\t\t\t\tref={itemRef}\n\t\t\t\tclass={rootClass()}\n\t\t\t\trole=\"option\"\n\t\t\t\taria-selected={selected()}\n\t\t\t\tdata-selected={selected() ? '' : undefined}\n\t\t\t\tdata-highlighted={highlighted() ? '' : undefined}\n\t\t\t\tdata-disabled={local.item.disabled ? '' : undefined}\n\t\t\t\tonMouseEnter={handleMouseEnter}\n\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{local.children}\n\t\t\t</li>\n\t\t</ComboboxItemContext.Provider>\n\t);\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.fl-combobox_listbox {
|
|
3
|
-
--fl-combobox-listbox-pad: var(--fl-size-2);
|
|
4
|
-
|
|
5
|
-
/* reset */
|
|
6
|
-
list-style: none;
|
|
7
|
-
|
|
8
|
-
/* layout */
|
|
9
|
-
max-height: inherit;
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
scroll-padding-block: var(--fl-combobox-listbox-pad);
|
|
12
|
-
|
|
13
|
-
/* spacing */
|
|
14
|
-
margin: 0;
|
|
15
|
-
padding: var(--fl-combobox-listbox-pad);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.fl-combobox_listbox:focus {
|
|
19
|
-
outline: none;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx/lite';
|
|
2
|
-
import { For, Show, splitProps } from 'solid-js';
|
|
3
|
-
import { comboboxClass } from './class';
|
|
4
|
-
import { ComboboxGroup } from './combobox-group';
|
|
5
|
-
import { ComboboxItem } from './combobox-item';
|
|
6
|
-
import { ComboboxItemIndicator } from './combobox-item-indicator';
|
|
7
|
-
import { ComboboxItemLabel } from './combobox-item-label';
|
|
8
|
-
import { useComboboxContext } from './context';
|
|
9
|
-
function DefaultItemComponent(props) {
|
|
10
|
-
return (<ComboboxItem item={props.item}>
|
|
11
|
-
<ComboboxItemLabel>{props.item.textValue}</ComboboxItemLabel>
|
|
12
|
-
<ComboboxItemIndicator />
|
|
13
|
-
</ComboboxItem>);
|
|
14
|
-
}
|
|
15
|
-
function DefaultGroupComponent(props) {
|
|
16
|
-
return <ComboboxGroup>{props.group.textValue}</ComboboxGroup>;
|
|
17
|
-
}
|
|
18
|
-
export function ComboboxListbox(props) {
|
|
19
|
-
const context = useComboboxContext();
|
|
20
|
-
const [local, rest] = splitProps(props, ['class', 'children']);
|
|
21
|
-
const rootClass = () => clsx(comboboxClass.listbox, local.class);
|
|
22
|
-
const ItemComponent = () => context.itemComponent ?? DefaultItemComponent;
|
|
23
|
-
const GroupComponent = () => context.groupComponent ?? DefaultGroupComponent;
|
|
24
|
-
return (<ul id={`${context.rootId}-listbox`} class={rootClass()} role="listbox" {...rest}>
|
|
25
|
-
{local.children ?? (<For each={context.visibleGroups()}>
|
|
26
|
-
{(group) => {
|
|
27
|
-
const GroupRenderer = GroupComponent();
|
|
28
|
-
const ItemRenderer = ItemComponent();
|
|
29
|
-
return (<>
|
|
30
|
-
<Show when={group.rawValue !== undefined}>
|
|
31
|
-
<GroupRenderer group={group}/>
|
|
32
|
-
</Show>
|
|
33
|
-
<For each={group.items}>{(item) => <ItemRenderer item={item}/>}</For>
|
|
34
|
-
</>);
|
|
35
|
-
}}
|
|
36
|
-
</For>)}
|
|
37
|
-
</ul>);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=combobox-listbox.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-listbox.jsx","sourceRoot":"","sources":["../../../../src/components/combobox/combobox-listbox.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,SAAS,oBAAoB,CAAU,KAAuC;IAC7E,OAAO,CACN,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAC9B;GAAA,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAC5D;GAAA,CAAC,qBAAqB,CAAC,AAAD,EACvB;EAAA,EAAE,YAAY,CAAC,CACf,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAe,KAA6C;IACzF,OAAO,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,eAAe,CAAsC,KAA2B;IAC/F,MAAM,OAAO,GAAG,kBAAkB,EAAyB,CAAC;IAC5D,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa,IAAI,oBAA6B,CAAC;IACnF,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,IAAI,qBAAmC,CAAC;IAE3F,OAAO,CACN,CAAC,EAAE,CACF,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,UAAU,CAAC,CAChC,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CACnB,IAAI,CAAC,SAAS,CACd,IAAI,IAAI,CAAC,CAET;GAAA,CAAC,KAAK,CAAC,QAAQ,IAAI,CAClB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAClC;KAAA,CAAC,CAAC,KAAK,EAAE,EAAE;gBACV,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC;gBACvC,MAAM,YAAY,GAAG,aAAa,EAAE,CAAC;gBAErC,OAAO,CACN,EACC;QAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CACxC;SAAA,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAC7B;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAC,EAAE,GAAG,CACtE;OAAA,GAAG,CACH,CAAC;YACH,CAAC,CACF;IAAA,EAAE,GAAG,CAAC,CACN,CACF;EAAA,EAAE,EAAE,CAAC,CACL,CAAC;AACH,CAAC","sourcesContent":["import clsx from 'clsx/lite';\nimport { For, Show, splitProps } from 'solid-js';\nimport { comboboxClass } from './class';\nimport { ComboboxGroup } from './combobox-group';\nimport { ComboboxItem } from './combobox-item';\nimport { ComboboxItemIndicator } from './combobox-item-indicator';\nimport { ComboboxItemLabel } from './combobox-item-label';\nimport { useComboboxContext } from './context';\nimport type { ComboboxListboxProps, ComboboxRenderGroupProps, ComboboxRenderItemProps } from './types';\n\nfunction DefaultItemComponent<TOption>(props: ComboboxRenderItemProps<TOption>) {\n\treturn (\n\t\t<ComboboxItem item={props.item}>\n\t\t\t<ComboboxItemLabel>{props.item.textValue}</ComboboxItemLabel>\n\t\t\t<ComboboxItemIndicator />\n\t\t</ComboboxItem>\n\t);\n}\n\nfunction DefaultGroupComponent<TOptionGroup>(props: ComboboxRenderGroupProps<TOptionGroup>) {\n\treturn <ComboboxGroup>{props.group.textValue}</ComboboxGroup>;\n}\n\nexport function ComboboxListbox<TOption = any, TOptionGroup = never>(props: ComboboxListboxProps) {\n\tconst context = useComboboxContext<TOption, TOptionGroup>();\n\tconst [local, rest] = splitProps(props, ['class', 'children']);\n\tconst rootClass = () => clsx(comboboxClass.listbox, local.class);\n\tconst ItemComponent = () => context.itemComponent ?? DefaultItemComponent<TOption>;\n\tconst GroupComponent = () => context.groupComponent ?? DefaultGroupComponent<TOptionGroup>;\n\n\treturn (\n\t\t<ul\n\t\t\tid={`${context.rootId}-listbox`}\n\t\t\tclass={rootClass()}\n\t\t\trole=\"listbox\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t{local.children ?? (\n\t\t\t\t<For each={context.visibleGroups()}>\n\t\t\t\t\t{(group) => {\n\t\t\t\t\t\tconst GroupRenderer = GroupComponent();\n\t\t\t\t\t\tconst ItemRenderer = ItemComponent();\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<Show when={group.rawValue !== undefined}>\n\t\t\t\t\t\t\t\t\t<GroupRenderer group={group} />\n\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t\t<For each={group.items}>{(item) => <ItemRenderer item={item} />}</For>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t</For>\n\t\t\t)}\n\t\t</ul>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-portal.jsx","sourceRoot":"","sources":["../../../../src/components/combobox/combobox-portal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,MAAM,UAAU,cAAc,CAAC,KAA0B;IACxD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAExD,OAAO,EAAE,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC;AAClC,CAAC","sourcesContent":["import { children } from 'solid-js';\nimport type { ComboboxPortalProps } from './types';\n\nexport function ComboboxPortal(props: ComboboxPortalProps) {\n\tconst resolvedChildren = children(() => props.children);\n\n\treturn <>{resolvedChildren()}</>;\n}\n"]}
|
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx/lite';
|
|
2
|
-
import { children, createEffect, createMemo, createSignal, createUniqueId, mergeProps, onCleanup, onMount, splitProps, } from 'solid-js';
|
|
3
|
-
import { comboboxClass } from './class';
|
|
4
|
-
import { ComboboxContent } from './combobox-content';
|
|
5
|
-
import { ComboboxControl } from './combobox-control';
|
|
6
|
-
import { ComboboxInput } from './combobox-input';
|
|
7
|
-
import { ComboboxListbox } from './combobox-listbox';
|
|
8
|
-
import { ComboboxPortal } from './combobox-portal';
|
|
9
|
-
import { ComboboxTrigger } from './combobox-trigger';
|
|
10
|
-
import { ComboboxContext } from './context';
|
|
11
|
-
import { callEventHandler, createContainsFilter, defaultTextValue, resolveAccessor, resolveGroupChildren, } from './util';
|
|
12
|
-
export function ComboboxRoot(props) {
|
|
13
|
-
const merged = mergeProps({
|
|
14
|
-
closeOnSelection: true,
|
|
15
|
-
}, props);
|
|
16
|
-
const [local, rest] = splitProps(merged, [
|
|
17
|
-
'class',
|
|
18
|
-
'children',
|
|
19
|
-
'options',
|
|
20
|
-
'optionValue',
|
|
21
|
-
'optionTextValue',
|
|
22
|
-
'optionLabel',
|
|
23
|
-
'optionDisabled',
|
|
24
|
-
'optionGroupChildren',
|
|
25
|
-
'itemComponent',
|
|
26
|
-
'groupComponent',
|
|
27
|
-
'placeholder',
|
|
28
|
-
'value',
|
|
29
|
-
'defaultValue',
|
|
30
|
-
'inputValue',
|
|
31
|
-
'defaultInputValue',
|
|
32
|
-
'onChange',
|
|
33
|
-
'onInputChange',
|
|
34
|
-
'open',
|
|
35
|
-
'defaultOpen',
|
|
36
|
-
'onOpenChange',
|
|
37
|
-
'disabled',
|
|
38
|
-
'readOnly',
|
|
39
|
-
'required',
|
|
40
|
-
'name',
|
|
41
|
-
'closeOnSelection',
|
|
42
|
-
'onFocusOut',
|
|
43
|
-
]);
|
|
44
|
-
const resolvedChildren = children(() => local.children);
|
|
45
|
-
const rootId = createUniqueId();
|
|
46
|
-
const [rootRef, setRootRef] = createSignal();
|
|
47
|
-
const [inputRef, setInputRef] = createSignal();
|
|
48
|
-
const [internalValue, setInternalValue] = createSignal(local.defaultValue ?? null);
|
|
49
|
-
const [internalOpen, setInternalOpen] = createSignal(Boolean(local.defaultOpen));
|
|
50
|
-
const [internalInputValue, setInternalInputValue] = createSignal(local.defaultInputValue ?? '');
|
|
51
|
-
const [filterValue, setFilterValue] = createSignal('');
|
|
52
|
-
const [highlightedKey, setHighlightedKey] = createSignal(null);
|
|
53
|
-
const [shouldScrollHighlightedItem, setShouldScrollHighlightedItem] = createSignal(false);
|
|
54
|
-
const isControlledValue = () => local.value !== undefined;
|
|
55
|
-
const isControlledInputValue = () => local.inputValue !== undefined;
|
|
56
|
-
const isControlledOpen = () => local.open !== undefined;
|
|
57
|
-
const filter = createMemo(() => createContainsFilter());
|
|
58
|
-
const inputValue = createMemo(() => {
|
|
59
|
-
if (isControlledInputValue()) {
|
|
60
|
-
return local.inputValue ?? '';
|
|
61
|
-
}
|
|
62
|
-
return internalInputValue();
|
|
63
|
-
});
|
|
64
|
-
const normalizedGroups = createMemo(() => {
|
|
65
|
-
const groups = [];
|
|
66
|
-
const looseItems = [];
|
|
67
|
-
let itemIndex = 0;
|
|
68
|
-
for (let index = 0; index < local.options.length; index += 1) {
|
|
69
|
-
const entry = local.options[index];
|
|
70
|
-
const groupChildren = resolveGroupChildren(entry, local.optionGroupChildren);
|
|
71
|
-
if (groupChildren !== undefined) {
|
|
72
|
-
const groupItems = groupChildren.map((option) => {
|
|
73
|
-
const value = String(resolveAccessor(option, local.optionValue, defaultTextValue));
|
|
74
|
-
const label = resolveAccessor(option, local.optionLabel, defaultTextValue);
|
|
75
|
-
const textValue = resolveAccessor(option, local.optionTextValue, () => label);
|
|
76
|
-
const disabled = Boolean(resolveAccessor(option, local.optionDisabled, () => false));
|
|
77
|
-
const item = {
|
|
78
|
-
key: `${value}-${itemIndex}`,
|
|
79
|
-
value,
|
|
80
|
-
label,
|
|
81
|
-
textValue,
|
|
82
|
-
disabled,
|
|
83
|
-
rawValue: option,
|
|
84
|
-
};
|
|
85
|
-
itemIndex += 1;
|
|
86
|
-
return item;
|
|
87
|
-
});
|
|
88
|
-
groups.push({
|
|
89
|
-
key: `group-${index}`,
|
|
90
|
-
textValue: defaultTextValue(entry),
|
|
91
|
-
rawValue: entry,
|
|
92
|
-
items: groupItems,
|
|
93
|
-
});
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
const option = entry;
|
|
97
|
-
const value = String(resolveAccessor(option, local.optionValue, defaultTextValue));
|
|
98
|
-
const label = resolveAccessor(option, local.optionLabel, defaultTextValue);
|
|
99
|
-
const textValue = resolveAccessor(option, local.optionTextValue, () => label);
|
|
100
|
-
const disabled = Boolean(resolveAccessor(option, local.optionDisabled, () => false));
|
|
101
|
-
looseItems.push({
|
|
102
|
-
key: `${value}-${itemIndex}`,
|
|
103
|
-
value,
|
|
104
|
-
label,
|
|
105
|
-
textValue,
|
|
106
|
-
disabled,
|
|
107
|
-
rawValue: option,
|
|
108
|
-
});
|
|
109
|
-
itemIndex += 1;
|
|
110
|
-
}
|
|
111
|
-
if (looseItems.length > 0) {
|
|
112
|
-
groups.unshift({
|
|
113
|
-
key: 'group-root',
|
|
114
|
-
textValue: '',
|
|
115
|
-
items: looseItems,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
return groups;
|
|
119
|
-
});
|
|
120
|
-
const allItems = createMemo(() => normalizedGroups().flatMap((group) => group.items));
|
|
121
|
-
const selectedItem = createMemo(() => {
|
|
122
|
-
let selectedOption = internalValue();
|
|
123
|
-
if (isControlledValue()) {
|
|
124
|
-
selectedOption = local.value ?? null;
|
|
125
|
-
}
|
|
126
|
-
if (selectedOption == null) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
const selectedValue = String(resolveAccessor(selectedOption, local.optionValue, defaultTextValue));
|
|
130
|
-
return allItems().find((item) => item.value === selectedValue) ?? null;
|
|
131
|
-
});
|
|
132
|
-
const visibleGroups = createMemo(() => {
|
|
133
|
-
const currentInput = filterValue().trim();
|
|
134
|
-
return normalizedGroups()
|
|
135
|
-
.map((group) => ({
|
|
136
|
-
...group,
|
|
137
|
-
items: group.items.filter((item) => filter()(item.rawValue, currentInput)),
|
|
138
|
-
}))
|
|
139
|
-
.filter((group) => group.items.length > 0);
|
|
140
|
-
});
|
|
141
|
-
const visibleItems = createMemo(() => visibleGroups().flatMap((group) => group.items));
|
|
142
|
-
const isOpen = createMemo(() => (isControlledOpen() ? Boolean(local.open) : internalOpen()) && visibleItems().length > 0);
|
|
143
|
-
const setOpen = (value) => {
|
|
144
|
-
if (!isControlledOpen()) {
|
|
145
|
-
setInternalOpen(value);
|
|
146
|
-
}
|
|
147
|
-
local.onOpenChange?.(value);
|
|
148
|
-
};
|
|
149
|
-
const setSelectedOption = (value) => {
|
|
150
|
-
if (!isControlledValue()) {
|
|
151
|
-
setInternalValue(() => value);
|
|
152
|
-
}
|
|
153
|
-
local.onChange?.(value);
|
|
154
|
-
};
|
|
155
|
-
const setDisplayedInputValue = (value, emitChange = false) => {
|
|
156
|
-
if (!isControlledInputValue()) {
|
|
157
|
-
setInternalInputValue(value);
|
|
158
|
-
}
|
|
159
|
-
if (emitChange) {
|
|
160
|
-
local.onInputChange?.(value);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const restoreInputFromSelection = () => {
|
|
164
|
-
setDisplayedInputValue(selectedItem()?.label ?? '', isControlledInputValue());
|
|
165
|
-
setFilterValue('');
|
|
166
|
-
};
|
|
167
|
-
const highlightByIndex = (index) => {
|
|
168
|
-
const items = visibleItems();
|
|
169
|
-
if (items.length === 0) {
|
|
170
|
-
setShouldScrollHighlightedItem(false);
|
|
171
|
-
setHighlightedKey(null);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const boundedIndex = Math.min(Math.max(index, 0), items.length - 1);
|
|
175
|
-
setShouldScrollHighlightedItem(true);
|
|
176
|
-
setHighlightedKey(items[boundedIndex]?.key ?? null);
|
|
177
|
-
};
|
|
178
|
-
const highlightFirst = () => highlightByIndex(0);
|
|
179
|
-
const highlightLast = () => highlightByIndex(visibleItems().length - 1);
|
|
180
|
-
const highlightNext = () => {
|
|
181
|
-
const items = visibleItems();
|
|
182
|
-
const index = items.findIndex((item) => item.key === highlightedKey());
|
|
183
|
-
highlightByIndex(index >= 0 ? index + 1 : 0);
|
|
184
|
-
};
|
|
185
|
-
const highlightPrevious = () => {
|
|
186
|
-
const items = visibleItems();
|
|
187
|
-
const index = items.findIndex((item) => item.key === highlightedKey());
|
|
188
|
-
highlightByIndex(index >= 0 ? index - 1 : items.length - 1);
|
|
189
|
-
};
|
|
190
|
-
const openPopup = (strategy = 'first') => {
|
|
191
|
-
if (local.disabled || local.readOnly || visibleItems().length === 0) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
setOpen(true);
|
|
195
|
-
if (strategy === 'last') {
|
|
196
|
-
highlightLast();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
if (strategy === 'preserve') {
|
|
200
|
-
if (highlightedKey() !== null) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (selectedItem()) {
|
|
204
|
-
setShouldScrollHighlightedItem(true);
|
|
205
|
-
setHighlightedKey(selectedItem().key);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
highlightFirst();
|
|
210
|
-
};
|
|
211
|
-
const openAllOptions = (strategy = 'first') => {
|
|
212
|
-
if (local.disabled || local.readOnly || allItems().length === 0) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
setFilterValue('');
|
|
216
|
-
setOpen(true);
|
|
217
|
-
if (strategy === 'last') {
|
|
218
|
-
highlightLast();
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (strategy === 'preserve') {
|
|
222
|
-
if (highlightedKey() !== null) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (selectedItem()) {
|
|
226
|
-
setShouldScrollHighlightedItem(true);
|
|
227
|
-
setHighlightedKey(selectedItem().key);
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
highlightFirst();
|
|
232
|
-
};
|
|
233
|
-
const closePopup = (restoreInput = true) => {
|
|
234
|
-
setOpen(false);
|
|
235
|
-
setShouldScrollHighlightedItem(false);
|
|
236
|
-
setHighlightedKey(null);
|
|
237
|
-
if (restoreInput) {
|
|
238
|
-
restoreInputFromSelection();
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
const selectItem = (item) => {
|
|
242
|
-
if (item.disabled) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
setSelectedOption(item.rawValue);
|
|
246
|
-
setDisplayedInputValue(item.label);
|
|
247
|
-
setFilterValue('');
|
|
248
|
-
setShouldScrollHighlightedItem(false);
|
|
249
|
-
setHighlightedKey(item.key);
|
|
250
|
-
if (local.closeOnSelection) {
|
|
251
|
-
setOpen(false);
|
|
252
|
-
}
|
|
253
|
-
inputRef()?.focus();
|
|
254
|
-
};
|
|
255
|
-
const clearPendingInput = () => {
|
|
256
|
-
if (selectedItem() === null) {
|
|
257
|
-
setDisplayedInputValue('', isControlledInputValue());
|
|
258
|
-
setFilterValue('');
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
restoreInputFromSelection();
|
|
262
|
-
};
|
|
263
|
-
const clearSelectedItem = () => {
|
|
264
|
-
setSelectedOption(null);
|
|
265
|
-
setDisplayedInputValue('', true);
|
|
266
|
-
setFilterValue('');
|
|
267
|
-
setShouldScrollHighlightedItem(false);
|
|
268
|
-
setHighlightedKey(null);
|
|
269
|
-
setOpen(false);
|
|
270
|
-
inputRef()?.focus();
|
|
271
|
-
};
|
|
272
|
-
createEffect(() => {
|
|
273
|
-
if (!isControlledValue()) {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (selectedItem() !== null) {
|
|
277
|
-
restoreInputFromSelection();
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
setFilterValue('');
|
|
281
|
-
if (!isControlledInputValue()) {
|
|
282
|
-
setDisplayedInputValue('');
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
createEffect(() => {
|
|
286
|
-
const items = visibleItems();
|
|
287
|
-
const selected = selectedItem();
|
|
288
|
-
if (items.length === 0) {
|
|
289
|
-
setShouldScrollHighlightedItem(false);
|
|
290
|
-
setHighlightedKey(null);
|
|
291
|
-
setOpen(false);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (highlightedKey() && items.some((item) => item.key === highlightedKey())) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (isOpen()) {
|
|
298
|
-
if (selected && items.some((item) => item.key === selected.key)) {
|
|
299
|
-
setShouldScrollHighlightedItem(true);
|
|
300
|
-
setHighlightedKey(selected.key);
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
highlightFirst();
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
onMount(() => {
|
|
307
|
-
restoreInputFromSelection();
|
|
308
|
-
const handlePointerDown = (event) => {
|
|
309
|
-
const root = rootRef();
|
|
310
|
-
if (!root || root.contains(event.target)) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
closePopup(true);
|
|
314
|
-
};
|
|
315
|
-
document.addEventListener('pointerdown', handlePointerDown);
|
|
316
|
-
onCleanup(() => {
|
|
317
|
-
document.removeEventListener('pointerdown', handlePointerDown);
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
const context = {
|
|
321
|
-
rootId,
|
|
322
|
-
rootRef,
|
|
323
|
-
setRootRef,
|
|
324
|
-
inputRef,
|
|
325
|
-
setInputRef,
|
|
326
|
-
inputValue,
|
|
327
|
-
setInputValue: (value) => {
|
|
328
|
-
const selected = selectedItem();
|
|
329
|
-
if (selected && value !== selected.label) {
|
|
330
|
-
setSelectedOption(null);
|
|
331
|
-
}
|
|
332
|
-
setDisplayedInputValue(value, true);
|
|
333
|
-
setFilterValue(value);
|
|
334
|
-
if (value.trim() === '') {
|
|
335
|
-
closePopup(false);
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
openPopup('first');
|
|
339
|
-
},
|
|
340
|
-
isOpen,
|
|
341
|
-
openPopup,
|
|
342
|
-
openAllOptions,
|
|
343
|
-
closePopup,
|
|
344
|
-
togglePopup: () => {
|
|
345
|
-
if (isOpen()) {
|
|
346
|
-
closePopup(true);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
openPopup('first');
|
|
350
|
-
},
|
|
351
|
-
visibleGroups,
|
|
352
|
-
visibleItems,
|
|
353
|
-
selectedItem,
|
|
354
|
-
highlightedKey,
|
|
355
|
-
shouldScrollHighlightedItem,
|
|
356
|
-
setHighlightedKey: (key) => {
|
|
357
|
-
setShouldScrollHighlightedItem(false);
|
|
358
|
-
setHighlightedKey(key);
|
|
359
|
-
},
|
|
360
|
-
highlightNext,
|
|
361
|
-
highlightPrevious,
|
|
362
|
-
highlightFirst,
|
|
363
|
-
highlightLast,
|
|
364
|
-
selectItem,
|
|
365
|
-
getItemId: (key) => `${rootId}-item-${key}`,
|
|
366
|
-
itemComponent: local.itemComponent,
|
|
367
|
-
groupComponent: local.groupComponent,
|
|
368
|
-
placeholder: () => local.placeholder,
|
|
369
|
-
disabled: () => Boolean(local.disabled),
|
|
370
|
-
readOnly: () => Boolean(local.readOnly),
|
|
371
|
-
required: () => Boolean(local.required),
|
|
372
|
-
name: () => local.name,
|
|
373
|
-
clearPendingInput,
|
|
374
|
-
clearSelectedItem,
|
|
375
|
-
};
|
|
376
|
-
const rootClass = () => clsx(comboboxClass.root, local.class);
|
|
377
|
-
const handleFocusOut = (event) => {
|
|
378
|
-
callEventHandler(local.onFocusOut, event);
|
|
379
|
-
const nextTarget = event.relatedTarget;
|
|
380
|
-
if (nextTarget && rootRef()?.contains(nextTarget)) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
queueMicrotask(() => {
|
|
384
|
-
const activeElement = document.activeElement;
|
|
385
|
-
if (activeElement instanceof Node && rootRef()?.contains(activeElement)) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
closePopup(true);
|
|
389
|
-
});
|
|
390
|
-
};
|
|
391
|
-
return (<ComboboxContext.Provider value={context}>
|
|
392
|
-
<div class={rootClass()} ref={setRootRef} onFocusOut={handleFocusOut} {...rest}>
|
|
393
|
-
{local.children ? (resolvedChildren()) : (<>
|
|
394
|
-
<ComboboxControl>
|
|
395
|
-
<ComboboxInput aria-label={local.placeholder ?? 'Combobox'}/>
|
|
396
|
-
<ComboboxTrigger />
|
|
397
|
-
</ComboboxControl>
|
|
398
|
-
<ComboboxPortal>
|
|
399
|
-
<ComboboxContent>
|
|
400
|
-
<ComboboxListbox />
|
|
401
|
-
</ComboboxContent>
|
|
402
|
-
</ComboboxPortal>
|
|
403
|
-
</>)}
|
|
404
|
-
</div>
|
|
405
|
-
</ComboboxContext.Provider>);
|
|
406
|
-
}
|
|
407
|
-
//# sourceMappingURL=combobox-root.jsx.map
|