@solid2-aria/stately 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +45 -2
- package/dist/LICENSES/Apache-2.0.txt +201 -0
- package/dist/LICENSES/react-spectrum-NOTICE.txt +242 -0
- package/dist/NOTICE.txt +636 -0
- package/dist/autocomplete/create-autocomplete-state.d.ts +46 -0
- package/dist/autocomplete/create-autocomplete-state.js +41 -0
- package/dist/autocomplete/create-autocomplete-state.js.map +1 -0
- package/dist/calendar/create-calendar-state.d.ts +62 -0
- package/dist/calendar/create-calendar-state.js +357 -0
- package/dist/calendar/create-calendar-state.js.map +1 -0
- package/dist/calendar/create-range-calendar-state.d.ts +63 -0
- package/dist/calendar/create-range-calendar-state.js +204 -0
- package/dist/calendar/create-range-calendar-state.js.map +1 -0
- package/dist/calendar/types.d.ts +222 -0
- package/dist/calendar/types.js +16 -0
- package/dist/calendar/utils.d.ts +27 -0
- package/dist/calendar/utils.js +81 -0
- package/dist/calendar/utils.js.map +1 -0
- package/dist/checkbox/create-checkbox-group-state.d.ts +60 -0
- package/dist/checkbox/create-checkbox-group-state.js +88 -0
- package/dist/checkbox/create-checkbox-group-state.js.map +1 -0
- package/dist/collections/collection-builder.d.ts +28 -0
- package/dist/collections/collection-builder.js +164 -0
- package/dist/collections/collection-builder.js.map +1 -0
- package/dist/collections/create-collection.d.ts +24 -0
- package/dist/collections/create-collection.js +35 -0
- package/dist/collections/create-collection.js.map +1 -0
- package/dist/collections/get-child-nodes.d.ts +25 -0
- package/dist/collections/get-child-nodes.js +67 -0
- package/dist/collections/get-child-nodes.js.map +1 -0
- package/dist/collections/get-item-count.d.ts +19 -0
- package/dist/collections/get-item-count.js +34 -0
- package/dist/collections/get-item-count.js.map +1 -0
- package/dist/collections/item.d.ts +29 -0
- package/dist/collections/item.js +68 -0
- package/dist/collections/item.js.map +1 -0
- package/dist/collections/section.d.ts +29 -0
- package/dist/collections/section.js +60 -0
- package/dist/collections/section.js.map +1 -0
- package/dist/collections/types.d.ts +46 -0
- package/dist/collections/types.js +29 -0
- package/dist/collections/types.js.map +1 -0
- package/dist/color/color/base-color.d.ts +40 -0
- package/dist/color/color/base-color.js +122 -0
- package/dist/color/color/base-color.js.map +1 -0
- package/dist/color/color/color-classes.d.ts +27 -0
- package/dist/color/color/color-classes.js +29 -0
- package/dist/color/color/color-classes.js.map +1 -0
- package/dist/color/color/color-constructors.d.ts +23 -0
- package/dist/color/color/color-constructors.js +16 -0
- package/dist/color/color/color.d.ts +3 -0
- package/dist/color/color/color.js +2 -0
- package/dist/color/color/hsb-color.d.ts +24 -0
- package/dist/color/color/hsb-color.js +183 -0
- package/dist/color/color/hsb-color.js.map +1 -0
- package/dist/color/color/hsl-color.d.ts +24 -0
- package/dist/color/color/hsl-color.js +184 -0
- package/dist/color/color/hsl-color.js.map +1 -0
- package/dist/color/color/normalize-hue.d.ts +18 -0
- package/dist/color/color/normalize-hue.js +24 -0
- package/dist/color/color/normalize-hue.js.map +1 -0
- package/dist/color/color/oklch.d.ts +19 -0
- package/dist/color/color/oklch.js +97 -0
- package/dist/color/color/oklch.js.map +1 -0
- package/dist/color/color/rgb-color.d.ts +24 -0
- package/dist/color/color/rgb-color.js +230 -0
- package/dist/color/color/rgb-color.js.map +1 -0
- package/dist/color/color.d.ts +25 -0
- package/dist/color/color.js +41 -0
- package/dist/color/color.js.map +1 -0
- package/dist/color/create-color-area-state.d.ts +105 -0
- package/dist/color/create-color-area-state.js +138 -0
- package/dist/color/create-color-area-state.js.map +1 -0
- package/dist/color/create-color-channel-field-state.d.ts +29 -0
- package/dist/color/create-color-channel-field-state.js +69 -0
- package/dist/color/create-color-channel-field-state.js.map +1 -0
- package/dist/color/create-color-field-state.d.ts +61 -0
- package/dist/color/create-color-field-state.js +113 -0
- package/dist/color/create-color-field-state.js.map +1 -0
- package/dist/color/create-color-picker-state.d.ts +16 -0
- package/dist/color/create-color-picker-state.js +26 -0
- package/dist/color/create-color-picker-state.js.map +1 -0
- package/dist/color/create-color-slider-state.d.ts +50 -0
- package/dist/color/create-color-slider-state.js +93 -0
- package/dist/color/create-color-slider-state.js.map +1 -0
- package/dist/color/create-color-wheel-state.d.ts +76 -0
- package/dist/color/create-color-wheel-state.js +130 -0
- package/dist/color/create-color-wheel-state.js.map +1 -0
- package/dist/color/create-color.d.ts +20 -0
- package/dist/color/create-color.js +33 -0
- package/dist/color/create-color.js.map +1 -0
- package/dist/color/types.d.ts +87 -0
- package/dist/color/types.js +5 -0
- package/dist/combobox/create-combo-box-state.d.ts +157 -0
- package/dist/combobox/create-combo-box-state.js +450 -0
- package/dist/combobox/create-combo-box-state.js.map +1 -0
- package/dist/data/create-async-list.d.ts +88 -0
- package/dist/data/create-async-list.js +276 -0
- package/dist/data/create-async-list.js.map +1 -0
- package/dist/data/create-list-data.d.ts +140 -0
- package/dist/data/create-list-data.js +250 -0
- package/dist/data/create-list-data.js.map +1 -0
- package/dist/data/create-tree-data.d.ts +134 -0
- package/dist/data/create-tree-data.js +364 -0
- package/dist/data/create-tree-data.js.map +1 -0
- package/dist/datepicker/create-date-field-state.d.ts +138 -0
- package/dist/datepicker/create-date-field-state.js +449 -0
- package/dist/datepicker/create-date-field-state.js.map +1 -0
- package/dist/datepicker/create-date-picker-state.d.ts +82 -0
- package/dist/datepicker/create-date-picker-state.js +191 -0
- package/dist/datepicker/create-date-picker-state.js.map +1 -0
- package/dist/datepicker/create-date-range-picker-state.d.ts +97 -0
- package/dist/datepicker/create-date-range-picker-state.js +305 -0
- package/dist/datepicker/create-date-range-picker-state.js.map +1 -0
- package/dist/datepicker/create-time-field-state.d.ts +34 -0
- package/dist/datepicker/create-time-field-state.js +128 -0
- package/dist/datepicker/create-time-field-state.js.map +1 -0
- package/dist/datepicker/incomplete-date.d.ts +71 -0
- package/dist/datepicker/incomplete-date.js +324 -0
- package/dist/datepicker/incomplete-date.js.map +1 -0
- package/dist/datepicker/placeholders.d.ts +18 -0
- package/dist/datepicker/placeholders.js +418 -0
- package/dist/datepicker/placeholders.js.map +1 -0
- package/dist/datepicker/types.d.ts +131 -0
- package/dist/datepicker/types.js +16 -0
- package/dist/datepicker/utils.d.ts +37 -0
- package/dist/datepicker/utils.js +168 -0
- package/dist/datepicker/utils.js.map +1 -0
- package/dist/disclosure/create-disclosure-group-state.d.ts +47 -0
- package/dist/disclosure/create-disclosure-group-state.js +62 -0
- package/dist/disclosure/create-disclosure-group-state.js.map +1 -0
- package/dist/disclosure/create-disclosure-state.d.ts +42 -0
- package/dist/disclosure/create-disclosure-state.js +49 -0
- package/dist/disclosure/create-disclosure-state.js.map +1 -0
- package/dist/dnd/create-draggable-collection-state.d.ts +63 -0
- package/dist/dnd/create-draggable-collection-state.js +136 -0
- package/dist/dnd/create-draggable-collection-state.js.map +1 -0
- package/dist/dnd/create-droppable-collection-state.d.ts +55 -0
- package/dist/dnd/create-droppable-collection-state.js +155 -0
- package/dist/dnd/create-droppable-collection-state.js.map +1 -0
- package/dist/flags/flags.d.ts +21 -0
- package/dist/flags/flags.js +34 -0
- package/dist/flags/flags.js.map +1 -0
- package/dist/form/create-form-validation-state.d.ts +37 -0
- package/dist/form/create-form-validation-state.js +152 -0
- package/dist/form/create-form-validation-state.js.map +1 -0
- package/dist/grid/create-grid-state.d.ts +38 -0
- package/dist/grid/create-grid-state.js +85 -0
- package/dist/grid/create-grid-state.js.map +1 -0
- package/dist/grid/grid-collection.d.ts +68 -0
- package/dist/grid/grid-collection.js +133 -0
- package/dist/grid/grid-collection.js.map +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +86 -0
- package/dist/intl/color/ar-AE.js +44 -0
- package/dist/intl/color/ar-AE.js.map +1 -0
- package/dist/intl/color/bg-BG.js +44 -0
- package/dist/intl/color/bg-BG.js.map +1 -0
- package/dist/intl/color/cs-CZ.js +44 -0
- package/dist/intl/color/cs-CZ.js.map +1 -0
- package/dist/intl/color/da-DK.js +44 -0
- package/dist/intl/color/da-DK.js.map +1 -0
- package/dist/intl/color/de-DE.js +44 -0
- package/dist/intl/color/de-DE.js.map +1 -0
- package/dist/intl/color/el-GR.js +44 -0
- package/dist/intl/color/el-GR.js.map +1 -0
- package/dist/intl/color/en-US.js +44 -0
- package/dist/intl/color/en-US.js.map +1 -0
- package/dist/intl/color/es-ES.js +44 -0
- package/dist/intl/color/es-ES.js.map +1 -0
- package/dist/intl/color/et-EE.js +44 -0
- package/dist/intl/color/et-EE.js.map +1 -0
- package/dist/intl/color/fi-FI.js +44 -0
- package/dist/intl/color/fi-FI.js.map +1 -0
- package/dist/intl/color/fr-FR.js +44 -0
- package/dist/intl/color/fr-FR.js.map +1 -0
- package/dist/intl/color/he-IL.js +44 -0
- package/dist/intl/color/he-IL.js.map +1 -0
- package/dist/intl/color/hr-HR.js +44 -0
- package/dist/intl/color/hr-HR.js.map +1 -0
- package/dist/intl/color/hu-HU.js +44 -0
- package/dist/intl/color/hu-HU.js.map +1 -0
- package/dist/intl/color/index.js +75 -0
- package/dist/intl/color/index.js.map +1 -0
- package/dist/intl/color/it-IT.js +44 -0
- package/dist/intl/color/it-IT.js.map +1 -0
- package/dist/intl/color/ja-JP.js +44 -0
- package/dist/intl/color/ja-JP.js.map +1 -0
- package/dist/intl/color/ko-KR.js +44 -0
- package/dist/intl/color/ko-KR.js.map +1 -0
- package/dist/intl/color/lt-LT.js +44 -0
- package/dist/intl/color/lt-LT.js.map +1 -0
- package/dist/intl/color/lv-LV.js +44 -0
- package/dist/intl/color/lv-LV.js.map +1 -0
- package/dist/intl/color/nb-NO.js +44 -0
- package/dist/intl/color/nb-NO.js.map +1 -0
- package/dist/intl/color/nl-NL.js +44 -0
- package/dist/intl/color/nl-NL.js.map +1 -0
- package/dist/intl/color/pl-PL.js +44 -0
- package/dist/intl/color/pl-PL.js.map +1 -0
- package/dist/intl/color/pt-BR.js +44 -0
- package/dist/intl/color/pt-BR.js.map +1 -0
- package/dist/intl/color/pt-PT.js +44 -0
- package/dist/intl/color/pt-PT.js.map +1 -0
- package/dist/intl/color/ro-RO.js +44 -0
- package/dist/intl/color/ro-RO.js.map +1 -0
- package/dist/intl/color/ru-RU.js +44 -0
- package/dist/intl/color/ru-RU.js.map +1 -0
- package/dist/intl/color/sk-SK.js +44 -0
- package/dist/intl/color/sk-SK.js.map +1 -0
- package/dist/intl/color/sl-SI.js +44 -0
- package/dist/intl/color/sl-SI.js.map +1 -0
- package/dist/intl/color/sr-SP.js +44 -0
- package/dist/intl/color/sr-SP.js.map +1 -0
- package/dist/intl/color/sv-SE.js +44 -0
- package/dist/intl/color/sv-SE.js.map +1 -0
- package/dist/intl/color/tr-TR.js +44 -0
- package/dist/intl/color/tr-TR.js.map +1 -0
- package/dist/intl/color/uk-UA.js +44 -0
- package/dist/intl/color/uk-UA.js.map +1 -0
- package/dist/intl/color/zh-CN.js +44 -0
- package/dist/intl/color/zh-CN.js.map +1 -0
- package/dist/intl/color/zh-TW.js +44 -0
- package/dist/intl/color/zh-TW.js.map +1 -0
- package/dist/intl/datepicker/ar-AE.js +11 -0
- package/dist/intl/datepicker/ar-AE.js.map +1 -0
- package/dist/intl/datepicker/bg-BG.js +11 -0
- package/dist/intl/datepicker/bg-BG.js.map +1 -0
- package/dist/intl/datepicker/cs-CZ.js +11 -0
- package/dist/intl/datepicker/cs-CZ.js.map +1 -0
- package/dist/intl/datepicker/da-DK.js +11 -0
- package/dist/intl/datepicker/da-DK.js.map +1 -0
- package/dist/intl/datepicker/de-DE.js +11 -0
- package/dist/intl/datepicker/de-DE.js.map +1 -0
- package/dist/intl/datepicker/el-GR.js +11 -0
- package/dist/intl/datepicker/el-GR.js.map +1 -0
- package/dist/intl/datepicker/en-US.js +11 -0
- package/dist/intl/datepicker/en-US.js.map +1 -0
- package/dist/intl/datepicker/es-ES.js +11 -0
- package/dist/intl/datepicker/es-ES.js.map +1 -0
- package/dist/intl/datepicker/et-EE.js +11 -0
- package/dist/intl/datepicker/et-EE.js.map +1 -0
- package/dist/intl/datepicker/fi-FI.js +11 -0
- package/dist/intl/datepicker/fi-FI.js.map +1 -0
- package/dist/intl/datepicker/fr-FR.js +11 -0
- package/dist/intl/datepicker/fr-FR.js.map +1 -0
- package/dist/intl/datepicker/he-IL.js +11 -0
- package/dist/intl/datepicker/he-IL.js.map +1 -0
- package/dist/intl/datepicker/hr-HR.js +11 -0
- package/dist/intl/datepicker/hr-HR.js.map +1 -0
- package/dist/intl/datepicker/hu-HU.js +11 -0
- package/dist/intl/datepicker/hu-HU.js.map +1 -0
- package/dist/intl/datepicker/index.js +75 -0
- package/dist/intl/datepicker/index.js.map +1 -0
- package/dist/intl/datepicker/it-IT.js +11 -0
- package/dist/intl/datepicker/it-IT.js.map +1 -0
- package/dist/intl/datepicker/ja-JP.js +11 -0
- package/dist/intl/datepicker/ja-JP.js.map +1 -0
- package/dist/intl/datepicker/ko-KR.js +11 -0
- package/dist/intl/datepicker/ko-KR.js.map +1 -0
- package/dist/intl/datepicker/lt-LT.js +11 -0
- package/dist/intl/datepicker/lt-LT.js.map +1 -0
- package/dist/intl/datepicker/lv-LV.js +11 -0
- package/dist/intl/datepicker/lv-LV.js.map +1 -0
- package/dist/intl/datepicker/nb-NO.js +11 -0
- package/dist/intl/datepicker/nb-NO.js.map +1 -0
- package/dist/intl/datepicker/nl-NL.js +11 -0
- package/dist/intl/datepicker/nl-NL.js.map +1 -0
- package/dist/intl/datepicker/pl-PL.js +11 -0
- package/dist/intl/datepicker/pl-PL.js.map +1 -0
- package/dist/intl/datepicker/pt-BR.js +11 -0
- package/dist/intl/datepicker/pt-BR.js.map +1 -0
- package/dist/intl/datepicker/pt-PT.js +11 -0
- package/dist/intl/datepicker/pt-PT.js.map +1 -0
- package/dist/intl/datepicker/ro-RO.js +11 -0
- package/dist/intl/datepicker/ro-RO.js.map +1 -0
- package/dist/intl/datepicker/ru-RU.js +11 -0
- package/dist/intl/datepicker/ru-RU.js.map +1 -0
- package/dist/intl/datepicker/sk-SK.js +11 -0
- package/dist/intl/datepicker/sk-SK.js.map +1 -0
- package/dist/intl/datepicker/sl-SI.js +11 -0
- package/dist/intl/datepicker/sl-SI.js.map +1 -0
- package/dist/intl/datepicker/sr-SP.js +11 -0
- package/dist/intl/datepicker/sr-SP.js.map +1 -0
- package/dist/intl/datepicker/sv-SE.js +11 -0
- package/dist/intl/datepicker/sv-SE.js.map +1 -0
- package/dist/intl/datepicker/tr-TR.js +11 -0
- package/dist/intl/datepicker/tr-TR.js.map +1 -0
- package/dist/intl/datepicker/uk-UA.js +11 -0
- package/dist/intl/datepicker/uk-UA.js.map +1 -0
- package/dist/intl/datepicker/zh-CN.js +11 -0
- package/dist/intl/datepicker/zh-CN.js.map +1 -0
- package/dist/intl/datepicker/zh-TW.js +11 -0
- package/dist/intl/datepicker/zh-TW.js.map +1 -0
- package/dist/layout/grid-layout.d.ts +107 -0
- package/dist/layout/grid-layout.js +253 -0
- package/dist/layout/grid-layout.js.map +1 -0
- package/dist/layout/list-layout.d.ts +187 -0
- package/dist/layout/list-layout.js +488 -0
- package/dist/layout/list-layout.js.map +1 -0
- package/dist/layout/table-layout.d.ts +98 -0
- package/dist/layout/table-layout.js +476 -0
- package/dist/layout/table-layout.js.map +1 -0
- package/dist/layout/waterfall-layout.d.ts +85 -0
- package/dist/layout/waterfall-layout.js +225 -0
- package/dist/layout/waterfall-layout.js.map +1 -0
- package/dist/list/create-list-state.d.ts +48 -0
- package/dist/list/create-list-state.js +123 -0
- package/dist/list/create-list-state.js.map +1 -0
- package/dist/list/create-single-select-list-state.d.ts +38 -0
- package/dist/list/create-single-select-list-state.js +55 -0
- package/dist/list/create-single-select-list-state.js.map +1 -0
- package/dist/list/list-collection.d.ts +36 -0
- package/dist/list/list-collection.js +91 -0
- package/dist/list/list-collection.js.map +1 -0
- package/dist/menu/create-menu-trigger-state.d.ts +55 -0
- package/dist/menu/create-menu-trigger-state.js +58 -0
- package/dist/menu/create-menu-trigger-state.js.map +1 -0
- package/dist/menu/create-submenu-trigger-state.d.ts +47 -0
- package/dist/menu/create-submenu-trigger-state.js +59 -0
- package/dist/menu/create-submenu-trigger-state.js.map +1 -0
- package/dist/numberfield/create-number-field-state.d.ts +93 -0
- package/dist/numberfield/create-number-field-state.js +139 -0
- package/dist/numberfield/create-number-field-state.js.map +1 -0
- package/dist/overlays/create-overlay-trigger-state.d.ts +51 -0
- package/dist/overlays/create-overlay-trigger-state.js +56 -0
- package/dist/overlays/create-overlay-trigger-state.js.map +1 -0
- package/dist/radio/create-radio-group-state.d.ts +61 -0
- package/dist/radio/create-radio-group-state.js +71 -0
- package/dist/radio/create-radio-group-state.js.map +1 -0
- package/dist/searchfield/create-search-field-state.d.ts +35 -0
- package/dist/searchfield/create-search-field-state.js +34 -0
- package/dist/searchfield/create-search-field-state.js.map +1 -0
- package/dist/select/create-select-state.d.ts +116 -0
- package/dist/select/create-select-state.js +151 -0
- package/dist/select/create-select-state.js.map +1 -0
- package/dist/selection/create-multiple-selection-state.d.ts +39 -0
- package/dist/selection/create-multiple-selection-state.js +114 -0
- package/dist/selection/create-multiple-selection-state.js.map +1 -0
- package/dist/selection/selection-manager.d.ts +139 -0
- package/dist/selection/selection-manager.js +334 -0
- package/dist/selection/selection-manager.js.map +1 -0
- package/dist/selection/selection.d.ts +27 -0
- package/dist/selection/selection.js +38 -0
- package/dist/selection/selection.js.map +1 -0
- package/dist/selection/types.d.ts +116 -0
- package/dist/selection/types.js +16 -0
- package/dist/slider/create-slider-state.d.ts +182 -0
- package/dist/slider/create-slider-state.js +131 -0
- package/dist/slider/create-slider-state.js.map +1 -0
- package/dist/steplist/create-step-list-state.d.ts +40 -0
- package/dist/steplist/create-step-list-state.js +132 -0
- package/dist/steplist/create-step-list-state.js.map +1 -0
- package/dist/table/cell.d.ts +37 -0
- package/dist/table/cell.js +47 -0
- package/dist/table/cell.js.map +1 -0
- package/dist/table/collection-context.d.ts +4 -0
- package/dist/table/collection-context.js +8 -0
- package/dist/table/collection-context.js.map +1 -0
- package/dist/table/column.d.ts +66 -0
- package/dist/table/column.js +71 -0
- package/dist/table/column.js.map +1 -0
- package/dist/table/create-table-column-resize-state.d.ts +65 -0
- package/dist/table/create-table-column-resize-state.js +100 -0
- package/dist/table/create-table-column-resize-state.js.map +1 -0
- package/dist/table/create-table-state.d.ts +112 -0
- package/dist/table/create-table-state.js +122 -0
- package/dist/table/create-table-state.js.map +1 -0
- package/dist/table/create-tree-grid-state.d.ts +44 -0
- package/dist/table/create-tree-grid-state.js +145 -0
- package/dist/table/create-tree-grid-state.js.map +1 -0
- package/dist/table/row.d.ts +44 -0
- package/dist/table/row.js +91 -0
- package/dist/table/row.js.map +1 -0
- package/dist/table/table-body.d.ts +36 -0
- package/dist/table/table-body.js +57 -0
- package/dist/table/table-body.js.map +1 -0
- package/dist/table/table-collection.d.ts +62 -0
- package/dist/table/table-collection.js +274 -0
- package/dist/table/table-collection.js.map +1 -0
- package/dist/table/table-column-layout.d.ts +47 -0
- package/dist/table/table-column-layout.js +94 -0
- package/dist/table/table-column-layout.js.map +1 -0
- package/dist/table/table-header.d.ts +37 -0
- package/dist/table/table-header.js +52 -0
- package/dist/table/table-header.js.map +1 -0
- package/dist/table/table-utils.d.ts +60 -0
- package/dist/table/table-utils.js +203 -0
- package/dist/table/table-utils.js.map +1 -0
- package/dist/tabs/create-tab-list-state.d.ts +42 -0
- package/dist/tabs/create-tab-list-state.js +78 -0
- package/dist/tabs/create-tab-list-state.js.map +1 -0
- package/dist/toast/create-toast-state.d.ts +97 -0
- package/dist/toast/create-toast-state.js +166 -0
- package/dist/toast/create-toast-state.js.map +1 -0
- package/dist/toggle/create-toggle-group-state.d.ts +55 -0
- package/dist/toggle/create-toggle-group-state.js +62 -0
- package/dist/toggle/create-toggle-group-state.js.map +1 -0
- package/dist/toggle/create-toggle-state.d.ts +58 -0
- package/dist/toggle/create-toggle-state.js +43 -0
- package/dist/toggle/create-toggle-state.js.map +1 -0
- package/dist/tokenfield/create-token-field-state.d.ts +39 -0
- package/dist/tokenfield/create-token-field-state.js +44 -0
- package/dist/tokenfield/create-token-field-state.js.map +1 -0
- package/dist/tokenfield/token-field-value.d.ts +111 -0
- package/dist/tokenfield/token-field-value.js +327 -0
- package/dist/tokenfield/token-field-value.js.map +1 -0
- package/dist/tooltip/create-tooltip-trigger-state.d.ts +73 -0
- package/dist/tooltip/create-tooltip-trigger-state.js +136 -0
- package/dist/tooltip/create-tooltip-trigger-state.js.map +1 -0
- package/dist/tree/create-tree-state.d.ts +42 -0
- package/dist/tree/create-tree-state.js +75 -0
- package/dist/tree/create-tree-state.js.map +1 -0
- package/dist/tree/tree-collection.d.ts +36 -0
- package/dist/tree/tree-collection.js +84 -0
- package/dist/tree/tree-collection.js.map +1 -0
- package/dist/utils/create-controlled-signal.d.ts +23 -0
- package/dist/utils/create-controlled-signal.js +54 -0
- package/dist/utils/create-controlled-signal.js.map +1 -0
- package/dist/utils/get-item-key.d.ts +5 -0
- package/dist/utils/get-item-key.js +12 -0
- package/dist/utils/get-item-key.js.map +1 -0
- package/dist/utils/get-node-props.d.ts +23 -0
- package/dist/utils/get-node-props.js +38 -0
- package/dist/utils/get-node-props.js.map +1 -0
- package/dist/utils/has-content.d.ts +5 -0
- package/dist/utils/has-content.js +7 -0
- package/dist/utils/has-content.js.map +1 -0
- package/dist/utils/legacy-props.d.ts +10 -0
- package/dist/utils/legacy-props.js +17 -0
- package/dist/utils/legacy-props.js.map +1 -0
- package/dist/utils/number.d.ts +25 -0
- package/dist/utils/number.js +59 -0
- package/dist/utils/number.js.map +1 -0
- package/dist/utils/parse-calendar-identifier.d.ts +5 -0
- package/dist/utils/parse-calendar-identifier.js +31 -0
- package/dist/utils/parse-calendar-identifier.js.map +1 -0
- package/dist/utils/require-value.d.ts +4 -0
- package/dist/utils/require-value.js +10 -0
- package/dist/utils/require-value.js.map +1 -0
- package/dist/virtualizer/create-virtualizer-state.d.ts +44 -0
- package/dist/virtualizer/create-virtualizer-state.js +92 -0
- package/dist/virtualizer/create-virtualizer-state.js.map +1 -0
- package/dist/virtualizer/layout-info.d.ts +94 -0
- package/dist/virtualizer/layout-info.js +118 -0
- package/dist/virtualizer/layout-info.js.map +1 -0
- package/dist/virtualizer/layout.d.ts +91 -0
- package/dist/virtualizer/layout.js +71 -0
- package/dist/virtualizer/layout.js.map +1 -0
- package/dist/virtualizer/overscan-manager.d.ts +25 -0
- package/dist/virtualizer/overscan-manager.js +46 -0
- package/dist/virtualizer/overscan-manager.js.map +1 -0
- package/dist/virtualizer/point.d.ts +36 -0
- package/dist/virtualizer/point.js +48 -0
- package/dist/virtualizer/point.js.map +1 -0
- package/dist/virtualizer/rect.d.ts +103 -0
- package/dist/virtualizer/rect.js +156 -0
- package/dist/virtualizer/rect.js.map +1 -0
- package/dist/virtualizer/reusable-view.d.ts +51 -0
- package/dist/virtualizer/reusable-view.js +81 -0
- package/dist/virtualizer/reusable-view.js.map +1 -0
- package/dist/virtualizer/scroll-anchor.d.ts +98 -0
- package/dist/virtualizer/scroll-anchor.js +150 -0
- package/dist/virtualizer/scroll-anchor.js.map +1 -0
- package/dist/virtualizer/size.d.ts +34 -0
- package/dist/virtualizer/size.js +46 -0
- package/dist/virtualizer/size.js.map +1 -0
- package/dist/virtualizer/types.d.ts +47 -0
- package/dist/virtualizer/types.js +16 -0
- package/dist/virtualizer/utils.d.ts +19 -0
- package/dist/virtualizer/utils.js +27 -0
- package/dist/virtualizer/utils.js.map +1 -0
- package/dist/virtualizer/virtualizer.d.ts +99 -0
- package/dist/virtualizer/virtualizer.js +314 -0
- package/dist/virtualizer/virtualizer.js.map +1 -0
- package/package.json +174 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/getItemCount.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { getChildNodes } from "./get-child-nodes.js";
|
|
18
|
+
// src/collections/get-item-count.ts
|
|
19
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function getItemCount(collection) {
|
|
21
|
+
const count = cache.get(collection);
|
|
22
|
+
if (count !== null && count !== void 0) return count;
|
|
23
|
+
let counter = 0;
|
|
24
|
+
const countItems = (items) => {
|
|
25
|
+
for (const item of items) if (item.type === "section") countItems(getChildNodes(item, collection));
|
|
26
|
+
else if (item.type === "item") counter += 1;
|
|
27
|
+
};
|
|
28
|
+
countItems(collection);
|
|
29
|
+
cache.set(collection, counter);
|
|
30
|
+
return counter;
|
|
31
|
+
}
|
|
32
|
+
export { getItemCount };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=get-item-count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-item-count.js","names":[],"sources":["../../src/collections/get-item-count.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/collections/getItemCount.ts.\n * Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { Collection, Node } from \"@solid2-aria/types-shared\";\n\nimport { getChildNodes } from \"./get-child-nodes\";\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n const count = cache.get(collection);\n\n if (count !== null && count !== undefined) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n\n const countItems = (items: Iterable<Node<T>>) => {\n for (const item of items) {\n if (item.type === \"section\") {\n countItems(getChildNodes(item, collection));\n } else if (item.type === \"item\") {\n counter += 1;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n\n return counter;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAM,wBAAQ,IAAI,QAAmC;AAErD,SAAgB,aAAgB,YAAyC;CACvE,MAAM,QAAQ,MAAM,IAAI,UAAU;CAElC,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC9B,OAAO;CAIT,IAAI,UAAU;CAEd,MAAM,cAAc,UAA6B;EAC/C,KAAK,MAAM,QAAQ,OACjB,IAAI,KAAK,SAAS,WAChB,WAAW,cAAc,MAAM,UAAU,CAAC;OACrC,IAAI,KAAK,SAAS,QACvB,WAAW;CAGjB;CAEA,WAAW,UAAU;CACrB,MAAM,IAAI,YAAY,OAAO;CAE7B,OAAO;AACT"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/Item.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { CollectionContext, PartialNode } from "./types.js";
|
|
18
|
+
import { Element } from "solid-js";
|
|
19
|
+
import { ItemProps } from "@solid2-aria/types-shared";
|
|
20
|
+
declare function Item<T>(props: ItemProps<T> & {
|
|
21
|
+
key?: string | number;
|
|
22
|
+
}): Element;
|
|
23
|
+
declare namespace Item {
|
|
24
|
+
var getCollectionNode: <T>(props: ItemProps<T> & {
|
|
25
|
+
key?: string | number;
|
|
26
|
+
}, context: CollectionContext) => Generator<PartialNode<T>>;
|
|
27
|
+
}
|
|
28
|
+
export { Item };
|
|
29
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/Item.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { hasContent } from "../utils/has-content.js";
|
|
18
|
+
import { collectionChildren } from "./types.js";
|
|
19
|
+
import { untrack } from "solid-js";
|
|
20
|
+
// src/collections/item.ts
|
|
21
|
+
function Item(props) {
|
|
22
|
+
return Object.assign([], {
|
|
23
|
+
getCollectionNode: (context) => Item.getCollectionNode(props, context),
|
|
24
|
+
get key() {
|
|
25
|
+
return props.key;
|
|
26
|
+
},
|
|
27
|
+
props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
31
|
+
const { childItems, title, children } = props;
|
|
32
|
+
const rendered = props.title ?? props.children;
|
|
33
|
+
let textValue = props["aria-label"] ?? "";
|
|
34
|
+
if (typeof rendered === "string" && rendered !== "") textValue = rendered;
|
|
35
|
+
if (props.textValue !== void 0 && props.textValue !== "") ({textValue} = props);
|
|
36
|
+
if (!textValue && (typeof context !== "object" || context === null || !("suppressTextValueWarning" in context) || context.suppressTextValueWarning !== true) && process.env.NODE_ENV !== "production") console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
|
|
37
|
+
yield {
|
|
38
|
+
"aria-label": props["aria-label"],
|
|
39
|
+
*childNodes() {
|
|
40
|
+
if (childItems) for (const child of childItems) yield {
|
|
41
|
+
type: "item",
|
|
42
|
+
value: child
|
|
43
|
+
};
|
|
44
|
+
else if (hasContent(title)) {
|
|
45
|
+
const items = [];
|
|
46
|
+
for (const child of collectionChildren(children)) items.push({
|
|
47
|
+
element: child,
|
|
48
|
+
type: "item"
|
|
49
|
+
});
|
|
50
|
+
yield* items;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
hasChildNodes: hasChildItems(props),
|
|
54
|
+
props,
|
|
55
|
+
rendered,
|
|
56
|
+
textValue,
|
|
57
|
+
type: "item"
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
function hasChildItems(props) {
|
|
61
|
+
if (untrack(() => props.hasChildItems) !== null && untrack(() => props.hasChildItems) !== void 0) return untrack(() => props.hasChildItems);
|
|
62
|
+
if (untrack(() => props.childItems)) return true;
|
|
63
|
+
if (Boolean(untrack(() => props.title)) && collectionChildren(untrack(() => props.children)).length > 0) return true;
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
export { Item };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","names":[],"sources":["../../src/collections/item.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/collections/Item.ts.\n * Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { ItemProps } from \"@solid2-aria/types-shared\";\nimport { untrack } from \"solid-js\";\nimport type { Element as SolidElement } from \"solid-js\";\n\nimport { hasContent } from \"../utils/has-content\";\nimport type { CollectionContext, PartialNode } from \"./types\";\nimport { collectionChildren } from \"./types\";\n\nfunction Item<T>(\n props: ItemProps<T> & {\n key?: string | number;\n }\n): SolidElement {\n return Object.assign([], {\n getCollectionNode: (context: CollectionContext) =>\n Item.getCollectionNode(props, context),\n get key() {\n return props.key;\n },\n props,\n });\n}\n\nItem.getCollectionNode = function* getCollectionNode<T>(\n props: ItemProps<T> & {\n key?: string | number;\n },\n context: CollectionContext\n): Generator<PartialNode<T>> {\n const { childItems, title, children } = props;\n const rendered = props.title ?? props.children;\n\n let textValue = props[\"aria-label\"] ?? \"\";\n\n if (typeof rendered === \"string\" && rendered !== \"\") {\n textValue = rendered;\n }\n\n if (props.textValue !== undefined && props.textValue !== \"\") {\n ({ textValue } = props);\n }\n\n // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.\n if (\n !textValue &&\n (typeof context !== \"object\" ||\n context === null ||\n !(\"suppressTextValueWarning\" in context) ||\n context.suppressTextValueWarning !== true) &&\n process.env.NODE_ENV !== \"production\"\n ) {\n console.warn(\n \"<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.\"\n );\n }\n\n yield {\n \"aria-label\": props[\"aria-label\"],\n *childNodes() {\n if (childItems) {\n for (const child of childItems) {\n yield {\n type: \"item\",\n value: child,\n };\n }\n } else if (hasContent(title)) {\n const items: PartialNode<T>[] = [];\n\n for (const child of collectionChildren(children)) {\n items.push({\n element: child,\n type: \"item\",\n });\n }\n\n yield* items;\n }\n },\n hasChildNodes: hasChildItems(props),\n props,\n rendered,\n textValue,\n type: \"item\",\n };\n};\n\nfunction hasChildItems<T>(\n props: ItemProps<T> & {\n key?: string | number;\n }\n) {\n if (\n untrack(() => props.hasChildItems) !== null &&\n untrack(() => props.hasChildItems) !== undefined\n ) {\n return untrack(() => props.hasChildItems);\n }\n\n if (untrack(() => props.childItems)) {\n return true;\n }\n\n if (\n Boolean(untrack(() => props.title)) &&\n collectionChildren(untrack(() => props.children)).length > 0\n ) {\n return true;\n }\n\n return false;\n}\n\nexport { Item };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,SAAS,KACP,OAGc;CACd,OAAO,OAAO,OAAO,CAAC,GAAG;EACvB,oBAAoB,YAClB,KAAK,kBAAkB,OAAO,OAAO;EACvC,IAAI,MAAM;GACR,OAAO,MAAM;EACf;EACA;CACF,CAAC;AACH;AAEA,KAAK,oBAAoB,UAAU,kBACjC,OAGA,SAC2B;CAC3B,MAAM,EAAE,YAAY,OAAO,aAAa;CACxC,MAAM,WAAW,MAAM,SAAS,MAAM;CAEtC,IAAI,YAAY,MAAM,iBAAiB;CAEvC,IAAI,OAAO,aAAa,YAAY,aAAa,IAC/C,YAAY;CAGd,IAAI,MAAM,cAAc,KAAA,KAAa,MAAM,cAAc,IACvD,CAAC,CAAE,aAAc;CAInB,IACE,CAAC,cACA,OAAO,YAAY,YAClB,YAAY,QACZ,EAAE,8BAA8B,YAChC,QAAQ,6BAA6B,SACvC,QAAQ,IAAI,aAAa,cAEzB,QAAQ,KACN,wHACF;CAGF,MAAM;EACJ,cAAc,MAAM;EACpB,CAAC,aAAa;GACZ,IAAI,YACF,KAAK,MAAM,SAAS,YAClB,MAAM;IACJ,MAAM;IACN,OAAO;GACT;QAEG,IAAI,WAAW,KAAK,GAAG;IAC5B,MAAM,QAA0B,CAAC;IAEjC,KAAK,MAAM,SAAS,mBAAmB,QAAQ,GAC7C,MAAM,KAAK;KACT,SAAS;KACT,MAAM;IACR,CAAC;IAGH,OAAO;GACT;EACF;EACA,eAAe,cAAc,KAAK;EAClC;EACA;EACA;EACA,MAAM;CACR;AACF;AAEA,SAAS,cACP,OAGA;CACA,IACE,cAAc,MAAM,aAAa,MAAM,QACvC,cAAc,MAAM,aAAa,MAAM,KAAA,GAEvC,OAAO,cAAc,MAAM,aAAa;CAG1C,IAAI,cAAc,MAAM,UAAU,GAChC,OAAO;CAGT,IACE,QAAQ,cAAc,MAAM,KAAK,CAAC,KAClC,mBAAmB,cAAc,MAAM,QAAQ,CAAC,CAAC,CAAC,SAAS,GAE3D,OAAO;CAGT,OAAO;AACT"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/Section.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { PartialNode } from "./types.js";
|
|
18
|
+
import { Element } from "solid-js";
|
|
19
|
+
import { SectionProps } from "@solid2-aria/types-shared";
|
|
20
|
+
declare function Section<T>(props: SectionProps<T> & {
|
|
21
|
+
key?: string | number;
|
|
22
|
+
}): Element;
|
|
23
|
+
declare namespace Section {
|
|
24
|
+
var getCollectionNode: <T>(props: SectionProps<T> & {
|
|
25
|
+
key?: string | number;
|
|
26
|
+
}) => Generator<PartialNode<T>>;
|
|
27
|
+
}
|
|
28
|
+
export { Section };
|
|
29
|
+
//# sourceMappingURL=section.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/Section.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { collectionChildren } from "./types.js";
|
|
18
|
+
import { untrack } from "solid-js";
|
|
19
|
+
// src/collections/section.ts
|
|
20
|
+
function Section(props) {
|
|
21
|
+
return Object.assign([], {
|
|
22
|
+
getCollectionNode: (_context) => Section.getCollectionNode(props),
|
|
23
|
+
get key() {
|
|
24
|
+
return props.key;
|
|
25
|
+
},
|
|
26
|
+
props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
Section.getCollectionNode = function* getCollectionNode(props) {
|
|
30
|
+
const { children, title, items } = untrack(() => props);
|
|
31
|
+
yield {
|
|
32
|
+
get "aria-label"() {
|
|
33
|
+
return props["aria-label"];
|
|
34
|
+
},
|
|
35
|
+
*childNodes() {
|
|
36
|
+
if (typeof children === "function") {
|
|
37
|
+
if (!items) throw new Error("props.children was a function but props.items is missing");
|
|
38
|
+
for (const item of items) yield {
|
|
39
|
+
renderer: children,
|
|
40
|
+
type: "item",
|
|
41
|
+
value: item
|
|
42
|
+
};
|
|
43
|
+
} else {
|
|
44
|
+
const localItems = [];
|
|
45
|
+
for (const child of collectionChildren(children)) localItems.push({
|
|
46
|
+
element: child,
|
|
47
|
+
type: "item"
|
|
48
|
+
});
|
|
49
|
+
yield* localItems;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
hasChildNodes: true,
|
|
53
|
+
props,
|
|
54
|
+
rendered: title,
|
|
55
|
+
type: "section"
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export { Section };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.js","names":[],"sources":["../../src/collections/section.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/collections/Section.ts.\n * Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { SectionProps } from \"@solid2-aria/types-shared\";\nimport { untrack } from \"solid-js\";\nimport type { Element as SolidElement } from \"solid-js\";\n\nimport type { CollectionContext, PartialNode } from \"./types\";\nimport { collectionChildren } from \"./types\";\n\nfunction Section<T>(\n props: SectionProps<T> & {\n key?: string | number;\n }\n): SolidElement {\n return Object.assign([], {\n getCollectionNode: (_context: CollectionContext) =>\n Section.getCollectionNode(props),\n get key() {\n return props.key;\n },\n props,\n });\n}\n\nSection.getCollectionNode = function* getCollectionNode<T>(\n props: SectionProps<T> & {\n key?: string | number;\n }\n): Generator<PartialNode<T>> {\n const { children, title, items } = untrack(() => props);\n yield {\n get \"aria-label\"() {\n return props[\"aria-label\"];\n },\n *childNodes() {\n if (typeof children === \"function\") {\n if (!items) {\n throw new Error(\n \"props.children was a function but props.items is missing\"\n );\n }\n\n for (const item of items) {\n yield {\n renderer: children,\n type: \"item\",\n value: item,\n };\n }\n } else {\n const localItems: PartialNode<T>[] = [];\n\n for (const child of collectionChildren(children)) {\n localItems.push({\n element: child,\n type: \"item\",\n });\n }\n\n yield* localItems;\n }\n },\n hasChildNodes: true,\n props,\n rendered: title,\n type: \"section\",\n };\n};\n\nexport { Section };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,SAAS,QACP,OAGc;CACd,OAAO,OAAO,OAAO,CAAC,GAAG;EACvB,oBAAoB,aAClB,QAAQ,kBAAkB,KAAK;EACjC,IAAI,MAAM;GACR,OAAO,MAAM;EACf;EACA;CACF,CAAC;AACH;AAEA,QAAQ,oBAAoB,UAAU,kBACpC,OAG2B;CAC3B,MAAM,EAAE,UAAU,OAAO,UAAU,cAAc,KAAK;CACtD,MAAM;EACJ,IAAI,eAAe;GACjB,OAAO,MAAM;EACf;EACA,CAAC,aAAa;GACZ,IAAI,OAAO,aAAa,YAAY;IAClC,IAAI,CAAC,OACH,MAAM,IAAI,MACR,0DACF;IAGF,KAAK,MAAM,QAAQ,OACjB,MAAM;KACJ,UAAU;KACV,MAAM;KACN,OAAO;IACT;GAEJ,OAAO;IACL,MAAM,aAA+B,CAAC;IAEtC,KAAK,MAAM,SAAS,mBAAmB,QAAQ,GAC7C,WAAW,KAAK;KACd,SAAS;KACT,MAAM;IACR,CAAC;IAGH,OAAO;GACT;EACF;EACA,eAAe;EACf;EACA,UAAU;EACV,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/types.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { Element } from "solid-js";
|
|
18
|
+
import { Key, Node } from "@solid2-aria/types-shared";
|
|
19
|
+
export interface PartialNode<T> {
|
|
20
|
+
type?: string;
|
|
21
|
+
key?: Key | null;
|
|
22
|
+
value?: T;
|
|
23
|
+
element?: Element | null;
|
|
24
|
+
wrapper?: (element: Element) => Element;
|
|
25
|
+
rendered?: Element;
|
|
26
|
+
textValue?: string;
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
index?: number;
|
|
29
|
+
renderer?: (item: T) => Element | null;
|
|
30
|
+
hasChildNodes?: boolean;
|
|
31
|
+
childNodes?: () => IterableIterator<PartialNode<T>>;
|
|
32
|
+
props?: unknown;
|
|
33
|
+
shouldInvalidate?: (context: CollectionContext) => boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Context supplied to custom collection node builders. */
|
|
36
|
+
export type CollectionContext = unknown;
|
|
37
|
+
/** Inert JSX arrays carry collection metadata without rendering DOM elements. */
|
|
38
|
+
export interface CollectionElement<T> extends Array<Element> {
|
|
39
|
+
getCollectionNode: (context: CollectionContext) => Generator<PartialNode<T>, void, Node<T>[]>;
|
|
40
|
+
props: unknown;
|
|
41
|
+
key?: Key | null;
|
|
42
|
+
}
|
|
43
|
+
/** T is supplied by the collection's typed renderer contract. */
|
|
44
|
+
export declare function isCollectionElement<T>(value: Element): value is CollectionElement<T>;
|
|
45
|
+
export declare function collectionChildren(value: Element): Element[];
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/collections/types.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
// src/collections/types.ts
|
|
18
|
+
/** T is supplied by the collection's typed renderer contract. */
|
|
19
|
+
function isCollectionElement(value) {
|
|
20
|
+
return Array.isArray(value) && "getCollectionNode" in value && typeof value.getCollectionNode === "function";
|
|
21
|
+
}
|
|
22
|
+
function collectionChildren(value) {
|
|
23
|
+
if (isCollectionElement(value)) return [value];
|
|
24
|
+
if (Array.isArray(value)) return value.flatMap(collectionChildren);
|
|
25
|
+
return value === null || value === void 0 || typeof value === "boolean" ? [] : [value];
|
|
26
|
+
}
|
|
27
|
+
export { collectionChildren, isCollectionElement };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/collections/types.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/collections/types.ts.\n * Modified for Solid Aria: adapted state, collection descriptors, imports, and APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { Node, Key } from \"@solid2-aria/types-shared\";\nimport type { Element as SolidElement } from \"solid-js\";\n\nexport interface PartialNode<T> {\n type?: string;\n key?: Key | null;\n value?: T;\n element?: SolidElement | null;\n wrapper?: (element: SolidElement) => SolidElement;\n rendered?: SolidElement;\n textValue?: string;\n \"aria-label\"?: string;\n index?: number;\n renderer?: (item: T) => SolidElement | null;\n hasChildNodes?: boolean;\n childNodes?: () => IterableIterator<PartialNode<T>>;\n props?: unknown;\n shouldInvalidate?: (context: CollectionContext) => boolean;\n}\n\n/** Context supplied to custom collection node builders. */\n// oxlint-disable-next-line anti-slop/no-unknown-type-aliases -- Collection context is opaque extension data forwarded to node builders without interpretation.\nexport type CollectionContext = unknown;\n\n/** Inert JSX arrays carry collection metadata without rendering DOM elements. */\nexport interface CollectionElement<T> extends Array<SolidElement> {\n getCollectionNode: (\n context: CollectionContext\n ) => Generator<PartialNode<T>, void, Node<T>[]>;\n props: unknown;\n key?: Key | null;\n}\n\n/** T is supplied by the collection's typed renderer contract. */\nexport function isCollectionElement<T>(\n value: SolidElement\n): value is CollectionElement<T> {\n return (\n Array.isArray(value) &&\n \"getCollectionNode\" in value &&\n typeof value.getCollectionNode === \"function\"\n );\n}\n\nexport function collectionChildren(value: SolidElement): SolidElement[] {\n if (isCollectionElement(value)) {\n return [value];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap(collectionChildren);\n }\n\n return value === null || value === undefined || typeof value === \"boolean\"\n ? []\n : [value];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,SAAgB,oBACd,OAC+B;CAC/B,OACE,MAAM,QAAQ,KAAK,KACnB,uBAAuB,SACvB,OAAO,MAAM,sBAAsB;AAEvC;AAEA,SAAgB,mBAAmB,OAAqC;CACtE,IAAI,oBAAoB,KAAK,GAC3B,OAAO,CAAC,KAAK;CAGf,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,QAAQ,kBAAkB;CAGzC,OAAO,UAAU,QAAQ,UAAU,KAAA,KAAa,OAAO,UAAU,YAC7D,CAAC,IACD,CAAC,KAAK;AACZ"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { Color as Color$1, ColorAxes, ColorChannel, ColorChannelRange, ColorFormat, ColorSpace } from "../types.js";
|
|
18
|
+
export declare abstract class Color implements Color$1 {
|
|
19
|
+
private readonly dictionary;
|
|
20
|
+
abstract toFormat(format: ColorFormat): Color$1;
|
|
21
|
+
abstract toString(format?: ColorFormat | "css"): string;
|
|
22
|
+
abstract clone(): Color$1;
|
|
23
|
+
abstract getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
24
|
+
abstract getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
25
|
+
abstract formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
26
|
+
toHexInt(): number;
|
|
27
|
+
abstract getChannelValue(channel: ColorChannel): number;
|
|
28
|
+
abstract withChannelValue(channel: ColorChannel, value: number): Color$1;
|
|
29
|
+
getChannelName: (channel: ColorChannel, locale: string) => string;
|
|
30
|
+
abstract getColorSpace(): ColorSpace;
|
|
31
|
+
getColorSpaceAxes(xyChannels: {
|
|
32
|
+
xChannel?: ColorChannel;
|
|
33
|
+
yChannel?: ColorChannel;
|
|
34
|
+
}): ColorAxes;
|
|
35
|
+
abstract getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
36
|
+
getColorName(locale: string): string;
|
|
37
|
+
private readonly getOklchHue;
|
|
38
|
+
getHueName(locale: string): string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=base-color.d.ts.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import color_default from "../../intl/color/index.js";
|
|
18
|
+
import { toOKLCH } from "./oklch.js";
|
|
19
|
+
import { NumberFormatter } from "@internationalized/number";
|
|
20
|
+
import { LocalizedStringDictionary, LocalizedStringFormatter } from "@internationalized/string";
|
|
21
|
+
// src/color/color/base-color.ts
|
|
22
|
+
const dictionary = new LocalizedStringDictionary(color_default);
|
|
23
|
+
const ORANGE_LIGHTNESS_THRESHOLD = .68;
|
|
24
|
+
const YELLOW_GREEN_LIGHTNESS_THRESHOLD = .85;
|
|
25
|
+
const MAX_DARK_LIGHTNESS = .55;
|
|
26
|
+
const GRAY_THRESHOLD = .001;
|
|
27
|
+
const OKLCH_HUES = [
|
|
28
|
+
[0, "pink"],
|
|
29
|
+
[15, "red"],
|
|
30
|
+
[48, "orange"],
|
|
31
|
+
[94, "yellow"],
|
|
32
|
+
[135, "green"],
|
|
33
|
+
[175, "cyan"],
|
|
34
|
+
[264, "blue"],
|
|
35
|
+
[284, "purple"],
|
|
36
|
+
[320, "magenta"],
|
|
37
|
+
[349, "pink"]
|
|
38
|
+
];
|
|
39
|
+
var Color = class {
|
|
40
|
+
dictionary = dictionary;
|
|
41
|
+
toHexInt() {
|
|
42
|
+
return this.toFormat("rgb").toHexInt();
|
|
43
|
+
}
|
|
44
|
+
getChannelName = (channel, locale) => {
|
|
45
|
+
return (LocalizedStringDictionary.getGlobalDictionaryForPackage("@react-stately/color") ?? this.dictionary).getStringForLocale(channel, locale);
|
|
46
|
+
};
|
|
47
|
+
getColorSpaceAxes(xyChannels) {
|
|
48
|
+
const { xChannel, yChannel } = xyChannels;
|
|
49
|
+
const channels = this.getColorChannels();
|
|
50
|
+
const xCh = xChannel ?? channels.find((channel) => channel !== yChannel);
|
|
51
|
+
const yCh = yChannel ?? channels.find((channel) => channel !== xCh);
|
|
52
|
+
const zCh = channels.find((channel) => channel !== xCh && channel !== yCh);
|
|
53
|
+
if (xCh === void 0 || yCh === void 0 || zCh === void 0) throw new Error("Unable to determine color space axes");
|
|
54
|
+
return {
|
|
55
|
+
xChannel: xCh,
|
|
56
|
+
yChannel: yCh,
|
|
57
|
+
zChannel: zCh
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
getColorName(locale) {
|
|
61
|
+
const [initialLightness, c, h] = toOKLCH(this);
|
|
62
|
+
let l = initialLightness;
|
|
63
|
+
const strings = LocalizedStringDictionary.getGlobalDictionaryForPackage("@react-stately/color") ?? this.dictionary;
|
|
64
|
+
if (l > .999) return strings.getStringForLocale("white", locale);
|
|
65
|
+
if (l < .001) return strings.getStringForLocale("black", locale);
|
|
66
|
+
const [hue, adjustedLightness] = this.getOklchHue(l, c, h, locale);
|
|
67
|
+
l = adjustedLightness;
|
|
68
|
+
let lightness = "";
|
|
69
|
+
let chroma = "";
|
|
70
|
+
if (c <= .1 && c >= GRAY_THRESHOLD) chroma = l >= .7 ? "pale" : "grayish";
|
|
71
|
+
else if (c >= .15) chroma = "vibrant";
|
|
72
|
+
if (l < .3) lightness = "very dark";
|
|
73
|
+
else if (l < MAX_DARK_LIGHTNESS) lightness = "dark";
|
|
74
|
+
else if (l < .7) {} else if (l < .85) lightness = "light";
|
|
75
|
+
else lightness = "very light";
|
|
76
|
+
if (chroma) chroma = strings.getStringForLocale(chroma, locale);
|
|
77
|
+
if (lightness) lightness = strings.getStringForLocale(lightness, locale);
|
|
78
|
+
const alpha = this.getChannelValue("alpha");
|
|
79
|
+
const formatter = new LocalizedStringFormatter(locale, strings);
|
|
80
|
+
if (alpha < 1) {
|
|
81
|
+
const percentTransparent = new NumberFormatter(locale, { style: "percent" }).format(1 - alpha);
|
|
82
|
+
return formatter.format("transparentColorName", {
|
|
83
|
+
chroma,
|
|
84
|
+
hue,
|
|
85
|
+
lightness,
|
|
86
|
+
percentTransparent
|
|
87
|
+
}).replaceAll(/\s+/gu, " ").trim();
|
|
88
|
+
}
|
|
89
|
+
return formatter.format("colorName", {
|
|
90
|
+
chroma,
|
|
91
|
+
hue,
|
|
92
|
+
lightness
|
|
93
|
+
}).replaceAll(/\s+/gu, " ").trim();
|
|
94
|
+
}
|
|
95
|
+
getOklchHue = (l, c, h, locale) => {
|
|
96
|
+
const strings = LocalizedStringDictionary.getGlobalDictionaryForPackage("@react-stately/color") ?? this.dictionary;
|
|
97
|
+
if (c < GRAY_THRESHOLD) return [strings.getStringForLocale("gray", locale), l];
|
|
98
|
+
let lightness = l;
|
|
99
|
+
for (const [i, [hue, initialHueName]] of OKLCH_HUES.entries()) {
|
|
100
|
+
let hueName = initialHueName;
|
|
101
|
+
const [nextHue, nextHueName] = OKLCH_HUES[i + 1] ?? [360, "pink"];
|
|
102
|
+
if (h >= hue && h < nextHue) {
|
|
103
|
+
if (hueName === "orange") {
|
|
104
|
+
if (lightness < ORANGE_LIGHTNESS_THRESHOLD) hueName = "brown";
|
|
105
|
+
else lightness = lightness - ORANGE_LIGHTNESS_THRESHOLD + MAX_DARK_LIGHTNESS;
|
|
106
|
+
}
|
|
107
|
+
if (h > hue + (nextHue - hue) / 2 && hueName !== nextHueName) hueName = `${hueName} ${nextHueName}`;
|
|
108
|
+
else if (hueName === "yellow" && lightness < YELLOW_GREEN_LIGHTNESS_THRESHOLD) hueName = "yellow green";
|
|
109
|
+
return [strings.getStringForLocale(hueName, locale).toLocaleLowerCase(locale), lightness];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
throw new Error("Unexpected hue");
|
|
113
|
+
};
|
|
114
|
+
getHueName(locale) {
|
|
115
|
+
const [l, c, h] = toOKLCH(this);
|
|
116
|
+
const [name] = this.getOklchHue(l, c, h, locale);
|
|
117
|
+
return name;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export { Color };
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=base-color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-color.js","names":["intlMessages"],"sources":["../../../src/color/color/base-color.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.\n * Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { NumberFormatter } from \"@internationalized/number\";\nimport {\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n} from \"@internationalized/string\";\n\nimport intlMessages from \"../../../intl/color\";\nimport type {\n ColorAxes,\n ColorChannel,\n ColorChannelRange,\n ColorFormat,\n ColorSpace,\n Color as IColor,\n} from \"../types\";\nimport { toOKLCH } from \"./oklch\";\n\nconst dictionary = new LocalizedStringDictionary<string>(intlMessages);\n\n// Lightness threshold between orange and brown.\nconst ORANGE_LIGHTNESS_THRESHOLD = 0.68;\n\n// Lightness threshold between pure yellow and \"yellow green\".\nconst YELLOW_GREEN_LIGHTNESS_THRESHOLD = 0.85;\n\n// The maximum lightness considered to be \"dark\".\nconst MAX_DARK_LIGHTNESS = 0.55;\n\n// The chroma threshold between gray and color.\nconst GRAY_THRESHOLD = 0.001;\n\nconst OKLCH_HUES: [number, string][] = [\n [0, \"pink\"],\n [15, \"red\"],\n [48, \"orange\"],\n [94, \"yellow\"],\n [135, \"green\"],\n [175, \"cyan\"],\n [264, \"blue\"],\n [284, \"purple\"],\n [320, \"magenta\"],\n [349, \"pink\"],\n];\n\nexport abstract class Color implements IColor {\n private readonly dictionary = dictionary;\n abstract toFormat(format: ColorFormat): IColor;\n abstract toString(format?: ColorFormat | \"css\"): string;\n abstract clone(): IColor;\n abstract getChannelRange(channel: ColorChannel): ColorChannelRange;\n abstract getChannelFormatOptions(\n channel: ColorChannel\n ): Intl.NumberFormatOptions;\n abstract formatChannelValue(channel: ColorChannel, locale: string): string;\n\n toHexInt(): number {\n return this.toFormat(\"rgb\").toHexInt();\n }\n\n abstract getChannelValue(channel: ColorChannel): number;\n abstract withChannelValue(channel: ColorChannel, value: number): IColor;\n\n getChannelName = (channel: ColorChannel, locale: string) => {\n const strings =\n LocalizedStringDictionary.getGlobalDictionaryForPackage(\n \"@react-stately/color\"\n ) ?? this.dictionary;\n\n return strings.getStringForLocale(channel, locale);\n };\n\n abstract getColorSpace(): ColorSpace;\n\n getColorSpaceAxes(xyChannels: {\n xChannel?: ColorChannel;\n yChannel?: ColorChannel;\n }): ColorAxes {\n const { xChannel, yChannel } = xyChannels;\n\n const channels = this.getColorChannels();\n const xCh = xChannel ?? channels.find((channel) => channel !== yChannel);\n const yCh = yChannel ?? channels.find((channel) => channel !== xCh);\n const zCh = channels.find((channel) => channel !== xCh && channel !== yCh);\n\n if (xCh === undefined || yCh === undefined || zCh === undefined) {\n throw new Error(\"Unable to determine color space axes\");\n }\n\n return { xChannel: xCh, yChannel: yCh, zChannel: zCh };\n }\n\n abstract getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];\n\n getColorName(locale: string): string {\n // Convert to oklch color space, which has perceptually uniform lightness across all hues.\n const [initialLightness, c, h] = toOKLCH(this);\n let l = initialLightness;\n\n const strings =\n LocalizedStringDictionary.getGlobalDictionaryForPackage(\n \"@react-stately/color\"\n ) ?? this.dictionary;\n\n if (l > 0.999) {\n return strings.getStringForLocale(\"white\", locale);\n }\n\n if (l < 0.001) {\n return strings.getStringForLocale(\"black\", locale);\n }\n\n const [hue, adjustedLightness] = this.getOklchHue(l, c, h, locale);\n l = adjustedLightness;\n\n let lightness = \"\";\n let chroma = \"\";\n\n if (c <= 0.1 && c >= GRAY_THRESHOLD) {\n chroma = l >= 0.7 ? \"pale\" : \"grayish\";\n } else if (c >= 0.15) {\n chroma = \"vibrant\";\n }\n\n if (l < 0.3) {\n lightness = \"very dark\";\n } else if (l < MAX_DARK_LIGHTNESS) {\n lightness = \"dark\";\n } else if (l < 0.7) {\n // none\n } else if (l < 0.85) {\n lightness = \"light\";\n } else {\n lightness = \"very light\";\n }\n\n if (chroma) {\n chroma = strings.getStringForLocale(chroma, locale);\n }\n\n if (lightness) {\n lightness = strings.getStringForLocale(lightness, locale);\n }\n\n const alpha = this.getChannelValue(\"alpha\");\n const formatter = new LocalizedStringFormatter(locale, strings);\n\n if (alpha < 1) {\n const percentTransparent = new NumberFormatter(locale, {\n style: \"percent\",\n }).format(1 - alpha);\n\n return formatter\n .format(\"transparentColorName\", {\n chroma,\n hue,\n lightness,\n percentTransparent,\n })\n .replaceAll(/\\s+/gu, \" \")\n .trim();\n }\n\n return formatter\n .format(\"colorName\", {\n chroma,\n hue,\n lightness,\n })\n .replaceAll(/\\s+/gu, \" \")\n .trim();\n }\n\n private readonly getOklchHue = (\n l: number,\n c: number,\n h: number,\n locale: string\n ): [string, number] => {\n const strings =\n LocalizedStringDictionary.getGlobalDictionaryForPackage(\n \"@react-stately/color\"\n ) ?? this.dictionary;\n\n if (c < GRAY_THRESHOLD) {\n return [strings.getStringForLocale(\"gray\", locale), l];\n }\n\n let lightness = l;\n\n for (const [i, [hue, initialHueName]] of OKLCH_HUES.entries()) {\n let hueName = initialHueName;\n const [nextHue, nextHueName] = OKLCH_HUES[i + 1] ?? [360, \"pink\"];\n\n if (h >= hue && h < nextHue) {\n // Split orange hue into brown/orange depending on lightness.\n if (hueName === \"orange\") {\n if (lightness < ORANGE_LIGHTNESS_THRESHOLD) {\n hueName = \"brown\";\n } else {\n // Adjust lightness.\n lightness =\n lightness - ORANGE_LIGHTNESS_THRESHOLD + MAX_DARK_LIGHTNESS;\n }\n }\n\n // If the hue is at least halfway to the next hue, add the next hue name as well.\n if (h > hue + (nextHue - hue) / 2 && hueName !== nextHueName) {\n hueName = `${hueName} ${nextHueName}`;\n } else if (\n hueName === \"yellow\" &&\n lightness < YELLOW_GREEN_LIGHTNESS_THRESHOLD\n ) {\n // Yellow shifts toward green at lower lightnesses.\n hueName = \"yellow green\";\n }\n\n const name = strings\n .getStringForLocale(hueName, locale)\n .toLocaleLowerCase(locale);\n\n return [name, lightness];\n }\n }\n\n throw new Error(\"Unexpected hue\");\n };\n\n getHueName(locale: string): string {\n const [l, c, h] = toOKLCH(this);\n const [name] = this.getOklchHue(l, c, h, locale);\n\n return name;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,aAAa,IAAI,0BAAkCA,aAAY;AAGrE,MAAM,6BAA6B;AAGnC,MAAM,mCAAmC;AAGzC,MAAM,qBAAqB;AAG3B,MAAM,iBAAiB;AAEvB,MAAM,aAAiC;CACrC,CAAC,GAAG,MAAM;CACV,CAAC,IAAI,KAAK;CACV,CAAC,IAAI,QAAQ;CACb,CAAC,IAAI,QAAQ;CACb,CAAC,KAAK,OAAO;CACb,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,MAAM;CACZ,CAAC,KAAK,QAAQ;CACd,CAAC,KAAK,SAAS;CACf,CAAC,KAAK,MAAM;AACd;AAEA,IAAsB,QAAtB,MAA8C;CAC5C,aAA8B;CAU9B,WAAmB;EACjB,OAAO,KAAK,SAAS,KAAK,CAAC,CAAC,SAAS;CACvC;CAKA,kBAAkB,SAAuB,WAAmB;EAM1D,QAJE,0BAA0B,8BACxB,sBACF,KAAK,KAAK,WAAA,CAEG,mBAAmB,SAAS,MAAM;CACnD;CAIA,kBAAkB,YAGJ;EACZ,MAAM,EAAE,UAAU,aAAa;EAE/B,MAAM,WAAW,KAAK,iBAAiB;EACvC,MAAM,MAAM,YAAY,SAAS,MAAM,YAAY,YAAY,QAAQ;EACvE,MAAM,MAAM,YAAY,SAAS,MAAM,YAAY,YAAY,GAAG;EAClE,MAAM,MAAM,SAAS,MAAM,YAAY,YAAY,OAAO,YAAY,GAAG;EAEzE,IAAI,QAAQ,KAAA,KAAa,QAAQ,KAAA,KAAa,QAAQ,KAAA,GACpD,MAAM,IAAI,MAAM,sCAAsC;EAGxD,OAAO;GAAE,UAAU;GAAK,UAAU;GAAK,UAAU;EAAI;CACvD;CAIA,aAAa,QAAwB;EAEnC,MAAM,CAAC,kBAAkB,GAAG,KAAK,QAAQ,IAAI;EAC7C,IAAI,IAAI;EAER,MAAM,UACJ,0BAA0B,8BACxB,sBACF,KAAK,KAAK;EAEZ,IAAI,IAAI,MACN,OAAO,QAAQ,mBAAmB,SAAS,MAAM;EAGnD,IAAI,IAAI,MACN,OAAO,QAAQ,mBAAmB,SAAS,MAAM;EAGnD,MAAM,CAAC,KAAK,qBAAqB,KAAK,YAAY,GAAG,GAAG,GAAG,MAAM;EACjE,IAAI;EAEJ,IAAI,YAAY;EAChB,IAAI,SAAS;EAEb,IAAI,KAAK,MAAO,KAAK,gBACnB,SAAS,KAAK,KAAM,SAAS;OACxB,IAAI,KAAK,KACd,SAAS;EAGX,IAAI,IAAI,IACN,YAAY;OACP,IAAI,IAAI,oBACb,YAAY;OACP,IAAI,IAAI,IAAK,CAEpB,OAAO,IAAI,IAAI,KACb,YAAY;OAEZ,YAAY;EAGd,IAAI,QACF,SAAS,QAAQ,mBAAmB,QAAQ,MAAM;EAGpD,IAAI,WACF,YAAY,QAAQ,mBAAmB,WAAW,MAAM;EAG1D,MAAM,QAAQ,KAAK,gBAAgB,OAAO;EAC1C,MAAM,YAAY,IAAI,yBAAyB,QAAQ,OAAO;EAE9D,IAAI,QAAQ,GAAG;GACb,MAAM,qBAAqB,IAAI,gBAAgB,QAAQ,EACrD,OAAO,UACT,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK;GAEnB,OAAO,UACJ,OAAO,wBAAwB;IAC9B;IACA;IACA;IACA;GACF,CAAC,CAAC,CACD,WAAW,SAAS,GAAG,CAAC,CACxB,KAAK;EACV;EAEA,OAAO,UACJ,OAAO,aAAa;GACnB;GACA;GACA;EACF,CAAC,CAAC,CACD,WAAW,SAAS,GAAG,CAAC,CACxB,KAAK;CACV;CAEA,eACE,GACA,GACA,GACA,WACqB;EACrB,MAAM,UACJ,0BAA0B,8BACxB,sBACF,KAAK,KAAK;EAEZ,IAAI,IAAI,gBACN,OAAO,CAAC,QAAQ,mBAAmB,QAAQ,MAAM,GAAG,CAAC;EAGvD,IAAI,YAAY;EAEhB,KAAK,MAAM,CAAC,GAAG,CAAC,KAAK,oBAAoB,WAAW,QAAQ,GAAG;GAC7D,IAAI,UAAU;GACd,MAAM,CAAC,SAAS,eAAe,WAAW,IAAI,MAAM,CAAC,KAAK,MAAM;GAEhE,IAAI,KAAK,OAAO,IAAI,SAAS;IAE3B,IAAI,YAAY,UAAU;KACxB,IAAI,YAAY,4BACd,UAAU;UAGV,YACE,YAAY,6BAA6B;IAE/C;IAGA,IAAI,IAAI,OAAO,UAAU,OAAO,KAAK,YAAY,aAC/C,UAAU,GAAG,QAAQ,GAAG;SACnB,IACL,YAAY,YACZ,YAAY,kCAGZ,UAAU;IAOZ,OAAO,CAJM,QACV,mBAAmB,SAAS,MAAM,CAAC,CACnC,kBAAkB,MAEV,GAAG,SAAS;GACzB;EACF;EAEA,MAAM,IAAI,MAAM,gBAAgB;CAClC;CAEA,WAAW,QAAwB;EACjC,MAAM,CAAC,GAAG,GAAG,KAAK,QAAQ,IAAI;EAC9B,MAAM,CAAC,QAAQ,KAAK,YAAY,GAAG,GAAG,GAAG,MAAM;EAE/C,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { createHSBColorClass } from "./hsb-color.js";
|
|
18
|
+
import { createHSLColorClass } from "./hsl-color.js";
|
|
19
|
+
import { createRGBColorClass } from "./rgb-color.js";
|
|
20
|
+
interface ColorClasses {
|
|
21
|
+
HSBColor: ReturnType<typeof createHSBColorClass>;
|
|
22
|
+
HSLColor: ReturnType<typeof createHSLColorClass>;
|
|
23
|
+
RGBColor: ReturnType<typeof createRGBColorClass>;
|
|
24
|
+
}
|
|
25
|
+
declare const { HSBColor, HSLColor, RGBColor }: ColorClasses;
|
|
26
|
+
export { HSBColor, HSLColor, RGBColor };
|
|
27
|
+
//# sourceMappingURL=color-classes.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { createHSBColorClass } from "./hsb-color.js";
|
|
18
|
+
import { createHSLColorClass } from "./hsl-color.js";
|
|
19
|
+
import { createRGBColorClass } from "./rgb-color.js";
|
|
20
|
+
// src/color/color/color-classes.ts
|
|
21
|
+
const colorClasses = {
|
|
22
|
+
HSBColor: createHSBColorClass(() => colorClasses),
|
|
23
|
+
HSLColor: createHSLColorClass(() => colorClasses),
|
|
24
|
+
RGBColor: createRGBColorClass(() => colorClasses)
|
|
25
|
+
};
|
|
26
|
+
const { HSBColor, HSLColor, RGBColor } = colorClasses;
|
|
27
|
+
export { HSBColor, HSLColor, RGBColor };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=color-classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-classes.js","names":[],"sources":["../../../src/color/color/color-classes.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.\n * Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { createHSBColorClass } from \"./hsb-color\";\nimport { createHSLColorClass } from \"./hsl-color\";\nimport { createRGBColorClass } from \"./rgb-color\";\n\ninterface ColorClasses {\n HSBColor: ReturnType<typeof createHSBColorClass>;\n HSLColor: ReturnType<typeof createHSLColorClass>;\n RGBColor: ReturnType<typeof createRGBColorClass>;\n}\n\nconst colorClasses: ColorClasses = {\n HSBColor: createHSBColorClass(() => colorClasses),\n HSLColor: createHSLColorClass(() => colorClasses),\n RGBColor: createRGBColorClass(() => colorClasses),\n};\n\nexport const { HSBColor, HSLColor, RGBColor } = colorClasses;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,eAA6B;CACjC,UAAU,0BAA0B,YAAY;CAChD,UAAU,0BAA0B,YAAY;CAChD,UAAU,0BAA0B,YAAY;AAClD;AAEA,MAAa,EAAE,UAAU,UAAU,aAAa"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { Color } from "../types.js";
|
|
18
|
+
export interface ColorConstructors {
|
|
19
|
+
RGBColor: new (red: number, green: number, blue: number, alpha: number) => Color;
|
|
20
|
+
HSBColor: new (hue: number, saturation: number, brightness: number, alpha: number) => Color;
|
|
21
|
+
HSLColor: new (hue: number, saturation: number, lightness: number, alpha: number) => Color;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=color-constructors.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/color/Color.ts.
|
|
14
|
+
* Modified for Solid Aria: reorganized color code, type declarations, imports, and formatting.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|