@react-spectrum/s2 3.0.0-nightly-a626c2596-240926 → 3.0.0-nightly-d57bd8d90-240927
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.map +1 -1
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/AlertDialog.cjs.map +1 -1
- package/dist/AlertDialog.css.map +1 -1
- package/dist/AlertDialog.mjs.map +1 -1
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs.map +1 -1
- package/dist/AvatarGroup.cjs.map +1 -1
- package/dist/AvatarGroup.css.map +1 -1
- package/dist/AvatarGroup.mjs.map +1 -1
- package/dist/Badge.cjs.map +1 -1
- package/dist/Badge.css.map +1 -1
- package/dist/Badge.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +34 -4
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +64 -0
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +34 -4
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs.map +1 -1
- package/dist/ButtonGroup.css.map +1 -1
- package/dist/ButtonGroup.mjs.map +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +1 -1
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs.map +1 -1
- package/dist/CenterBaseline.css.map +1 -1
- package/dist/CenterBaseline.mjs.map +1 -1
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/ClearButton.cjs.map +1 -1
- package/dist/ClearButton.css.map +1 -1
- package/dist/ClearButton.mjs.map +1 -1
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css.map +1 -1
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs.map +1 -1
- package/dist/ColorHandle.css.map +1 -1
- package/dist/ColorHandle.mjs.map +1 -1
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs.map +1 -1
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs.map +1 -1
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs.map +1 -1
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +0 -1
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +0 -4
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +0 -1
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.cjs.map +1 -1
- package/dist/Provider.css.map +1 -1
- package/dist/Provider.mjs.map +1 -1
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +11 -8
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +11 -8
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/SkeletonCollection.cjs.map +1 -1
- package/dist/SkeletonCollection.mjs.map +1 -1
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs.map +1 -1
- package/dist/Table.cjs +61 -90
- package/dist/Table.cjs.map +1 -1
- package/dist/Table.css +36 -56
- package/dist/Table.css.map +1 -1
- package/dist/Table.mjs +61 -90
- package/dist/Table.mjs.map +1 -1
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs.map +1 -1
- package/dist/ToggleButton.cjs +2 -1
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +2 -1
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/main.cjs +3 -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 +47 -30
- package/dist/types.d.ts.map +1 -1
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs.map +1 -1
- package/package.json +17 -17
- package/src/Accordion.tsx +2 -2
- package/src/ActionButton.tsx +3 -3
- package/src/AlertDialog.tsx +1 -1
- package/src/Avatar.tsx +1 -1
- package/src/AvatarGroup.tsx +1 -1
- package/src/Badge.tsx +1 -1
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +19 -5
- package/src/ButtonGroup.tsx +1 -1
- package/src/Card.tsx +6 -6
- package/src/CardView.tsx +2 -2
- package/src/CenterBaseline.tsx +1 -1
- package/src/Checkbox.tsx +2 -2
- package/src/CheckboxGroup.tsx +1 -1
- package/src/ClearButton.tsx +1 -1
- package/src/CloseButton.tsx +2 -2
- package/src/ColorArea.tsx +1 -1
- package/src/ColorField.tsx +1 -1
- package/src/ColorHandle.tsx +1 -1
- package/src/ColorSlider.tsx +1 -1
- package/src/ColorSwatch.tsx +3 -3
- package/src/ColorSwatchPicker.tsx +5 -5
- package/src/ColorWheel.tsx +1 -1
- package/src/ComboBox.tsx +4 -4
- package/src/ContextualHelp.tsx +1 -1
- package/src/Dialog.tsx +1 -1
- package/src/Disclosure.tsx +4 -4
- package/src/Divider.tsx +1 -1
- package/src/DropZone.tsx +1 -1
- package/src/Field.tsx +2 -2
- package/src/Form.tsx +1 -1
- package/src/IllustratedMessage.tsx +1 -1
- package/src/Image.tsx +1 -1
- package/src/InlineAlert.tsx +2 -2
- package/src/Link.tsx +2 -2
- package/src/Menu.tsx +2 -2
- package/src/Meter.tsx +1 -1
- package/src/Modal.tsx +1 -1
- package/src/NumberField.tsx +2 -2
- package/src/Picker.tsx +4 -4
- package/src/Popover.tsx +1 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/ProgressCircle.tsx +7 -5
- package/src/Provider.tsx +1 -1
- package/src/Radio.tsx +2 -2
- package/src/RadioGroup.tsx +1 -1
- package/src/SearchField.tsx +1 -1
- package/src/SegmentedControl.tsx +32 -22
- package/src/Skeleton.tsx +4 -1
- package/src/SkeletonCollection.tsx +4 -0
- package/src/Slider.tsx +2 -2
- package/src/StatusLight.tsx +1 -1
- package/src/Switch.tsx +2 -2
- package/src/Table.tsx +39 -60
- package/src/Tabs.tsx +3 -3
- package/src/TagGroup.tsx +2 -2
- package/src/TextField.tsx +1 -1
- package/src/ToggleButton.tsx +3 -2
- package/src/Tooltip.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/style-utils.ts +0 -10
- package/style/dist/main.cjs +18 -1964
- package/style/dist/main.cjs.map +1 -1
- package/style/dist/module.mjs +11 -1958
- package/style/dist/module.mjs.map +1 -1
- package/style/dist/spectrum-theme.cjs +1989 -0
- package/style/dist/spectrum-theme.cjs.map +1 -0
- package/style/dist/spectrum-theme.mjs +1978 -0
- package/style/dist/spectrum-theme.mjs.map +1 -0
- package/style/dist/style-macro.cjs +4 -3
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +4 -4
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/dist/types.d.ts +198 -187
- package/style/dist/types.d.ts.map +1 -1
- package/style/index.ts +24 -0
- package/style/spectrum-theme.ts +19 -13
- package/style/style-macro.ts +1 -1
- package/style/types.ts +2 -1
package/src/Link.tsx
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
import {ContextValue, LinkRenderProps, Link as RACLink, LinkProps as RACLinkProps} from 'react-aria-components';
|
|
14
14
|
import {createContext, forwardRef, ReactNode, useContext} from 'react';
|
|
15
15
|
import {FocusableRef, FocusableRefValue} from '@react-types/shared';
|
|
16
|
-
import {focusRing,
|
|
16
|
+
import {focusRing, style} from '../style' with {type: 'macro'};
|
|
17
|
+
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
17
18
|
import {SkeletonContext, useSkeletonText} from './Skeleton';
|
|
18
|
-
import {style} from '../style/spectrum-theme' with {type: 'macro'};
|
|
19
19
|
import {useFocusableRef} from '@react-spectrum/utils';
|
|
20
20
|
import {useLayoutEffect} from '@react-aria/utils';
|
|
21
21
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
package/src/Menu.tsx
CHANGED
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
Separator,
|
|
27
27
|
SeparatorProps
|
|
28
28
|
} from 'react-aria-components';
|
|
29
|
-
import {baseColor, edgeToText, fontRelative, size, space, style} from '../style
|
|
29
|
+
import {baseColor, edgeToText, focusRing, fontRelative, size, space, style} from '../style' with {type: 'macro'};
|
|
30
30
|
import {box, iconStyles} from './Checkbox';
|
|
31
31
|
import {centerBaseline} from './CenterBaseline';
|
|
32
|
-
import {centerPadding,
|
|
32
|
+
import {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
33
33
|
import CheckmarkIcon from '../ui-icons/Checkmark';
|
|
34
34
|
import ChevronRightIcon from '../ui-icons/Chevron';
|
|
35
35
|
import {createContext, forwardRef, JSX, ReactNode, useContext, useRef} from 'react';
|
package/src/Meter.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import {createContext, forwardRef, ReactNode} from 'react';
|
|
|
20
20
|
import {DOMRef, DOMRefValue} from '@react-types/shared';
|
|
21
21
|
import {FieldLabel} from './Field';
|
|
22
22
|
import {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
23
|
-
import {size, style} from '../style
|
|
23
|
+
import {size, style} from '../style' with {type: 'macro'};
|
|
24
24
|
import {SkeletonWrapper} from './Skeleton';
|
|
25
25
|
import {Text} from './Content';
|
|
26
26
|
import {useDOMRef} from '@react-spectrum/utils';
|
package/src/Modal.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import {DOMRef} from '@react-types/shared';
|
|
|
16
16
|
import {forwardRef, MutableRefObject, useCallback, useContext} from 'react';
|
|
17
17
|
import {keyframes} from '../style/style-macro' with {type: 'macro'};
|
|
18
18
|
import {ModalOverlay, ModalOverlayProps, Modal as RACModal, useLocale} from 'react-aria-components';
|
|
19
|
-
import {style} from '../style
|
|
19
|
+
import {style} from '../style' with {type: 'macro'};
|
|
20
20
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
21
21
|
|
|
22
22
|
interface ModalProps extends ModalOverlayProps {
|
package/src/NumberField.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
Text,
|
|
22
22
|
useContextProps
|
|
23
23
|
} from 'react-aria-components';
|
|
24
|
-
import {baseColor, size, style} from '../style
|
|
24
|
+
import {baseColor, size, style} from '../style' with {type: 'macro'};
|
|
25
25
|
import {createContext, CSSProperties, ForwardedRef, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useMemo, useRef} from 'react';
|
|
26
26
|
import {createFocusableRef} from '@react-spectrum/utils';
|
|
27
27
|
import Dash from '../ui-icons/Dash';
|
|
@@ -49,7 +49,7 @@ export interface NumberFieldProps extends
|
|
|
49
49
|
/**
|
|
50
50
|
* The size of the NumberField.
|
|
51
51
|
*
|
|
52
|
-
* @default
|
|
52
|
+
* @default 'M'
|
|
53
53
|
*/
|
|
54
54
|
size?: 'S' | 'M' | 'L' | 'XL'
|
|
55
55
|
}
|
package/src/Picker.tsx
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
SectionProps,
|
|
28
28
|
SelectValue
|
|
29
29
|
} from 'react-aria-components';
|
|
30
|
-
import {baseColor, edgeToText, style} from '../style
|
|
30
|
+
import {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};
|
|
31
31
|
import {centerBaseline} from './CenterBaseline';
|
|
32
32
|
import {
|
|
33
33
|
checkmark,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from './Menu';
|
|
44
44
|
import CheckmarkIcon from '../ui-icons/Checkmark';
|
|
45
45
|
import ChevronIcon from '../ui-icons/Chevron';
|
|
46
|
-
import {field, fieldInput,
|
|
46
|
+
import {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
47
47
|
import {
|
|
48
48
|
FieldErrorIcon,
|
|
49
49
|
FieldLabel,
|
|
@@ -93,13 +93,13 @@ export interface PickerProps<T extends object> extends
|
|
|
93
93
|
/**
|
|
94
94
|
* Direction the menu will render relative to the Picker.
|
|
95
95
|
*
|
|
96
|
-
* @default
|
|
96
|
+
* @default 'bottom'
|
|
97
97
|
*/
|
|
98
98
|
direction?: 'bottom' | 'top',
|
|
99
99
|
/**
|
|
100
100
|
* Alignment of the menu relative to the input target.
|
|
101
101
|
*
|
|
102
|
-
* @default
|
|
102
|
+
* @default 'start'
|
|
103
103
|
*/
|
|
104
104
|
align?: 'start' | 'end',
|
|
105
105
|
/** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */
|
package/src/Popover.tsx
CHANGED
|
@@ -23,7 +23,7 @@ import {DOMRef} from '@react-types/shared';
|
|
|
23
23
|
import {forwardRef, MutableRefObject, useCallback, useContext} from 'react';
|
|
24
24
|
import {keyframes} from '../style/style-macro' with {type: 'macro'};
|
|
25
25
|
import {mergeStyles} from '../style/runtime';
|
|
26
|
-
import {style} from '../style
|
|
26
|
+
import {style} from '../style' with {type: 'macro'};
|
|
27
27
|
import {StyleString} from '../style/types' with {type: 'macro'};
|
|
28
28
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
29
29
|
|
package/src/ProgressBar.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {FieldLabel} from './Field';
|
|
|
22
22
|
import {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
23
23
|
import {keyframes} from '../style/style-macro' with {type: 'macro'};
|
|
24
24
|
import {mergeStyles} from '../style/runtime';
|
|
25
|
-
import {size, style} from '../style
|
|
25
|
+
import {size, style} from '../style' with {type: 'macro'};
|
|
26
26
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
27
27
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
28
28
|
|
package/src/ProgressCircle.tsx
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
import {ContextValue, ProgressBar as RACProgressBar, ProgressBarProps as RACProgressBarProps} from 'react-aria-components';
|
|
14
14
|
import {createContext, forwardRef} from 'react';
|
|
15
15
|
import {DOMRef, DOMRefValue} from '@react-types/shared';
|
|
16
|
-
import {getAllowedOverrides,
|
|
16
|
+
import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};
|
|
17
17
|
import {keyframes} from '../style/style-macro' with {type: 'macro'};
|
|
18
|
-
import {style} from '../style
|
|
18
|
+
import {style} from '../style' with {type: 'macro'};
|
|
19
19
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
20
20
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
21
21
|
|
|
@@ -45,8 +45,7 @@ const wrapper = style<ProgressCircleStyleProps>({
|
|
|
45
45
|
L: 64
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
aspectRatio: 'square'
|
|
49
|
-
display: 'inline-block'
|
|
48
|
+
aspectRatio: 'square'
|
|
50
49
|
}, getAllowedOverrides({height: true}));
|
|
51
50
|
|
|
52
51
|
const track = style<ProgressCircleStyleProps>({
|
|
@@ -73,7 +72,10 @@ const fill = style<ProgressCircleStyleProps>({
|
|
|
73
72
|
transformOrigin: 'center'
|
|
74
73
|
});
|
|
75
74
|
|
|
76
|
-
export interface ProgressCircleProps extends Omit<RACProgressBarProps, 'children' | 'style' | 'valueLabel' | 'formatOptions' | 'label' | 'className'>, ProgressCircleStyleProps,
|
|
75
|
+
export interface ProgressCircleProps extends Omit<RACProgressBarProps, 'children' | 'style' | 'valueLabel' | 'formatOptions' | 'label' | 'className'>, ProgressCircleStyleProps, UnsafeStyles {
|
|
76
|
+
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
77
|
+
styles?: StylesPropWithHeight
|
|
78
|
+
}
|
|
77
79
|
|
|
78
80
|
const rotationAnimation = keyframes(`
|
|
79
81
|
0% {
|
package/src/Provider.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import {createContext, JSX, ReactNode, useContext} from 'react';
|
|
|
16
16
|
import {generateDefaultColorSchemeStyles} from './page.macro' with {type: 'macro'};
|
|
17
17
|
import {I18nProvider, RouterProvider, useLocale} from 'react-aria-components';
|
|
18
18
|
import {mergeStyles} from '../style/runtime';
|
|
19
|
-
import {style} from '../style
|
|
19
|
+
import {style} from '../style' with {type: 'macro'};
|
|
20
20
|
import {StyleString} from '../style/types';
|
|
21
21
|
|
|
22
22
|
export interface ProviderProps extends UnsafeStyles {
|
package/src/Radio.tsx
CHANGED
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
RadioProps as AriaRadioProps,
|
|
16
16
|
RadioRenderProps
|
|
17
17
|
} from 'react-aria-components';
|
|
18
|
-
import {baseColor, style} from '../style
|
|
18
|
+
import {baseColor, focusRing, style} from '../style' with {type: 'macro'};
|
|
19
19
|
import {CenterBaseline} from './CenterBaseline';
|
|
20
20
|
import {FocusableRef} from '@react-types/shared';
|
|
21
|
-
import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
22
21
|
import {FormContext, useFormProps} from './Form';
|
|
23
22
|
import {forwardRef, ReactNode, useContext, useRef} from 'react';
|
|
23
|
+
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
24
24
|
import {pressScale} from './pressScale';
|
|
25
25
|
import {useFocusableRef} from '@react-spectrum/utils';
|
|
26
26
|
|
package/src/RadioGroup.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type:
|
|
|
20
20
|
import {FieldLabel, HelpText} from './Field';
|
|
21
21
|
import {FormContext, useFormProps} from './Form';
|
|
22
22
|
import React, {createContext, forwardRef, ReactNode, useContext} from 'react';
|
|
23
|
-
import {style} from '../style
|
|
23
|
+
import {style} from '../style' with {type: 'macro'};
|
|
24
24
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
25
25
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
26
26
|
|
package/src/SearchField.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {createContext, forwardRef, Ref, useContext, useImperativeHandle, useRef}
|
|
|
22
22
|
import {createFocusableRef} from '@react-spectrum/utils';
|
|
23
23
|
import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
24
24
|
import {FieldGroup, FieldLabel, HelpText, Input} from './Field';
|
|
25
|
-
import {fontRelative, style} from '../style
|
|
25
|
+
import {fontRelative, style} from '../style' with {type: 'macro'};
|
|
26
26
|
import {FormContext, useFormProps} from './Form';
|
|
27
27
|
import {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';
|
|
28
28
|
import {IconContext} from './Icon';
|
package/src/SegmentedControl.tsx
CHANGED
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef} from '@react-types/shared';
|
|
13
14
|
import {centerBaseline} from './CenterBaseline';
|
|
14
|
-
import {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, Radio, RadioGroup,
|
|
15
|
+
import {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, Radio, RadioGroup, RadioGroupStateContext, SlotProps} from 'react-aria-components';
|
|
15
16
|
import {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
17
|
+
import {focusRing, size, style} from '../style' with {type: 'macro'};
|
|
18
|
+
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
18
19
|
import {IconContext} from './Icon';
|
|
19
20
|
import {pressScale} from './pressScale';
|
|
20
|
-
import {size, style} from '../style/spectrum-theme' with {type: 'macro'};
|
|
21
21
|
import {Text, TextContext} from './Content';
|
|
22
22
|
import {useDOMRef, useFocusableRef} from '@react-spectrum/utils';
|
|
23
23
|
import {useLayoutEffect} from '@react-aria/utils';
|
|
24
24
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
25
25
|
|
|
26
|
-
export interface SegmentedControlProps extends
|
|
26
|
+
export interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {
|
|
27
27
|
/**
|
|
28
28
|
* The content to display in the segmented control.
|
|
29
29
|
*/
|
|
@@ -32,16 +32,22 @@ export interface SegmentedControlProps extends Omit<RadioGroupProps, 'isReadOnly
|
|
|
32
32
|
* Whether the segmented control is disabled.
|
|
33
33
|
*/
|
|
34
34
|
isDisabled?: boolean,
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/** The id of the currently selected item (controlled). */
|
|
36
|
+
selectedKey?: string | null,
|
|
37
|
+
/** The id of the initial selected item (uncontrolled). */
|
|
38
|
+
defaultSelectedKey?: string,
|
|
39
|
+
/** Handler that is called when the selection changes. */
|
|
40
|
+
onSelectionChange?: (id: string) => void
|
|
39
41
|
}
|
|
40
|
-
export interface SegmentedControlItemProps extends
|
|
42
|
+
export interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {
|
|
41
43
|
/**
|
|
42
|
-
* The content to display in the control item.
|
|
44
|
+
* The content to display in the segmented control item.
|
|
43
45
|
*/
|
|
44
|
-
children: ReactNode
|
|
46
|
+
children: ReactNode,
|
|
47
|
+
/** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */
|
|
48
|
+
id: string,
|
|
49
|
+
/** Whether the item is disabled or not. */
|
|
50
|
+
isDisabled?: boolean
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
export const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps, DOMRefValue<HTMLDivElement>>>(null);
|
|
@@ -135,8 +141,9 @@ const InternalSegmentedControlContext = createContext<InternalSegmentedControlCo
|
|
|
135
141
|
function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {
|
|
136
142
|
[props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);
|
|
137
143
|
let {
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
defaultSelectedKey,
|
|
145
|
+
selectedKey,
|
|
146
|
+
onSelectionChange
|
|
140
147
|
} = props;
|
|
141
148
|
let domRef = useDOMRef(ref);
|
|
142
149
|
|
|
@@ -148,21 +155,23 @@ function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivEleme
|
|
|
148
155
|
prevRef.current = currentSelectedRef?.current.getBoundingClientRect();
|
|
149
156
|
}
|
|
150
157
|
|
|
151
|
-
if (
|
|
152
|
-
|
|
158
|
+
if (onSelectionChange) {
|
|
159
|
+
onSelectionChange(value);
|
|
153
160
|
}
|
|
154
161
|
};
|
|
155
162
|
|
|
156
163
|
return (
|
|
157
164
|
<RadioGroup
|
|
158
165
|
{...props}
|
|
166
|
+
value={selectedKey}
|
|
167
|
+
defaultValue={defaultSelectedKey}
|
|
159
168
|
ref={domRef}
|
|
160
169
|
orientation="horizontal"
|
|
161
170
|
style={props.UNSAFE_style}
|
|
162
171
|
onChange={onChange}
|
|
163
172
|
className={(props.UNSAFE_className || '') + segmentedControl({size: 'M'}, props.styles)}
|
|
164
173
|
aria-label={props['aria-label']}>
|
|
165
|
-
<DefaultSelectionTracker defaultValue={
|
|
174
|
+
<DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef}>
|
|
166
175
|
{props.children}
|
|
167
176
|
</DefaultSelectionTracker>
|
|
168
177
|
</RadioGroup>
|
|
@@ -197,7 +206,7 @@ function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRe
|
|
|
197
206
|
let divRef = useRef<HTMLDivElement>(null);
|
|
198
207
|
let {register, prevRef, currentSelectedRef} = useContext(InternalSegmentedControlContext);
|
|
199
208
|
let state = useContext(RadioGroupStateContext);
|
|
200
|
-
let isSelected = props.
|
|
209
|
+
let isSelected = props.id === state?.selectedValue;
|
|
201
210
|
// do not apply animation if a user has the prefers-reduced-motion setting
|
|
202
211
|
let isReduced = false;
|
|
203
212
|
if (window?.matchMedia) {
|
|
@@ -205,7 +214,7 @@ function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRe
|
|
|
205
214
|
}
|
|
206
215
|
|
|
207
216
|
useLayoutEffect(() => {
|
|
208
|
-
register?.(props.
|
|
217
|
+
register?.(props.id);
|
|
209
218
|
}, []);
|
|
210
219
|
|
|
211
220
|
useLayoutEffect(() => {
|
|
@@ -231,7 +240,8 @@ function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRe
|
|
|
231
240
|
|
|
232
241
|
return (
|
|
233
242
|
<Radio
|
|
234
|
-
{...props}
|
|
243
|
+
{...props}
|
|
244
|
+
value={props.id}
|
|
235
245
|
ref={domRef}
|
|
236
246
|
inputRef={inputRef}
|
|
237
247
|
style={props.UNSAFE_style}
|
|
@@ -259,13 +269,13 @@ function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRe
|
|
|
259
269
|
}
|
|
260
270
|
|
|
261
271
|
/**
|
|
262
|
-
* A
|
|
272
|
+
* A SegmentedControlItem represents an option within a SegmentedControl.
|
|
263
273
|
*/
|
|
264
274
|
const _SegmentedControlItem = /*#__PURE__*/ forwardRef(SegmentedControlItem);
|
|
265
275
|
export {_SegmentedControlItem as SegmentedControlItem};
|
|
266
276
|
|
|
267
277
|
/**
|
|
268
|
-
* A
|
|
278
|
+
* A SegmentedControl is a mutually exclusive group of buttons used for view switching.
|
|
269
279
|
*/
|
|
270
280
|
const _SegmentedControl = /*#__PURE__*/ forwardRef(SegmentedControl);
|
|
271
281
|
export {_SegmentedControl as SegmentedControl};
|
package/src/Skeleton.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import {colorToken} from '../style/tokens' with {type: 'macro'};
|
|
|
15
15
|
import {mergeRefs} from '@react-aria/utils';
|
|
16
16
|
import {mergeStyles} from '../style/runtime';
|
|
17
17
|
import {raw} from '../style/style-macro' with {type: 'macro'};
|
|
18
|
-
import {style} from '../style
|
|
18
|
+
import {style} from '../style' with {type: 'macro'};
|
|
19
19
|
import {StyleString} from '../style/types';
|
|
20
20
|
|
|
21
21
|
let reduceMotion = typeof window?.matchMedia === 'function'
|
|
@@ -64,6 +64,9 @@ export interface SkeletonProps {
|
|
|
64
64
|
isLoading: boolean
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* A Skeleton wraps around content to render it as a placeholder.
|
|
69
|
+
*/
|
|
67
70
|
export function Skeleton({children, isLoading}: SkeletonProps) {
|
|
68
71
|
// Disable all form components inside a skeleton.
|
|
69
72
|
return (
|
|
@@ -19,6 +19,10 @@ export interface SkeletonCollectionProps {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
let cache = new WeakMap();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A SkeletonCollection generates placeholder content within a collection component such as CardView.
|
|
25
|
+
*/
|
|
22
26
|
export const SkeletonCollection = createLeafComponent('skeleton', (props: SkeletonCollectionProps, ref, node) => {
|
|
23
27
|
// Cache rendering based on node object identity. This allows the children function to randomize
|
|
24
28
|
// its content (e.g. heights) and preserve on re-renders.
|
package/src/Slider.tsx
CHANGED
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
} from 'react-aria-components';
|
|
21
21
|
import {clamp} from '@react-aria/utils';
|
|
22
22
|
import {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';
|
|
23
|
-
import {field, fieldInput,
|
|
23
|
+
import {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
24
24
|
import {FieldLabel} from './Field';
|
|
25
25
|
import {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';
|
|
26
|
+
import {focusRing, size, style} from '../style' with {type: 'macro'};
|
|
26
27
|
import {FormContext, useFormProps} from './Form';
|
|
27
28
|
import {mergeStyles} from '../style/runtime';
|
|
28
29
|
import {pressScale} from './pressScale';
|
|
29
|
-
import {size, style} from '../style/spectrum-theme' with {type: 'macro'};
|
|
30
30
|
import {useFocusableRef} from '@react-spectrum/utils';
|
|
31
31
|
import {useLocale, useNumberFormatter} from '@react-aria/i18n';
|
|
32
32
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
package/src/StatusLight.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import {ContextValue, SlotProps} from 'react-aria-components';
|
|
|
16
16
|
import {createContext, forwardRef, ReactNode} from 'react';
|
|
17
17
|
import {filterDOMProps} from '@react-aria/utils';
|
|
18
18
|
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
19
|
-
import {size, style} from '../style
|
|
19
|
+
import {size, style} from '../style' with {type: 'macro'};
|
|
20
20
|
import {Text} from './Content';
|
|
21
21
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
22
22
|
import {useIsSkeleton} from './Skeleton';
|
package/src/Switch.tsx
CHANGED
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
ContextValue,
|
|
17
17
|
SwitchRenderProps
|
|
18
18
|
} from 'react-aria-components';
|
|
19
|
-
import {baseColor, fontRelative, style} from '../style
|
|
19
|
+
import {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};
|
|
20
20
|
import {CenterBaseline} from './CenterBaseline';
|
|
21
21
|
import {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';
|
|
22
22
|
import {FocusableRef, FocusableRefValue} from '@react-types/shared';
|
|
23
|
-
import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
24
23
|
import {FormContext, useFormProps} from './Form';
|
|
24
|
+
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
25
25
|
import {pressScale} from './pressScale';
|
|
26
26
|
import {useFocusableRef} from '@react-spectrum/utils';
|
|
27
27
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
package/src/Table.tsx
CHANGED
|
@@ -44,9 +44,9 @@ import {
|
|
|
44
44
|
import {centerPadding, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};
|
|
45
45
|
import {Checkbox} from './Checkbox';
|
|
46
46
|
import Chevron from '../ui-icons/Chevron';
|
|
47
|
+
import {colorMix, fontRelative, lightDark, size, style} from '../style/spectrum-theme' with {type: 'macro'};
|
|
47
48
|
import {ColumnSize} from '@react-types/table';
|
|
48
49
|
import {DOMRef, LoadingState, Node} from '@react-types/shared';
|
|
49
|
-
import {fontRelative, lightDark, size, style} from '../style/spectrum-theme' with {type: 'macro'};
|
|
50
50
|
import {GridNode} from '@react-types/grid';
|
|
51
51
|
import {IconContext} from './Icon';
|
|
52
52
|
// @ts-ignore
|
|
@@ -430,9 +430,8 @@ const cellFocus = {
|
|
|
430
430
|
borderRadius: size(6)
|
|
431
431
|
} as const;
|
|
432
432
|
|
|
433
|
-
function CellFocusRing(
|
|
434
|
-
|
|
435
|
-
return <div role="presentation" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible})} />;
|
|
433
|
+
function CellFocusRing() {
|
|
434
|
+
return <div role="presentation" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />;
|
|
436
435
|
}
|
|
437
436
|
|
|
438
437
|
const columnStyles = style({
|
|
@@ -463,7 +462,10 @@ const columnStyles = style({
|
|
|
463
462
|
default: 'gray-300',
|
|
464
463
|
forcedColors: 'ButtonBorder'
|
|
465
464
|
},
|
|
466
|
-
borderTopWidth:
|
|
465
|
+
borderTopWidth: {
|
|
466
|
+
default: 0,
|
|
467
|
+
isQuiet: 1
|
|
468
|
+
},
|
|
467
469
|
borderBottomWidth: 1,
|
|
468
470
|
borderStartWidth: 0,
|
|
469
471
|
borderEndWidth: {
|
|
@@ -493,17 +495,18 @@ export interface ColumnProps extends RACColumnProps {
|
|
|
493
495
|
*/
|
|
494
496
|
export function Column(props: ColumnProps) {
|
|
495
497
|
let {isHeaderRowHovered} = useContext(InternalTableHeaderContext);
|
|
498
|
+
let {isQuiet} = useContext(InternalTableContext);
|
|
496
499
|
let {allowsResizing, children, align = 'start'} = props;
|
|
497
500
|
let isColumnResizable = allowsResizing;
|
|
498
501
|
|
|
499
502
|
return (
|
|
500
|
-
<RACColumn {...props} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align})}>
|
|
503
|
+
<RACColumn {...props} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align, isQuiet})}>
|
|
501
504
|
{({allowsSorting, sortDirection, isFocusVisible, sort, startResize, isHovered}) => (
|
|
502
505
|
<>
|
|
503
506
|
{/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity
|
|
504
507
|
(no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}
|
|
505
508
|
{/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}
|
|
506
|
-
<CellFocusRing
|
|
509
|
+
{isFocusVisible && <CellFocusRing />}
|
|
507
510
|
{isColumnResizable ?
|
|
508
511
|
(
|
|
509
512
|
<ResizableColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} isHovered={isHeaderRowHovered || isHovered} align={align}>
|
|
@@ -797,7 +800,8 @@ const selectAllCheckbox = style({
|
|
|
797
800
|
|
|
798
801
|
const selectAllCheckboxColumn = style({
|
|
799
802
|
padding: 0,
|
|
800
|
-
height: '
|
|
803
|
+
height: 'full',
|
|
804
|
+
boxSizing: 'border-box',
|
|
801
805
|
outlineStyle: 'none',
|
|
802
806
|
position: 'relative',
|
|
803
807
|
alignContent: 'center',
|
|
@@ -806,7 +810,10 @@ const selectAllCheckboxColumn = style({
|
|
|
806
810
|
forcedColors: 'ButtonBorder'
|
|
807
811
|
},
|
|
808
812
|
borderXWidth: 0,
|
|
809
|
-
borderTopWidth:
|
|
813
|
+
borderTopWidth: {
|
|
814
|
+
default: 0,
|
|
815
|
+
isQuiet: 1
|
|
816
|
+
},
|
|
810
817
|
borderBottomWidth: 1,
|
|
811
818
|
borderStyle: 'solid',
|
|
812
819
|
backgroundColor: 'gray-75'
|
|
@@ -814,7 +821,7 @@ const selectAllCheckboxColumn = style({
|
|
|
814
821
|
|
|
815
822
|
let InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});
|
|
816
823
|
|
|
817
|
-
export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies'> {}
|
|
824
|
+
export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}
|
|
818
825
|
|
|
819
826
|
/**
|
|
820
827
|
* A header within a `<Table>`, containing the table columns.
|
|
@@ -822,6 +829,7 @@ export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style
|
|
|
822
829
|
export function TableHeader<T extends object>({columns, children}: TableHeaderProps<T>) {
|
|
823
830
|
let scale = useScale();
|
|
824
831
|
let {selectionBehavior, selectionMode} = useTableOptions();
|
|
832
|
+
let {isQuiet} = useContext(InternalTableContext);
|
|
825
833
|
let [isHeaderRowHovered, setHeaderRowHovered] = useState(false);
|
|
826
834
|
|
|
827
835
|
return (
|
|
@@ -831,12 +839,12 @@ export function TableHeader<T extends object>({columns, children}: TableHeaderPr
|
|
|
831
839
|
{selectionBehavior === 'toggle' && (
|
|
832
840
|
// Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
|
|
833
841
|
// @ts-ignore
|
|
834
|
-
<RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn}>
|
|
842
|
+
<RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>
|
|
835
843
|
{({isFocusVisible}) => (
|
|
836
844
|
<>
|
|
837
845
|
{selectionMode === 'single' &&
|
|
838
846
|
<>
|
|
839
|
-
<CellFocusRing
|
|
847
|
+
{isFocusVisible && <CellFocusRing />}
|
|
840
848
|
<VisuallyHiddenSelectAllLabel />
|
|
841
849
|
</>
|
|
842
850
|
}
|
|
@@ -919,13 +927,8 @@ const checkboxCellStyle = style({
|
|
|
919
927
|
paddingStart: 16,
|
|
920
928
|
alignContent: 'center',
|
|
921
929
|
height: '[calc(100% - 1px)]',
|
|
922
|
-
borderBottomWidth: 0
|
|
923
|
-
|
|
924
|
-
// of having a separate white rectangle div base below a div with the row background color set above it as a mask
|
|
925
|
-
// is that it doesn't come out as the same color as the other cells because the base below the sticky cell will be the blue of the
|
|
926
|
-
// other cells, not the same white base. If I could convert informative-900/10 (and the rest of the rowBackgroundColors) to an equivalent without any opacity
|
|
927
|
-
// then this would be possible. Currently waiting request for Spectrum to provide tokens for these equivalent values
|
|
928
|
-
// backgroundColor: '--rowBackgroundColor'
|
|
930
|
+
borderBottomWidth: 0,
|
|
931
|
+
backgroundColor: '--rowBackgroundColor'
|
|
929
932
|
});
|
|
930
933
|
|
|
931
934
|
const cellContent = style({
|
|
@@ -952,15 +955,7 @@ const cellContent = style({
|
|
|
952
955
|
margin: {
|
|
953
956
|
default: -4,
|
|
954
957
|
isSticky: 0
|
|
955
|
-
}
|
|
956
|
-
});
|
|
957
|
-
|
|
958
|
-
const cellBackground = style({
|
|
959
|
-
position: 'absolute',
|
|
960
|
-
top: 0,
|
|
961
|
-
bottom: 0,
|
|
962
|
-
right: 0,
|
|
963
|
-
left: 0,
|
|
958
|
+
},
|
|
964
959
|
backgroundColor: {
|
|
965
960
|
default: 'transparent',
|
|
966
961
|
isSticky: '--rowBackgroundColor'
|
|
@@ -996,17 +991,7 @@ export function Cell(props: CellProps) {
|
|
|
996
991
|
{...otherProps}>
|
|
997
992
|
{({isFocusVisible}) => (
|
|
998
993
|
<>
|
|
999
|
-
{
|
|
1000
|
-
// TODO: problem with having the checkbox cell itself use the row background color directly instead
|
|
1001
|
-
of having a separate white rectangle div base below a div with the row background color set above it as a mask
|
|
1002
|
-
is that it doesn't come out as the same color as the other cells because the base below the sticky cell when other selected cells are scrolled below it will be the blue of the
|
|
1003
|
-
other cells, not the same white base. If I could convert informative-900/10 (and the rest of the rowBackgroundColors) to an equivalent without any opacity
|
|
1004
|
-
then I could do away with this styling. To reproduce this, comment out the stickyCell gray-25, get rid of the below div and apply backgroundColor: '--rowBackgroundColor' to checkboxCellStyle.
|
|
1005
|
-
Having the CellFocusRing here instead of applying a outline on the cell directly also makes it NOT overlap with the border (can be remedied with a -3px outline offset) and applying a border radius to get the curved outline focus ring messes
|
|
1006
|
-
with the divider rendered on the cell since those are also borders
|
|
1007
|
-
*/}
|
|
1008
|
-
<div role="presentation" className={cellBackground({isSticky})} />
|
|
1009
|
-
<CellFocusRing isFocusVisible={isFocusVisible} />
|
|
994
|
+
{isFocusVisible && <CellFocusRing />}
|
|
1010
995
|
<span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>
|
|
1011
996
|
</>
|
|
1012
997
|
)}
|
|
@@ -1014,28 +999,22 @@ export function Cell(props: CellProps) {
|
|
|
1014
999
|
);
|
|
1015
1000
|
}
|
|
1016
1001
|
|
|
1002
|
+
// Use color-mix instead of transparency so sticky cells work correctly.
|
|
1003
|
+
const selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));
|
|
1004
|
+
const selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));
|
|
1017
1005
|
const rowBackgroundColor = {
|
|
1018
|
-
default:
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
isPressed: 'gray-900/10', // table-row-hover-color
|
|
1022
|
-
isSelected: {
|
|
1023
|
-
default: lightDark('informative-900/10', 'informative-700/10'), // table-selected-row-background-color, opacity /10
|
|
1024
|
-
isFocusVisibleWithin: lightDark('informative-900/15', 'informative-700/15'), // table-selected-row-background-color, opacity /15
|
|
1025
|
-
isHovered: lightDark('informative-900/15', 'informative-700/15'), // table-selected-row-background-color, opacity /15
|
|
1026
|
-
isPressed: lightDark('informative-900/15', 'informative-700/15') // table-selected-row-background-color, opacity /15
|
|
1006
|
+
default: {
|
|
1007
|
+
default: 'gray-25',
|
|
1008
|
+
isQuiet: 'transparent'
|
|
1027
1009
|
},
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
isHovered: lightDark('informative-900/15', 'informative-700/15'), // table-selected-row-background-color, opacity /15
|
|
1037
|
-
isPressed: lightDark('informative-900/15', 'informative-700/15') // table-selected-row-background-color, opacity /15
|
|
1038
|
-
}
|
|
1010
|
+
isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
|
|
1011
|
+
isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
|
|
1012
|
+
isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color
|
|
1013
|
+
isSelected: {
|
|
1014
|
+
default: selectedBackground, // table-selected-row-background-color, opacity /10
|
|
1015
|
+
isFocusVisibleWithin: selectedActiveBackground, // table-selected-row-background-color, opacity /15
|
|
1016
|
+
isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15
|
|
1017
|
+
isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15
|
|
1039
1018
|
},
|
|
1040
1019
|
forcedColors: {
|
|
1041
1020
|
default: 'Background'
|
|
@@ -1046,7 +1025,7 @@ const row = style<RowRenderProps & S2TableProps>({
|
|
|
1046
1025
|
height: 'full',
|
|
1047
1026
|
position: 'relative',
|
|
1048
1027
|
boxSizing: 'border-box',
|
|
1049
|
-
backgroundColor: rowBackgroundColor,
|
|
1028
|
+
backgroundColor: '--rowBackgroundColor',
|
|
1050
1029
|
'--rowBackgroundColor': {
|
|
1051
1030
|
type: 'backgroundColor',
|
|
1052
1031
|
value: rowBackgroundColor
|