@react-spectrum/s2 0.10.0 → 0.11.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 +2 -2
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.mjs +2 -2
- package/dist/ActionBar.cjs +62 -62
- package/dist/ActionBar.css +61 -61
- package/dist/ActionBar.mjs +62 -62
- package/dist/ActionButton.cjs +202 -202
- package/dist/ActionButton.css +138 -138
- package/dist/ActionButton.mjs +202 -202
- package/dist/ActionButtonGroup.cjs +15 -15
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +15 -15
- 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 +14 -14
- package/dist/Avatar.css +14 -14
- package/dist/Avatar.mjs +14 -14
- package/dist/AvatarGroup.cjs +134 -134
- package/dist/AvatarGroup.css +33 -33
- package/dist/AvatarGroup.mjs +134 -134
- package/dist/Badge.cjs +206 -206
- package/dist/Badge.css +127 -127
- package/dist/Badge.mjs +206 -206
- package/dist/Breadcrumbs.cjs +254 -254
- package/dist/Breadcrumbs.css +109 -109
- package/dist/Breadcrumbs.mjs +254 -254
- package/dist/Button.cjs +341 -341
- package/dist/Button.css +177 -177
- package/dist/Button.mjs +341 -341
- package/dist/ButtonGroup.cjs +20 -20
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +20 -20
- package/dist/Calendar.cjs +151 -139
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +153 -141
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +304 -304
- package/dist/Card.css +209 -209
- package/dist/Card.mjs +304 -304
- package/dist/CardView.cjs +16 -16
- package/dist/CardView.css +16 -16
- package/dist/CardView.mjs +16 -16
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +170 -170
- package/dist/Checkbox.css +92 -92
- package/dist/Checkbox.mjs +170 -170
- package/dist/CheckboxGroup.cjs +45 -45
- package/dist/CheckboxGroup.css +38 -38
- package/dist/CheckboxGroup.mjs +45 -45
- 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 +29 -29
- package/dist/ClearButton.css +29 -29
- package/dist/ClearButton.mjs +29 -29
- package/dist/CloseButton.cjs +54 -54
- package/dist/CloseButton.css +46 -46
- package/dist/CloseButton.mjs +54 -54
- package/dist/ColorArea.cjs +16 -16
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.mjs +16 -16
- package/dist/ColorField.cjs +32 -32
- package/dist/ColorField.css +28 -28
- package/dist/ColorField.mjs +32 -32
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +42 -42
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +118 -118
- package/dist/ColorSlider.css +54 -54
- package/dist/ColorSlider.mjs +118 -118
- package/dist/ColorSwatch.cjs +29 -29
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.mjs +29 -29
- package/dist/ColorSwatchPicker.cjs +27 -27
- package/dist/ColorSwatchPicker.css +46 -46
- package/dist/ColorSwatchPicker.mjs +27 -27
- package/dist/ColorWheel.cjs +26 -26
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.mjs +26 -26
- package/dist/ComboBox.cjs +415 -400
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +181 -181
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +415 -400
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +60 -60
- 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 +25 -25
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.mjs +25 -25
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/DateField.cjs +73 -73
- package/dist/DateField.css +77 -77
- package/dist/DateField.mjs +73 -73
- package/dist/DatePicker.cjs +182 -185
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +126 -126
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +182 -185
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +58 -61
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +60 -60
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +58 -61
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.css +82 -82
- package/dist/Dialog.mjs +17 -17
- package/dist/Disclosure.cjs +135 -135
- package/dist/Disclosure.css +106 -106
- package/dist/Disclosure.mjs +135 -135
- package/dist/Divider.cjs +25 -25
- package/dist/Divider.css +25 -25
- package/dist/Divider.mjs +25 -25
- package/dist/DropZone.cjs +62 -62
- package/dist/DropZone.css +58 -58
- package/dist/DropZone.mjs +62 -62
- package/dist/Field.cjs +370 -370
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +142 -142
- package/dist/Field.mjs +370 -370
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +9 -9
- package/dist/Form.css +9 -9
- package/dist/Form.mjs +9 -9
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.css +91 -91
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/IllustratedMessage.cjs +256 -256
- package/dist/IllustratedMessage.css +78 -78
- package/dist/IllustratedMessage.mjs +256 -256
- package/dist/Image.cjs +13 -13
- package/dist/Image.css +14 -14
- package/dist/Image.mjs +13 -13
- package/dist/InlineAlert.cjs +117 -117
- package/dist/InlineAlert.css +98 -98
- package/dist/InlineAlert.mjs +117 -117
- package/dist/Link.cjs +54 -54
- package/dist/Link.css +46 -46
- package/dist/Link.mjs +54 -54
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +459 -459
- package/dist/Menu.css +185 -185
- package/dist/Menu.mjs +459 -459
- package/dist/Meter.cjs +163 -163
- package/dist/Meter.css +93 -93
- package/dist/Meter.mjs +163 -163
- package/dist/Modal.cjs +58 -58
- package/dist/Modal.css +50 -50
- package/dist/Modal.mjs +58 -58
- package/dist/NotificationBadge.cjs +58 -58
- package/dist/NotificationBadge.css +51 -51
- package/dist/NotificationBadge.mjs +58 -58
- package/dist/NumberField.cjs +115 -115
- package/dist/NumberField.css +100 -100
- package/dist/NumberField.mjs +115 -115
- package/dist/Picker.cjs +283 -283
- package/dist/Picker.css +169 -169
- package/dist/Picker.mjs +283 -283
- package/dist/Popover.cjs +86 -86
- package/dist/Popover.css +66 -66
- package/dist/Popover.mjs +86 -86
- package/dist/ProgressBar.cjs +173 -173
- package/dist/ProgressBar.css +101 -101
- package/dist/ProgressBar.mjs +173 -173
- package/dist/ProgressCircle.cjs +31 -31
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.mjs +31 -31
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.css +10 -10
- package/dist/Provider.mjs +11 -11
- package/dist/Radio.cjs +154 -154
- package/dist/Radio.css +79 -79
- package/dist/Radio.mjs +154 -154
- package/dist/RadioGroup.cjs +42 -42
- package/dist/RadioGroup.css +38 -38
- package/dist/RadioGroup.mjs +42 -42
- package/dist/RangeCalendar.cjs +32 -20
- package/dist/RangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar.css +10 -10
- package/dist/RangeCalendar.css.map +1 -1
- package/dist/RangeCalendar.mjs +34 -22
- package/dist/RangeCalendar.mjs.map +1 -1
- package/dist/SearchField.cjs +42 -42
- package/dist/SearchField.css +46 -46
- package/dist/SearchField.mjs +42 -42
- package/dist/SegmentedControl.cjs +181 -181
- package/dist/SegmentedControl.css +118 -118
- package/dist/SegmentedControl.mjs +181 -181
- package/dist/SelectBoxGroup.cjs +342 -0
- package/dist/SelectBoxGroup.cjs.map +1 -0
- package/dist/SelectBoxGroup.css +503 -0
- package/dist/SelectBoxGroup.css.map +1 -0
- package/dist/SelectBoxGroup.mjs +335 -0
- package/dist/SelectBoxGroup.mjs.map +1 -0
- package/dist/SkeletonCollection.cjs +6 -1
- package/dist/SkeletonCollection.cjs.map +1 -1
- package/dist/SkeletonCollection.mjs +7 -2
- package/dist/SkeletonCollection.mjs.map +1 -1
- package/dist/Slider.cjs +299 -299
- package/dist/Slider.css +151 -151
- package/dist/Slider.mjs +299 -299
- package/dist/StatusLight.cjs +125 -125
- package/dist/StatusLight.css +61 -61
- package/dist/StatusLight.mjs +125 -125
- package/dist/Switch.cjs +162 -162
- package/dist/Switch.css +74 -74
- package/dist/Switch.mjs +162 -162
- package/dist/TableView.cjs +319 -319
- package/dist/TableView.css +172 -172
- package/dist/TableView.mjs +319 -319
- package/dist/Tabs.cjs +213 -188
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +105 -101
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +213 -188
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +127 -127
- package/dist/TabsPicker.css +111 -111
- package/dist/TabsPicker.mjs +127 -127
- package/dist/TagGroup.cjs +213 -213
- package/dist/TagGroup.css +147 -147
- package/dist/TagGroup.mjs +213 -213
- package/dist/TextField.cjs +59 -59
- package/dist/TextField.css +54 -54
- package/dist/TextField.mjs +59 -59
- package/dist/TimeField.cjs +52 -52
- package/dist/TimeField.css +48 -48
- package/dist/TimeField.mjs +52 -52
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.css +107 -107
- package/dist/Toast.mjs +120 -120
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +83 -83
- package/dist/Tooltip.css +70 -70
- package/dist/Tooltip.mjs +83 -83
- package/dist/TreeView.cjs +146 -146
- package/dist/TreeView.css +147 -147
- package/dist/TreeView.mjs +146 -146
- package/dist/main.cjs +5 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +3 -1
- package/dist/module.mjs.map +1 -1
- package/dist/types.d.ts +43 -1
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs +10 -10
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +10 -10
- 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/package.json +21 -21
- package/src/Calendar.tsx +13 -6
- package/src/ComboBox.tsx +20 -5
- package/src/DatePicker.tsx +1 -7
- package/src/DateRangePicker.tsx +1 -7
- package/src/RangeCalendar.tsx +13 -6
- package/src/SelectBoxGroup.tsx +408 -0
- package/src/SkeletonCollection.tsx +6 -2
- package/src/Tabs.tsx +49 -24
- package/src/index.ts +2 -0
- package/style/__tests__/style-macro.test.js +162 -166
- package/style/dist/main.cjs +24 -24
- package/style/dist/module.mjs +13 -13
- package/style/dist/properties.mjs +3 -3
- package/style/dist/spectrum-theme.cjs +219 -219
- package/style/dist/spectrum-theme.mjs +210 -210
- package/style/dist/style-macro.cjs +80 -80
- package/style/dist/style-macro.mjs +75 -75
package/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AE,UAAU;YAClC,KAAK,CAAA,GAAA,gBAAQ,EAAE,UAAU;YACzB,WAAW,AAAC,CAAA,SAAS,KAAK,CAAC,SAAS,IAAI,EAAC,IAAK,MAAM;YACpD,6CAA6C;YAC7C,OAAO,CAAA,GAAA,iBAAS,EAAE;QACpB,KAAK;;AAGX;AAGO,SAAS,0CAAgB,MAAmB;IACjD,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;IAC5B,IAAI,YACF,OAAO,CAAA,GAAA,yCAAU,0BAA+B;IAElD,OAAO,UAAU;AACnB","sources":["packages/@react-spectrum/s2/src/Skeleton.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 {cloneElement, createContext, CSSProperties, ReactElement, ReactNode, Ref, useCallback, useContext, useRef} from 'react';\nimport {color, style} from '../style' with {type: 'macro'};\nimport {inertValue, mergeRefs} from '@react-aria/utils';\nimport {mergeStyles} from '../style/runtime';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport function useLoadingAnimation(isAnimating: boolean): (element: HTMLElement | null) => void {\n let animationRef = useRef<Animation | null>(null);\n let reduceMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n return useCallback((element: HTMLElement | null) => {\n if (isAnimating && !animationRef.current && element && !reduceMotion) {\n // Use web animation API instead of CSS animations so that we can\n // synchronize it between all loading elements on the page (via startTime).\n animationRef.current = element.animate(\n [\n {backgroundPosition: '100%'},\n {backgroundPosition: '0%'}\n ],\n {\n duration: 2000,\n iterations: Infinity,\n easing: 'ease-in-out'\n }\n );\n animationRef.current.startTime = 0;\n } else if (!isAnimating && animationRef.current) {\n animationRef.current.cancel();\n animationRef.current = null;\n }\n }, [isAnimating]);\n}\n\nexport type SkeletonElement = ReactElement<{\n children: ReactNode,\n className?: string,\n ref?: Ref<HTMLElement>,\n inert?: boolean | 'true'\n}>;\n\nexport const SkeletonContext = createContext<boolean | null>(null);\nexport function useIsSkeleton(): boolean {\n return useContext(SkeletonContext) || false;\n}\n\nexport interface SkeletonProps {\n children: ReactNode,\n isLoading: boolean\n}\n\n/**\n * A Skeleton wraps around content to render it as a placeholder.\n */\nexport function Skeleton({children, isLoading}: SkeletonProps): ReactNode {\n // Disable all form components inside a skeleton.\n return (\n <SkeletonContext.Provider value={isLoading}>\n {children}\n </SkeletonContext.Provider>\n );\n}\n\nexport const loadingStyle = raw(`\n background-image: linear-gradient(to right, ${color('gray-100')} 33%, light-dark(${color('gray-25')}, ${color('gray-300')}), ${color('gray-100')} 66%);\n background-size: 300%;\n * {\n visibility: hidden;\n }\n`, 'L'); // add to a separate layer so it overrides default style macro styles\n\nexport function useSkeletonText(children: ReactNode, style: CSSProperties | undefined): [ReactNode, CSSProperties | undefined] {\n let isSkeleton = useContext(SkeletonContext);\n if (isSkeleton) {\n children = <SkeletonText>{children}</SkeletonText>;\n style = {\n ...style,\n // This ensures the ellipsis on truncated text is also hidden.\n // -webkit-text-fill-color overrides any `color` property that is also set.\n WebkitTextFillColor: 'transparent'\n };\n }\n return [children, style];\n}\n\n// Rendered inside <Text> to create skeleton line boxes via box-decoration-break.\nexport function SkeletonText({children}: {children: ReactNode}): ReactNode {\n return (\n <span\n // @ts-ignore - compatibility with React < 19\n inert={inertValue(true)}\n ref={useLoadingAnimation(true)}\n className={loadingStyle + style({\n color: 'transparent',\n boxDecorationBreak: 'clone',\n borderRadius: 'sm'\n })}>\n {children}\n </span>\n );\n}\n\n// Clones the child element and displays it with skeleton styling.\nexport function SkeletonWrapper({children}: {children: SkeletonElement}): ReactNode {\n let isLoading = useContext(SkeletonContext);\n let animation = useLoadingAnimation(isLoading || false);\n if (isLoading == null) {\n return children;\n }\n\n let childRef = 'ref' in children && !Object.getOwnPropertyDescriptor(children, 'ref')?.get ? children.ref as any : children.props.ref;\n return (\n <SkeletonContext.Provider value={null}>\n {isLoading ? cloneElement(children, {\n ref: mergeRefs(childRef, animation),\n className: (children.props.className || '') + ' ' + loadingStyle,\n // @ts-ignore - compatibility with React < 19\n inert: inertValue(true)\n }) : children}\n </SkeletonContext.Provider>\n );\n}\n\n// Adds default border radius around icons when displayed in a skeleton.\nexport function useSkeletonIcon(styles: StyleString): StyleString {\n let isSkeleton = useContext(SkeletonContext);\n if (isSkeleton) {\n return mergeStyles(style({borderRadius: 'sm'}), styles);\n }\n return styles || '' as StyleString;\n}\n"],"names":[],"version":3,"file":"Skeleton.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/s2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Spectrum 2 UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -77,28 +77,28 @@
|
|
|
77
77
|
"src"
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@internationalized/date": "^3.
|
|
81
|
-
"@internationalized/number": "^3.6.
|
|
82
|
-
"@react-aria/calendar": "^3.9.
|
|
83
|
-
"@react-aria/collections": "3.0.0-rc.
|
|
84
|
-
"@react-aria/focus": "^3.21.
|
|
85
|
-
"@react-aria/i18n": "^3.12.
|
|
86
|
-
"@react-aria/interactions": "^3.25.
|
|
80
|
+
"@internationalized/date": "^3.9.0",
|
|
81
|
+
"@internationalized/number": "^3.6.5",
|
|
82
|
+
"@react-aria/calendar": "^3.9.1",
|
|
83
|
+
"@react-aria/collections": "3.0.0-rc.5",
|
|
84
|
+
"@react-aria/focus": "^3.21.1",
|
|
85
|
+
"@react-aria/i18n": "^3.12.12",
|
|
86
|
+
"@react-aria/interactions": "^3.25.5",
|
|
87
87
|
"@react-aria/live-announcer": "^3.4.4",
|
|
88
|
-
"@react-aria/utils": "^3.30.
|
|
89
|
-
"@react-spectrum/utils": "^3.12.
|
|
90
|
-
"@react-stately/layout": "^4.
|
|
88
|
+
"@react-aria/utils": "^3.30.1",
|
|
89
|
+
"@react-spectrum/utils": "^3.12.8",
|
|
90
|
+
"@react-stately/layout": "^4.5.0",
|
|
91
91
|
"@react-stately/utils": "^3.10.8",
|
|
92
|
-
"@react-types/dialog": "^3.5.
|
|
93
|
-
"@react-types/grid": "^3.3.
|
|
94
|
-
"@react-types/provider": "^3.8.
|
|
95
|
-
"@react-types/shared": "^3.
|
|
96
|
-
"@react-types/table": "^3.13.
|
|
97
|
-
"@react-types/textfield": "^3.12.
|
|
92
|
+
"@react-types/dialog": "^3.5.21",
|
|
93
|
+
"@react-types/grid": "^3.3.5",
|
|
94
|
+
"@react-types/provider": "^3.8.12",
|
|
95
|
+
"@react-types/shared": "^3.32.0",
|
|
96
|
+
"@react-types/table": "^3.13.3",
|
|
97
|
+
"@react-types/textfield": "^3.12.5",
|
|
98
98
|
"csstype": "^3.0.2",
|
|
99
|
-
"react-aria": "^3.
|
|
100
|
-
"react-aria-components": "^1.
|
|
101
|
-
"react-stately": "^3.
|
|
99
|
+
"react-aria": "^3.43.0",
|
|
100
|
+
"react-aria-components": "^1.12.0",
|
|
101
|
+
"react-stately": "^3.41.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"react": "^18.0.0 || ^19.0.0-rc.1",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"publishConfig": {
|
|
108
108
|
"access": "public"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
|
|
111
111
|
}
|
package/src/Calendar.tsx
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {ActionButton, Header, Heading, pressScale} from './';
|
|
13
|
+
import {ActionButton, Header, HeaderContext, Heading, HeadingContext, pressScale} from './';
|
|
14
14
|
import {
|
|
15
15
|
Calendar as AriaCalendar,
|
|
16
16
|
CalendarCell as AriaCalendarCell,
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
CalendarStateContext,
|
|
28
28
|
ContextValue,
|
|
29
29
|
DateValue,
|
|
30
|
+
Provider,
|
|
30
31
|
RangeCalendarState,
|
|
31
32
|
RangeCalendarStateContext,
|
|
32
33
|
Text
|
|
@@ -304,11 +305,17 @@ export const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ca
|
|
|
304
305
|
{({isInvalid, isDisabled}) => {
|
|
305
306
|
return (
|
|
306
307
|
<>
|
|
307
|
-
<
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
<Provider
|
|
309
|
+
values={[
|
|
310
|
+
[HeaderContext, null],
|
|
311
|
+
[HeadingContext, null]
|
|
312
|
+
]}>
|
|
313
|
+
<Header styles={headerStyles}>
|
|
314
|
+
<CalendarButton slot="previous"><ChevronLeftIcon /></CalendarButton>
|
|
315
|
+
<CalendarHeading />
|
|
316
|
+
<CalendarButton slot="next"><ChevronRightIcon /></CalendarButton>
|
|
317
|
+
</Header>
|
|
318
|
+
</Provider>
|
|
312
319
|
<div
|
|
313
320
|
className={style({
|
|
314
321
|
display: 'flex',
|
package/src/ComboBox.tsx
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
Virtualizer
|
|
34
34
|
} from 'react-aria-components';
|
|
35
35
|
import {AsyncLoadable, GlobalDOMAttributes, HelpTextProps, LoadingState, SpectrumLabelableProps} from '@react-types/shared';
|
|
36
|
+
import {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';
|
|
36
37
|
import {baseColor, edgeToText, focusRing, space, style} from '../style' with {type: 'macro'};
|
|
37
38
|
import {centerBaseline} from './CenterBaseline';
|
|
38
39
|
import {centerPadding, control, controlBorderRadius, controlFont, controlSize, field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
@@ -48,7 +49,6 @@ import CheckmarkIcon from '../ui-icons/Checkmark';
|
|
|
48
49
|
import ChevronIcon from '../ui-icons/Chevron';
|
|
49
50
|
import {createContext, CSSProperties, ForwardedRef, forwardRef, ReactNode, Ref, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react';
|
|
50
51
|
import {createFocusableRef} from '@react-spectrum/utils';
|
|
51
|
-
import {createLeafComponent} from '@react-aria/collections';
|
|
52
52
|
import {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';
|
|
53
53
|
import {FormContext, useFormProps} from './Form';
|
|
54
54
|
import {forwardRefType} from './types';
|
|
@@ -209,7 +209,8 @@ export let listbox = style<{size: 'S' | 'M' | 'L' | 'XL'}>({
|
|
|
209
209
|
overflowY: 'auto',
|
|
210
210
|
overflowX: 'hidden',
|
|
211
211
|
fontFamily: 'sans',
|
|
212
|
-
fontSize: controlFont()
|
|
212
|
+
fontSize: controlFont(),
|
|
213
|
+
outlineStyle: 'none'
|
|
213
214
|
});
|
|
214
215
|
|
|
215
216
|
export let listboxItem = style({
|
|
@@ -338,14 +339,13 @@ export const ComboBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Co
|
|
|
338
339
|
labelPosition = 'top',
|
|
339
340
|
UNSAFE_className = '',
|
|
340
341
|
UNSAFE_style,
|
|
341
|
-
loadingState,
|
|
342
342
|
...comboBoxProps
|
|
343
343
|
} = props;
|
|
344
344
|
|
|
345
345
|
return (
|
|
346
346
|
<AriaComboBox
|
|
347
347
|
{...comboBoxProps}
|
|
348
|
-
allowsEmptyCollection
|
|
348
|
+
allowsEmptyCollection
|
|
349
349
|
style={UNSAFE_style}
|
|
350
350
|
className={UNSAFE_className + style(field(), getAllowedOverrides())({
|
|
351
351
|
isInForm: !!formContext,
|
|
@@ -699,7 +699,22 @@ const ComboboxInner = forwardRef(function ComboboxInner(props: ComboBoxProps<any
|
|
|
699
699
|
);
|
|
700
700
|
});
|
|
701
701
|
|
|
702
|
-
|
|
702
|
+
class SeparatorNode extends CollectionNode<any> {
|
|
703
|
+
static readonly type = 'separator';
|
|
704
|
+
|
|
705
|
+
filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {
|
|
706
|
+
let prevItem = newCollection.getItem(this.prevKey!);
|
|
707
|
+
if (prevItem && prevItem.type !== 'separator') {
|
|
708
|
+
let clone = this.clone();
|
|
709
|
+
newCollection.addDescendants(clone, collection);
|
|
710
|
+
return clone;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
return null;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export const Divider = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Divider({size}: {size?: 'S' | 'M' | 'L' | 'XL'}, ref: ForwardedRef<HTMLDivElement>, node: Node<unknown>) {
|
|
703
718
|
let listState = useContext(ListStateContext)!;
|
|
704
719
|
|
|
705
720
|
let nextNode = node.nextKey != null && listState.collection.getItem(node.nextKey);
|
package/src/DatePicker.tsx
CHANGED
|
@@ -139,10 +139,7 @@ export const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
139
139
|
styles,
|
|
140
140
|
placeholderValue,
|
|
141
141
|
maxVisibleMonths = 1,
|
|
142
|
-
firstDayOfWeek,
|
|
143
142
|
createCalendar,
|
|
144
|
-
pageBehavior,
|
|
145
|
-
isDateUnavailable,
|
|
146
143
|
...dateFieldProps
|
|
147
144
|
} = props;
|
|
148
145
|
let formContext = useContext(FormContext);
|
|
@@ -206,10 +203,7 @@ export const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
206
203
|
<CalendarPopover>
|
|
207
204
|
<Calendar
|
|
208
205
|
visibleMonths={maxVisibleMonths}
|
|
209
|
-
createCalendar={createCalendar}
|
|
210
|
-
firstDayOfWeek={firstDayOfWeek}
|
|
211
|
-
isDateUnavailable={isDateUnavailable}
|
|
212
|
-
pageBehavior={pageBehavior} />
|
|
206
|
+
createCalendar={createCalendar} />
|
|
213
207
|
{showTimeField && (
|
|
214
208
|
<div className={style({display: 'flex', gap: 16, contain: 'inline-size'})}>
|
|
215
209
|
<TimeField
|
package/src/DateRangePicker.tsx
CHANGED
|
@@ -72,10 +72,7 @@ export const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(func
|
|
|
72
72
|
styles,
|
|
73
73
|
placeholderValue,
|
|
74
74
|
maxVisibleMonths = 1,
|
|
75
|
-
firstDayOfWeek,
|
|
76
75
|
createCalendar,
|
|
77
|
-
pageBehavior,
|
|
78
|
-
isDateUnavailable,
|
|
79
76
|
...dateFieldProps
|
|
80
77
|
} = props;
|
|
81
78
|
let formContext = useContext(FormContext);
|
|
@@ -145,10 +142,7 @@ export const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(func
|
|
|
145
142
|
<CalendarPopover>
|
|
146
143
|
<RangeCalendar
|
|
147
144
|
visibleMonths={maxVisibleMonths}
|
|
148
|
-
createCalendar={createCalendar}
|
|
149
|
-
firstDayOfWeek={firstDayOfWeek}
|
|
150
|
-
isDateUnavailable={isDateUnavailable}
|
|
151
|
-
pageBehavior={pageBehavior} />
|
|
145
|
+
createCalendar={createCalendar} />
|
|
152
146
|
{showTimeField && (
|
|
153
147
|
<div className={style({display: 'flex', gap: 16, contain: 'inline-size', marginTop: 24})}>
|
|
154
148
|
<TimeField
|
package/src/RangeCalendar.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
RangeCalendarProps as AriaRangeCalendarProps,
|
|
16
16
|
ContextValue,
|
|
17
17
|
DateValue,
|
|
18
|
+
Provider,
|
|
18
19
|
Text
|
|
19
20
|
} from 'react-aria-components';
|
|
20
21
|
import {CalendarButton, CalendarGrid, CalendarHeading} from './Calendar';
|
|
@@ -23,7 +24,7 @@ import ChevronRightIcon from '../s2wf-icons/S2_Icon_ChevronRight_20_N.svg';
|
|
|
23
24
|
import {createContext, ForwardedRef, forwardRef, ReactNode} from 'react';
|
|
24
25
|
import {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';
|
|
25
26
|
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
26
|
-
import {Header} from './';
|
|
27
|
+
import {Header, HeaderContext, HeadingContext} from './';
|
|
27
28
|
import {helpTextStyles} from './Field';
|
|
28
29
|
// @ts-ignore
|
|
29
30
|
import intlMessages from '../intl/*.json';
|
|
@@ -85,11 +86,17 @@ export const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
|
|
|
85
86
|
{({isInvalid, isDisabled}) => {
|
|
86
87
|
return (
|
|
87
88
|
<>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
<Provider
|
|
90
|
+
values={[
|
|
91
|
+
[HeaderContext, null],
|
|
92
|
+
[HeadingContext, null]
|
|
93
|
+
]}>
|
|
94
|
+
<Header styles={headerStyles}>
|
|
95
|
+
<CalendarButton slot="previous"><ChevronLeftIcon /></CalendarButton>
|
|
96
|
+
<CalendarHeading />
|
|
97
|
+
<CalendarButton slot="next"><ChevronRightIcon /></CalendarButton>
|
|
98
|
+
</Header>
|
|
99
|
+
</Provider>
|
|
93
100
|
<div
|
|
94
101
|
className={style({
|
|
95
102
|
display: 'flex',
|