@react-spectrum/s2 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.cjs +3 -3
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +3 -3
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionBar.cjs +62 -61
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +58 -58
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +62 -61
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +234 -234
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +160 -160
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +234 -234
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +16 -16
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +16 -16
- package/dist/Add.cjs +10 -10
- package/dist/Add.css +6 -6
- package/dist/Add.mjs +10 -10
- package/dist/AlertDialog.cjs +3 -3
- package/dist/AlertDialog.css +3 -3
- package/dist/AlertDialog.mjs +3 -3
- package/dist/Asterisk.cjs +6 -6
- package/dist/Asterisk.css +4 -4
- package/dist/Asterisk.mjs +6 -6
- package/dist/Avatar.cjs +17 -17
- package/dist/Avatar.css +16 -16
- package/dist/Avatar.mjs +17 -17
- package/dist/AvatarGroup.cjs +121 -121
- package/dist/AvatarGroup.css +31 -31
- package/dist/AvatarGroup.mjs +121 -121
- package/dist/Badge.cjs +197 -197
- package/dist/Badge.css +125 -125
- package/dist/Badge.mjs +197 -197
- package/dist/Breadcrumbs.cjs +235 -235
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +100 -100
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +235 -235
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +333 -333
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +174 -174
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +333 -333
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +21 -21
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +21 -21
- package/dist/Calendar.cjs +169 -169
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +169 -169
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +310 -310
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +206 -206
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +310 -310
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +19 -19
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +17 -17
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +19 -19
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +162 -162
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +95 -91
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +162 -162
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +44 -44
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css +37 -37
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +44 -44
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/Checkmark.cjs +12 -12
- package/dist/Checkmark.css +8 -8
- package/dist/Checkmark.mjs +12 -12
- package/dist/Chevron.cjs +12 -12
- package/dist/Chevron.css +10 -10
- package/dist/Chevron.mjs +12 -12
- package/dist/ClearButton.cjs +30 -30
- package/dist/ClearButton.css +30 -30
- package/dist/ClearButton.mjs +30 -30
- package/dist/CloseButton.cjs +56 -56
- package/dist/CloseButton.css +47 -47
- package/dist/CloseButton.mjs +56 -56
- package/dist/ColorArea.cjs +17 -17
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +17 -17
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +32 -32
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +27 -27
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +32 -32
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +42 -42
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +109 -109
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +52 -52
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +109 -109
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +30 -30
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +30 -30
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +30 -30
- package/dist/ColorSwatchPicker.css +48 -48
- package/dist/ColorSwatchPicker.mjs +30 -30
- package/dist/ColorWheel.cjs +31 -27
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs +31 -27
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/ComboBox.cjs +383 -383
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +187 -187
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +383 -383
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +50 -50
- package/dist/ContextualHelp.mjs +5 -5
- package/dist/Cross.cjs +14 -14
- package/dist/Cross.css +10 -10
- package/dist/Cross.mjs +14 -14
- package/dist/CustomDialog.cjs +26 -26
- package/dist/CustomDialog.cjs.map +1 -1
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.css.map +1 -1
- package/dist/CustomDialog.mjs +26 -26
- package/dist/CustomDialog.mjs.map +1 -1
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/DateField.cjs +74 -74
- package/dist/DateField.cjs.map +1 -1
- package/dist/DateField.css +77 -77
- package/dist/DateField.css.map +1 -1
- package/dist/DateField.mjs +74 -74
- package/dist/DateField.mjs.map +1 -1
- package/dist/DatePicker.cjs +173 -173
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +128 -128
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +173 -173
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +56 -56
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +59 -59
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +56 -56
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css +70 -70
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +17 -17
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +120 -120
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +112 -112
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +120 -120
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +26 -26
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css +25 -25
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs +26 -26
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs +62 -62
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +57 -57
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +62 -62
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +348 -348
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +147 -147
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +348 -348
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +10 -10
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css +9 -9
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs +10 -10
- package/dist/Form.mjs.map +1 -1
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css +78 -78
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +229 -229
- package/dist/IllustratedMessage.css +72 -72
- package/dist/IllustratedMessage.mjs +229 -229
- package/dist/Image.cjs +14 -14
- package/dist/Image.css +14 -14
- package/dist/Image.mjs +14 -14
- package/dist/InlineAlert.cjs +101 -101
- package/dist/InlineAlert.css +76 -76
- package/dist/InlineAlert.mjs +101 -101
- package/dist/Link.cjs +50 -50
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css +41 -41
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs +50 -50
- package/dist/Link.mjs.map +1 -1
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +446 -443
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +184 -184
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +446 -443
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +154 -154
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +91 -91
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +154 -154
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +66 -66
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +54 -54
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +66 -66
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +57 -57
- package/dist/NotificationBadge.css +49 -49
- package/dist/NotificationBadge.mjs +57 -57
- package/dist/NumberField.cjs +115 -115
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +99 -99
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +115 -115
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +275 -275
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +173 -173
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +275 -275
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +89 -89
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +70 -70
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +89 -89
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +164 -164
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +99 -99
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +164 -164
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.css +10 -10
- package/dist/Provider.mjs +11 -11
- package/dist/Radio.cjs +146 -146
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +78 -78
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +146 -146
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +42 -42
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css +37 -37
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +42 -42
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/RangeCalendar.cjs +8 -8
- package/dist/RangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar.css +10 -10
- package/dist/RangeCalendar.css.map +1 -1
- package/dist/RangeCalendar.mjs +8 -8
- package/dist/RangeCalendar.mjs.map +1 -1
- package/dist/SearchField.cjs +42 -42
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +45 -45
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +42 -42
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +180 -180
- package/dist/SegmentedControl.css +123 -123
- package/dist/SegmentedControl.mjs +180 -180
- package/dist/SelectBoxGroup.cjs +144 -144
- package/dist/SelectBoxGroup.cjs.map +1 -1
- package/dist/SelectBoxGroup.css +120 -120
- package/dist/SelectBoxGroup.css.map +1 -1
- package/dist/SelectBoxGroup.mjs +144 -144
- package/dist/SelectBoxGroup.mjs.map +1 -1
- package/dist/Slider.cjs +295 -295
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +154 -154
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +295 -295
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +116 -116
- package/dist/StatusLight.css +59 -59
- package/dist/StatusLight.mjs +116 -116
- package/dist/Switch.cjs +155 -155
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +74 -74
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +155 -155
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +415 -415
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +199 -199
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +416 -416
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +127 -127
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +105 -105
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +127 -127
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +127 -127
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +108 -108
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +127 -127
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +204 -204
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +146 -146
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +204 -204
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +59 -59
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +54 -54
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +59 -59
- package/dist/TextField.mjs.map +1 -1
- package/dist/TimeField.cjs +52 -52
- package/dist/TimeField.cjs.map +1 -1
- package/dist/TimeField.css +47 -47
- package/dist/TimeField.css.map +1 -1
- package/dist/TimeField.mjs +52 -52
- package/dist/TimeField.mjs.map +1 -1
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.cjs.map +1 -1
- package/dist/Toast.css +110 -110
- package/dist/Toast.css.map +1 -1
- package/dist/Toast.mjs +120 -120
- package/dist/Toast.mjs.map +1 -1
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +3 -3
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs.map +1 -1
- package/dist/ToggleButtonGroup.mjs.map +1 -1
- package/dist/Tooltip.cjs +78 -78
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +65 -65
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +78 -78
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +144 -128
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +131 -127
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +144 -128
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +68 -72
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs +12 -12
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +12 -12
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.mjs +2 -2
- package/icons/Skeleton.mjs.map +1 -1
- package/icons/runtime.cjs +16 -3
- package/icons/runtime.cjs.map +1 -1
- package/icons/runtime.mjs +16 -3
- package/icons/runtime.mjs.map +1 -1
- package/package.json +21 -21
- package/src/Accordion.tsx +1 -1
- package/src/ActionBar.tsx +2 -2
- package/src/ActionButton.tsx +1 -1
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +2 -2
- package/src/Calendar.tsx +1 -1
- package/src/Card.tsx +1 -1
- package/src/CardView.tsx +1 -1
- package/src/Checkbox.tsx +2 -1
- package/src/CheckboxGroup.tsx +1 -1
- package/src/CoachMark.tsx +1 -1
- package/src/ColorArea.tsx +1 -1
- package/src/ColorField.tsx +1 -1
- package/src/ColorSlider.tsx +1 -1
- package/src/ColorSwatch.tsx +1 -1
- package/src/ColorWheel.tsx +2 -2
- package/src/ComboBox.tsx +2 -2
- package/src/CustomDialog.tsx +1 -1
- package/src/DateField.tsx +1 -1
- package/src/DatePicker.tsx +1 -1
- package/src/DateRangePicker.tsx +1 -1
- package/src/Dialog.tsx +1 -1
- package/src/Disclosure.tsx +2 -2
- package/src/Divider.tsx +1 -1
- package/src/DropZone.tsx +1 -1
- package/src/Field.tsx +3 -3
- package/src/Form.tsx +1 -1
- package/src/FullscreenDialog.tsx +1 -1
- package/src/Link.tsx +1 -1
- package/src/Menu.tsx +11 -13
- package/src/Meter.tsx +1 -1
- package/src/Modal.tsx +1 -1
- package/src/NumberField.tsx +1 -1
- package/src/Picker.tsx +3 -3
- package/src/Popover.tsx +2 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/ProgressCircle.tsx +1 -1
- package/src/Radio.tsx +1 -1
- package/src/RadioGroup.tsx +1 -1
- package/src/RangeCalendar.tsx +1 -1
- package/src/SearchField.tsx +1 -1
- package/src/SelectBoxGroup.tsx +1 -1
- package/src/Slider.tsx +1 -1
- package/src/Switch.tsx +1 -1
- package/src/TableView.tsx +9 -9
- package/src/Tabs.tsx +4 -4
- package/src/TabsPicker.tsx +2 -2
- package/src/TagGroup.tsx +2 -2
- package/src/TextField.tsx +1 -1
- package/src/TimeField.tsx +1 -1
- package/src/Toast.tsx +1 -1
- package/src/ToggleButton.tsx +1 -1
- package/src/ToggleButtonGroup.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/TreeView.tsx +10 -6
- package/style/__tests__/mergeStyles.test.ts +68 -0
- package/style/__tests__/style-macro.test.js +79 -59
- package/style/dist/style-macro.cjs +65 -14
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +65 -14
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/runtime.ts +21 -5
- package/style/style-macro.ts +81 -16
- package/style/__tests__/mergeStyles.test.js +0 -32
package/dist/TextField.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AC6EqB;EAAA;;;;EA6Ce;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqEnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AArEmB;EAAA;;;;EAqEnB;;;;;AAAA;;AAAA;EAAA;IAAA","sources":["b5f6eedb906c59d7","packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["@import \"ab36e6acf2667a8b\";\n@import \"67d58da798418a3e\";\n@import \"83cde29013713f83\";\n","/*\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 TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n InputProps,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, controlSize, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {GlobalDOMAttributes, HelpTextProps, RefObject, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps, Pick<InputProps, 'placeholder'> {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<Partial<TextFieldProps>, TextFieldRef>>(null);\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nexport const TextField = forwardRef(function TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </TextFieldBase>\n );\n});\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<Partial<TextAreaProps>, TextFieldRef<HTMLTextAreaElement>>>(null);\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </TextFieldBase>\n );\n});\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n});\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n let {placeholder} = useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n let {ref} = useSlottedContext(InputContext) ?? {};\n\n return (\n <AriaTextArea\n ref={mergeRefs(onHeightChange, ref as RefObject<HTMLTextAreaElement | null>)}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder={placeholder ?? ' '}\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: controlSize(),\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: {\n default: 'inherit',\n '::placeholder': {\n default: 'gray-600',\n forcedColors: 'GrayText'\n }\n },\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.css.map"}
|
|
1
|
+
{"mappings":"AC6EqB;EAAA;;;;EA6Ce;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqEnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AArEmB;EAAA;;;;EAqEnB;;;;;AAAA;;AAAA;EAAA;IAAA","sources":["b5f6eedb906c59d7","packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["@import \"ab36e6acf2667a8b\";\n@import \"67d58da798418a3e\";\n@import \"83cde29013713f83\";\n","/*\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 TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n InputProps,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, controlSize, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {GlobalDOMAttributes, HelpTextProps, RefObject, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps, Pick<InputProps, 'placeholder'> {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<Partial<TextFieldProps>, TextFieldRef>>(null);\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nexport const TextField = forwardRef(function TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </TextFieldBase>\n );\n});\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<Partial<TextAreaProps>, TextFieldRef<HTMLTextAreaElement>>>(null);\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </TextFieldBase>\n );\n});\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n});\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n let {placeholder} = useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n let {ref} = useSlottedContext(InputContext) ?? {};\n\n return (\n <AriaTextArea\n ref={mergeRefs(onHeightChange, ref as RefObject<HTMLTextAreaElement | null>)}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder={placeholder ?? ' '}\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: controlSize(),\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: {\n default: 'inherit',\n '::placeholder': {\n default: 'gray-600',\n forcedColors: 'GrayText'\n }\n },\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.css.map"}
|
package/dist/TextField.mjs
CHANGED
|
@@ -41,7 +41,7 @@ const $d946f50010ba937f$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $fsr8S$forwa
|
|
|
41
41
|
return /*#__PURE__*/ (0, $fsr8S$jsx)($d946f50010ba937f$export$d22444a338b6e3c2, {
|
|
42
42
|
...props,
|
|
43
43
|
ref: ref,
|
|
44
|
-
fieldGroupCss: "
|
|
44
|
+
fieldGroupCss: " ea11 Fd11",
|
|
45
45
|
children: /*#__PURE__*/ (0, $fsr8S$jsx)($d946f50010ba937f$var$TextAreaInput, {})
|
|
46
46
|
});
|
|
47
47
|
});
|
|
@@ -69,57 +69,57 @@ const $d946f50010ba937f$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $fsr8S$forwa
|
|
|
69
69
|
let rules = " ";
|
|
70
70
|
let gridColumnStart = false;
|
|
71
71
|
let gridColumnEnd = false;
|
|
72
|
-
let matches = (overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
|
|
72
|
+
let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
|
|
73
73
|
for (let p of matches){
|
|
74
74
|
if (p[1] === "z") gridColumnStart = true;
|
|
75
75
|
if (p[1] === "y") gridColumnEnd = true;
|
|
76
76
|
rules += p[0];
|
|
77
77
|
}
|
|
78
|
-
rules += '
|
|
78
|
+
rules += ' se11';
|
|
79
79
|
if (props.isInForm) {
|
|
80
|
-
if (!gridColumnStart) rules += '
|
|
80
|
+
if (!gridColumnStart) rules += ' z2mU11';
|
|
81
81
|
}
|
|
82
82
|
if (props.isInForm) {
|
|
83
83
|
if (props.labelPosition === "side") {
|
|
84
|
-
if (!gridColumnEnd) rules += '
|
|
84
|
+
if (!gridColumnEnd) rules += ' yvoofG11';
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
if (props.isInForm) rules += '
|
|
87
|
+
if (props.isInForm) rules += ' DLwlgod11';
|
|
88
88
|
else {
|
|
89
|
-
if (props.labelPosition === "side") rules += '
|
|
90
|
-
else if (props.labelPosition === "top") rules += '
|
|
89
|
+
if (props.labelPosition === "side") rules += ' DPlN5qb11';
|
|
90
|
+
else if (props.labelPosition === "top") rules += ' DM8Mfn11';
|
|
91
91
|
}
|
|
92
|
-
if (props.labelPosition === "side") rules += '
|
|
93
|
-
else if (props.labelPosition === "top") rules += '
|
|
94
|
-
if (props.labelPosition === "side") rules += '
|
|
95
|
-
else if (props.labelPosition === "top") rules += '
|
|
92
|
+
if (props.labelPosition === "side") rules += ' EPlN5qb11';
|
|
93
|
+
else if (props.labelPosition === "top") rules += ' E4w1sLc11';
|
|
94
|
+
if (props.labelPosition === "side") rules += ' CbRM95c11';
|
|
95
|
+
else if (props.labelPosition === "top") rules += ' Cxaocre11';
|
|
96
96
|
if (props.size === "XL") {
|
|
97
|
-
rules += ' -_6BNtrc-
|
|
98
|
-
rules += '
|
|
97
|
+
rules += ' -_6BNtrc-e11';
|
|
98
|
+
rules += ' vx11';
|
|
99
99
|
} else if (props.size === "L") {
|
|
100
|
-
rules += ' -_6BNtrc-
|
|
101
|
-
rules += '
|
|
100
|
+
rules += ' -_6BNtrc-d11';
|
|
101
|
+
rules += ' vx11';
|
|
102
102
|
} else if (props.size === "S") {
|
|
103
|
-
rules += ' -_6BNtrc-
|
|
104
|
-
rules += '
|
|
103
|
+
rules += ' -_6BNtrc-b11';
|
|
104
|
+
rules += ' vx11';
|
|
105
105
|
} else if (props.size === "XS") {
|
|
106
|
-
rules += ' -_6BNtrc-
|
|
107
|
-
rules += '
|
|
106
|
+
rules += ' -_6BNtrc-a11';
|
|
107
|
+
rules += ' vx11';
|
|
108
108
|
} else {
|
|
109
|
-
rules += ' -_6BNtrc-
|
|
110
|
-
rules += '
|
|
109
|
+
rules += ' -_6BNtrc-c11';
|
|
110
|
+
rules += ' vx11';
|
|
111
111
|
}
|
|
112
|
-
rules += '
|
|
113
|
-
rules += '
|
|
114
|
-
rules += '
|
|
115
|
-
if (props.size === "XL") rules += ' -BhX7R-
|
|
116
|
-
else if (props.size === "L") rules += ' -BhX7R-
|
|
117
|
-
else if (props.size === "S") rules += ' -BhX7R-
|
|
118
|
-
else if (props.size === "XS") rules += ' -BhX7R-
|
|
119
|
-
else rules += ' -BhX7R-
|
|
120
|
-
rules += ' -AJjOLd-
|
|
121
|
-
rules += '
|
|
122
|
-
rules += '
|
|
112
|
+
rules += ' ea11';
|
|
113
|
+
rules += ' _Fd11';
|
|
114
|
+
rules += ' _FnuYUweb11';
|
|
115
|
+
if (props.size === "XL") rules += ' -BhX7R-Fz11';
|
|
116
|
+
else if (props.size === "L") rules += ' -BhX7R-Fv11';
|
|
117
|
+
else if (props.size === "S") rules += ' -BhX7R-Fp11';
|
|
118
|
+
else if (props.size === "XS") rules += ' -BhX7R-Fn11';
|
|
119
|
+
else rules += ' -BhX7R-Fx11';
|
|
120
|
+
rules += ' -AJjOLd-UVkF0Db11';
|
|
121
|
+
rules += ' qg11';
|
|
122
|
+
rules += ' __ca11';
|
|
123
123
|
return rules;
|
|
124
124
|
}({
|
|
125
125
|
size: props.size,
|
|
@@ -196,32 +196,32 @@ function $d946f50010ba937f$var$TextAreaInput() {
|
|
|
196
196
|
placeholder: placeholder ?? ' ',
|
|
197
197
|
className: function anonymous(props) {
|
|
198
198
|
let rules = " ";
|
|
199
|
-
rules += '
|
|
200
|
-
rules += '
|
|
201
|
-
rules += '
|
|
202
|
-
rules += '
|
|
203
|
-
rules += '
|
|
204
|
-
rules += '
|
|
205
|
-
rules += '
|
|
206
|
-
rules += '
|
|
207
|
-
rules += '
|
|
208
|
-
rules += '
|
|
209
|
-
rules += '
|
|
210
|
-
rules += '
|
|
211
|
-
rules += '
|
|
212
|
-
rules += '
|
|
213
|
-
rules += '
|
|
214
|
-
rules += '
|
|
215
|
-
rules += '
|
|
216
|
-
rules += '
|
|
217
|
-
rules += '
|
|
218
|
-
rules += '
|
|
219
|
-
rules += '
|
|
220
|
-
if (props.size === "XL") rules += ' -M_-
|
|
221
|
-
else if (props.size === "L") rules += ' -M_-
|
|
222
|
-
else if (props.size === "S") rules += ' -M_-
|
|
223
|
-
else if (props.size === "XS") rules += ' -M_-
|
|
224
|
-
else rules += ' -M_-
|
|
199
|
+
rules += ' Sd11';
|
|
200
|
+
rules += ' Rd11';
|
|
201
|
+
rules += ' Tu7Fubd11';
|
|
202
|
+
rules += ' Qu7Fubd11';
|
|
203
|
+
rules += ' MAyFGYc11';
|
|
204
|
+
rules += ' _oa11';
|
|
205
|
+
rules += ' g911';
|
|
206
|
+
rules += ' p40ub4c11';
|
|
207
|
+
rules += ' pYFIK2bn11';
|
|
208
|
+
rules += ' pYFIK2blc11';
|
|
209
|
+
rules += ' u40ub4c11';
|
|
210
|
+
rules += ' v40ub4c11';
|
|
211
|
+
rules += ' x40ub4c11';
|
|
212
|
+
rules += ' _xa11';
|
|
213
|
+
rules += ' _F40ub4c11';
|
|
214
|
+
rules += ' _ub11';
|
|
215
|
+
rules += ' Na11';
|
|
216
|
+
rules += ' _Le11';
|
|
217
|
+
rules += ' _je11';
|
|
218
|
+
rules += ' _Qc11';
|
|
219
|
+
rules += ' _Nc11';
|
|
220
|
+
if (props.size === "XL") rules += ' -M_-Mk11';
|
|
221
|
+
else if (props.size === "L") rules += ' -M_-Mh11';
|
|
222
|
+
else if (props.size === "S") rules += ' -M_-Mg11';
|
|
223
|
+
else if (props.size === "XS") rules += ' -M_-Mf11';
|
|
224
|
+
else rules += ' -M_-Mi11';
|
|
225
225
|
return rules;
|
|
226
226
|
}
|
|
227
227
|
});
|
package/dist/TextField.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"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","sources":["packages/@react-spectrum/s2/src/TextField.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 TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n InputProps,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, controlSize, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {GlobalDOMAttributes, HelpTextProps, RefObject, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps, Pick<InputProps, 'placeholder'> {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<Partial<TextFieldProps>, TextFieldRef>>(null);\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nexport const TextField = forwardRef(function TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </TextFieldBase>\n );\n});\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<Partial<TextAreaProps>, TextFieldRef<HTMLTextAreaElement>>>(null);\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </TextFieldBase>\n );\n});\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n});\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n let {placeholder} = useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n let {ref} = useSlottedContext(InputContext) ?? {};\n\n return (\n <AriaTextArea\n ref={mergeRefs(onHeightChange, ref as RefObject<HTMLTextAreaElement | null>)}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder={placeholder ?? ' '}\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: controlSize(),\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: {\n default: 'inherit',\n '::placeholder': {\n default: 'gray-600',\n forcedColors: 'GrayText'\n }\n },\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.mjs.map"}
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-spectrum/s2/src/TextField.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 TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n InputProps,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, controlSize, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {GlobalDOMAttributes, HelpTextProps, RefObject, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps, Pick<InputProps, 'placeholder'> {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<Partial<TextFieldProps>, TextFieldRef>>(null);\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nexport const TextField = forwardRef(function TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </TextFieldBase>\n );\n});\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<Partial<TextAreaProps>, TextFieldRef<HTMLTextAreaElement>>>(null);\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </TextFieldBase>\n );\n});\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n});\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n let {placeholder} = useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n let {ref} = useSlottedContext(InputContext) ?? {};\n\n return (\n <AriaTextArea\n ref={mergeRefs(onHeightChange, ref as RefObject<HTMLTextAreaElement | null>)}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder={placeholder ?? ' '}\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: controlSize(),\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: {\n default: 'inherit',\n '::placeholder': {\n default: 'gray-600',\n forcedColors: 'GrayText'\n }\n },\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.mjs.map"}
|
package/dist/TimeField.cjs
CHANGED
|
@@ -43,57 +43,57 @@ const $7b93ad26130ad3f8$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $gqnnu$react
|
|
|
43
43
|
let rules = " ";
|
|
44
44
|
let gridColumnStart = false;
|
|
45
45
|
let gridColumnEnd = false;
|
|
46
|
-
let matches = (overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
|
|
46
|
+
let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
|
|
47
47
|
for (let p of matches){
|
|
48
48
|
if (p[1] === "z") gridColumnStart = true;
|
|
49
49
|
if (p[1] === "y") gridColumnEnd = true;
|
|
50
50
|
rules += p[0];
|
|
51
51
|
}
|
|
52
|
-
rules += '
|
|
52
|
+
rules += ' se11';
|
|
53
53
|
if (props.isInForm) {
|
|
54
|
-
if (!gridColumnStart) rules += '
|
|
54
|
+
if (!gridColumnStart) rules += ' z2mU11';
|
|
55
55
|
}
|
|
56
56
|
if (props.isInForm) {
|
|
57
57
|
if (props.labelPosition === "side") {
|
|
58
|
-
if (!gridColumnEnd) rules += '
|
|
58
|
+
if (!gridColumnEnd) rules += ' yvoofG11';
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
if (props.isInForm) rules += '
|
|
61
|
+
if (props.isInForm) rules += ' DLwlgod11';
|
|
62
62
|
else {
|
|
63
|
-
if (props.labelPosition === "side") rules += '
|
|
64
|
-
else if (props.labelPosition === "top") rules += '
|
|
63
|
+
if (props.labelPosition === "side") rules += ' DPlN5qb11';
|
|
64
|
+
else if (props.labelPosition === "top") rules += ' DM8Mfn11';
|
|
65
65
|
}
|
|
66
|
-
if (props.labelPosition === "side") rules += '
|
|
67
|
-
else if (props.labelPosition === "top") rules += '
|
|
68
|
-
if (props.labelPosition === "side") rules += '
|
|
69
|
-
else if (props.labelPosition === "top") rules += '
|
|
66
|
+
if (props.labelPosition === "side") rules += ' EPlN5qb11';
|
|
67
|
+
else if (props.labelPosition === "top") rules += ' E4w1sLc11';
|
|
68
|
+
if (props.labelPosition === "side") rules += ' CbRM95c11';
|
|
69
|
+
else if (props.labelPosition === "top") rules += ' Cxaocre11';
|
|
70
70
|
if (props.size === "XL") {
|
|
71
|
-
rules += ' -_6BNtrc-
|
|
72
|
-
rules += '
|
|
71
|
+
rules += ' -_6BNtrc-e11';
|
|
72
|
+
rules += ' vx11';
|
|
73
73
|
} else if (props.size === "L") {
|
|
74
|
-
rules += ' -_6BNtrc-
|
|
75
|
-
rules += '
|
|
74
|
+
rules += ' -_6BNtrc-d11';
|
|
75
|
+
rules += ' vx11';
|
|
76
76
|
} else if (props.size === "S") {
|
|
77
|
-
rules += ' -_6BNtrc-
|
|
78
|
-
rules += '
|
|
77
|
+
rules += ' -_6BNtrc-b11';
|
|
78
|
+
rules += ' vx11';
|
|
79
79
|
} else if (props.size === "XS") {
|
|
80
|
-
rules += ' -_6BNtrc-
|
|
81
|
-
rules += '
|
|
80
|
+
rules += ' -_6BNtrc-a11';
|
|
81
|
+
rules += ' vx11';
|
|
82
82
|
} else {
|
|
83
|
-
rules += ' -_6BNtrc-
|
|
84
|
-
rules += '
|
|
83
|
+
rules += ' -_6BNtrc-c11';
|
|
84
|
+
rules += ' vx11';
|
|
85
85
|
}
|
|
86
|
-
rules += '
|
|
87
|
-
rules += '
|
|
88
|
-
rules += '
|
|
89
|
-
if (props.size === "XL") rules += ' -BhX7R-
|
|
90
|
-
else if (props.size === "L") rules += ' -BhX7R-
|
|
91
|
-
else if (props.size === "S") rules += ' -BhX7R-
|
|
92
|
-
else if (props.size === "XS") rules += ' -BhX7R-
|
|
93
|
-
else rules += ' -BhX7R-
|
|
94
|
-
rules += ' -AJjOLd-
|
|
95
|
-
rules += '
|
|
96
|
-
rules += '
|
|
86
|
+
rules += ' ea11';
|
|
87
|
+
rules += ' _Fd11';
|
|
88
|
+
rules += ' _FnuYUweb11';
|
|
89
|
+
if (props.size === "XL") rules += ' -BhX7R-Fz11';
|
|
90
|
+
else if (props.size === "L") rules += ' -BhX7R-Fv11';
|
|
91
|
+
else if (props.size === "S") rules += ' -BhX7R-Fp11';
|
|
92
|
+
else if (props.size === "XS") rules += ' -BhX7R-Fn11';
|
|
93
|
+
else rules += ' -BhX7R-Fx11';
|
|
94
|
+
rules += ' -AJjOLd-UVkF0Db11';
|
|
95
|
+
rules += ' qg11';
|
|
96
|
+
rules += ' __ca11';
|
|
97
97
|
return rules;
|
|
98
98
|
}({
|
|
99
99
|
isInForm: !!formContext,
|
|
@@ -120,26 +120,26 @@ const $7b93ad26130ad3f8$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $gqnnu$react
|
|
|
120
120
|
size: size,
|
|
121
121
|
styles: function anonymous(props) {
|
|
122
122
|
let rules = " ";
|
|
123
|
-
rules += '
|
|
124
|
-
rules += '
|
|
125
|
-
rules += '
|
|
126
|
-
rules += '
|
|
127
|
-
if (props.size === "XL") rules += '
|
|
128
|
-
else if (props.size === "L") rules += '
|
|
129
|
-
else if (props.size === "S") rules += '
|
|
130
|
-
else if (props.size === "XS") rules += '
|
|
131
|
-
else rules += '
|
|
132
|
-
if (props.isQuiet) rules += '
|
|
133
|
-
else rules += '
|
|
134
|
-
if (props.size === "XL") rules += ' -Anxdcc-
|
|
135
|
-
else if (props.size === "L") rules += ' -Anxdcc-
|
|
136
|
-
else if (props.size === "S") rules += ' -Anxdcc-
|
|
137
|
-
else rules += ' -Anxdcc-
|
|
138
|
-
rules += '
|
|
139
|
-
rules += '
|
|
140
|
-
rules += '
|
|
141
|
-
rules += ' -S_-
|
|
142
|
-
rules += ' -R_-
|
|
123
|
+
rules += ' zXcEWr11';
|
|
124
|
+
rules += ' yXcEWr11';
|
|
125
|
+
rules += ' BXcEWr11';
|
|
126
|
+
rules += ' AXcEWr11';
|
|
127
|
+
if (props.size === "XL") rules += ' Nl11';
|
|
128
|
+
else if (props.size === "L") rules += ' Nj11';
|
|
129
|
+
else if (props.size === "S") rules += ' Nf11';
|
|
130
|
+
else if (props.size === "XS") rules += ' Ne11';
|
|
131
|
+
else rules += ' Nk11';
|
|
132
|
+
if (props.isQuiet) rules += ' _qd11';
|
|
133
|
+
else rules += ' _qtb11';
|
|
134
|
+
if (props.size === "XL") rules += ' -Anxdcc-Zt11';
|
|
135
|
+
else if (props.size === "L") rules += ' -Anxdcc-ZStdtne11';
|
|
136
|
+
else if (props.size === "S") rules += ' -Anxdcc-Zr11';
|
|
137
|
+
else rules += ' -Anxdcc-Z3fn9H11';
|
|
138
|
+
rules += ' __v6TNLWb11';
|
|
139
|
+
rules += ' SMBFGYc11';
|
|
140
|
+
rules += ' RfBFGYc11';
|
|
141
|
+
rules += ' -S_-Sv11';
|
|
142
|
+
rules += ' -R_-Rv11';
|
|
143
143
|
return rules;
|
|
144
144
|
}({
|
|
145
145
|
size: size
|
package/dist/TimeField.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA+BM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA8D;AAMnG,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,UAC7E,KAAwB,EAAE,GAAwB;IAElD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SACF,KAAK,kBACL,cAAc,EACd,aAAa,kBAAkB,gBAC/B,YAAY,cACZ,UAAU,QACV,OAAO,oBACP,gBAAgB,2BAChB,kBAAkB,cAClB,aAAa,uBACb,YAAY,oBACZ,gBAAgB,UAChB,MAAM,EACN,GAAG,gBACJ,GAAG;IACJ,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,sCAAU;IAEvC,qBACE,gCAAC,CAAA,GAAA,oCAAY;QACX,KAAK;QACL,YAAY;QACX,GAAG,cAAc;QAClB,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAsC;YAC1E,UAAU,CAAC,CAAC;2BACZ;kBACA;QACF,GAAG;kBACF,CAAC,cAAC,UAAU,aAAE,SAAS,EAAC;YACvB,qBACE;;kCACE,gCAAC,CAAA,GAAA,oCAAS;wBACR,YAAY;wBACZ,YAAY;wBACZ,MAAM;wBACN,eAAe;wBACf,YAAY;wBACZ,oBAAoB;wBACpB,gBAAgB;kCACf;;kCAGH,iCAAC,CAAA,GAAA,oCAAS;wBACR,MAAK;wBACL,YAAY;wBACZ,WAAW;wBACX,MAAM;wBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;0BAGL;kCAAC;wBAAI;;0CACR,gCAAC,CAAA,GAAA,4CAAiB;0CAChB,cAAA,gCAAC,CAAA,GAAA,mCAAQ;;0CAEX,gCAAC,CAAA,GAAA,0CAAe;gCAAE,WAAW;gCAAW,YAAY;;;;kCAEtD,gCAAC,CAAA,GAAA,kCAAO;wBACN,MAAM;wBACN,YAAY;wBACZ,WAAW;wBACX,aAAa;kCACZ;;;;QAIT;;AAGN","sources":["packages/@react-spectrum/s2/src/TimeField.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 TimeField as AriaTimeField,\n TimeFieldProps as AriaTimeFieldProps,\n ContextValue,\n FormContext,\n TimeValue\n} from 'react-aria-components';\nimport {createContext, forwardRef, ReactElement, Ref, useContext} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {forwardRefType, GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {style} from '../style' with {type: 'macro'};\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface TimeFieldProps<T extends TimeValue> extends\n Omit<AriaTimeFieldProps<T>, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the TimeField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TimeFieldContext = createContext<ContextValue<Partial<TimeFieldProps<any>>, HTMLDivElement>>(null);\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(\n props: TimeFieldProps<T>, ref: Ref<HTMLDivElement>\n): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, TimeFieldContext);\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n ...timeFieldProps\n } = props;\n let formContext = useContext(FormContext);\n\n return (\n <AriaTimeField\n ref={ref}\n isRequired={isRequired}\n {...timeFieldProps}\n style={UNSAFE_style}\n className={(UNSAFE_className || '') + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, styles)}>\n {({isDisabled, isInvalid}) => {\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n\n <FieldGroup\n role=\"presentation\"\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n paddingX: 'edge-to-text'\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n </FieldGroup>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaTimeField>\n );\n});\n"],"names":[],"version":3,"file":"TimeField.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA+BM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA8D;AAMnG,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,UAC7E,KAAwB,EAAE,GAAwB;IAElD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SACF,KAAK,kBACL,cAAc,EACd,aAAa,kBAAkB,gBAC/B,YAAY,cACZ,UAAU,QACV,OAAO,oBACP,gBAAgB,2BAChB,kBAAkB,cAClB,aAAa,uBACb,YAAY,oBACZ,gBAAgB,UAChB,MAAM,EACN,GAAG,gBACJ,GAAG;IACJ,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,sCAAU;IAEvC,qBACE,gCAAC,CAAA,GAAA,oCAAY;QACX,KAAK;QACL,YAAY;QACX,GAAG,cAAc;QAClB,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAsC;YAC1E,UAAU,CAAC,CAAC;2BACZ;kBACA;QACF,GAAG;kBACF,CAAC,cAAC,UAAU,aAAE,SAAS,EAAC;YACvB,qBACE;;kCACE,gCAAC,CAAA,GAAA,oCAAS;wBACR,YAAY;wBACZ,YAAY;wBACZ,MAAM;wBACN,eAAe;wBACf,YAAY;wBACZ,oBAAoB;wBACpB,gBAAgB;kCACf;;kCAGH,iCAAC,CAAA,GAAA,oCAAS;wBACR,MAAK;wBACL,YAAY;wBACZ,WAAW;wBACX,MAAM;wBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;0BAGL;kCAAC;wBAAI;;0CACR,gCAAC,CAAA,GAAA,4CAAiB;0CAChB,cAAA,gCAAC,CAAA,GAAA,mCAAQ;;0CAEX,gCAAC,CAAA,GAAA,0CAAe;gCAAE,WAAW;gCAAW,YAAY;;;;kCAEtD,gCAAC,CAAA,GAAA,kCAAO;wBACN,MAAM;wBACN,YAAY;wBACZ,WAAW;wBACX,aAAa;kCACZ;;;;QAIT;;AAGN","sources":["packages/@react-spectrum/s2/src/TimeField.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 TimeField as AriaTimeField,\n TimeFieldProps as AriaTimeFieldProps,\n ContextValue,\n FormContext,\n TimeValue\n} from 'react-aria-components';\nimport {createContext, forwardRef, ReactElement, Ref, useContext} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {forwardRefType, GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {style} from '../style' with {type: 'macro'};\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface TimeFieldProps<T extends TimeValue> extends\n Omit<AriaTimeFieldProps<T>, 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the TimeField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TimeFieldContext = createContext<ContextValue<Partial<TimeFieldProps<any>>, HTMLDivElement>>(null);\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(\n props: TimeFieldProps<T>, ref: Ref<HTMLDivElement>\n): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, TimeFieldContext);\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n ...timeFieldProps\n } = props;\n let formContext = useContext(FormContext);\n\n return (\n <AriaTimeField\n ref={ref}\n isRequired={isRequired}\n {...timeFieldProps}\n style={UNSAFE_style}\n className={(UNSAFE_className || '') + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, styles)}>\n {({isDisabled, isInvalid}) => {\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n\n <FieldGroup\n role=\"presentation\"\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n paddingX: 'edge-to-text'\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n </FieldGroup>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaTimeField>\n );\n});\n"],"names":[],"version":3,"file":"TimeField.cjs.map"}
|