@cognitiv/components-web 1.0.4 → 1.1.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/README.md +266 -0
- package/dist/components/accordion/accordion.d.ts +30 -0
- package/dist/components/accordion/accordion.js +191 -0
- package/dist/components/accordion/index.d.ts +25 -0
- package/dist/components/accordion/index.js +18 -0
- package/dist/components/accordion/styles.d.ts +53 -0
- package/dist/components/accordion/styles.js +27 -0
- package/dist/components/alert/alert.d.ts +15 -0
- package/dist/components/alert/alert.js +152 -0
- package/dist/components/alert/index.d.ts +21 -0
- package/dist/components/alert/index.js +16 -0
- package/dist/components/alert/styles.d.ts +75 -0
- package/dist/components/alert/styles.js +36 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +65 -0
- package/dist/components/alert-dialog/alert-dialog.js +309 -0
- package/dist/components/alert-dialog/index.d.ts +33 -0
- package/dist/components/alert-dialog/index.js +22 -0
- package/dist/components/alert-dialog/styles.d.ts +174 -0
- package/dist/components/alert-dialog/styles.js +71 -0
- package/dist/components/autocomplete/autocomplete.d.ts +31 -0
- package/dist/components/autocomplete/autocomplete.js +241 -0
- package/dist/components/autocomplete/index.d.ts +25 -0
- package/dist/components/autocomplete/index.js +18 -0
- package/dist/components/autocomplete/styles.d.ts +75 -0
- package/dist/components/autocomplete/styles.js +37 -0
- package/dist/components/avatar/avatar.d.ts +15 -0
- package/dist/components/avatar/avatar.js +93 -0
- package/dist/components/avatar/index.d.ts +17 -0
- package/dist/components/avatar/index.js +14 -0
- package/dist/components/avatar/styles.d.ts +120 -0
- package/dist/components/avatar/styles.js +52 -0
- package/dist/components/badge/badge.d.ts +19 -0
- package/dist/components/badge/badge.js +87 -0
- package/dist/components/badge/index.d.ts +17 -0
- package/dist/components/badge/index.js +14 -0
- package/dist/components/badge/styles.d.ts +177 -0
- package/dist/components/badge/styles.js +73 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +84 -0
- package/dist/components/breadcrumbs/index.d.ts +15 -0
- package/dist/components/breadcrumbs/index.js +13 -0
- package/dist/components/breadcrumbs/styles.d.ts +45 -0
- package/dist/components/breadcrumbs/styles.js +13 -0
- package/dist/components/button/button.d.ts +10 -0
- package/dist/components/button/button.js +49 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/button/index.js +13 -0
- package/dist/components/button/styles.d.ts +69 -0
- package/dist/components/button/styles.js +37 -0
- package/dist/components/button-group/button-group.d.ts +26 -0
- package/dist/components/button-group/button-group.js +82 -0
- package/dist/components/button-group/index.d.ts +16 -0
- package/dist/components/button-group/index.js +14 -0
- package/dist/components/button-group/styles.d.ts +57 -0
- package/dist/components/button-group/styles.js +31 -0
- package/dist/components/calendar/calendar.d.ts +71 -0
- package/dist/components/calendar/calendar.js +274 -0
- package/dist/components/calendar/index.d.ts +91 -0
- package/dist/components/calendar/index.js +29 -0
- package/dist/components/calendar/styles.d.ts +78 -0
- package/dist/components/calendar/styles.js +35 -0
- package/dist/components/calendar-year-picker/calendar-year-picker.d.ts +61 -0
- package/dist/components/calendar-year-picker/calendar-year-picker.js +407 -0
- package/dist/components/calendar-year-picker/index.d.ts +43 -0
- package/dist/components/calendar-year-picker/index.js +18 -0
- package/dist/components/calendar-year-picker/styles.d.ts +51 -0
- package/dist/components/calendar-year-picker/styles.js +14 -0
- package/dist/components/calendar-year-picker/year-picker-context.d.ts +28 -0
- package/dist/components/calendar-year-picker/year-picker-context.js +39 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.js +141 -0
- package/dist/components/card/index.d.ts +23 -0
- package/dist/components/card/index.js +17 -0
- package/dist/components/card/styles.d.ts +70 -0
- package/dist/components/card/styles.js +34 -0
- package/dist/components/checkbox/checkbox.d.ts +22 -0
- package/dist/components/checkbox/checkbox.js +124 -0
- package/dist/components/checkbox/index.d.ts +19 -0
- package/dist/components/checkbox/index.js +15 -0
- package/dist/components/checkbox/styles.d.ts +45 -0
- package/dist/components/checkbox/styles.js +26 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +14 -0
- package/dist/components/checkbox-group/checkbox-group.js +33 -0
- package/dist/components/checkbox-group/index.d.ts +3 -0
- package/dist/components/checkbox-group/index.js +3 -0
- package/dist/components/checkbox-group/styles.d.ts +18 -0
- package/dist/components/checkbox-group/styles.js +17 -0
- package/dist/components/chip/chip.d.ts +14 -0
- package/dist/components/chip/chip.js +67 -0
- package/dist/components/chip/index.d.ts +15 -0
- package/dist/components/chip/index.js +13 -0
- package/dist/components/chip/styles.d.ts +141 -0
- package/dist/components/chip/styles.js +59 -0
- package/dist/components/close-button/close-button.d.ts +8 -0
- package/dist/components/close-button/close-button.js +33 -0
- package/dist/components/close-button/index.d.ts +13 -0
- package/dist/components/close-button/index.js +12 -0
- package/dist/components/close-button/styles.d.ts +15 -0
- package/dist/components/close-button/styles.js +16 -0
- package/dist/components/color-area/color-area.d.ts +11 -0
- package/dist/components/color-area/color-area.js +70 -0
- package/dist/components/color-area/index.d.ts +15 -0
- package/dist/components/color-area/index.js +13 -0
- package/dist/components/color-area/styles.d.ts +33 -0
- package/dist/components/color-area/styles.js +22 -0
- package/dist/components/color-field/color-field.d.ts +9 -0
- package/dist/components/color-field/color-field.js +29 -0
- package/dist/components/color-field/index.d.ts +22 -0
- package/dist/components/color-field/index.js +18 -0
- package/dist/components/color-field/styles.d.ts +18 -0
- package/dist/components/color-field/styles.js +17 -0
- package/dist/components/color-input-group/color-input-group.d.ts +19 -0
- package/dist/components/color-input-group/color-input-group.js +98 -0
- package/dist/components/color-input-group/index.d.ts +19 -0
- package/dist/components/color-input-group/index.js +15 -0
- package/dist/components/color-input-group/styles.d.ts +63 -0
- package/dist/components/color-input-group/styles.js +33 -0
- package/dist/components/color-picker/color-picker.d.ts +21 -0
- package/dist/components/color-picker/color-picker.js +86 -0
- package/dist/components/color-picker/index.d.ts +17 -0
- package/dist/components/color-picker/index.js +14 -0
- package/dist/components/color-picker/styles.d.ts +39 -0
- package/dist/components/color-picker/styles.js +12 -0
- package/dist/components/color-slider/color-slider.d.ts +50 -0
- package/dist/components/color-slider/color-slider.js +205 -0
- package/dist/components/color-slider/index.d.ts +19 -0
- package/dist/components/color-slider/index.js +15 -0
- package/dist/components/color-slider/styles.d.ts +45 -0
- package/dist/components/color-slider/styles.js +13 -0
- package/dist/components/color-swatch/color-swatch.d.ts +8 -0
- package/dist/components/color-swatch/color-swatch.js +31 -0
- package/dist/components/color-swatch/index.d.ts +13 -0
- package/dist/components/color-swatch/index.js +12 -0
- package/dist/components/color-swatch/styles.d.ts +39 -0
- package/dist/components/color-swatch/styles.js +25 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts +20 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.js +149 -0
- package/dist/components/color-swatch-picker/index.d.ts +19 -0
- package/dist/components/color-swatch-picker/index.js +15 -0
- package/dist/components/color-swatch-picker/styles.d.ts +120 -0
- package/dist/components/color-swatch-picker/styles.js +53 -0
- package/dist/components/combo-box/combo-box.d.ts +34 -0
- package/dist/components/combo-box/combo-box.js +116 -0
- package/dist/components/combo-box/index.d.ts +20 -0
- package/dist/components/combo-box/index.js +16 -0
- package/dist/components/combo-box/styles.d.ts +42 -0
- package/dist/components/combo-box/styles.js +25 -0
- package/dist/components/date-field/date-field.d.ts +9 -0
- package/dist/components/date-field/date-field.js +29 -0
- package/dist/components/date-field/index.d.ts +26 -0
- package/dist/components/date-field/index.js +20 -0
- package/dist/components/date-field/styles.d.ts +18 -0
- package/dist/components/date-field/styles.js +17 -0
- package/dist/components/date-input-group/date-input-group.d.ts +25 -0
- package/dist/components/date-input-group/date-input-group.js +146 -0
- package/dist/components/date-input-group/index.d.ts +23 -0
- package/dist/components/date-input-group/index.js +17 -0
- package/dist/components/date-input-group/styles.d.ts +69 -0
- package/dist/components/date-input-group/styles.js +35 -0
- package/dist/components/date-picker/date-picker.d.ts +30 -0
- package/dist/components/date-picker/date-picker.js +151 -0
- package/dist/components/date-picker/index.d.ts +31 -0
- package/dist/components/date-picker/index.js +15 -0
- package/dist/components/date-picker/styles.d.ts +45 -0
- package/dist/components/date-picker/styles.js +13 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +36 -0
- package/dist/components/date-range-picker/date-range-picker.js +173 -0
- package/dist/components/date-range-picker/index.d.ts +36 -0
- package/dist/components/date-range-picker/index.js +16 -0
- package/dist/components/date-range-picker/styles.d.ts +51 -0
- package/dist/components/date-range-picker/styles.js +14 -0
- package/dist/components/description/description.d.ts +9 -0
- package/dist/components/description/description.js +22 -0
- package/dist/components/description/index.d.ts +13 -0
- package/dist/components/description/index.js +12 -0
- package/dist/components/description/styles.d.ts +3 -0
- package/dist/components/description/styles.js +8 -0
- package/dist/components/disclosure/disclosure.d.ts +27 -0
- package/dist/components/disclosure/disclosure.js +157 -0
- package/dist/components/disclosure/index.d.ts +23 -0
- package/dist/components/disclosure/index.js +17 -0
- package/dist/components/disclosure/styles.d.ts +29 -0
- package/dist/components/disclosure/styles.js +20 -0
- package/dist/components/disclosure-group/disclosure-group.d.ts +8 -0
- package/dist/components/disclosure-group/disclosure-group.js +35 -0
- package/dist/components/disclosure-group/index.d.ts +15 -0
- package/dist/components/disclosure-group/index.js +13 -0
- package/dist/components/disclosure-group/styles.d.ts +9 -0
- package/dist/components/disclosure-group/styles.js +12 -0
- package/dist/components/disclosure-group/use-disclosure-group-navigation.d.ts +14 -0
- package/dist/components/disclosure-group/use-disclosure-group-navigation.js +51 -0
- package/dist/components/drawer/drawer.d.ts +84 -0
- package/dist/components/drawer/drawer.js +439 -0
- package/dist/components/drawer/index.d.ts +69 -0
- package/dist/components/drawer/index.js +22 -0
- package/dist/components/drawer/styles.d.ts +126 -0
- package/dist/components/drawer/styles.js +54 -0
- package/dist/components/dropdown/dropdown.d.ts +38 -0
- package/dist/components/dropdown/dropdown.js +156 -0
- package/dist/components/dropdown/index.d.ts +29 -0
- package/dist/components/dropdown/index.js +20 -0
- package/dist/components/dropdown/styles.d.ts +45 -0
- package/dist/components/dropdown/styles.js +13 -0
- package/dist/components/empty-state/empty-state.d.ts +7 -0
- package/dist/components/empty-state/empty-state.js +20 -0
- package/dist/components/empty-state/index.d.ts +13 -0
- package/dist/components/empty-state/index.js +12 -0
- package/dist/components/empty-state/styles.d.ts +3 -0
- package/dist/components/empty-state/styles.js +8 -0
- package/dist/components/error-message/error-message.d.ts +9 -0
- package/dist/components/error-message/error-message.js +22 -0
- package/dist/components/error-message/index.d.ts +13 -0
- package/dist/components/error-message/index.js +12 -0
- package/dist/components/error-message/styles.d.ts +3 -0
- package/dist/components/error-message/styles.js +8 -0
- package/dist/components/field-error/field-error.d.ts +8 -0
- package/dist/components/field-error/field-error.js +21 -0
- package/dist/components/field-error/index.d.ts +13 -0
- package/dist/components/field-error/index.js +12 -0
- package/dist/components/field-error/styles.d.ts +3 -0
- package/dist/components/field-error/styles.js +8 -0
- package/dist/components/fieldset/fieldset.d.ts +16 -0
- package/dist/components/fieldset/fieldset.js +88 -0
- package/dist/components/fieldset/index.d.ts +19 -0
- package/dist/components/fieldset/index.js +15 -0
- package/dist/components/fieldset/styles.d.ts +51 -0
- package/dist/components/fieldset/styles.js +14 -0
- package/dist/components/form/form.d.ts +7 -0
- package/dist/components/form/form.js +13 -0
- package/dist/components/form/index.d.ts +11 -0
- package/dist/components/form/index.js +11 -0
- package/dist/components/header/header.d.ts +7 -0
- package/dist/components/header/header.js +21 -0
- package/dist/components/header/index.d.ts +9 -0
- package/dist/components/header/index.js +10 -0
- package/dist/components/header/styles.d.ts +1 -0
- package/dist/components/header/styles.js +8 -0
- package/dist/components/icons.d.ts +18 -0
- package/dist/components/icons.js +243 -0
- package/dist/components/index.d.ts +84 -0
- package/dist/components/input/index.d.ts +13 -0
- package/dist/components/input/index.js +12 -0
- package/dist/components/input/input.d.ts +8 -0
- package/dist/components/input/input.js +31 -0
- package/dist/components/input/styles.d.ts +30 -0
- package/dist/components/input/styles.js +22 -0
- package/dist/components/input-group/index.d.ts +21 -0
- package/dist/components/input-group/index.js +16 -0
- package/dist/components/input-group/input-group.d.ts +20 -0
- package/dist/components/input-group/input-group.js +129 -0
- package/dist/components/input-group/styles.d.ts +63 -0
- package/dist/components/input-group/styles.js +33 -0
- package/dist/components/input-otp/index.d.ts +22 -0
- package/dist/components/input-otp/index.js +21 -0
- package/dist/components/input-otp/input-otp.d.ts +26 -0
- package/dist/components/input-otp/input-otp.js +139 -0
- package/dist/components/input-otp/styles.d.ts +54 -0
- package/dist/components/input-otp/styles.js +29 -0
- package/dist/components/kbd/index.d.ts +19 -0
- package/dist/components/kbd/index.js +15 -0
- package/dist/components/kbd/kbd.constants.d.ts +3 -0
- package/dist/components/kbd/kbd.constants.js +51 -0
- package/dist/components/kbd/kbd.d.ts +24 -0
- package/dist/components/kbd/kbd.js +76 -0
- package/dist/components/kbd/styles.d.ts +30 -0
- package/dist/components/kbd/styles.js +19 -0
- package/dist/components/label/index.d.ts +13 -0
- package/dist/components/label/index.js +12 -0
- package/dist/components/label/label.d.ts +8 -0
- package/dist/components/label/label.js +27 -0
- package/dist/components/label/styles.d.ts +33 -0
- package/dist/components/label/styles.js +24 -0
- package/dist/components/link/index.d.ts +15 -0
- package/dist/components/link/index.js +13 -0
- package/dist/components/link/link.d.ts +10 -0
- package/dist/components/link/link.js +59 -0
- package/dist/components/link/styles.d.ts +35 -0
- package/dist/components/link/styles.js +13 -0
- package/dist/components/list-box/index.d.ts +23 -0
- package/dist/components/list-box/index.js +18 -0
- package/dist/components/list-box/list-box.d.ts +9 -0
- package/dist/components/list-box/list-box.js +23 -0
- package/dist/components/list-box/styles.d.ts +18 -0
- package/dist/components/list-box/styles.js +17 -0
- package/dist/components/list-box-item/index.d.ts +15 -0
- package/dist/components/list-box-item/index.js +13 -0
- package/dist/components/list-box-item/list-box-item.d.ts +15 -0
- package/dist/components/list-box-item/list-box-item.js +77 -0
- package/dist/components/list-box-item/styles.d.ts +39 -0
- package/dist/components/list-box-item/styles.js +24 -0
- package/dist/components/list-box-section/index.d.ts +10 -0
- package/dist/components/list-box-section/index.js +10 -0
- package/dist/components/list-box-section/list-box-section.d.ts +8 -0
- package/dist/components/list-box-section/list-box-section.js +22 -0
- package/dist/components/list-box-section/styles.d.ts +3 -0
- package/dist/components/list-box-section/styles.js +8 -0
- package/dist/components/menu/index.d.ts +24 -0
- package/dist/components/menu/index.js +18 -0
- package/dist/components/menu/menu.d.ts +9 -0
- package/dist/components/menu/menu.js +20 -0
- package/dist/components/menu/styles.d.ts +3 -0
- package/dist/components/menu/styles.js +8 -0
- package/dist/components/menu-item/index.d.ts +17 -0
- package/dist/components/menu-item/index.js +14 -0
- package/dist/components/menu-item/menu-item.d.ts +20 -0
- package/dist/components/menu-item/menu-item.js +123 -0
- package/dist/components/menu-item/styles.d.ts +42 -0
- package/dist/components/menu-item/styles.js +25 -0
- package/dist/components/menu-section/index.d.ts +10 -0
- package/dist/components/menu-section/index.js +10 -0
- package/dist/components/menu-section/menu-section.d.ts +8 -0
- package/dist/components/menu-section/menu-section.js +22 -0
- package/dist/components/menu-section/styles.d.ts +3 -0
- package/dist/components/menu-section/styles.js +8 -0
- package/dist/components/meter/index.d.ts +34 -0
- package/dist/components/meter/index.js +15 -0
- package/dist/components/meter/meter.d.ts +29 -0
- package/dist/components/meter/meter.js +108 -0
- package/dist/components/meter/styles.d.ts +105 -0
- package/dist/components/meter/styles.js +47 -0
- package/dist/components/modal/index.d.ts +33 -0
- package/dist/components/modal/index.js +22 -0
- package/dist/components/modal/modal.d.ts +53 -0
- package/dist/components/modal/modal.js +288 -0
- package/dist/components/modal/styles.d.ts +168 -0
- package/dist/components/modal/styles.js +69 -0
- package/dist/components/number-field/index.d.ts +21 -0
- package/dist/components/number-field/index.js +16 -0
- package/dist/components/number-field/number-field.d.ts +20 -0
- package/dist/components/number-field/number-field.js +127 -0
- package/dist/components/number-field/styles.d.ts +69 -0
- package/dist/components/number-field/styles.js +35 -0
- package/dist/components/pagination/index.d.ts +64 -0
- package/dist/components/pagination/index.js +21 -0
- package/dist/components/pagination/pagination.d.ts +84 -0
- package/dist/components/pagination/pagination.js +230 -0
- package/dist/components/pagination/styles.d.ts +60 -0
- package/dist/components/pagination/styles.js +31 -0
- package/dist/components/popover/index.d.ts +23 -0
- package/dist/components/popover/index.js +17 -0
- package/dist/components/popover/popover.d.ts +24 -0
- package/dist/components/popover/popover.js +153 -0
- package/dist/components/popover/styles.d.ts +45 -0
- package/dist/components/popover/styles.js +13 -0
- package/dist/components/progress-bar/index.d.ts +34 -0
- package/dist/components/progress-bar/index.js +15 -0
- package/dist/components/progress-bar/progress-bar.d.ts +29 -0
- package/dist/components/progress-bar/progress-bar.js +108 -0
- package/dist/components/progress-bar/styles.d.ts +105 -0
- package/dist/components/progress-bar/styles.js +47 -0
- package/dist/components/progress-circle/index.d.ts +34 -0
- package/dist/components/progress-circle/index.js +15 -0
- package/dist/components/progress-circle/progress-circle.d.ts +29 -0
- package/dist/components/progress-circle/progress-circle.js +126 -0
- package/dist/components/progress-circle/styles.d.ts +105 -0
- package/dist/components/progress-circle/styles.js +47 -0
- package/dist/components/rac/components.d.ts +1 -0
- package/dist/components/rac/index.d.ts +4 -0
- package/dist/components/rac/index.js +2 -0
- package/dist/components/rac/types.d.ts +3 -0
- package/dist/components/rac/utils.d.ts +1 -0
- package/dist/components/radio/index.d.ts +19 -0
- package/dist/components/radio/index.js +15 -0
- package/dist/components/radio/radio.d.ts +21 -0
- package/dist/components/radio/radio.js +97 -0
- package/dist/components/radio/styles.d.ts +45 -0
- package/dist/components/radio/styles.js +13 -0
- package/dist/components/radio-group/index.d.ts +13 -0
- package/dist/components/radio-group/index.js +12 -0
- package/dist/components/radio-group/radio-group.d.ts +8 -0
- package/dist/components/radio-group/radio-group.js +27 -0
- package/dist/components/radio-group/styles.d.ts +18 -0
- package/dist/components/radio-group/styles.js +17 -0
- package/dist/components/range-calendar/index.d.ts +91 -0
- package/dist/components/range-calendar/index.js +29 -0
- package/dist/components/range-calendar/range-calendar.d.ts +71 -0
- package/dist/components/range-calendar/range-calendar.js +289 -0
- package/dist/components/range-calendar/styles.d.ts +78 -0
- package/dist/components/range-calendar/styles.js +35 -0
- package/dist/components/scroll-shadow/index.d.ts +21 -0
- package/dist/components/scroll-shadow/index.js +13 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts +32 -0
- package/dist/components/scroll-shadow/scroll-shadow.js +76 -0
- package/dist/components/scroll-shadow/styles.d.ts +69 -0
- package/dist/components/scroll-shadow/styles.js +36 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.d.ts +11 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.js +121 -0
- package/dist/components/search-field/index.d.ts +21 -0
- package/dist/components/search-field/index.js +16 -0
- package/dist/components/search-field/search-field.d.ts +23 -0
- package/dist/components/search-field/search-field.js +127 -0
- package/dist/components/search-field/styles.d.ts +69 -0
- package/dist/components/search-field/styles.js +35 -0
- package/dist/components/select/index.d.ts +21 -0
- package/dist/components/select/index.js +16 -0
- package/dist/components/select/select.d.ts +24 -0
- package/dist/components/select/select.js +140 -0
- package/dist/components/select/styles.d.ts +69 -0
- package/dist/components/select/styles.js +35 -0
- package/dist/components/separator/index.d.ts +13 -0
- package/dist/components/separator/index.js +12 -0
- package/dist/components/separator/separator.d.ts +8 -0
- package/dist/components/separator/separator.js +27 -0
- package/dist/components/separator/styles.d.ts +34 -0
- package/dist/components/separator/styles.js +23 -0
- package/dist/components/skeleton/index.d.ts +13 -0
- package/dist/components/skeleton/index.js +12 -0
- package/dist/components/skeleton/skeleton.d.ts +7 -0
- package/dist/components/skeleton/skeleton.js +25 -0
- package/dist/components/skeleton/styles.d.ts +27 -0
- package/dist/components/skeleton/styles.js +20 -0
- package/dist/components/slider/index.d.ts +23 -0
- package/dist/components/slider/index.js +17 -0
- package/dist/components/slider/slider.d.ts +23 -0
- package/dist/components/slider/slider.js +177 -0
- package/dist/components/slider/styles.d.ts +57 -0
- package/dist/components/slider/styles.js +15 -0
- package/dist/components/spinner/index.d.ts +13 -0
- package/dist/components/spinner/index.js +12 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +88 -0
- package/dist/components/spinner/styles.d.ts +45 -0
- package/dist/components/spinner/styles.js +27 -0
- package/dist/components/surface/index.d.ts +14 -0
- package/dist/components/surface/index.js +13 -0
- package/dist/components/surface/styles.d.ts +24 -0
- package/dist/components/surface/styles.js +19 -0
- package/dist/components/surface/surface.d.ts +12 -0
- package/dist/components/surface/surface.js +34 -0
- package/dist/components/switch/index.d.ts +21 -0
- package/dist/components/switch/index.js +16 -0
- package/dist/components/switch/styles.d.ts +57 -0
- package/dist/components/switch/styles.js +30 -0
- package/dist/components/switch/switch.d.ts +20 -0
- package/dist/components/switch/switch.js +118 -0
- package/dist/components/switch-group/index.d.ts +13 -0
- package/dist/components/switch-group/index.js +12 -0
- package/dist/components/switch-group/styles.d.ts +39 -0
- package/dist/components/switch-group/styles.js +24 -0
- package/dist/components/switch-group/switch-group.d.ts +7 -0
- package/dist/components/switch-group/switch-group.js +25 -0
- package/dist/components/table/index.d.ts +38 -0
- package/dist/components/table/index.js +25 -0
- package/dist/components/table/styles.d.ts +74 -0
- package/dist/components/table/styles.js +37 -0
- package/dist/components/table/table.d.ts +50 -0
- package/dist/components/table/table.js +283 -0
- package/dist/components/tabs/index.d.ts +25 -0
- package/dist/components/tabs/index.js +18 -0
- package/dist/components/tabs/styles.d.ts +50 -0
- package/dist/components/tabs/styles.js +29 -0
- package/dist/components/tabs/tabs.d.ts +37 -0
- package/dist/components/tabs/tabs.js +156 -0
- package/dist/components/tag/index.d.ts +15 -0
- package/dist/components/tag/index.js +13 -0
- package/dist/components/tag/styles.d.ts +72 -0
- package/dist/components/tag/styles.js +36 -0
- package/dist/components/tag/tag.d.ts +14 -0
- package/dist/components/tag/tag.js +85 -0
- package/dist/components/tag-group/index.d.ts +15 -0
- package/dist/components/tag-group/index.js +14 -0
- package/dist/components/tag-group/styles.d.ts +33 -0
- package/dist/components/tag-group/styles.js +11 -0
- package/dist/components/tag-group/tag-group.d.ts +20 -0
- package/dist/components/tag-group/tag-group.js +59 -0
- package/dist/components/text/index.d.ts +13 -0
- package/dist/components/text/index.js +12 -0
- package/dist/components/text/styles.d.ts +48 -0
- package/dist/components/text/styles.js +28 -0
- package/dist/components/text/text.d.ts +8 -0
- package/dist/components/text/text.js +25 -0
- package/dist/components/textarea/index.d.ts +13 -0
- package/dist/components/textarea/index.js +12 -0
- package/dist/components/textarea/styles.d.ts +30 -0
- package/dist/components/textarea/styles.js +22 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +27 -0
- package/dist/components/textfield/index.d.ts +14 -0
- package/dist/components/textfield/index.js +13 -0
- package/dist/components/textfield/styles.d.ts +18 -0
- package/dist/components/textfield/styles.js +17 -0
- package/dist/components/textfield/textfield.d.ts +18 -0
- package/dist/components/textfield/textfield.js +39 -0
- package/dist/components/time-field/index.d.ts +26 -0
- package/dist/components/time-field/index.js +20 -0
- package/dist/components/time-field/styles.d.ts +18 -0
- package/dist/components/time-field/styles.js +17 -0
- package/dist/components/time-field/time-field.d.ts +9 -0
- package/dist/components/time-field/time-field.js +29 -0
- package/dist/components/toast/constants.d.ts +6 -0
- package/dist/components/toast/constants.js +15 -0
- package/dist/components/toast/index.d.ts +75 -0
- package/dist/components/toast/index.js +23 -0
- package/dist/components/toast/styles.d.ts +162 -0
- package/dist/components/toast/styles.js +66 -0
- package/dist/components/toast/toast-queue.d.ts +70 -0
- package/dist/components/toast/toast-queue.js +147 -0
- package/dist/components/toast/toast.d.ts +69 -0
- package/dist/components/toast/toast.js +365 -0
- package/dist/components/toggle-button/index.d.ts +13 -0
- package/dist/components/toggle-button/index.js +12 -0
- package/dist/components/toggle-button/styles.d.ts +42 -0
- package/dist/components/toggle-button/styles.js +27 -0
- package/dist/components/toggle-button/toggle-button.d.ts +8 -0
- package/dist/components/toggle-button/toggle-button.js +36 -0
- package/dist/components/toggle-button-group/index.d.ts +16 -0
- package/dist/components/toggle-button-group/index.js +14 -0
- package/dist/components/toggle-button-group/styles.d.ts +75 -0
- package/dist/components/toggle-button-group/styles.js +38 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +26 -0
- package/dist/components/toggle-button-group/toggle-button-group.js +70 -0
- package/dist/components/toolbar/index.d.ts +19 -0
- package/dist/components/toolbar/index.js +12 -0
- package/dist/components/toolbar/styles.d.ts +28 -0
- package/dist/components/toolbar/styles.js +21 -0
- package/dist/components/toolbar/toolbar.d.ts +11 -0
- package/dist/components/toolbar/toolbar.js +39 -0
- package/dist/components/tooltip/index.d.ts +19 -0
- package/dist/components/tooltip/index.js +15 -0
- package/dist/components/tooltip/styles.d.ts +33 -0
- package/dist/components/tooltip/styles.js +11 -0
- package/dist/components/tooltip/tooltip.d.ts +20 -0
- package/dist/components/tooltip/tooltip.js +106 -0
- package/dist/css/base.css +17 -0
- package/dist/css/components.css +117 -0
- package/dist/css/index.css +22 -0
- package/dist/css/themes/default/index.css +5 -0
- package/dist/css/themes/default/variables.css +162 -0
- package/dist/css/themes/shared/theme.css +191 -0
- package/dist/css/utilities.css +56 -0
- package/dist/css/variants.css +106 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/use-css-variable.d.ts +36 -0
- package/dist/hooks/use-css-variable.js +72 -0
- package/dist/hooks/use-is-hydrated.d.ts +19 -0
- package/dist/hooks/use-is-hydrated.js +28 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/hooks/use-isomorphic-layout-effect.js +6 -0
- package/dist/hooks/use-list-data.d.ts +111 -0
- package/dist/hooks/use-list-data.js +296 -0
- package/dist/hooks/use-measured-height.d.ts +4 -0
- package/dist/hooks/use-measured-height.js +47 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +50 -0
- package/dist/hooks/use-mounted.d.ts +1 -0
- package/dist/hooks/use-mounted.js +15 -0
- package/dist/hooks/use-overlay-state.d.ts +52 -0
- package/dist/hooks/use-overlay-state.js +70 -0
- package/dist/hooks/use-safe-layout-effect.d.ts +2 -0
- package/dist/hooks/use-safe-layout-effect.js +6 -0
- package/dist/index.d.ts +3 -3740
- package/dist/index.js +262 -982
- package/dist/styles/components/index.d.ts +83 -0
- package/dist/styles/index.d.ts +3 -0
- package/dist/styles/utils/index.d.ts +7 -0
- package/dist/styles.css +2 -0
- package/dist/utils/assertion.d.ts +9 -0
- package/dist/utils/assertion.js +3 -0
- package/dist/utils/calendar.d.ts +5 -0
- package/dist/utils/calendar.js +19 -0
- package/dist/utils/children.d.ts +9 -0
- package/dist/utils/children.js +17 -0
- package/dist/utils/compose.d.ts +7 -0
- package/dist/utils/compose.js +18 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/logger.d.ts +23 -0
- package/dist/utils/tv.d.ts +3 -0
- package/dist/utils/variants.d.ts +73 -0
- package/package.json +119 -70
- package/dist/component-manifest.json +0 -749
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ColorSliderVariants } from "./styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { ColorSpace } from "react-aria-components";
|
|
4
|
+
import { ColorSlider as ColorSliderPrimitive, ColorThumb as ColorThumbPrimitive, SliderOutput as SliderOutputPrimitive, SliderTrack as SliderTrackPrimitive } from "react-aria-components";
|
|
5
|
+
/** Channels available in HSL color space */
|
|
6
|
+
type HSLChannel = "hue" | "saturation" | "lightness" | "alpha";
|
|
7
|
+
/** Channels available in HSB color space */
|
|
8
|
+
type HSBChannel = "hue" | "saturation" | "brightness" | "alpha";
|
|
9
|
+
/** Channels available in RGB color space */
|
|
10
|
+
type RGBChannel = "red" | "green" | "blue" | "alpha";
|
|
11
|
+
/** Channels shared between HSL and HSB (but NOT RGB) */
|
|
12
|
+
type HSLHSBSharedChannel = "hue" | "saturation";
|
|
13
|
+
/** Alpha channel works across ALL color spaces */
|
|
14
|
+
type AlphaChannel = "alpha";
|
|
15
|
+
/**
|
|
16
|
+
* Discriminated union type for valid channel/colorSpace combinations.
|
|
17
|
+
* This ensures TypeScript will error on invalid combinations like
|
|
18
|
+
* `channel="red"` with `colorSpace="hsl"` or `channel="saturation"` with `colorSpace="rgb"`.
|
|
19
|
+
*/
|
|
20
|
+
type ColorSliderChannelProps = {
|
|
21
|
+
channel: HSLChannel;
|
|
22
|
+
colorSpace?: "hsl";
|
|
23
|
+
} | {
|
|
24
|
+
channel: HSBChannel;
|
|
25
|
+
colorSpace?: "hsb";
|
|
26
|
+
} | {
|
|
27
|
+
channel: RGBChannel;
|
|
28
|
+
colorSpace?: "rgb";
|
|
29
|
+
} | {
|
|
30
|
+
channel: HSLHSBSharedChannel;
|
|
31
|
+
colorSpace?: "hsl" | "hsb";
|
|
32
|
+
} | {
|
|
33
|
+
channel: AlphaChannel;
|
|
34
|
+
colorSpace?: ColorSpace;
|
|
35
|
+
};
|
|
36
|
+
interface ColorSliderRootBaseProps extends Omit<ComponentPropsWithRef<typeof ColorSliderPrimitive>, "channel" | "colorSpace">, ColorSliderVariants {
|
|
37
|
+
}
|
|
38
|
+
type ColorSliderRootProps = ColorSliderRootBaseProps & ColorSliderChannelProps;
|
|
39
|
+
declare const ColorSliderRoot: ({ channel, children, className, colorSpace, orientation, ...props }: ColorSliderRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
interface ColorSliderOutputProps extends ComponentPropsWithRef<typeof SliderOutputPrimitive> {
|
|
41
|
+
}
|
|
42
|
+
declare const ColorSliderOutput: ({ children, className, ...props }: ColorSliderOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
interface ColorSliderTrackProps extends ComponentPropsWithRef<typeof SliderTrackPrimitive> {
|
|
44
|
+
}
|
|
45
|
+
declare const ColorSliderTrack: ({ children, className, style, ...props }: ColorSliderTrackProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
interface ColorSliderThumbProps extends ComponentPropsWithRef<typeof ColorThumbPrimitive> {
|
|
47
|
+
}
|
|
48
|
+
declare const ColorSliderThumb: ({ children, className, style, ...props }: ColorSliderThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export { ColorSliderRoot, ColorSliderOutput, ColorSliderTrack, ColorSliderThumb };
|
|
50
|
+
export type { ColorSliderRootProps, ColorSliderOutputProps, ColorSliderTrackProps, ColorSliderThumbProps, HSLChannel, HSBChannel, RGBChannel, HSLHSBSharedChannel, AlphaChannel, ColorSliderChannelProps, };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React__default, { useContext, createContext } from 'react';
|
|
3
|
+
import { ColorSlider, SliderTrack, ColorThumb, SliderOutput } from 'react-aria-components';
|
|
4
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
5
|
+
import { colorSliderVariants } from './styles.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
/* -------------------------------------------------------------------------------------------------
|
|
9
|
+
* ColorSlider Validation Utilities
|
|
10
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
11
|
+
|
|
12
|
+
/** Maps channels to their required color space (for channels that are color-space specific) */
|
|
13
|
+
const CHANNEL_TO_REQUIRED_COLORSPACE = {
|
|
14
|
+
blue: "rgb",
|
|
15
|
+
brightness: "hsb",
|
|
16
|
+
green: "rgb",
|
|
17
|
+
lightness: "hsl",
|
|
18
|
+
red: "rgb"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Channels that only work with HSL or HSB (not RGB) */
|
|
22
|
+
const HSL_HSB_ONLY_CHANNELS = new Set(["hue", "saturation"]);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Validates and returns a valid colorSpace for the given channel.
|
|
26
|
+
* If an invalid combination is detected, logs a warning and returns the correct colorSpace.
|
|
27
|
+
*/
|
|
28
|
+
function getValidColorSpace(channel, colorSpace) {
|
|
29
|
+
// Check if channel requires a specific color space (e.g., "red" requires "rgb")
|
|
30
|
+
const requiredSpace = CHANNEL_TO_REQUIRED_COLORSPACE[channel];
|
|
31
|
+
if (requiredSpace && colorSpace && colorSpace !== requiredSpace) {
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
console.warn(`[Cognitiv ColorSlider] Invalid combination: channel="${channel}" requires colorSpace="${requiredSpace}", ` + `but received colorSpace="${colorSpace}". Auto-correcting to "${requiredSpace}".`);
|
|
34
|
+
return requiredSpace;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Check if channel is HSL/HSB only (hue, saturation) but RGB was specified
|
|
38
|
+
if (HSL_HSB_ONLY_CHANNELS.has(channel) && colorSpace === "rgb") {
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
console.warn(`[Cognitiv ColorSlider] Invalid combination: channel="${channel}" is not available in RGB color space. ` + `Use colorSpace="hsl" or colorSpace="hsb" instead. Auto-correcting to "hsl".`);
|
|
41
|
+
return "hsl";
|
|
42
|
+
}
|
|
43
|
+
return colorSpace;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* -------------------------------------------------------------------------------------------------
|
|
47
|
+
* ColorSlider Context
|
|
48
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
49
|
+
|
|
50
|
+
const ColorSliderContext = /*#__PURE__*/createContext({});
|
|
51
|
+
|
|
52
|
+
/* -------------------------------------------------------------------------------------------------
|
|
53
|
+
* ColorSlider Root
|
|
54
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
55
|
+
|
|
56
|
+
const ColorSliderRoot = ({
|
|
57
|
+
channel,
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
colorSpace,
|
|
61
|
+
orientation = "horizontal",
|
|
62
|
+
...props
|
|
63
|
+
}) => {
|
|
64
|
+
const slots = React__default.useMemo(() => colorSliderVariants({}), []);
|
|
65
|
+
|
|
66
|
+
// Validate and auto-correct invalid channel/colorSpace combinations
|
|
67
|
+
const validColorSpace = getValidColorSpace(channel, colorSpace);
|
|
68
|
+
return /*#__PURE__*/jsx(ColorSlider, {
|
|
69
|
+
channel: channel,
|
|
70
|
+
colorSpace: validColorSpace,
|
|
71
|
+
"data-slot": "color-slider",
|
|
72
|
+
orientation: orientation,
|
|
73
|
+
...props,
|
|
74
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
75
|
+
children: values => /*#__PURE__*/jsx(ColorSliderContext, {
|
|
76
|
+
value: {
|
|
77
|
+
channel,
|
|
78
|
+
slots,
|
|
79
|
+
state: values
|
|
80
|
+
},
|
|
81
|
+
children: typeof children === "function" ? children(values) : children
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/* -------------------------------------------------------------------------------------------------
|
|
87
|
+
* ColorSlider Output
|
|
88
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
89
|
+
|
|
90
|
+
const ColorSliderOutput = ({
|
|
91
|
+
children,
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) => {
|
|
95
|
+
const {
|
|
96
|
+
slots
|
|
97
|
+
} = useContext(ColorSliderContext);
|
|
98
|
+
return /*#__PURE__*/jsx(SliderOutput, {
|
|
99
|
+
className: composeTwRenderProps(className, slots?.output()),
|
|
100
|
+
"data-slot": "color-slider-output",
|
|
101
|
+
...props,
|
|
102
|
+
children: children ? values => /*#__PURE__*/jsx(Fragment, {
|
|
103
|
+
children: typeof children === "function" ? children(values) : children
|
|
104
|
+
}) : ({
|
|
105
|
+
state
|
|
106
|
+
}) => state.getThumbValueLabel(0)
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/* -------------------------------------------------------------------------------------------------
|
|
111
|
+
* ColorSlider Track
|
|
112
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
113
|
+
|
|
114
|
+
const ColorSliderTrack = ({
|
|
115
|
+
children,
|
|
116
|
+
className,
|
|
117
|
+
style,
|
|
118
|
+
...props
|
|
119
|
+
}) => {
|
|
120
|
+
const {
|
|
121
|
+
channel,
|
|
122
|
+
slots,
|
|
123
|
+
state
|
|
124
|
+
} = useContext(ColorSliderContext);
|
|
125
|
+
// Calculate start and end colors for the gradient edge caps
|
|
126
|
+
const displayColor = state?.state?.getDisplayColor();
|
|
127
|
+
const edgeColors = React__default.useMemo(() => {
|
|
128
|
+
// Access color through state.state.value (ColorSliderState.value)
|
|
129
|
+
if (!displayColor || !channel) {
|
|
130
|
+
return {
|
|
131
|
+
end: "transparent",
|
|
132
|
+
start: "transparent"
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const range = displayColor.getChannelRange(channel);
|
|
136
|
+
|
|
137
|
+
// Get colors at min and max values of the channel
|
|
138
|
+
const startColor = displayColor.withChannelValue(channel, range.minValue);
|
|
139
|
+
const endColor = displayColor.withChannelValue(channel, range.maxValue);
|
|
140
|
+
return {
|
|
141
|
+
end: endColor.toString("css"),
|
|
142
|
+
start: startColor.toString("css")
|
|
143
|
+
};
|
|
144
|
+
}, [channel, displayColor]);
|
|
145
|
+
return /*#__PURE__*/jsx(SliderTrack, {
|
|
146
|
+
className: composeTwRenderProps(className, slots?.track()),
|
|
147
|
+
"data-slot": "color-slider-track",
|
|
148
|
+
style: ({
|
|
149
|
+
defaultStyle,
|
|
150
|
+
...rest
|
|
151
|
+
}) => ({
|
|
152
|
+
// Pass edge colors as CSS custom properties for ::before and ::after
|
|
153
|
+
"--track-end-color": edgeColors.end,
|
|
154
|
+
"--track-start-color": edgeColors.start,
|
|
155
|
+
// Add transparency checkerboard pattern for alpha channel
|
|
156
|
+
background: `${defaultStyle.background}, repeating-conic-gradient(#efefef 0% 25%, #f7f7f7 0% 50%) 50% / 16px 16px`,
|
|
157
|
+
...(typeof style === "function" ? style({
|
|
158
|
+
defaultStyle,
|
|
159
|
+
...rest
|
|
160
|
+
}) : style)
|
|
161
|
+
}),
|
|
162
|
+
...props,
|
|
163
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
164
|
+
children: typeof children === "function" ? children(values) : children
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/* -------------------------------------------------------------------------------------------------
|
|
170
|
+
* ColorSlider Thumb
|
|
171
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
172
|
+
|
|
173
|
+
const ColorSliderThumb = ({
|
|
174
|
+
children,
|
|
175
|
+
className,
|
|
176
|
+
style,
|
|
177
|
+
...props
|
|
178
|
+
}) => {
|
|
179
|
+
const {
|
|
180
|
+
slots
|
|
181
|
+
} = useContext(ColorSliderContext);
|
|
182
|
+
return /*#__PURE__*/jsx(ColorThumb, {
|
|
183
|
+
className: composeTwRenderProps(className, slots?.thumb()),
|
|
184
|
+
"data-slot": "color-slider-thumb",
|
|
185
|
+
style: ({
|
|
186
|
+
defaultStyle,
|
|
187
|
+
isDisabled,
|
|
188
|
+
...rest
|
|
189
|
+
}) => ({
|
|
190
|
+
...defaultStyle,
|
|
191
|
+
backgroundColor: isDisabled ? undefined : defaultStyle.backgroundColor,
|
|
192
|
+
...(typeof style === "function" ? style({
|
|
193
|
+
defaultStyle,
|
|
194
|
+
isDisabled,
|
|
195
|
+
...rest
|
|
196
|
+
}) : style)
|
|
197
|
+
}),
|
|
198
|
+
...props,
|
|
199
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
200
|
+
children: typeof children === "function" ? children(values) : children
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export { ColorSliderOutput, ColorSliderRoot, ColorSliderThumb, ColorSliderTrack };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorSliderOutput, ColorSliderRoot, ColorSliderThumb, ColorSliderTrack } from "./color-slider";
|
|
3
|
+
export declare const ColorSlider: (({ channel, children, className, colorSpace, orientation, ...props }: import("./color-slider").ColorSliderRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Output: ({ children, className, ...props }: import("./color-slider").ColorSliderOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Root: ({ channel, children, className, colorSpace, orientation, ...props }: import("./color-slider").ColorSliderRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Thumb: ({ children, className, style, ...props }: import("./color-slider").ColorSliderThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Track: ({ children, className, style, ...props }: import("./color-slider").ColorSliderTrackProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export type ColorSlider = {
|
|
10
|
+
Props: ComponentProps<typeof ColorSliderRoot>;
|
|
11
|
+
RootProps: ComponentProps<typeof ColorSliderRoot>;
|
|
12
|
+
OutputProps: ComponentProps<typeof ColorSliderOutput>;
|
|
13
|
+
TrackProps: ComponentProps<typeof ColorSliderTrack>;
|
|
14
|
+
ThumbProps: ComponentProps<typeof ColorSliderThumb>;
|
|
15
|
+
};
|
|
16
|
+
export { ColorSliderRoot, ColorSliderOutput, ColorSliderTrack, ColorSliderThumb };
|
|
17
|
+
export type { ColorSliderRootProps, ColorSliderRootProps as ColorSliderProps, ColorSliderOutputProps, ColorSliderTrackProps, ColorSliderThumbProps, HSLChannel, HSBChannel, RGBChannel, HSLHSBSharedChannel, AlphaChannel, ColorSliderChannelProps, } from "./color-slider";
|
|
18
|
+
export { colorSliderVariants } from "./styles";
|
|
19
|
+
export type { ColorSliderVariants } from "./styles";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ColorSliderRoot, ColorSliderTrack, ColorSliderThumb, ColorSliderOutput } from './color-slider.js';
|
|
3
|
+
export { colorSliderVariants } from './styles.js';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ColorSlider = Object.assign(ColorSliderRoot, {
|
|
9
|
+
Output: ColorSliderOutput,
|
|
10
|
+
Root: ColorSliderRoot,
|
|
11
|
+
Thumb: ColorSliderThumb,
|
|
12
|
+
Track: ColorSliderTrack
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { ColorSlider, ColorSliderOutput, ColorSliderRoot, ColorSliderThumb, ColorSliderTrack };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const colorSliderVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
[key: string]: {
|
|
4
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
5
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
6
|
+
output?: import("tailwind-merge").ClassNameValue;
|
|
7
|
+
track?: import("tailwind-merge").ClassNameValue;
|
|
8
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
[x: string]: {
|
|
13
|
+
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
14
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
15
|
+
output?: import("tailwind-merge").ClassNameValue;
|
|
16
|
+
track?: import("tailwind-merge").ClassNameValue;
|
|
17
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
} | {}, {
|
|
21
|
+
base: string;
|
|
22
|
+
output: string;
|
|
23
|
+
thumb: string;
|
|
24
|
+
track: string;
|
|
25
|
+
}, undefined, {
|
|
26
|
+
[key: string]: {
|
|
27
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
28
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
29
|
+
output?: import("tailwind-merge").ClassNameValue;
|
|
30
|
+
track?: import("tailwind-merge").ClassNameValue;
|
|
31
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
} | {}, {
|
|
35
|
+
base: string;
|
|
36
|
+
output: string;
|
|
37
|
+
thumb: string;
|
|
38
|
+
track: string;
|
|
39
|
+
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
40
|
+
base: string;
|
|
41
|
+
output: string;
|
|
42
|
+
thumb: string;
|
|
43
|
+
track: string;
|
|
44
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
45
|
+
export type ColorSliderVariants = VariantProps<typeof colorSliderVariants>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { tv } from 'tailwind-variants';
|
|
3
|
+
|
|
4
|
+
const colorSliderVariants = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
base: "color-slider",
|
|
7
|
+
output: "color-slider__output",
|
|
8
|
+
thumb: "color-slider__thumb",
|
|
9
|
+
track: "color-slider__track"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { colorSliderVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ColorSwatchVariants } from "./styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { ColorSwatch as ColorSwatchPrimitive } from "react-aria-components";
|
|
4
|
+
interface ColorSwatchRootProps extends ComponentPropsWithRef<typeof ColorSwatchPrimitive>, ColorSwatchVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const ColorSwatchRoot: ({ className, shape, size, style, ...props }: ColorSwatchRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { ColorSwatchRoot };
|
|
8
|
+
export type { ColorSwatchRootProps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ColorSwatch } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
|
+
import { colorSwatchVariants } from './styles.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const ColorSwatchRoot = ({
|
|
8
|
+
className,
|
|
9
|
+
shape,
|
|
10
|
+
size,
|
|
11
|
+
style,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
return /*#__PURE__*/jsx(ColorSwatch, {
|
|
15
|
+
...props,
|
|
16
|
+
className: composeTwRenderProps(className, colorSwatchVariants({
|
|
17
|
+
shape,
|
|
18
|
+
size
|
|
19
|
+
})),
|
|
20
|
+
"data-slot": "color-swatch",
|
|
21
|
+
style: renderProps => {
|
|
22
|
+
const userStyle = typeof style === "function" ? style(renderProps) : style;
|
|
23
|
+
return {
|
|
24
|
+
"--color-swatch-current": renderProps.color.toString("css"),
|
|
25
|
+
...userStyle
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { ColorSwatchRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorSwatchRoot } from "./color-swatch";
|
|
3
|
+
export declare const ColorSwatch: (({ className, shape, size, style, ...props }: import("./color-swatch").ColorSwatchRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ className, shape, size, style, ...props }: import("./color-swatch").ColorSwatchRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type ColorSwatch = {
|
|
7
|
+
Props: ComponentProps<typeof ColorSwatchRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof ColorSwatchRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { ColorSwatchRoot };
|
|
11
|
+
export type { ColorSwatchRootProps, ColorSwatchRootProps as ColorSwatchProps, } from "./color-swatch";
|
|
12
|
+
export { colorSwatchVariants } from "./styles";
|
|
13
|
+
export type { ColorSwatchVariants } from "./styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ColorSwatchRoot } from './color-swatch.js';
|
|
3
|
+
export { colorSwatchVariants } from './styles.js';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ColorSwatch = Object.assign(ColorSwatchRoot, {
|
|
9
|
+
Root: ColorSwatchRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { ColorSwatch, ColorSwatchRoot };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const colorSwatchVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
shape: {
|
|
4
|
+
circle: string;
|
|
5
|
+
square: string;
|
|
6
|
+
};
|
|
7
|
+
size: {
|
|
8
|
+
lg: string;
|
|
9
|
+
md: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
xl: string;
|
|
12
|
+
xs: string;
|
|
13
|
+
};
|
|
14
|
+
}, undefined, "color-swatch", {
|
|
15
|
+
shape: {
|
|
16
|
+
circle: string;
|
|
17
|
+
square: string;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
lg: string;
|
|
21
|
+
md: string;
|
|
22
|
+
sm: string;
|
|
23
|
+
xl: string;
|
|
24
|
+
xs: string;
|
|
25
|
+
};
|
|
26
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
27
|
+
shape: {
|
|
28
|
+
circle: string;
|
|
29
|
+
square: string;
|
|
30
|
+
};
|
|
31
|
+
size: {
|
|
32
|
+
lg: string;
|
|
33
|
+
md: string;
|
|
34
|
+
sm: string;
|
|
35
|
+
xl: string;
|
|
36
|
+
xs: string;
|
|
37
|
+
};
|
|
38
|
+
}, undefined, "color-swatch", unknown, unknown, undefined>>;
|
|
39
|
+
export type ColorSwatchVariants = VariantProps<typeof colorSwatchVariants>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { tv } from 'tailwind-variants';
|
|
3
|
+
|
|
4
|
+
const colorSwatchVariants = tv({
|
|
5
|
+
base: "color-swatch",
|
|
6
|
+
defaultVariants: {
|
|
7
|
+
shape: "circle",
|
|
8
|
+
size: "md"
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
shape: {
|
|
12
|
+
circle: "color-swatch--circle",
|
|
13
|
+
square: "color-swatch--square"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
lg: "color-swatch--lg",
|
|
17
|
+
md: "color-swatch--md",
|
|
18
|
+
sm: "color-swatch--sm",
|
|
19
|
+
xl: "color-swatch--xl",
|
|
20
|
+
xs: "color-swatch--xs"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { colorSwatchVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ColorSwatchPickerVariants } from "./styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { ColorSwatchPickerItemRenderProps } from "react-aria-components";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { ColorSwatchPickerItem as ColorSwatchPickerItemPrimitive, ColorSwatchPicker as ColorSwatchPickerPrimitive, ColorSwatch as ColorSwatchPrimitive } from "react-aria-components";
|
|
6
|
+
interface ColorSwatchPickerRootProps extends ComponentPropsWithRef<typeof ColorSwatchPickerPrimitive>, ColorSwatchPickerVariants {
|
|
7
|
+
}
|
|
8
|
+
declare const ColorSwatchPickerRoot: ({ children, className, layout, size, variant, ...props }: ColorSwatchPickerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface ColorSwatchPickerItemProps extends ComponentPropsWithRef<typeof ColorSwatchPickerItemPrimitive> {
|
|
10
|
+
}
|
|
11
|
+
declare const ColorSwatchPickerItem: ({ children, className, ...props }: ColorSwatchPickerItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
interface ColorSwatchPickerSwatchProps extends ComponentPropsWithRef<typeof ColorSwatchPrimitive> {
|
|
13
|
+
}
|
|
14
|
+
declare const ColorSwatchPickerSwatch: ({ className, ...props }: ColorSwatchPickerSwatchProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface ColorSwatchPickerIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
16
|
+
children?: React.ReactNode | ((props: ColorSwatchPickerItemRenderProps) => React.ReactNode);
|
|
17
|
+
}
|
|
18
|
+
declare const ColorSwatchPickerIndicator: ({ children, className, ...props }: ColorSwatchPickerIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { ColorSwatchPickerRoot, ColorSwatchPickerItem, ColorSwatchPickerSwatch, ColorSwatchPickerIndicator, };
|
|
20
|
+
export type { ColorSwatchPickerRootProps, ColorSwatchPickerItemProps, ColorSwatchPickerSwatchProps, ColorSwatchPickerIndicatorProps, };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React__default, { useContext, createContext } from 'react';
|
|
3
|
+
import { ColorSwatchPicker, ColorSwatch, ColorSwatchPickerItem as ColorSwatchPickerItem$1 } from 'react-aria-components';
|
|
4
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
5
|
+
import { colorSwatchPickerVariants } from './styles.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const ColorSwatchPickerContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
| * ColorSwatchPickerItem Context
|
|
12
|
+
| * -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const ColorSwatchPickerItemContext = /*#__PURE__*/createContext({});
|
|
15
|
+
|
|
16
|
+
/* -------------------------------------------------------------------------------------------------
|
|
17
|
+
| * ColorSwatchPicker Root
|
|
18
|
+
| * -----------------------------------------------------------------------------------------------*/
|
|
19
|
+
|
|
20
|
+
const ColorSwatchPickerRoot = ({
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
layout,
|
|
24
|
+
size,
|
|
25
|
+
variant,
|
|
26
|
+
...props
|
|
27
|
+
}) => {
|
|
28
|
+
const slots = React__default.useMemo(() => colorSwatchPickerVariants({
|
|
29
|
+
layout,
|
|
30
|
+
size,
|
|
31
|
+
variant
|
|
32
|
+
}), [layout, size, variant]);
|
|
33
|
+
return /*#__PURE__*/jsx(ColorSwatchPickerContext, {
|
|
34
|
+
value: {
|
|
35
|
+
slots
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/jsx(ColorSwatchPicker, {
|
|
38
|
+
"data-slot": "color-swatch-picker",
|
|
39
|
+
...props,
|
|
40
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
41
|
+
children: children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/* -------------------------------------------------------------------------------------------------
|
|
47
|
+
| * ColorSwatchPicker Item
|
|
48
|
+
| * -----------------------------------------------------------------------------------------------*/
|
|
49
|
+
|
|
50
|
+
const ColorSwatchPickerItem = ({
|
|
51
|
+
children,
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}) => {
|
|
55
|
+
const {
|
|
56
|
+
slots
|
|
57
|
+
} = useContext(ColorSwatchPickerContext);
|
|
58
|
+
return /*#__PURE__*/jsx(ColorSwatchPickerItem$1, {
|
|
59
|
+
"data-slot": "color-swatch-picker-item",
|
|
60
|
+
...props,
|
|
61
|
+
className: composeTwRenderProps(className, slots?.item()),
|
|
62
|
+
style: renderProps => ({
|
|
63
|
+
"--color-swatch-current": renderProps.color.toString("css")
|
|
64
|
+
}),
|
|
65
|
+
children: renderProps => /*#__PURE__*/jsx(ColorSwatchPickerItemContext, {
|
|
66
|
+
value: {
|
|
67
|
+
state: renderProps
|
|
68
|
+
},
|
|
69
|
+
children: typeof children === "function" ? children(renderProps) : children
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/* -------------------------------------------------------------------------------------------------
|
|
75
|
+
| * ColorSwatchPicker Swatch
|
|
76
|
+
| * -----------------------------------------------------------------------------------------------*/
|
|
77
|
+
|
|
78
|
+
const ColorSwatchPickerSwatch = ({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) => {
|
|
82
|
+
const {
|
|
83
|
+
slots
|
|
84
|
+
} = useContext(ColorSwatchPickerContext);
|
|
85
|
+
return /*#__PURE__*/jsx(ColorSwatch, {
|
|
86
|
+
className: composeTwRenderProps(className, slots?.swatch()),
|
|
87
|
+
"data-slot": "color-swatch-picker-swatch",
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/* -------------------------------------------------------------------------------------------------
|
|
93
|
+
| * ColorSwatchPicker Indicator
|
|
94
|
+
| * -----------------------------------------------------------------------------------------------*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Calculate relative luminance of a color
|
|
98
|
+
* Uses the formula: L = 0.2126 * R + 0.7152 * G + 0.0722 * B
|
|
99
|
+
* Returns a value between 0 (black) and 1 (white)
|
|
100
|
+
*/
|
|
101
|
+
function getColorLuminance(color) {
|
|
102
|
+
// Get RGB values (0-255 range)
|
|
103
|
+
const r = color.getChannelValue("red");
|
|
104
|
+
const g = color.getChannelValue("green");
|
|
105
|
+
const b = color.getChannelValue("blue");
|
|
106
|
+
|
|
107
|
+
// Normalize to 0-1 and calculate luminance
|
|
108
|
+
return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
|
109
|
+
}
|
|
110
|
+
const ColorSwatchPickerIndicator = ({
|
|
111
|
+
children,
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}) => {
|
|
115
|
+
const {
|
|
116
|
+
slots
|
|
117
|
+
} = useContext(ColorSwatchPickerContext);
|
|
118
|
+
const {
|
|
119
|
+
state
|
|
120
|
+
} = useContext(ColorSwatchPickerItemContext);
|
|
121
|
+
|
|
122
|
+
// Determine if the background color is light (luminance > 0.5)
|
|
123
|
+
// Use white checkmark on dark backgrounds, black on light backgrounds
|
|
124
|
+
const isLightColor = state?.color ? getColorLuminance(state.color) > 0.5 : false;
|
|
125
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : /*#__PURE__*/jsx("svg", {
|
|
126
|
+
"aria-hidden": "true",
|
|
127
|
+
"data-slot": "color-swatch-picker-checkmark",
|
|
128
|
+
fill: "none",
|
|
129
|
+
role: "presentation",
|
|
130
|
+
stroke: "currentColor",
|
|
131
|
+
strokeLinecap: "round",
|
|
132
|
+
strokeLinejoin: "round",
|
|
133
|
+
strokeWidth: 1.5,
|
|
134
|
+
viewBox: "0 0 12 12",
|
|
135
|
+
children: /*#__PURE__*/jsx("polyline", {
|
|
136
|
+
points: "2.5 6 5 8.5 9.5 3"
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
return /*#__PURE__*/jsx("span", {
|
|
140
|
+
"aria-hidden": "true",
|
|
141
|
+
className: composeSlotClassName(slots?.indicator, className),
|
|
142
|
+
"data-light-color": isLightColor ? "true" : undefined,
|
|
143
|
+
"data-slot": "color-swatch-picker-indicator",
|
|
144
|
+
...props,
|
|
145
|
+
children: content
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export { ColorSwatchPickerIndicator, ColorSwatchPickerItem, ColorSwatchPickerRoot, ColorSwatchPickerSwatch };
|