@adobe/react-spectrum 3.47.2 → 3.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/private/actionbar/ActionBar.cjs +2 -3
- package/dist/private/actionbar/ActionBar.cjs.map +1 -1
- package/dist/private/actionbar/ActionBar.js +2 -3
- package/dist/private/actionbar/ActionBar.js.map +1 -1
- package/dist/private/actionbar/ActionBar.mjs +2 -3
- package/dist/private/actionbar/ActionBar.mjs.map +1 -1
- package/dist/private/actiongroup/ActionGroup.cjs +5 -1
- package/dist/private/actiongroup/ActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/ActionGroup.js +5 -1
- package/dist/private/actiongroup/ActionGroup.js.map +1 -1
- package/dist/private/actiongroup/ActionGroup.mjs +5 -1
- package/dist/private/actiongroup/ActionGroup.mjs.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.cjs +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.js +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.mjs +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.mjs.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.cjs +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.js +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.mjs +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.mjs.map +1 -1
- package/dist/private/button/Button.cjs +2 -1
- package/dist/private/button/Button.cjs.map +1 -1
- package/dist/private/button/Button.js +3 -2
- package/dist/private/button/Button.js.map +1 -1
- package/dist/private/button/Button.mjs +3 -2
- package/dist/private/button/Button.mjs.map +1 -1
- package/dist/private/button/ClearButton.cjs +2 -1
- package/dist/private/button/ClearButton.cjs.map +1 -1
- package/dist/private/button/ClearButton.js +2 -1
- package/dist/private/button/ClearButton.js.map +1 -1
- package/dist/private/button/ClearButton.mjs +2 -1
- package/dist/private/button/ClearButton.mjs.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.cjs +4 -2
- package/dist/private/buttongroup/ButtonGroup.cjs.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.js +4 -2
- package/dist/private/buttongroup/ButtonGroup.js.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.mjs +4 -2
- package/dist/private/buttongroup/ButtonGroup.mjs.map +1 -1
- package/dist/private/card/CardBase.cjs +1 -0
- package/dist/private/card/CardBase.cjs.map +1 -1
- package/dist/private/card/CardBase.js +1 -0
- package/dist/private/card/CardBase.js.map +1 -1
- package/dist/private/card/CardBase.mjs +1 -0
- package/dist/private/card/CardBase.mjs.map +1 -1
- package/dist/private/card/CardView.cjs +3 -0
- package/dist/private/card/CardView.cjs.map +1 -1
- package/dist/private/card/CardView.js +3 -0
- package/dist/private/card/CardView.js.map +1 -1
- package/dist/private/card/CardView.mjs +3 -0
- package/dist/private/card/CardView.mjs.map +1 -1
- package/dist/private/checkbox/Checkbox.cjs.map +1 -1
- package/dist/private/checkbox/Checkbox.js.map +1 -1
- package/dist/private/checkbox/Checkbox.mjs.map +1 -1
- package/dist/private/color/ColorField.cjs +1 -0
- package/dist/private/color/ColorField.cjs.map +1 -1
- package/dist/private/color/ColorField.js +1 -0
- package/dist/private/color/ColorField.js.map +1 -1
- package/dist/private/color/ColorField.mjs +1 -0
- package/dist/private/color/ColorField.mjs.map +1 -1
- package/dist/private/color/ColorPicker.cjs.map +1 -1
- package/dist/private/color/ColorPicker.js.map +1 -1
- package/dist/private/color/ColorPicker.mjs.map +1 -1
- package/dist/private/color/ColorSwatch.cjs +2 -1
- package/dist/private/color/ColorSwatch.cjs.map +1 -1
- package/dist/private/color/ColorSwatch.js +2 -1
- package/dist/private/color/ColorSwatch.js.map +1 -1
- package/dist/private/color/ColorSwatch.mjs +2 -1
- package/dist/private/color/ColorSwatch.mjs.map +1 -1
- package/dist/private/color/ColorSwatchPicker.cjs.map +1 -1
- package/dist/private/color/ColorSwatchPicker.js.map +1 -1
- package/dist/private/color/ColorSwatchPicker.mjs.map +1 -1
- package/dist/private/color/ColorWheel.cjs +1 -0
- package/dist/private/color/ColorWheel.cjs.map +1 -1
- package/dist/private/color/ColorWheel.js +1 -0
- package/dist/private/color/ColorWheel.js.map +1 -1
- package/dist/private/color/ColorWheel.mjs +1 -0
- package/dist/private/color/ColorWheel.mjs.map +1 -1
- package/dist/private/combobox/ComboBox.cjs +1 -0
- package/dist/private/combobox/ComboBox.cjs.map +1 -1
- package/dist/private/combobox/ComboBox.js +1 -0
- package/dist/private/combobox/ComboBox.js.map +1 -1
- package/dist/private/combobox/ComboBox.mjs +1 -0
- package/dist/private/combobox/ComboBox.mjs.map +1 -1
- package/dist/private/combobox/MobileComboBox.cjs +8 -0
- package/dist/private/combobox/MobileComboBox.cjs.map +1 -1
- package/dist/private/combobox/MobileComboBox.js +8 -0
- package/dist/private/combobox/MobileComboBox.js.map +1 -1
- package/dist/private/combobox/MobileComboBox.mjs +8 -0
- package/dist/private/combobox/MobileComboBox.mjs.map +1 -1
- package/dist/private/datepicker/DateField.cjs +2 -1
- package/dist/private/datepicker/DateField.cjs.map +1 -1
- package/dist/private/datepicker/DateField.js +2 -1
- package/dist/private/datepicker/DateField.js.map +1 -1
- package/dist/private/datepicker/DateField.mjs +2 -1
- package/dist/private/datepicker/DateField.mjs.map +1 -1
- package/dist/private/datepicker/DatePicker.cjs +2 -1
- package/dist/private/datepicker/DatePicker.cjs.map +1 -1
- package/dist/private/datepicker/DatePicker.js +2 -1
- package/dist/private/datepicker/DatePicker.js.map +1 -1
- package/dist/private/datepicker/DatePicker.mjs +2 -1
- package/dist/private/datepicker/DatePicker.mjs.map +1 -1
- package/dist/private/datepicker/DateRangePicker.cjs +2 -1
- package/dist/private/datepicker/DateRangePicker.cjs.map +1 -1
- package/dist/private/datepicker/DateRangePicker.js +2 -1
- package/dist/private/datepicker/DateRangePicker.js.map +1 -1
- package/dist/private/datepicker/DateRangePicker.mjs +2 -1
- package/dist/private/datepicker/DateRangePicker.mjs.map +1 -1
- package/dist/private/dialog/AlertDialog.cjs +3 -1
- package/dist/private/dialog/AlertDialog.cjs.map +1 -1
- package/dist/private/dialog/AlertDialog.js +3 -1
- package/dist/private/dialog/AlertDialog.js.map +1 -1
- package/dist/private/dialog/AlertDialog.mjs +3 -1
- package/dist/private/dialog/AlertDialog.mjs.map +1 -1
- package/dist/private/dialog/Dialog.cjs +10 -3
- package/dist/private/dialog/Dialog.cjs.map +1 -1
- package/dist/private/dialog/Dialog.js +10 -3
- package/dist/private/dialog/Dialog.js.map +1 -1
- package/dist/private/dialog/Dialog.mjs +10 -3
- package/dist/private/dialog/Dialog.mjs.map +1 -1
- package/dist/private/dnd/useDragAndDrop.cjs +7 -0
- package/dist/private/dnd/useDragAndDrop.cjs.map +1 -1
- package/dist/private/dnd/useDragAndDrop.js +7 -0
- package/dist/private/dnd/useDragAndDrop.js.map +1 -1
- package/dist/private/dnd/useDragAndDrop.mjs +7 -0
- package/dist/private/dnd/useDragAndDrop.mjs.map +1 -1
- package/dist/private/icon/Icon.cjs +1 -1
- package/dist/private/icon/Icon.cjs.map +1 -1
- package/dist/private/icon/Icon.js +1 -1
- package/dist/private/icon/Icon.js.map +1 -1
- package/dist/private/icon/Icon.mjs +1 -1
- package/dist/private/icon/Icon.mjs.map +1 -1
- package/dist/private/icon/UIIcon.cjs +1 -1
- package/dist/private/icon/UIIcon.cjs.map +1 -1
- package/dist/private/icon/UIIcon.js +1 -1
- package/dist/private/icon/UIIcon.js.map +1 -1
- package/dist/private/icon/UIIcon.mjs +1 -1
- package/dist/private/icon/UIIcon.mjs.map +1 -1
- package/dist/private/intl/label/zh-CN.cjs +1 -1
- package/dist/private/intl/label/zh-CN.cjs.map +1 -1
- package/dist/private/intl/label/zh-CN.js +1 -1
- package/dist/private/intl/label/zh-CN.js.map +1 -1
- package/dist/private/intl/label/zh-CN.mjs +1 -1
- package/dist/private/intl/label/zh-CN.mjs.map +1 -1
- package/dist/private/intl/menu/es-ES.cjs +1 -1
- package/dist/private/intl/menu/es-ES.cjs.map +1 -1
- package/dist/private/intl/menu/es-ES.js +1 -1
- package/dist/private/intl/menu/es-ES.js.map +1 -1
- package/dist/private/intl/menu/es-ES.mjs +1 -1
- package/dist/private/intl/menu/es-ES.mjs.map +1 -1
- package/dist/private/intl/picker/zh-CN.cjs +1 -1
- package/dist/private/intl/picker/zh-CN.cjs.map +1 -1
- package/dist/private/intl/picker/zh-CN.js +1 -1
- package/dist/private/intl/picker/zh-CN.js.map +1 -1
- package/dist/private/intl/picker/zh-CN.mjs +1 -1
- package/dist/private/intl/picker/zh-CN.mjs.map +1 -1
- package/dist/private/intl/table/es-ES.cjs +1 -1
- package/dist/private/intl/table/es-ES.cjs.map +1 -1
- package/dist/private/intl/table/es-ES.js +1 -1
- package/dist/private/intl/table/es-ES.js.map +1 -1
- package/dist/private/intl/table/es-ES.mjs +1 -1
- package/dist/private/intl/table/es-ES.mjs.map +1 -1
- package/dist/private/intl/table/zh-TW.cjs +2 -2
- package/dist/private/intl/table/zh-TW.cjs.map +1 -1
- package/dist/private/intl/table/zh-TW.js +2 -2
- package/dist/private/intl/table/zh-TW.js.map +1 -1
- package/dist/private/intl/table/zh-TW.mjs +2 -2
- package/dist/private/intl/table/zh-TW.mjs.map +1 -1
- package/dist/private/label/Field.cjs +2 -1
- package/dist/private/label/Field.cjs.map +1 -1
- package/dist/private/label/Field.js +2 -1
- package/dist/private/label/Field.js.map +1 -1
- package/dist/private/label/Field.mjs +2 -1
- package/dist/private/label/Field.mjs.map +1 -1
- package/dist/private/layout/Grid.cjs +2 -1
- package/dist/private/layout/Grid.cjs.map +1 -1
- package/dist/private/layout/Grid.js +2 -1
- package/dist/private/layout/Grid.js.map +1 -1
- package/dist/private/layout/Grid.mjs +2 -1
- package/dist/private/layout/Grid.mjs.map +1 -1
- package/dist/private/link/Link.cjs +3 -0
- package/dist/private/link/Link.cjs.map +1 -1
- package/dist/private/link/Link.js +3 -0
- package/dist/private/link/Link.js.map +1 -1
- package/dist/private/link/Link.mjs +3 -0
- package/dist/private/link/Link.mjs.map +1 -1
- package/dist/private/list/InsertionIndicator.cjs +1 -0
- package/dist/private/list/InsertionIndicator.cjs.map +1 -1
- package/dist/private/list/InsertionIndicator.js +1 -0
- package/dist/private/list/InsertionIndicator.js.map +1 -1
- package/dist/private/list/InsertionIndicator.mjs +1 -0
- package/dist/private/list/InsertionIndicator.mjs.map +1 -1
- package/dist/private/list/ListView.cjs +5 -0
- package/dist/private/list/ListView.cjs.map +1 -1
- package/dist/private/list/ListView.js +5 -0
- package/dist/private/list/ListView.js.map +1 -1
- package/dist/private/list/ListView.mjs +5 -0
- package/dist/private/list/ListView.mjs.map +1 -1
- package/dist/private/list/ListViewItem.cjs +2 -0
- package/dist/private/list/ListViewItem.cjs.map +1 -1
- package/dist/private/list/ListViewItem.js +2 -0
- package/dist/private/list/ListViewItem.js.map +1 -1
- package/dist/private/list/ListViewItem.mjs +2 -0
- package/dist/private/list/ListViewItem.mjs.map +1 -1
- package/dist/private/list/RootDropIndicator.cjs +1 -0
- package/dist/private/list/RootDropIndicator.cjs.map +1 -1
- package/dist/private/list/RootDropIndicator.js +1 -0
- package/dist/private/list/RootDropIndicator.js.map +1 -1
- package/dist/private/list/RootDropIndicator.mjs +1 -0
- package/dist/private/list/RootDropIndicator.mjs.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.cjs +7 -1
- package/dist/private/menu/ContextualHelpTrigger.cjs.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.js +7 -1
- package/dist/private/menu/ContextualHelpTrigger.js.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.mjs +7 -1
- package/dist/private/menu/ContextualHelpTrigger.mjs.map +1 -1
- package/dist/private/menu/MenuItem.cjs +2 -0
- package/dist/private/menu/MenuItem.cjs.map +1 -1
- package/dist/private/menu/MenuItem.js +2 -0
- package/dist/private/menu/MenuItem.js.map +1 -1
- package/dist/private/menu/MenuItem.mjs +2 -0
- package/dist/private/menu/MenuItem.mjs.map +1 -1
- package/dist/private/menu/MenuTrigger.cjs +1 -0
- package/dist/private/menu/MenuTrigger.cjs.map +1 -1
- package/dist/private/menu/MenuTrigger.js +1 -0
- package/dist/private/menu/MenuTrigger.js.map +1 -1
- package/dist/private/menu/MenuTrigger.mjs +1 -0
- package/dist/private/menu/MenuTrigger.mjs.map +1 -1
- package/dist/private/menu/SubmenuTrigger.cjs +6 -1
- package/dist/private/menu/SubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/SubmenuTrigger.js +6 -1
- package/dist/private/menu/SubmenuTrigger.js.map +1 -1
- package/dist/private/menu/SubmenuTrigger.mjs +6 -1
- package/dist/private/menu/SubmenuTrigger.mjs.map +1 -1
- package/dist/private/package.cjs +1 -1
- package/dist/private/package.cjs.map +1 -1
- package/dist/private/package.js +1 -1
- package/dist/private/package.js.map +1 -1
- package/dist/private/package.mjs +1 -1
- package/dist/private/package.mjs.map +1 -1
- package/dist/private/progress/ProgressBarBase.cjs +2 -1
- package/dist/private/progress/ProgressBarBase.cjs.map +1 -1
- package/dist/private/progress/ProgressBarBase.js +2 -1
- package/dist/private/progress/ProgressBarBase.js.map +1 -1
- package/dist/private/progress/ProgressBarBase.mjs +2 -1
- package/dist/private/progress/ProgressBarBase.mjs.map +1 -1
- package/dist/private/progress/ProgressCircle.cjs +2 -1
- package/dist/private/progress/ProgressCircle.cjs.map +1 -1
- package/dist/private/progress/ProgressCircle.js +2 -1
- package/dist/private/progress/ProgressCircle.js.map +1 -1
- package/dist/private/progress/ProgressCircle.mjs +2 -1
- package/dist/private/progress/ProgressCircle.mjs.map +1 -1
- package/dist/private/slider/Slider.cjs +1 -0
- package/dist/private/slider/Slider.cjs.map +1 -1
- package/dist/private/slider/Slider.js +1 -0
- package/dist/private/slider/Slider.js.map +1 -1
- package/dist/private/slider/Slider.mjs +1 -0
- package/dist/private/slider/Slider.mjs.map +1 -1
- package/dist/private/table/InsertionIndicator.cjs +1 -0
- package/dist/private/table/InsertionIndicator.cjs.map +1 -1
- package/dist/private/table/InsertionIndicator.js +1 -0
- package/dist/private/table/InsertionIndicator.js.map +1 -1
- package/dist/private/table/InsertionIndicator.mjs +1 -0
- package/dist/private/table/InsertionIndicator.mjs.map +1 -1
- package/dist/private/table/Resizer.cjs +2 -25
- package/dist/private/table/Resizer.cjs.map +1 -1
- package/dist/private/table/Resizer.js +3 -26
- package/dist/private/table/Resizer.js.map +1 -1
- package/dist/private/table/Resizer.mjs +3 -26
- package/dist/private/table/Resizer.mjs.map +1 -1
- package/dist/private/table/RootDropIndicator.cjs +1 -0
- package/dist/private/table/RootDropIndicator.cjs.map +1 -1
- package/dist/private/table/RootDropIndicator.js +1 -0
- package/dist/private/table/RootDropIndicator.js.map +1 -1
- package/dist/private/table/RootDropIndicator.mjs +1 -0
- package/dist/private/table/RootDropIndicator.mjs.map +1 -1
- package/dist/private/table/TableViewBase.cjs +8 -0
- package/dist/private/table/TableViewBase.cjs.map +1 -1
- package/dist/private/table/TableViewBase.js +8 -0
- package/dist/private/table/TableViewBase.js.map +1 -1
- package/dist/private/table/TableViewBase.mjs +8 -0
- package/dist/private/table/TableViewBase.mjs.map +1 -1
- package/dist/private/table/TreeGridTableView.cjs +1 -0
- package/dist/private/table/TreeGridTableView.cjs.map +1 -1
- package/dist/private/table/TreeGridTableView.js +1 -0
- package/dist/private/table/TreeGridTableView.js.map +1 -1
- package/dist/private/table/TreeGridTableView.mjs +1 -0
- package/dist/private/table/TreeGridTableView.mjs.map +1 -1
- package/dist/private/tabs/Tabs.cjs +4 -2
- package/dist/private/tabs/Tabs.cjs.map +1 -1
- package/dist/private/tabs/Tabs.js +4 -2
- package/dist/private/tabs/Tabs.js.map +1 -1
- package/dist/private/tabs/Tabs.mjs +4 -2
- package/dist/private/tabs/Tabs.mjs.map +1 -1
- package/dist/private/tag/TagGroup.cjs +2 -0
- package/dist/private/tag/TagGroup.cjs.map +1 -1
- package/dist/private/tag/TagGroup.js +2 -0
- package/dist/private/tag/TagGroup.js.map +1 -1
- package/dist/private/tag/TagGroup.mjs +2 -0
- package/dist/private/tag/TagGroup.mjs.map +1 -1
- package/dist/private/textfield/TextArea.cjs +2 -0
- package/dist/private/textfield/TextArea.cjs.map +1 -1
- package/dist/private/textfield/TextArea.js +2 -0
- package/dist/private/textfield/TextArea.js.map +1 -1
- package/dist/private/textfield/TextArea.mjs +2 -0
- package/dist/private/textfield/TextArea.mjs.map +1 -1
- package/dist/private/textfield/TextField.cjs +1 -0
- package/dist/private/textfield/TextField.cjs.map +1 -1
- package/dist/private/textfield/TextField.js +1 -0
- package/dist/private/textfield/TextField.js.map +1 -1
- package/dist/private/textfield/TextField.mjs +1 -0
- package/dist/private/textfield/TextField.mjs.map +1 -1
- package/dist/private/textfield/TextFieldBase.cjs +2 -1
- package/dist/private/textfield/TextFieldBase.cjs.map +1 -1
- package/dist/private/textfield/TextFieldBase.js +2 -1
- package/dist/private/textfield/TextFieldBase.js.map +1 -1
- package/dist/private/textfield/TextFieldBase.mjs +2 -1
- package/dist/private/textfield/TextFieldBase.mjs.map +1 -1
- package/dist/private/utils/Slots.cjs +1 -0
- package/dist/private/utils/Slots.cjs.map +1 -1
- package/dist/private/utils/Slots.js +1 -0
- package/dist/private/utils/Slots.js.map +1 -1
- package/dist/private/utils/Slots.mjs +1 -0
- package/dist/private/utils/Slots.mjs.map +1 -1
- package/dist/types/src/dialog/AlertDialog.d.ts +2 -2
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAyCM,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAA4B,EAC5B,GAAmC;IAEnC,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,sBAAc;IAC/D,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,mBAAC,kBAAkB,qBAAO,eAAe,kBAAO,SAAS,YAAE,QAAQ,EAAE,GAAG,YAAW,GAAG;IAC1F,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IAEjC,2EAA2E;IAC3E,gFAAgF;IAChF,8EAA8E;IAC9E,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAmB;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,aAElD,CAAA,GAAA,2BAAmB,EACjB;QACE,GAAG,KAAK;QACR,qFAAqF;QACrF,2EAA2E;QAC3E,aAAa;QACb,OAAO,MAAM,KAAK;QAClB,2EAA2E;Q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C;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA2B,WAC9D,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA6B;AAIzE","sources":["packages/@adobe/react-spectrum/src/checkbox/Checkbox.tsx"],"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\nimport {AriaCheckboxProps, useCheckbox} from 'react-aria/useCheckbox';\n\nimport {CheckboxContext} from 'react-aria-components/Checkbox';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames} from '../utils/classNames';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckboxGroupItem} from 'react-aria/useCheckboxGroup';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useToggleState} from 'react-stately/useToggleState';\n\nexport interface SpectrumCheckboxProps extends Omit<AriaCheckboxProps, 'onClick'>, StyleProps {\n /**\n * This prop sets the emphasized style which provides visual prominence.\n */\n isEmphasized?: boolean;\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent\n * component. An explicit `null` value indicates that the local props completely override all\n * props received from a parent.\n *\n * @private\n */\n slot?: string | null;\n}\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(\n props: SpectrumCheckboxProps,\n ref: FocusableRef<HTMLLabelElement>\n) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isIndeterminate = false, isEmphasized = false, autoFocus, children, ...otherProps} = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {labelProps, inputProps, isInvalid, isDisabled} = groupState\n ? //
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAyCM,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAA4B,EAC5B,GAAmC;IAEnC,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,sBAAc;IAC/D,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,mBAAC,kBAAkB,qBAAO,eAAe,kBAAO,SAAS,YAAE,QAAQ,EAAE,GAAG,YAAW,GAAG;IAC1F,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IAEjC,2EAA2E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A4B,CAAC;YAC7B,cAAc;YACd,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAEtB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;uBAGlC,gCAAC;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA2B,WAC9D,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA6B;AAIzE","sources":["packages/@adobe/react-spectrum/src/checkbox/Checkbox.tsx"],"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\nimport {AriaCheckboxProps, useCheckbox} from 'react-aria/useCheckbox';\n\nimport {CheckboxContext} from 'react-aria-components/Checkbox';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames} from '../utils/classNames';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckboxGroupItem} from 'react-aria/useCheckboxGroup';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useToggleState} from 'react-stately/useToggleState';\n\nexport interface SpectrumCheckboxProps extends Omit<AriaCheckboxProps, 'onClick'>, StyleProps {\n /**\n * This prop sets the emphasized style which provides visual prominence.\n */\n isEmphasized?: boolean;\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent\n * component. An explicit `null` value indicates that the local props completely override all\n * props received from a parent.\n *\n * @private\n */\n slot?: string | null;\n}\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(\n props: SpectrumCheckboxProps,\n ref: FocusableRef<HTMLLabelElement>\n) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isIndeterminate = false, isEmphasized = false, autoFocus, children, ...otherProps} = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {labelProps, inputProps, isInvalid, isDisabled} = groupState\n ? // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useCheckboxGroupItem(\n {\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // Only pass isRequired and validationState to react-aria if they came from\n // the props for this individual checkbox, and not from the group via context.\n isRequired: originalProps.isRequired,\n validationState: originalProps.validationState,\n isInvalid: originalProps.isInvalid\n },\n groupState,\n inputRef\n )\n : // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useCheckbox(props, useToggleState(props), inputRef);\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let markIcon = isIndeterminate ? (\n <DashSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-partialCheckmark')} />\n ) : (\n <CheckmarkSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-checkmark')} />\n );\n\n if (groupState && process.env.NODE_ENV !== 'production') {\n for (let key of ['isSelected', 'defaultSelected', 'isEmphasized']) {\n if (originalProps[key] != null) {\n console.warn(\n `${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`\n );\n }\n }\n if (props.value == null) {\n console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');\n }\n }\n\n return (\n <label\n {...labelProps}\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={classNames(\n styles,\n 'spectrum-Checkbox',\n {\n 'is-checked': inputProps.checked,\n 'is-indeterminate': isIndeterminate,\n 'spectrum-Checkbox--quiet': !isEmphasized,\n 'is-invalid': isInvalid,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Checkbox-input')}\n />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Checkbox-box')}>{markIcon}</span>\n {children && (\n <span className={classNames(styles, 'spectrum-Checkbox-label')}>{children}</span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAyCM,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAA4B,EAC5B,GAAmC;IAEnC,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAA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AAc;QACvD,KAAK,IAAI,OAAO;YAAC;YAAc;YAAmB;SAAe,CAC/D,IAAI,aAAa,CAAC,IAAI,IAAI,MACxB,QAAQ,IAAI,CACV,GAAG,IAAI,0HAA0H,CAAC;QAIxI,IAAI,MAAM,KAAK,IAAI,MACjB,QAAQ,IAAI,CAAC;IAEjB;IAEA,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,qDAAK,GACL,qBACA;YACE,cAAc,WAAW,OAAO;YAChC,oBAAoB;YACpB,4BAA4B,CAAC;YAC7B,cAAc;YACd,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAEtB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;uBAGlC,gCAAC;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA2B,WAC9D,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,qDAAK,GAAG;OAA6B;AAIzE","sources":["packages/@adobe/react-spectrum/src/checkbox/Checkbox.tsx"],"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\nimport {AriaCheckboxProps, useCheckbox} from 'react-aria/useCheckbox';\n\nimport {CheckboxContext} from 'react-aria-components/Checkbox';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames} from '../utils/classNames';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckboxGroupItem} from 'react-aria/useCheckboxGroup';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useToggleState} from 'react-stately/useToggleState';\n\nexport interface SpectrumCheckboxProps extends Omit<AriaCheckboxProps, 'onClick'>, StyleProps {\n /**\n * This prop sets the emphasized style which provides visual prominence.\n */\n isEmphasized?: boolean;\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent\n * component. An explicit `null` value indicates that the local props completely override all\n * props received from a parent.\n *\n * @private\n */\n slot?: string | null;\n}\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(\n props: SpectrumCheckboxProps,\n ref: FocusableRef<HTMLLabelElement>\n) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isIndeterminate = false, isEmphasized = false, autoFocus, children, ...otherProps} = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {labelProps, inputProps, isInvalid, isDisabled} = groupState\n ? //
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAyCM,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAA4B,EAC5B,GAAmC;IAEnC,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,sBAAc;IAC/D,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,mBAAC,kBAAkB,qBAAO,eAAe,kBAAO,SAAS,YAAE,QAAQ,EAAE,GAAG,YAAW,GAAG;IAC1F,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IAEjC,2EAA2E;IAC3E,gFAAgF;IAChF,8EAA8E;IAC9E,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAmB;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,aAElD,CAAA,GAAA,2BAAmB,EACjB;QACE,GAAG,KAAK;QACR,qFAAqF;QACrF,2EAA2E;QAC3E,aAAa;QACb,OAAO,MAAM,KAAK;QAClB,2EAA2E;QAC3E,8EAA8E;QAC9E,YAAY,cAAc,UAAU;QACpC,iBAAiB,cAAc,eAAe;QAC9C,WAAW,cAAc,SAAS;IACpC,GACA,YACA,YAGF,CAAA,GAAA,kBAAU,EAAE,OAAO,CAAA,GAAA,qBAAa,EAAE,QAAQ;IAE9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAA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 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\nimport {AriaCheckboxProps, useCheckbox} from 'react-aria/useCheckbox';\n\nimport {CheckboxContext} from 'react-aria-components/Checkbox';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames} from '../utils/classNames';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckboxGroupItem} from 'react-aria/useCheckboxGroup';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useToggleState} from 'react-stately/useToggleState';\n\nexport interface SpectrumCheckboxProps extends Omit<AriaCheckboxProps, 'onClick'>, StyleProps {\n /**\n * This prop sets the emphasized style which provides visual prominence.\n */\n isEmphasized?: boolean;\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent\n * component. An explicit `null` value indicates that the local props completely override all\n * props received from a parent.\n *\n * @private\n */\n slot?: string | null;\n}\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(\n props: SpectrumCheckboxProps,\n ref: FocusableRef<HTMLLabelElement>\n) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isIndeterminate = false, isEmphasized = false, autoFocus, children, ...otherProps} = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {labelProps, inputProps, isInvalid, isDisabled} = groupState\n ? // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useCheckboxGroupItem(\n {\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // Only pass isRequired and validationState to react-aria if they came from\n // the props for this individual checkbox, and not from the group via context.\n isRequired: originalProps.isRequired,\n validationState: originalProps.validationState,\n isInvalid: originalProps.isInvalid\n },\n groupState,\n inputRef\n )\n : // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useCheckbox(props, useToggleState(props), inputRef);\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let markIcon = isIndeterminate ? (\n <DashSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-partialCheckmark')} />\n ) : (\n <CheckmarkSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-checkmark')} />\n );\n\n if (groupState && process.env.NODE_ENV !== 'production') {\n for (let key of ['isSelected', 'defaultSelected', 'isEmphasized']) {\n if (originalProps[key] != null) {\n console.warn(\n `${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`\n );\n }\n }\n if (props.value == null) {\n console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');\n }\n }\n\n return (\n <label\n {...labelProps}\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={classNames(\n styles,\n 'spectrum-Checkbox',\n {\n 'is-checked': inputProps.checked,\n 'is-indeterminate': isIndeterminate,\n 'spectrum-Checkbox--quiet': !isEmphasized,\n 'is-invalid': isInvalid,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Checkbox-input')}\n />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Checkbox-box')}>{markIcon}</span>\n {children && (\n <span className={classNames(styles, 'spectrum-Checkbox-label')}>{children}</span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.mjs.map"}
|
|
@@ -43,6 +43,7 @@ $parcel$export(module.exports, "ColorField", function () { return $cd43964140eb8
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
const $cd43964140eb8bb2$export$b865d4358897bb17 = /*#__PURE__*/ (0, ($parcel$interopDefault($5QiVu$react))).forwardRef(function ColorField(props, ref) {
|
|
46
|
+
// oxlint-disable-next-line react/react-compiler
|
|
46
47
|
props = (0, $544fc82701fc93e9$exports.useProviderProps)(props);
|
|
47
48
|
props = (0, $1af2ca8553741739$exports.useFormProps)(props);
|
|
48
49
|
[props] = (0, $5QiVu$reactariacomponentsslots.useContextProps)(props, null, (0, $5QiVu$reactariacomponentsColorField.ColorFieldContext));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,+CAAc,EAAE,OAAO,MAAM,CAAA,GAAA,s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,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,wDAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,2CAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,gDAAgD;IAChD,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,+CAAc,EAAE,OAAO,MAAM,CAAA,GAAA,sDAAgB;IAEvD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,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;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n // oxlint-disable-next-line react/react-compiler\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.cjs.map"}
|
|
@@ -37,6 +37,7 @@ function $parcel$interopDefault(a) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
const $5b07f9ba6aa1e89e$export$b865d4358897bb17 = /*#__PURE__*/ (0, $5a4rp$react).forwardRef(function ColorField(props, ref) {
|
|
40
|
+
// oxlint-disable-next-line react/react-compiler
|
|
40
41
|
props = (0, $089943c7a219141c$export$521c373ccc32c300)(props);
|
|
41
42
|
props = (0, $d23ca6800ac02cf1$export$a6b5be5c6b451665)(props);
|
|
42
43
|
[props] = (0, $5a4rp$useContextProps)(props, null, (0, $5a4rp$ColorFieldContext));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CA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AAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,oBAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,gDAAgD;IAChD,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CAAA,GAAA,wBAAgB;IAEvD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CACV;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AAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n // oxlint-disable-next-line react/react-compiler\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.js.map"}
|
|
@@ -37,6 +37,7 @@ function $parcel$interopDefault(a) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
const $41f1a8db81de171a$export$b865d4358897bb17 = /*#__PURE__*/ (0, $f9TgH$react).forwardRef(function ColorField(props, ref) {
|
|
40
|
+
// oxlint-disable-next-line react/react-compiler
|
|
40
41
|
props = (0, $71dfb0e0358a12de$export$521c373ccc32c300)(props);
|
|
41
42
|
props = (0, $c29c48d4ef19ffc4$export$a6b5be5c6b451665)(props);
|
|
42
43
|
[props] = (0, $f9TgH$useContextProps)(props, null, (0, $f9TgH$ColorFieldContext));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CAAA,GAAA,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,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,oBAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+CM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAA8B,EAC9B,GAAsB;IAEtB,gDAAgD;IAChD,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CAAA,GAAA,wBAAgB;IAEvD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CACV;YAEF,U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AU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;;AAGzC","sources":["packages/@adobe/react-spectrum/src/color/ColorField.tsx"],"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\nimport {AriaColorFieldProps, useColorChannelField, useColorField} from 'react-aria/useColorField';\n\nimport {classNames} from '../utils/classNames';\nimport {Color, ColorChannel, ColorSpace} from 'react-stately/Color';\nimport {ColorFieldContext} from 'react-aria-components/ColorField';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport {\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n SpectrumTextInputBase,\n StyleProps\n} from '@react-types/shared';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport {TextFieldRef} from '../textfield/TextField';\nimport {useColorChannelFieldState, useColorFieldState} from 'react-stately/useColorFieldState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorFieldProps\n extends\n SpectrumTextInputBase,\n Omit<AriaColorFieldProps, 'isInvalid' | 'validationState'>,\n SpectrumFieldValidation<Color | null>,\n SpectrumLabelableProps,\n StyleProps {\n /**\n * The color channel that this field edits. If not provided,\n * the color is edited as a hex value.\n */\n channel?: ColorChannel;\n /**\n * The color space that the color field operates in if a `channel` prop is provided.\n * If no `channel` is provided, the color field always displays the color as an RGB hex value.\n */\n colorSpace?: ColorSpace;\n /** Whether the ColorField should be displayed with a quiet style. */\n isQuiet?: boolean;\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(\n props: SpectrumColorFieldProps,\n ref: Ref<TextFieldRef>\n) {\n // oxlint-disable-next-line react/react-compiler\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text'\n );\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel;\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n form={props.form}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>;\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')}\n />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuCM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YACnD,KAA+B,EAC/B,GAAoC;IAEpC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,2BAAI;IAClB,qBACE,0DAAC,CAAA,GAAA,iDAAc,GAAM,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuCM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YACnD,KAA+B,EAC/B,GAAoC;IAEpC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,2BAAI;IAClB,qBACE,0DAAC,CAAA,GAAA,iDAAc,GAAM,qBAEnB,0DAAC,CAAA,GAAA,uCAAY;QAAE,MAAK;QAAU,YAAW;QAAO,WAAW,CAAA,GAAA,sCAAW,EAAE;qBACtE,0DAAC,CAAA,GAAA,uCAAK;QACJ,KAAK;QACL,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkBR;YAAC,MAAM,MAAM,IAAI,IAAI;QAAG;OAC1B,CAAC,kBAAC,cAAc,EAAC,iBAChB,oIACE,0DAAC;YACC,WAAW;;;;;;;;;;;;;cASR;gCAAC;YAAc;yBAClB,0DAAC,CAAA,GAAA,qCAAU;YACT,KAAK;YACL,OAAO,MAAM,KAAK;YAClB,MAAM,MAAM,IAAI;YAChB,UAAU,MAAM,QAAQ;YACxB,cAAY,KAAK,CAAC,aAAa;YAC/B,mBAAiB,KAAK,CAAC,kBAAkB;YACzC,oBAAkB,KAAK,CAAC,mBAAmB;YAC3C,gBAAc,KAAK,CAAC,eAAe;aAGtC,MAAM,KAAK,kBAAI,0DAAC;YAAK,IAAI;WAAU,MAAM,KAAK,mBAIrD,0DAAC,CAAA,GAAA,gCAAK;QACJ,mBAAiB,MAAM,KAAK,GAAG,UAAU,KAAK,CAAC,kBAAkB;QACjE,cAAY,KAAK,CAAC,aAAa;QAC/B,cAAc;YACZ,OAAO;YACP,UAAU;YACV,QAAQ,SAAS,sBAAsB;QACzC;qBACA,0DAAC,CAAA,GAAA,iCAAM;QACL,cAAc;YACZ,UAAU;YACV,QAAQ;YACR,SAAS;QACX;OACC,MAAM,QAAQ;AAM3B","sources":["packages/@adobe/react-spectrum/src/color/ColorPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {ColorPicker as AriaColorPicker} from 'react-aria-components/ColorPicker';\n\nimport {AriaLabelingProps, FocusableRef, ValueBase} from '@react-types/shared';\nimport {Button} from 'react-aria-components/Button';\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatch} from './ColorSwatch';\nimport {Content} from '../view/Content';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport React, {ReactNode, useRef} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useId} from 'react-aria/useId';\n\nexport interface SpectrumColorPickerProps\n extends ValueBase<string | Color, Color>, AriaLabelingProps {\n /** A visual label for the color picker. */\n label?: ReactNode;\n /** The contents of the color picker popover, e.g. `<ColorEditor />`. */\n children?: ReactNode;\n /**\n * The size of the color swatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\n/**\n * A ColorPicker combines a swatch with a customizable popover for editing a color.\n */\nexport const ColorPicker = React.forwardRef(function ColorPicker(\n props: SpectrumColorPickerProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let swatchRef = useRef(null);\n let domRef = useFocusableRef(ref);\n let labelId = useId();\n return (\n <AriaColorPicker {...props}>\n {/* oxlint-disable-next-line react/react-compiler */}\n <DialogTrigger type=\"popover\" mobileType=\"tray\" targetRef={unwrapDOMRef(swatchRef)}>\n <Button\n ref={domRef}\n className={style({\n backgroundColor: 'transparent',\n borderStyle: 'none',\n padding: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 'text-to-control',\n outlineStyle: 'none',\n fontFamily: 'sans',\n color: 'body',\n fontSize: {\n size: {\n XS: 'xs',\n S: 'sm',\n M: 'base',\n L: 'lg'\n }\n }\n })({size: props.size || 'M'})}>\n {({isFocusVisible}) => (\n <>\n <div\n className={style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n borderRadius: 'default'\n })({isFocusVisible})}>\n <ColorSwatch\n ref={swatchRef}\n color={props.value}\n size={props.size}\n rounding={props.rounding}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']}\n />\n </div>\n {props.label && <span id={labelId}>{props.label}</span>}\n </>\n )}\n </Button>\n <Dialog\n aria-labelledby={props.label ? labelId : props['aria-labelledby']}\n aria-label={props['aria-label']}\n UNSAFE_style={{\n width: 'fit-content',\n minWidth: 0,\n margin: '0 auto' // Center within tray.\n }}>\n <Content\n UNSAFE_style={{\n position: 'relative',\n margin: 'calc(var(--spectrum-dialog-padding) * -1)',\n padding: 'var(--spectrum-global-dimension-size-200)'\n }}>\n {props.children}\n </Content>\n </Dialog>\n </DialogTrigger>\n </AriaColorPicker>\n );\n});\n"],"names":[],"version":3,"file":"ColorPicker.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuCM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YACnD,KAA+B,EAC/B,GAAoC;IAEpC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,YAAI;IAClB,qBACE,gCAAC,CAAA,GAAA,kBAAc,GAAM,
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuCM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YACnD,KAA+B,EAC/B,GAAoC;IAEpC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,YAAI;IAClB,qBACE,gCAAC,CAAA,GAAA,kBAAc,GAAM,qBAEnB,gCAAC,CAAA,GAAA,yCAAY;QAAE,MAAK;QAAU,YAAW;QAAO,WAAW,CAAA,GAAA,yCAAW,EAAE;qBACtE,gCAAC,CAAA,GAAA,aAAK;QACJ,KAAK;QACL,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkBR;YAAC,MAAM,MAAM,IAAI,IAAI;QAAG;OAC1B,CAAC,kBAAC,cAAc,EAAC,iBAChB,gFACE,gCAAC;YACC,WAAW;;;;;;;;;;;;;cASR;gCAAC;YAAc;yBAClB,gCAAC,CAAA,GAAA,yCAAU;YACT,KAAK;YACL,OAAO,MAAM,KAAK;YAClB,MAAM,MAAM,IAAI;YAChB,UAAU,MAAM,QAAQ;YACxB,cAAY,KAAK,CAAC,aAAa;YAC/B,mBAAiB,KAAK,CAAC,kBAAkB;YACzC,oBAAkB,KAAK,CAAC,mBAAmB;YAC3C,gBAAc,KAAK,CAAC,eAAe;aAGtC,MAAM,KAAK,kBAAI,gCAAC;YAAK,IAAI;WAAU,MAAM,KAAK,mBAIrD,gCAAC,CAAA,GAAA,yCAAK;QACJ,mBAAiB,MAAM,KAAK,GAAG,UAAU,KAAK,CAAC,kBAAkB;QACjE,cAAY,KAAK,CAAC,aAAa;QAC/B,cAAc;YACZ,OAAO;YACP,UAAU;YACV,QAAQ,SAAS,sBAAsB;QACzC;qBACA,gCAAC,CAAA,GAAA,yCAAM;QACL,cAAc;YACZ,UAAU;YACV,QAAQ;YACR,SAAS;QACX;OACC,MAAM,QAAQ;AAM3B","sources":["packages/@adobe/react-spectrum/src/color/ColorPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {ColorPicker as AriaColorPicker} from 'react-aria-components/ColorPicker';\n\nimport {AriaLabelingProps, FocusableRef, ValueBase} from '@react-types/shared';\nimport {Button} from 'react-aria-components/Button';\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatch} from './ColorSwatch';\nimport {Content} from '../view/Content';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport React, {ReactNode, useRef} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useId} from 'react-aria/useId';\n\nexport interface SpectrumColorPickerProps\n extends ValueBase<string | Color, Color>, AriaLabelingProps {\n /** A visual label for the color picker. */\n label?: ReactNode;\n /** The contents of the color picker popover, e.g. `<ColorEditor />`. */\n children?: ReactNode;\n /**\n * The size of the color swatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\n/**\n * A ColorPicker combines a swatch with a customizable popover for editing a color.\n */\nexport const ColorPicker = React.forwardRef(function ColorPicker(\n props: SpectrumColorPickerProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let swatchRef = useRef(null);\n let domRef = useFocusableRef(ref);\n let labelId = useId();\n return (\n <AriaColorPicker {...props}>\n {/* oxlint-disable-next-line react/react-compiler */}\n <DialogTrigger type=\"popover\" mobileType=\"tray\" targetRef={unwrapDOMRef(swatchRef)}>\n <Button\n ref={domRef}\n className={style({\n backgroundColor: 'transparent',\n borderStyle: 'none',\n padding: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 'text-to-control',\n outlineStyle: 'none',\n fontFamily: 'sans',\n color: 'body',\n fontSize: {\n size: {\n XS: 'xs',\n S: 'sm',\n M: 'base',\n L: 'lg'\n }\n }\n })({size: props.size || 'M'})}>\n {({isFocusVisible}) => (\n <>\n <div\n className={style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n borderRadius: 'default'\n })({isFocusVisible})}>\n <ColorSwatch\n ref={swatchRef}\n color={props.value}\n size={props.size}\n rounding={props.rounding}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']}\n />\n </div>\n {props.label && <span id={labelId}>{props.label}</span>}\n </>\n )}\n </Button>\n <Dialog\n aria-labelledby={props.label ? labelId : props['aria-labelledby']}\n aria-label={props['aria-label']}\n UNSAFE_style={{\n width: 'fit-content',\n minWidth: 0,\n margin: '0 auto' // Center within tray.\n }}>\n <Content\n UNSAFE_style={{\n position: 'relative',\n margin: 'calc(var(--spectrum-dialog-padding) * -1)',\n padding: 'var(--spectrum-global-dimension-size-200)'\n }}>\n {props.children}\n </Content>\n </Dialog>\n </DialogTrigger>\n </AriaColorPicker>\n );\n});\n"],"names":[],"version":3,"file":"ColorPicker.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuCM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YACnD,KAA+B,EAC/B,GAAoC;IAEpC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,YAAI;IAClB,qBACE,gCAAC,CAAA,GAAA,kBAAc,GAAM,
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAu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"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {ColorPicker as AriaColorPicker} from 'react-aria-components/ColorPicker';\n\nimport {AriaLabelingProps, FocusableRef, ValueBase} from '@react-types/shared';\nimport {Button} from 'react-aria-components/Button';\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatch} from './ColorSwatch';\nimport {Content} from '../view/Content';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport React, {ReactNode, useRef} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useId} from 'react-aria/useId';\n\nexport interface SpectrumColorPickerProps\n extends ValueBase<string | Color, Color>, AriaLabelingProps {\n /** A visual label for the color picker. */\n label?: ReactNode;\n /** The contents of the color picker popover, e.g. `<ColorEditor />`. */\n children?: ReactNode;\n /**\n * The size of the color swatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\n/**\n * A ColorPicker combines a swatch with a customizable popover for editing a color.\n */\nexport const ColorPicker = React.forwardRef(function ColorPicker(\n props: SpectrumColorPickerProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let swatchRef = useRef(null);\n let domRef = useFocusableRef(ref);\n let labelId = useId();\n return (\n <AriaColorPicker {...props}>\n {/* oxlint-disable-next-line react/react-compiler */}\n <DialogTrigger type=\"popover\" mobileType=\"tray\" targetRef={unwrapDOMRef(swatchRef)}>\n <Button\n ref={domRef}\n className={style({\n backgroundColor: 'transparent',\n borderStyle: 'none',\n padding: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 'text-to-control',\n outlineStyle: 'none',\n fontFamily: 'sans',\n color: 'body',\n fontSize: {\n size: {\n XS: 'xs',\n S: 'sm',\n M: 'base',\n L: 'lg'\n }\n }\n })({size: props.size || 'M'})}>\n {({isFocusVisible}) => (\n <>\n <div\n className={style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n borderRadius: 'default'\n })({isFocusVisible})}>\n <ColorSwatch\n ref={swatchRef}\n color={props.value}\n size={props.size}\n rounding={props.rounding}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']}\n />\n </div>\n {props.label && <span id={labelId}>{props.label}</span>}\n </>\n )}\n </Button>\n <Dialog\n aria-labelledby={props.label ? labelId : props['aria-labelledby']}\n aria-label={props['aria-label']}\n UNSAFE_style={{\n width: 'fit-content',\n minWidth: 0,\n margin: '0 auto' // Center within tray.\n }}>\n <Content\n UNSAFE_style={{\n position: 'relative',\n margin: 'calc(var(--spectrum-dialog-padding) * -1)',\n padding: 'var(--spectrum-global-dimension-size-200)'\n }}>\n {props.children}\n </Content>\n </Dialog>\n </DialogTrigger>\n </AriaColorPicker>\n );\n});\n"],"names":[],"version":3,"file":"ColorPicker.mjs.map"}
|
|
@@ -87,7 +87,8 @@ const $a6faa7a1d4cc9146$export$cae13e90592f246a = /*#__PURE__*/ (0, $l5TaA$react
|
|
|
87
87
|
})
|
|
88
88
|
});
|
|
89
89
|
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
|
90
|
-
if (ctx)
|
|
90
|
+
if (ctx) // oxlint-disable-next-line react/react-compiler
|
|
91
|
+
return ctx.useWrapper(swatch, color, rounding);
|
|
91
92
|
return swatch;
|
|
92
93
|
});
|
|
93
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,+CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,wDAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,6CAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,KAAK,QAAQ,eAAK,WAAW,KAAK,YAAY,WAAU,GAAG;IAEvE,IAAI,uBACF,0DAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,+CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,wDAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,6CAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,KAAK,QAAQ,eAAK,WAAW,KAAK,YAAY,WAAU,GAAG;IAEvE,IAAI,uBACF,0DAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,gDAAgD;IAChD,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n // oxlint-disable-next-line react/react-compiler\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.cjs.map"}
|
|
@@ -76,7 +76,8 @@ const $471078cf7ddd2506$export$cae13e90592f246a = /*#__PURE__*/ (0, $8Jkvo$forwa
|
|
|
76
76
|
})
|
|
77
77
|
});
|
|
78
78
|
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
|
79
|
-
if (ctx)
|
|
79
|
+
if (ctx) // oxlint-disable-next-line react/react-compiler
|
|
80
|
+
return ctx.useWrapper(swatch, color, rounding);
|
|
80
81
|
return swatch;
|
|
81
82
|
});
|
|
82
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,yBAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,CAAA,gBAAA,0BAAA,IAAK,IAAI,KAAI,eAAK,WAAW,CAAA,gBAAA,0BAAA,IAAK,QAAQ,KAAI,WAAU,GAAG;IAEvE,IAAI,uBACF,gCAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,yBAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,CAAA,gBAAA,0BAAA,IAAK,IAAI,KAAI,eAAK,WAAW,CAAA,gBAAA,0BAAA,IAAK,QAAQ,KAAI,WAAU,GAAG;IAEvE,IAAI,uBACF,gCAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,gDAAgD;IAChD,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n // oxlint-disable-next-line react/react-compiler\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.js.map"}
|
|
@@ -76,7 +76,8 @@ const $dbd0cc077b352deb$export$cae13e90592f246a = /*#__PURE__*/ (0, $kQ1XW$forwa
|
|
|
76
76
|
})
|
|
77
77
|
});
|
|
78
78
|
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
|
79
|
-
if (ctx)
|
|
79
|
+
if (ctx) // oxlint-disable-next-line react/react-compiler
|
|
80
|
+
return ctx.useWrapper(swatch, color, rounding);
|
|
80
81
|
return swatch;
|
|
81
82
|
});
|
|
82
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,yBAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,KAAK,QAAQ,eAAK,WAAW,KAAK,YAAY,WAAU,GAAG;IAEvE,IAAI,uBACF,gCAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAuCM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EACpD;AAMK,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,yBAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,QAAC,OAAO,KAAK,QAAQ,eAAK,WAAW,KAAK,YAAY,WAAU,GAAG;IAEvE,IAAI,uBACF,gCAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YACE,MAAM,eAAe,CAAC,WAAW,IAC7B,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACR;QACA,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBG;kBAAC;sBAAM;QAAQ;;IAKxB,+DAA+D;IAC/D,IAAI,KACF,gDAAgD;IAChD,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\n\nimport {Color} from 'react-stately/Color';\nimport {ColorSwatchContext} from 'react-aria-components/ColorSwatch';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the ColorSwatch.\n *\n * @default 'default'\n */\n rounding?: 'default' | 'none' | 'full';\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<\n SpectrumColorSwatchProps,\n 'size' | 'rounding'\n> {\n useWrapper: (\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n ) => JSX.Element;\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(\n null\n);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n props: SpectrumColorSwatchProps,\n ref: DOMRef<HTMLDivElement>\n): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {size = ctx?.size || 'M', rounding = ctx?.rounding || 'default'} = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background:\n color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n : // Red slash to indicate there is no selected color.\n 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={\n styleProps.className +\n style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})\n }\n />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n // oxlint-disable-next-line react/react-compiler\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0CM,MAAM,0DAAoB,CAAA,GAAA,uBAAS,EAAE,SAAS,kBACnD,KAAqC,EACrC,GAA2B;IAE3B,IAAI,WAAC,UAAU,iBAAW,OAAO,eAAK,WAAW,QAAQ,GAAG,YAAW,GAAG;IAC1E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,6DAAoB;QAClB,GAAG,UAAU;QACd,OAAO,WAAW,KAAK;QACvB,KAAK;QACL,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;UAUG;qBAAC;QAAO;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0CM,MAAM,0DAAoB,CAAA,GAAA,uBAAS,EAAE,SAAS,kBACnD,KAAqC,EACrC,GAA2B;IAE3B,IAAI,WAAC,UAAU,iBAAW,OAAO,eAAK,WAAW,QAAQ,GAAG,YAAW,GAAG;IAC1E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,6DAAoB;QAClB,GAAG,UAAU;QACd,OAAO,WAAW,KAAK;QACvB,KAAK;QACL,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;UAUG;qBAAC;QAAO;qBAGb,0DAAC,CAAA,GAAA,oDAAyB,EAAE,QAAQ;QAAC,OAAO;wBAAC;kBAAY;sBAAM;QAAQ;OACpE,MAAM,QAAQ;AAIvB;AAEA,SAAS,iCACP,MAAoB,EACpB,KAAY,EACZ,QAA8C;IAE9C,qBACE,0DAAC,CAAA,GAAA,iEAAwB;QACvB,OAAO;QACP,WAAW,CAAA,cACT;;;;;;;;;;;;;;;;;;;;;;eAgBG;gBAAC,GAAG,WAAW;0BAAE;YAAQ;OAE7B,CAAC,cAAC,UAAU,EAAC,iBACZ,sHACG,QACA,4BACC,0DAAC;YACC,eAAA;YACA,WAAW;;;;;;;;;;;;;;;;;AAezB","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatchPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {\n ColorSwatchPicker as AriaColorSwatchPicker,\n ColorSwatchPickerItem as AriaColorSwatchPickerItem\n} from 'react-aria-components/ColorSwatchPicker';\n\nimport {Color} from 'react-stately/Color';\nimport {DOMRef, StyleProps, ValueBase} from '@react-types/shared';\nimport React, {forwardRef, ReactElement, ReactNode} from 'react';\nimport {SpectrumColorSwatchContext, SpectrumColorSwatchProps} from './ColorSwatch';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchPickerProps\n extends ValueBase<string | Color, Color>, StyleProps {\n /** The ColorSwatches within the ColorSwatchPicker. */\n children: ReactNode;\n /**\n * The amount of padding between the swatches.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious';\n /**\n * The size of the color swatches.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatches.\n *\n * @default 'none'\n */\n rounding?: 'none' | 'default' | 'full';\n}\n\n/**\n * A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.\n */\nexport const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(\n props: SpectrumColorSwatchPickerProps,\n ref: DOMRef<HTMLDivElement>\n) {\n let {density = 'regular', size = 'M', rounding = 'none', ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n\n return (\n <AriaColorSwatchPicker\n {...otherProps}\n style={styleProps.style}\n ref={domRef}\n className={\n styleProps.className +\n style({\n display: 'flex',\n flexWrap: 'wrap',\n gap: {\n density: {\n compact: 0.5,\n regular: 1,\n spacious: 2\n }\n }\n })({density})\n }>\n {/* oxlint-disable-next-line react/react-compiler */}\n <SpectrumColorSwatchContext.Provider value={{useWrapper, size, rounding}}>\n {props.children}\n </SpectrumColorSwatchContext.Provider>\n </AriaColorSwatchPicker>\n );\n});\n\nfunction useWrapper(\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n) {\n return (\n <AriaColorSwatchPickerItem\n color={color}\n className={renderProps =>\n style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n position: 'relative',\n borderRadius: {\n rounding: {\n none: 'none',\n default: 'default',\n full: 'full'\n }\n }\n })({...renderProps, rounding})\n }>\n {({isSelected}) => (\n <>\n {swatch}\n {isSelected && (\n <div\n aria-hidden\n className={style({\n position: 'absolute',\n pointerEvents: 'none',\n inset: 0,\n boxShadow:\n '[inset 0 0 0 2px var(--spectrum-gray-900), inset 0 0 0 4px var(--spectrum-gray-50)]',\n forcedColorAdjust: 'none',\n borderRadius: '[inherit]'\n })()}\n />\n )}\n </>\n )}\n </AriaColorSwatchPickerItem>\n );\n}\n"],"names":[],"version":3,"file":"ColorSwatchPicker.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0CM,MAAM,0DAAoB,CAAA,GAAA,iBAAS,EAAE,SAAS,kBACnD,KAAqC,EACrC,GAA2B;IAE3B,IAAI,WAAC,UAAU,iBAAW,OAAO,eAAK,WAAW,QAAQ,GAAG,YAAW,GAAG;IAC1E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,wBAAoB;QAClB,GAAG,UAAU;QACd,OAAO,WAAW,KAAK;QACvB,KAAK;QACL,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;UAUG;qBAAC;QAAO;
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0CM,MAAM,0DAAoB,CAAA,GAAA,iBAAS,EAAE,SAAS,kBACnD,KAAqC,EACrC,GAA2B;IAE3B,IAAI,WAAC,UAAU,iBAAW,OAAO,eAAK,WAAW,QAAQ,GAAG,YAAW,GAAG;IAC1E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,wBAAoB;QAClB,GAAG,UAAU;QACd,OAAO,WAAW,KAAK;QACvB,KAAK;QACL,WACE,WAAW,SAAS,GACpB;;;;;;;;;;;UAUG;qBAAC;QAAO;qBAGb,gCAAC,CAAA,GAAA,yCAAyB,EAAE,QAAQ;QAAC,OAAO;wBAAC;kBAAY;sBAAM;QAAQ;OACpE,MAAM,QAAQ;AAIvB;AAEA,SAAS,iCACP,MAAoB,EACpB,KAAY,EACZ,QAA8C;IAE9C,qBACE,gCAAC,CAAA,GAAA,4BAAwB;QACvB,OAAO;QACP,WAAW,CAAA,cACT;;;;;;;;;;;;;;;;;;;;;;eAgBG;gBAAC,GAAG,WAAW;0BAAE;YAAQ;OAE7B,CAAC,cAAC,UAAU,EAAC,iBACZ,kEACG,QACA,4BACC,gCAAC;YACC,eAAA;YACA,WAAW;;;;;;;;;;;;;;;;;AAezB","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatchPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {\n ColorSwatchPicker as AriaColorSwatchPicker,\n ColorSwatchPickerItem as AriaColorSwatchPickerItem\n} from 'react-aria-components/ColorSwatchPicker';\n\nimport {Color} from 'react-stately/Color';\nimport {DOMRef, StyleProps, ValueBase} from '@react-types/shared';\nimport React, {forwardRef, ReactElement, ReactNode} from 'react';\nimport {SpectrumColorSwatchContext, SpectrumColorSwatchProps} from './ColorSwatch';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchPickerProps\n extends ValueBase<string | Color, Color>, StyleProps {\n /** The ColorSwatches within the ColorSwatchPicker. */\n children: ReactNode;\n /**\n * The amount of padding between the swatches.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious';\n /**\n * The size of the color swatches.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatches.\n *\n * @default 'none'\n */\n rounding?: 'none' | 'default' | 'full';\n}\n\n/**\n * A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.\n */\nexport const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(\n props: SpectrumColorSwatchPickerProps,\n ref: DOMRef<HTMLDivElement>\n) {\n let {density = 'regular', size = 'M', rounding = 'none', ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n\n return (\n <AriaColorSwatchPicker\n {...otherProps}\n style={styleProps.style}\n ref={domRef}\n className={\n styleProps.className +\n style({\n display: 'flex',\n flexWrap: 'wrap',\n gap: {\n density: {\n compact: 0.5,\n regular: 1,\n spacious: 2\n }\n }\n })({density})\n }>\n {/* oxlint-disable-next-line react/react-compiler */}\n <SpectrumColorSwatchContext.Provider value={{useWrapper, size, rounding}}>\n {props.children}\n </SpectrumColorSwatchContext.Provider>\n </AriaColorSwatchPicker>\n );\n});\n\nfunction useWrapper(\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n) {\n return (\n <AriaColorSwatchPickerItem\n color={color}\n className={renderProps =>\n style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n position: 'relative',\n borderRadius: {\n rounding: {\n none: 'none',\n default: 'default',\n full: 'full'\n }\n }\n })({...renderProps, rounding})\n }>\n {({isSelected}) => (\n <>\n {swatch}\n {isSelected && (\n <div\n aria-hidden\n className={style({\n position: 'absolute',\n pointerEvents: 'none',\n inset: 0,\n boxShadow:\n '[inset 0 0 0 2px var(--spectrum-gray-900), inset 0 0 0 4px var(--spectrum-gray-50)]',\n forcedColorAdjust: 'none',\n borderRadius: '[in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IAE9C,qBACE,gCAAC,CAAA,GAAA,4BAAwB;QACvB,OAAO;QACP,WAAW,CAAA,cACT;;;;;;;;;;;;;;;;;;;;;;eAgBG;gBAAC,GAAG,WAAW;0BAAE;YAAQ;OAE7B,CAAC,cAAC,UAAU,EAAC,iBACZ,kEACG,QACA,4BACC,gCAAC;YACC,eAAA;YACA,WAAW;;;;;;;;;;;;;;;;;AAezB","sources":["packages/@adobe/react-spectrum/src/color/ColorSwatchPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {\n ColorSwatchPicker as AriaColorSwatchPicker,\n ColorSwatchPickerItem as AriaColorSwatchPickerItem\n} from 'react-aria-components/ColorSwatchPicker';\n\nimport {Color} from 'react-stately/Color';\nimport {DOMRef, StyleProps, ValueBase} from '@react-types/shared';\nimport React, {forwardRef, ReactElement, ReactNode} from 'react';\nimport {SpectrumColorSwatchContext, SpectrumColorSwatchProps} from './ColorSwatch';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumColorSwatchPickerProps\n extends ValueBase<string | Color, Color>, StyleProps {\n /** The ColorSwatches within the ColorSwatchPicker. */\n children: ReactNode;\n /**\n * The amount of padding between the swatches.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious';\n /**\n * The size of the color swatches.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L';\n /**\n * The corner rounding of the color swatches.\n *\n * @default 'none'\n */\n rounding?: 'none' | 'default' | 'full';\n}\n\n/**\n * A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.\n */\nexport const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(\n props: SpectrumColorSwatchPickerProps,\n ref: DOMRef<HTMLDivElement>\n) {\n let {density = 'regular', size = 'M', rounding = 'none', ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n\n return (\n <AriaColorSwatchPicker\n {...otherProps}\n style={styleProps.style}\n ref={domRef}\n className={\n styleProps.className +\n style({\n display: 'flex',\n flexWrap: 'wrap',\n gap: {\n density: {\n compact: 0.5,\n regular: 1,\n spacious: 2\n }\n }\n })({density})\n }>\n {/* oxlint-disable-next-line react/react-compiler */}\n <SpectrumColorSwatchContext.Provider value={{useWrapper, size, rounding}}>\n {props.children}\n </SpectrumColorSwatchContext.Provider>\n </AriaColorSwatchPicker>\n );\n});\n\nfunction useWrapper(\n swatch: ReactElement,\n color: Color,\n rounding: SpectrumColorSwatchProps['rounding']\n) {\n return (\n <AriaColorSwatchPickerItem\n color={color}\n className={renderProps =>\n style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n position: 'relative',\n borderRadius: {\n rounding: {\n none: 'none',\n default: 'default',\n full: 'full'\n }\n }\n })({...renderProps, rounding})\n }>\n {({isSelected}) => (\n <>\n {swatch}\n {isSelected && (\n <div\n aria-hidden\n className={style({\n position: 'absolute',\n pointerEvents: 'none',\n inset: 0,\n boxShadow:\n '[inset 0 0 0 2px var(--spectrum-gray-900), inset 0 0 0 4px var(--spectrum-gray-50)]',\n forcedColorAdjust: 'none',\n borderRadius: '[inherit]'\n })()}\n />\n )}\n </>\n )}\n </AriaColorSwatchPickerItem>\n );\n}\n"],"names":[],"version":3,"file":"ColorSwatchPicker.mjs.map"}
|
|
@@ -59,6 +59,7 @@ const $488ea514274761b9$export$f80663f808113381 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
59
59
|
let { styleProps: styleProps } = (0, $b8f90d51c4908137$exports.useStyleProps)(props);
|
|
60
60
|
let [wheelRadius, setWheelRadius] = (0, $eKF6D$react.useState)(0);
|
|
61
61
|
let [wheelThickness, setWheelThickness] = (0, $eKF6D$react.useState)($488ea514274761b9$var$WHEEL_THICKNESS);
|
|
62
|
+
// oxlint-disable-next-line react/react-compiler
|
|
62
63
|
let resizeHandler = (0, $eKF6D$react.useCallback)(()=>{
|
|
63
64
|
if (containerRef.current) {
|
|
64
65
|
setWheelRadius(containerRef.current.offsetWidth / 2);
|