@react-spectrum/s2 3.0.0-nightly-ab9fd5c68-241126 → 3.0.0-nightly-b0f156972-241128
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 -5
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +2 -5
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionButton.cjs +2 -6
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +3 -7
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +2 -5
- package/dist/ActionButtonGroup.cjs.map +1 -1
- package/dist/ActionButtonGroup.css.map +1 -1
- package/dist/ActionButtonGroup.mjs +2 -5
- package/dist/ActionButtonGroup.mjs.map +1 -1
- package/dist/ActionMenu.cjs +2 -5
- package/dist/ActionMenu.cjs.map +1 -1
- package/dist/ActionMenu.mjs +2 -5
- package/dist/ActionMenu.mjs.map +1 -1
- package/dist/AlertDialog.cjs +2 -5
- package/dist/AlertDialog.cjs.map +1 -1
- package/dist/AlertDialog.css.map +1 -1
- package/dist/AlertDialog.mjs +2 -5
- package/dist/AlertDialog.mjs.map +1 -1
- package/dist/Avatar.cjs +2 -5
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +2 -5
- package/dist/Avatar.mjs.map +1 -1
- package/dist/AvatarGroup.cjs +2 -5
- package/dist/AvatarGroup.cjs.map +1 -1
- package/dist/AvatarGroup.css.map +1 -1
- package/dist/AvatarGroup.mjs +2 -5
- package/dist/AvatarGroup.mjs.map +1 -1
- package/dist/Badge.cjs +2 -5
- package/dist/Badge.cjs.map +1 -1
- package/dist/Badge.css.map +1 -1
- package/dist/Badge.mjs +2 -5
- package/dist/Badge.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs +4 -6
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +5 -7
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +4 -12
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +5 -13
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +2 -5
- package/dist/ButtonGroup.cjs.map +1 -1
- package/dist/ButtonGroup.css.map +1 -1
- package/dist/ButtonGroup.mjs +3 -6
- package/dist/ButtonGroup.mjs.map +1 -1
- package/dist/CardView.cjs +2 -3
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +3 -4
- package/dist/CardView.mjs.map +1 -1
- package/dist/Checkbox.cjs +2 -6
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +3 -7
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +2 -5
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +3 -6
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/ClearButton.cjs +2 -3
- package/dist/ClearButton.cjs.map +1 -1
- package/dist/ClearButton.css.map +1 -1
- package/dist/ClearButton.mjs +2 -3
- package/dist/ClearButton.mjs.map +1 -1
- package/dist/CloseButton.cjs +2 -5
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css.map +1 -1
- package/dist/CloseButton.mjs +2 -5
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs +2 -5
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +2 -5
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +2 -5
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +3 -6
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorSlider.cjs +2 -5
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +3 -6
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +2 -5
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +3 -6
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +2 -5
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs +2 -5
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ColorWheel.cjs +2 -5
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs +2 -5
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/ComboBox.cjs +2 -5
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +3 -6
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/Content.cjs +12 -19
- package/dist/Content.cjs.map +1 -1
- package/dist/Content.mjs +12 -19
- package/dist/Content.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +2 -5
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +2 -5
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/CustomDialog.cjs +2 -5
- package/dist/CustomDialog.cjs.map +1 -1
- package/dist/CustomDialog.css.map +1 -1
- package/dist/CustomDialog.mjs +2 -5
- package/dist/CustomDialog.mjs.map +1 -1
- package/dist/Dialog.cjs +2 -6
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +2 -6
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +6 -15
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +7 -16
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +2 -6
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs +2 -6
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs +2 -5
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +2 -5
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +6 -9
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +6 -9
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +2 -5
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs +2 -5
- package/dist/Form.mjs.map +1 -1
- package/dist/FullscreenDialog.cjs +2 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +2 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +2 -6
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs +2 -6
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs +2 -3
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +3 -4
- package/dist/Image.mjs.map +1 -1
- package/dist/InlineAlert.cjs +2 -6
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +3 -7
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Link.cjs +2 -6
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs +3 -7
- package/dist/Link.mjs.map +1 -1
- package/dist/Menu.cjs +2 -5
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +3 -6
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +2 -6
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +2 -6
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +2 -5
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +3 -6
- package/dist/Modal.mjs.map +1 -1
- package/dist/NumberField.cjs +2 -5
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +2 -5
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +3 -6
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +4 -8
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +5 -9
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +2 -6
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +2 -6
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +2 -6
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +2 -6
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Radio.cjs +2 -6
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +3 -7
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +2 -6
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +3 -7
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/RangeSlider.cjs +2 -3
- package/dist/RangeSlider.cjs.map +1 -1
- package/dist/RangeSlider.mjs +3 -4
- package/dist/RangeSlider.mjs.map +1 -1
- package/dist/SearchField.cjs +2 -5
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +3 -6
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +5 -11
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +6 -12
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/Slider.cjs +2 -3
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +3 -4
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +2 -6
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs +2 -6
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs +2 -6
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +3 -7
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +9 -21
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +10 -22
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +2 -5
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +2 -5
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs +4 -6
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +4 -6
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +8 -19
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +9 -20
- package/dist/TextField.mjs.map +1 -1
- package/dist/ToggleButton.cjs +2 -6
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +2 -6
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs +2 -5
- package/dist/ToggleButtonGroup.cjs.map +1 -1
- package/dist/ToggleButtonGroup.mjs +2 -5
- package/dist/ToggleButtonGroup.mjs.map +1 -1
- package/dist/Tooltip.cjs +3 -6
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +4 -7
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/types.d.ts +64 -64
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/Accordion.tsx +5 -8
- package/src/ActionButton.tsx +6 -9
- package/src/ActionButtonGroup.tsx +5 -8
- package/src/ActionMenu.tsx +5 -8
- package/src/AlertDialog.tsx +5 -8
- package/src/Avatar.tsx +5 -8
- package/src/AvatarGroup.tsx +5 -8
- package/src/Badge.tsx +5 -8
- package/src/Breadcrumbs.tsx +6 -12
- package/src/Button.tsx +10 -16
- package/src/ButtonGroup.tsx +5 -8
- package/src/CardView.tsx +2 -5
- package/src/Checkbox.tsx +6 -9
- package/src/CheckboxGroup.tsx +5 -8
- package/src/ClearButton.tsx +2 -5
- package/src/CloseButton.tsx +5 -8
- package/src/ColorArea.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +5 -8
- package/src/ColorWheel.tsx +5 -8
- package/src/ComboBox.tsx +5 -8
- package/src/Content.tsx +12 -30
- package/src/ContextualHelp.tsx +5 -8
- package/src/CustomDialog.tsx +5 -8
- package/src/Dialog.tsx +6 -9
- package/src/Disclosure.tsx +15 -24
- package/src/Divider.tsx +6 -9
- package/src/DropZone.tsx +5 -8
- package/src/Field.tsx +6 -15
- package/src/Form.tsx +5 -8
- package/src/FullscreenDialog.tsx +5 -8
- package/src/IllustratedMessage.tsx +6 -9
- package/src/Image.tsx +3 -6
- package/src/InlineAlert.tsx +6 -9
- package/src/Link.tsx +6 -9
- package/src/Menu.tsx +5 -8
- package/src/Meter.tsx +6 -9
- package/src/Modal.tsx +5 -8
- package/src/NumberField.tsx +5 -8
- package/src/Picker.tsx +5 -8
- package/src/Popover.tsx +9 -15
- package/src/ProgressBar.tsx +6 -9
- package/src/ProgressCircle.tsx +6 -9
- package/src/Radio.tsx +6 -9
- package/src/RadioGroup.tsx +6 -9
- package/src/RangeSlider.tsx +2 -5
- package/src/SearchField.tsx +5 -8
- package/src/SegmentedControl.tsx +10 -16
- package/src/Slider.tsx +2 -5
- package/src/StatusLight.tsx +6 -9
- package/src/Switch.tsx +6 -9
- package/src/TableView.tsx +20 -32
- package/src/Tabs.tsx +5 -8
- package/src/TagGroup.tsx +7 -14
- package/src/TextField.tsx +20 -28
- package/src/ToggleButton.tsx +6 -9
- package/src/ToggleButtonGroup.tsx +5 -8
- package/src/Tooltip.tsx +5 -9
- package/style/dist/style-macro.cjs +12 -0
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +12 -0
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/style-macro.ts +17 -1
package/src/TableView.tsx
CHANGED
|
@@ -255,7 +255,10 @@ export class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {
|
|
|
255
255
|
|
|
256
256
|
export const TableContext = createContext<ContextValue<TableViewProps, DOMRefValue<HTMLDivElement>>>(null);
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
/**
|
|
259
|
+
* Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.
|
|
260
|
+
*/
|
|
261
|
+
export const TableView = forwardRef(function TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {
|
|
259
262
|
[props, ref] = useSpectrumContextProps(props, ref, TableContext);
|
|
260
263
|
let {
|
|
261
264
|
UNSAFE_style,
|
|
@@ -344,7 +347,7 @@ function TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {
|
|
|
344
347
|
</UNSTABLE_Virtualizer>
|
|
345
348
|
</ResizableTableContainer>
|
|
346
349
|
);
|
|
347
|
-
}
|
|
350
|
+
});
|
|
348
351
|
|
|
349
352
|
const centeredWrapper = style({
|
|
350
353
|
display: 'flex',
|
|
@@ -356,7 +359,10 @@ const centeredWrapper = style({
|
|
|
356
359
|
|
|
357
360
|
export interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'dependencies'> {}
|
|
358
361
|
|
|
359
|
-
|
|
362
|
+
/**
|
|
363
|
+
* The body of a `<Table>`, containing the table rows.
|
|
364
|
+
*/
|
|
365
|
+
export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
360
366
|
let {items, renderEmptyState, children} = props;
|
|
361
367
|
let domRef = useDOMRef(ref);
|
|
362
368
|
let {loadingState} = useContext(InternalTableContext);
|
|
@@ -422,13 +428,7 @@ function TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLD
|
|
|
422
428
|
{renderer}
|
|
423
429
|
</RACTableBody>
|
|
424
430
|
);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* The body of a `<Table>`, containing the table rows.
|
|
429
|
-
*/
|
|
430
|
-
let _TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(TableBody);
|
|
431
|
-
export {_TableBody as TableBody};
|
|
431
|
+
});
|
|
432
432
|
|
|
433
433
|
const cellFocus = {
|
|
434
434
|
outlineStyle: {
|
|
@@ -830,7 +830,10 @@ let InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({
|
|
|
830
830
|
|
|
831
831
|
export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}
|
|
832
832
|
|
|
833
|
-
|
|
833
|
+
/**
|
|
834
|
+
* A header within a `<Table>`, containing the table columns.
|
|
835
|
+
*/
|
|
836
|
+
export const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T extends object>({columns, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
834
837
|
let scale = useScale();
|
|
835
838
|
let {selectionBehavior, selectionMode} = useTableOptions();
|
|
836
839
|
let {isQuiet} = useContext(InternalTableContext);
|
|
@@ -870,13 +873,7 @@ function TableHeader<T extends object>({columns, children}: TableHeaderProps<T>,
|
|
|
870
873
|
</RACTableHeader>
|
|
871
874
|
</InternalTableHeaderContext.Provider>
|
|
872
875
|
);
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* A header within a `<Table>`, containing the table columns.
|
|
877
|
-
*/
|
|
878
|
-
let _TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(TableHeader);
|
|
879
|
-
export {_TableHeader as TableHeader};
|
|
876
|
+
});
|
|
880
877
|
|
|
881
878
|
function VisuallyHiddenSelectAllLabel() {
|
|
882
879
|
let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');
|
|
@@ -1093,7 +1090,10 @@ const row = style<RowRenderProps & S2TableProps>({
|
|
|
1093
1090
|
|
|
1094
1091
|
export interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'children' | 'textValue'> {}
|
|
1095
1092
|
|
|
1096
|
-
|
|
1093
|
+
/**
|
|
1094
|
+
* A row within a `<Table>`.
|
|
1095
|
+
*/
|
|
1096
|
+
export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T extends object>({id, columns, children, ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
1097
1097
|
let {selectionBehavior, selectionMode} = useTableOptions();
|
|
1098
1098
|
let tableVisualOptions = useContext(InternalTableContext);
|
|
1099
1099
|
let domRef = useDOMRef(ref);
|
|
@@ -1118,16 +1118,4 @@ function Row<T extends object>({id, columns, children, ...otherProps}: RowProps<
|
|
|
1118
1118
|
</Collection>
|
|
1119
1119
|
</RACRow>
|
|
1120
1120
|
);
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
/**
|
|
1124
|
-
* A row within a `<Table>`.
|
|
1125
|
-
*/
|
|
1126
|
-
let _Row = /*#__PURE__*/ (forwardRef as forwardRefType)(Row);
|
|
1127
|
-
export {_Row as Row};
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.
|
|
1131
|
-
*/
|
|
1132
|
-
const _TableView = forwardRef(TableView);
|
|
1133
|
-
export {_TableView as TableView};
|
|
1121
|
+
});
|
package/src/Tabs.tsx
CHANGED
|
@@ -333,7 +333,10 @@ const tabs = style({
|
|
|
333
333
|
}
|
|
334
334
|
}, getAllowedOverrides({height: true}));
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
/**
|
|
337
|
+
* Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.
|
|
338
|
+
*/
|
|
339
|
+
export const Tabs = forwardRef(function Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {
|
|
337
340
|
[props, ref] = useSpectrumContextProps(props, ref, TabsContext);
|
|
338
341
|
let {
|
|
339
342
|
density = 'regular',
|
|
@@ -357,10 +360,4 @@ function Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {
|
|
|
357
360
|
</Provider>
|
|
358
361
|
</RACTabs>
|
|
359
362
|
);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.
|
|
364
|
-
*/
|
|
365
|
-
const _Tabs = forwardRef(Tabs);
|
|
366
|
-
export {_Tabs as Tabs};
|
|
363
|
+
});
|
package/src/TagGroup.tsx
CHANGED
|
@@ -103,7 +103,8 @@ const helpTextStyles = style({
|
|
|
103
103
|
|
|
104
104
|
const InternalTagGroupContext = createContext<TagGroupProps<any>>({});
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */
|
|
107
|
+
export const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
107
108
|
[props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);
|
|
108
109
|
props = useFormProps(props);
|
|
109
110
|
let {onRemove} = props;
|
|
@@ -114,11 +115,7 @@ function TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDiv
|
|
|
114
115
|
</CollectionBuilder>
|
|
115
116
|
</InternalTagGroupContext.Provider>
|
|
116
117
|
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */
|
|
120
|
-
let _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);
|
|
121
|
-
export {_TagGroup as TagGroup};
|
|
118
|
+
});
|
|
122
119
|
|
|
123
120
|
function TagGroupInner<T>({
|
|
124
121
|
props: {
|
|
@@ -360,7 +357,7 @@ function TagGroupInner<T>({
|
|
|
360
357
|
minWidth: 'full',
|
|
361
358
|
font: 'ui'
|
|
362
359
|
})}>
|
|
363
|
-
{item => <
|
|
360
|
+
{item => <Tag {...item.props} id={item.key} textValue={item.textValue} />}
|
|
364
361
|
</TagList>
|
|
365
362
|
{!isEmpty && (showCollapseToggleButton || groupActionLabel) &&
|
|
366
363
|
<ActionGroup
|
|
@@ -519,7 +516,8 @@ const avatarSize = {
|
|
|
519
516
|
L: 24
|
|
520
517
|
} as const;
|
|
521
518
|
|
|
522
|
-
|
|
519
|
+
/** An individual Tag for TagGroups. */
|
|
520
|
+
export const Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {
|
|
523
521
|
textValue ||= typeof children === 'string' ? children : undefined;
|
|
524
522
|
let ctx = useSlottedContext(TagGroupContext);
|
|
525
523
|
let isInRealDOM = Boolean(ctx?.size);
|
|
@@ -541,12 +539,7 @@ function Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivEleme
|
|
|
541
539
|
))}
|
|
542
540
|
</AriaTag>
|
|
543
541
|
);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
/** An individual Tag for TagGroups. */
|
|
548
|
-
let _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);
|
|
549
|
-
export {_Tag as Tag};
|
|
542
|
+
});
|
|
550
543
|
|
|
551
544
|
function TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {
|
|
552
545
|
let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};
|
package/src/TextField.tsx
CHANGED
|
@@ -43,33 +43,35 @@ export interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'c
|
|
|
43
43
|
|
|
44
44
|
export const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* TextFields are text inputs that allow users to input custom text entries
|
|
48
|
+
* with a keyboard. Various decorations can be displayed around the field to
|
|
49
|
+
* communicate the entry requirements.
|
|
50
|
+
*/
|
|
51
|
+
export const TextField = forwardRef(function TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {
|
|
47
52
|
[props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);
|
|
48
53
|
return (
|
|
49
|
-
<
|
|
54
|
+
<TextFieldBase
|
|
50
55
|
{...props}
|
|
51
56
|
ref={ref}>
|
|
52
57
|
<Input />
|
|
53
|
-
</
|
|
58
|
+
</TextFieldBase>
|
|
54
59
|
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* TextFields are text inputs that allow users to input custom text entries
|
|
59
|
-
* with a keyboard. Various decorations can be displayed around the field to
|
|
60
|
-
* communicate the entry requirements.
|
|
61
|
-
*/
|
|
62
|
-
let _TextField = forwardRef(TextField);
|
|
63
|
-
export {_TextField as TextField};
|
|
60
|
+
});
|
|
64
61
|
|
|
65
62
|
export interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}
|
|
66
63
|
|
|
67
64
|
export const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
/**
|
|
67
|
+
* TextAreas are multiline text inputs, useful for cases where users have
|
|
68
|
+
* a sizable amount of text to enter. They allow for all customizations that
|
|
69
|
+
* are available to text fields.
|
|
70
|
+
*/
|
|
71
|
+
export const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {
|
|
70
72
|
[props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);
|
|
71
73
|
return (
|
|
72
|
-
<
|
|
74
|
+
<TextFieldBase
|
|
73
75
|
{...props}
|
|
74
76
|
ref={ref}
|
|
75
77
|
fieldGroupCss={style({
|
|
@@ -77,19 +79,11 @@ function TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElemen
|
|
|
77
79
|
height: 'auto'
|
|
78
80
|
})}>
|
|
79
81
|
<TextAreaInput />
|
|
80
|
-
</
|
|
82
|
+
</TextFieldBase>
|
|
81
83
|
);
|
|
82
|
-
}
|
|
84
|
+
});
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
* TextAreas are multiline text inputs, useful for cases where users have
|
|
86
|
-
* a sizable amount of text to enter. They allow for all customizations that
|
|
87
|
-
* are available to text fields.
|
|
88
|
-
*/
|
|
89
|
-
let _TextArea = forwardRef(TextArea);
|
|
90
|
-
export {_TextArea as TextArea};
|
|
91
|
-
|
|
92
|
-
function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {
|
|
86
|
+
export const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {
|
|
93
87
|
let inputRef = useRef<HTMLInputElement>(null);
|
|
94
88
|
let domRef = useRef<HTMLDivElement>(null);
|
|
95
89
|
let formContext = useContext(FormContext);
|
|
@@ -162,9 +156,7 @@ function TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupC
|
|
|
162
156
|
</>))}
|
|
163
157
|
</AriaTextField>
|
|
164
158
|
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
let _TextFieldBase = forwardRef(TextFieldBase);
|
|
159
|
+
});
|
|
168
160
|
|
|
169
161
|
function TextAreaInput() {
|
|
170
162
|
// Force re-render when value changes so we update the height.
|
package/src/ToggleButton.tsx
CHANGED
|
@@ -35,7 +35,11 @@ export interface ToggleButtonProps extends Omit<RACToggleButtonProps, 'className
|
|
|
35
35
|
|
|
36
36
|
export const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* ToggleButtons allow users to toggle a selection on or off, for example
|
|
40
|
+
* switching between two states or modes.
|
|
41
|
+
*/
|
|
42
|
+
export const ToggleButton = forwardRef(function ToggleButton(props: ToggleButtonProps, ref: FocusableRef<HTMLButtonElement>) {
|
|
39
43
|
[props, ref] = useSpectrumContextProps(props, ref, ToggleButtonContext);
|
|
40
44
|
props = useFormProps(props as any);
|
|
41
45
|
let domRef = useFocusableRef(ref);
|
|
@@ -83,11 +87,4 @@ function ToggleButton(props: ToggleButtonProps, ref: FocusableRef<HTMLButtonElem
|
|
|
83
87
|
</Provider>
|
|
84
88
|
</RACToggleButton>
|
|
85
89
|
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* ToggleButtons allow users to toggle a selection on or off, for example
|
|
90
|
-
* switching between two states or modes.
|
|
91
|
-
*/
|
|
92
|
-
let _ToggleButton = forwardRef(ToggleButton);
|
|
93
|
-
export {_ToggleButton as ToggleButton};
|
|
90
|
+
});
|
|
@@ -22,7 +22,10 @@ export interface ToggleButtonGroupProps extends ActionButtonGroupProps, Omit<RAC
|
|
|
22
22
|
|
|
23
23
|
export const ToggleButtonGroupContext = createContext<ContextValue<ToggleButtonGroupProps, HTMLDivElement>>(null);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* A ToggleButtonGroup is a grouping of related ToggleButtons, with single or multiple selection.
|
|
27
|
+
*/
|
|
28
|
+
export const ToggleButtonGroup = forwardRef(function ToggleButtonGroup(props: ToggleButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
26
29
|
[props, ref] = useSpectrumContextProps(props, ref, ToggleButtonGroupContext);
|
|
27
30
|
let {
|
|
28
31
|
density = 'regular',
|
|
@@ -46,10 +49,4 @@ function ToggleButtonGroup(props: ToggleButtonGroupProps, ref: ForwardedRef<HTML
|
|
|
46
49
|
</ToggleButtonGroupContext.Provider>
|
|
47
50
|
</RACToggleButtonGroup>
|
|
48
51
|
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* A ToggleButtonGroup is a grouping of related ToggleButtons, with single or multiple selection.
|
|
53
|
-
*/
|
|
54
|
-
const _ToggleButtonGroup = forwardRef(ToggleButtonGroup);
|
|
55
|
-
export {_ToggleButtonGroup as ToggleButtonGroup};
|
|
52
|
+
});
|
package/src/Tooltip.tsx
CHANGED
|
@@ -142,7 +142,10 @@ const arrowStyles = style<TooltipRenderProps>({
|
|
|
142
142
|
|
|
143
143
|
let InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Display container for Tooltip content. Has a directional arrow dependent on its placement.
|
|
147
|
+
*/
|
|
148
|
+
export const Tooltip = forwardRef(function Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {
|
|
146
149
|
let {children, UNSAFE_style, UNSAFE_className = ''} = props;
|
|
147
150
|
let domRef = useDOMRef(ref);
|
|
148
151
|
let {
|
|
@@ -193,7 +196,7 @@ function Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {
|
|
|
193
196
|
)}
|
|
194
197
|
</AriaTooltip>
|
|
195
198
|
);
|
|
196
|
-
}
|
|
199
|
+
});
|
|
197
200
|
|
|
198
201
|
/**
|
|
199
202
|
* TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing
|
|
@@ -227,13 +230,6 @@ export function TooltipTrigger(props: TooltipTriggerProps) {
|
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
|
|
230
|
-
/**
|
|
231
|
-
* Display container for Tooltip content. Has a directional arrow dependent on its placement.
|
|
232
|
-
*/
|
|
233
|
-
let _Tooltip = forwardRef(Tooltip);
|
|
234
|
-
export {_Tooltip as Tooltip};
|
|
235
|
-
|
|
236
|
-
|
|
237
233
|
// This is purely so that storybook generates the types for both Menu and MenuTrigger
|
|
238
234
|
interface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}
|
|
239
235
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -550,6 +550,12 @@ function $b3643cb9d2948e30$var$getStaticClassName(rules) {
|
|
|
550
550
|
return rules.map((rule)=>(rule.prelude.startsWith('.') ? ' ' + rule.prelude.slice(1) : '') + (Array.isArray(rule.body) ? $b3643cb9d2948e30$var$getStaticClassName(rule.body) : '')).join('');
|
|
551
551
|
}
|
|
552
552
|
function $b3643cb9d2948e30$export$1776c186c69df29e(css, layer = '_.a') {
|
|
553
|
+
// Check if `this` is undefined, which means style was not called as a macro but as a normal function.
|
|
554
|
+
// We also check if this is globalThis, which happens in non-strict mode bundles.
|
|
555
|
+
// Also allow style to be called as a normal function in tests.
|
|
556
|
+
// @ts-ignore
|
|
557
|
+
// eslint-disable-next-line
|
|
558
|
+
if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') throw new Error('The raw macro must be imported with {type: "macro"}.');
|
|
553
559
|
let className = $b3643cb9d2948e30$var$generateArbitraryValueSelector(css, true);
|
|
554
560
|
css = `@layer ${layer} {
|
|
555
561
|
.${className} {
|
|
@@ -563,6 +569,12 @@ function $b3643cb9d2948e30$export$1776c186c69df29e(css, layer = '_.a') {
|
|
|
563
569
|
return className;
|
|
564
570
|
}
|
|
565
571
|
function $b3643cb9d2948e30$export$d25ddfdf17c3ad3e(css) {
|
|
572
|
+
// Check if `this` is undefined, which means style was not called as a macro but as a normal function.
|
|
573
|
+
// We also check if this is globalThis, which happens in non-strict mode bundles.
|
|
574
|
+
// Also allow style to be called as a normal function in tests.
|
|
575
|
+
// @ts-ignore
|
|
576
|
+
// eslint-disable-next-line
|
|
577
|
+
if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') throw new Error('The keyframes macro must be imported with {type: "macro"}.');
|
|
566
578
|
let name = $b3643cb9d2948e30$var$generateArbitraryValueSelector(css, true);
|
|
567
579
|
css = `@keyframes ${name} {
|
|
568
580
|
${css}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAID,IAAI,iDAA2B,CAAkB,OAAU,WAAsB,CAAA;QAAC,CAAC,SAAS,EAAE;IAAK,CAAA;AAC5F,SAAS,0CAAyC,KAAoD,8CAAwB;IACnI,OAAO,CAAC,OAAO;QACb,IAAI,WAAW,MAAM,OAAO,CAAC,SAAS,qDAA+B,MAAM,GAAG,CAAC,CAAA,IAAK,OAAO,IAAI,IAAI,CAAC,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C,CAAA,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,KAAK,EAAC,IAAM,CAAA,MAAM,OAAO,CAAC,KAAK,IAAI,IAAI,yCAAmB,KAAK,IAAI,IAAI,EAAC,GAAI,IAAI,CAAC;AACrK;AAEO,SAAS,0CAA+B,GAAW,EAAE,QAAQ,KAAK;IACvE,IAAI,YAAY,qDAA+B,KAAK;IACpD,MAAM,CAAC,OAAO,EAAE,MAAM;GACrB,EAAE,UAAU;EACb,EAAE,IAAI;;CAEP,CAAC;IACA,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,YACnC,IAAI,CAAC,QAAQ,CAAC;QACZ,MAAM;QACN,SAAS;IACX;IAEF,OAAO;AACT;AAEO,SAAS,0CAAqC,GAAW;IAC9D,IAAI,OAAO,qDAA+B,KAAK;IAC/C,MAAM,CAAC,WAAW,EAAE,KAAK;EACzB,EAAE,IAAI;CACP,CAAC;IACA,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,YACnC,IAAI,CAAC,QAAQ,CAAC;QACZ,MAAM;QACN,SAAS;IACX;IAEF,OAAO;AACT","sources":["packages/@react-spectrum/s2/style/style-macro.ts"],"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 type {Condition, CSSProperties, CSSValue, CustomValue, PropertyFunction, PropertyValueDefinition, PropertyValueMap, RenderProps, ShorthandProperty, StyleFunction, StyleValue, Theme, ThemeProperties, Value} from './types';\n\nlet defaultArbitraryProperty = <T extends Value>(value: T, property: string) => ({[property]: value} as CSSProperties);\nexport function createArbitraryProperty<T extends Value>(fn: (value: T, property: string) => CSSProperties = defaultArbitraryProperty): PropertyFunction<T> {\n return (value, property) => {\n let selector = Array.isArray(value) ? generateArbitraryValueSelector(value.map(v => String(v)).join('')) : generateArbitraryValueSelector(String(value));\n return {default: [fn(value, property), selector]};\n };\n}\n\nfunction recursiveValues(obj: object): string[] {\n return Object.values(obj).flatMap(v => typeof v === 'object' ? recursiveValues(v) : [v]);\n}\n\nexport function createMappedProperty<T extends CSSValue>(fn: (value: string, property: string) => CSSProperties, values: PropertyValueMap<T> | string[]): PropertyFunction<T> {\n let valueMap = createValueLookup(Array.isArray(values) ? values : recursiveValues(values));\n return (value, property) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [fn(v[0], property), v[1]]};\n }\n\n let val = Array.isArray(values) ? value : values[String(value)];\n return mapConditionalValue(val, value => {\n return [fn(value, property), valueMap.get(value)!];\n });\n };\n}\n\nexport function createRenamedProperty<T extends CSSValue>(name: string, values: PropertyValueMap<T> | string[]): PropertyFunction<T> {\n return createMappedProperty((value, property) => ({[property.startsWith('--') ? property : name]: value}), values);\n}\n\nexport function createSizingProperty<T extends CSSValue>(values: PropertyValueMap<T>, fn: (value: number) => string): PropertyFunction<T | (number & {})> {\n let valueMap = createValueLookup(Array.isArray(values) ? values : recursiveValues(values));\n return (value, property) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [{[property]: v[0]}, v[1]]};\n }\n\n let val = values[String(value)];\n if (val != null) {\n return mapConditionalValue(val, value => {\n return [{[property]: value}, valueMap.get(value)!];\n });\n }\n \n if (typeof value === 'number') {\n let cssValue = value === 0 ? '0px' : fn(value);\n return {default: [{[property]: cssValue}, generateName(value + valueMap.size)]};\n }\n\n throw new Error('Invalid sizing value: ' + value);\n };\n}\n\nexport type Color<C extends string> = C | `${string}/${number}`;\nexport function createColorProperty<C extends string>(colors: PropertyValueMap<C>, property?: keyof CSSProperties): PropertyFunction<Color<C>> {\n let valueMap = createValueLookup(Object.values(colors).flatMap((v: any) => typeof v === 'object' ? Object.values(v) : [v]));\n return (value: Color<C>, key: string) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [{[property || key]: v[0]}, v[1]]};\n }\n\n let [color, opacity] = value.split('/');\n let c = colors[color];\n return mapConditionalValue(c, value => {\n let css = opacity ? `rgb(from ${value} r g b / ${opacity}%)` : value;\n let selector = valueMap.get(value)! + (opacity ? opacity.replace('.', '-') : '');\n return [{[property || key]: css}, selector];\n });\n };\n}\n\nfunction mapConditionalValue<T, U>(value: PropertyValueDefinition<T>, fn: (value: T) => U): PropertyValueDefinition<U> {\n if (typeof value === 'object') {\n let res: PropertyValueDefinition<U> = {};\n for (let condition in value) {\n res[condition] = mapConditionalValue((value as any)[condition], fn);\n }\n return res;\n } else {\n return fn(value);\n }\n}\n\nfunction mapConditionalShorthand<T, C extends string, R extends RenderProps<string>>(value: PropertyValueDefinition<T>, fn: ShorthandProperty<T>): {[property: string]: StyleValue<Value, C, R>} {\n if (typeof value === 'object') {\n let res = {};\n for (let condition in value) {\n let properties = mapConditionalShorthand(value[condition], fn);\n for (let property in properties) {\n res[property] ??= {};\n res[property][condition] = properties[property];\n }\n }\n return res;\n } else {\n return fn(value);\n }\n}\n\nfunction createValueLookup(values: Array<CSSValue>, atStart = false) {\n let map = new Map<CSSValue, string>();\n for (let value of values) {\n if (!map.has(value)) {\n map.set(value, generateName(map.size, atStart));\n }\n }\n return map;\n}\n\nexport function parseArbitraryValue(value: any) {\n if (typeof value === 'string' && value.startsWith('--')) {\n return [`var(${value})`, generateArbitraryValueSelector(value)];\n } else if (typeof value === 'string' && value[0] === '[' && value[value.length - 1] === ']') {\n let s = generateArbitraryValueSelector(value.slice(1, -1));\n return [value.slice(1, -1), s];\n }\n}\n\ninterface MacroContext {\n addAsset(asset: {type: string, content: string}): void\n}\n\nexport function createTheme<T extends Theme>(theme: T): StyleFunction<ThemeProperties<T>, 'default' | Extract<keyof T['conditions'], string>> {\n let themePropertyMap = createValueLookup(Object.keys(theme.properties), true);\n let themeConditionMap = createValueLookup(Object.keys(theme.conditions), true);\n let propertyFunctions = new Map(Object.entries(theme.properties).map(([k, v]) => {\n if (typeof v === 'function') {\n return [k, v];\n }\n return [k, createMappedProperty((value, p) => ({[p]: value}), v) as PropertyFunction<Value>];\n }));\n\n let dependencies = new Set<string>();\n let hasConditions = false;\n return function style(this: MacroContext | void, style, allowedOverrides?: readonly string[]) {\n // Check if `this` is undefined, which means style was not called as a macro but as a normal function.\n // We also check if this is globalThis, which happens in non-strict mode bundles.\n // Also allow style to be called as a normal function in tests.\n // @ts-ignore\n // eslint-disable-next-line\n if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') {\n throw new Error('The style macro must be imported with {type: \"macro\"}.');\n }\n\n // Generate rules for each property.\n let rules = new Map<string, Rule[]>();\n let values = new Map();\n dependencies.clear();\n let usedPriorities = 1;\n let setRules = (key: string, value: [number, Rule[]]) => {\n usedPriorities = Math.max(usedPriorities, value[0]);\n rules.set(key, value[1]);\n };\n\n hasConditions = false;\n for (let key in style) {\n let value = style[key]!;\n let themeProperty = key;\n values.set(key, value);\n\n // Get the type of custom properties in the theme.\n if (key.startsWith('--')) {\n themeProperty = value.type;\n value = value.value;\n }\n\n // Expand shorthands to longhands so that merging works as expected.\n if (theme.shorthands[key]) {\n let shorthand = theme.shorthands[key];\n if (typeof shorthand === 'function') {\n let expanded = mapConditionalShorthand(value, shorthand);\n for (let k in expanded) {\n let v = expanded[k];\n values.set(k, v);\n setRules(k, compileValue(k, k, v));\n }\n } else {\n for (let prop of shorthand) {\n values.set(prop, value);\n setRules(prop, compileValue(prop, prop, value));\n }\n }\n } else if (themeProperty in theme.properties) {\n setRules(key, compileValue(key, themeProperty, value));\n }\n }\n\n // For properties referenced by self(), rewrite the declarations to assign\n // to an intermediary custom property so we can access the value.\n for (let dep of dependencies) {\n let value = values.get(dep);\n if (value != null) {\n if (!(dep in theme.properties)) {\n throw new Error(`Unknown dependency ${dep}`);\n }\n let name = `--${themePropertyMap.get(dep)}`;\n // Could potentially use @property to prevent the var from inheriting in children.\n setRules(name, compileValue(name, dep, value));\n setRules(dep, compileValue(dep, dep, name));\n }\n }\n dependencies.clear();\n\n // Prevent all global styles from leaking into this element.\n // The :not(#a#b) raises the specificity of the selector by 2 ids,\n // which can never occur on a real element, and will win over other\n // selectors such as class and element selectors.\n let css = '.\\\\.:not(#a#b) { all: revert-layer }\\n\\n';\n\n // Declare layers for each priority ahead of time so the order is always correct.\n css += '@layer ';\n let first = true;\n for (let i = 0; i <= usedPriorities; i++) {\n if (first) {\n first = false;\n } else {\n css += ', ';\n }\n css += layerName(generateName(i, true));\n }\n css += ', UNSAFE_overrides;\\n\\n';\n\n // If allowed overrides are provided, generate code to match the input override string and include only allowed classes.\n // Also generate a variable for each overridable property that overlaps with the style definition. If those are defined,\n // the defaults from the style definition are omitted.\n let allowedOverridesSet = new Set<string>();\n let js = 'let rules = \" .\";\\n';\n if (allowedOverrides?.length) {\n for (let property of allowedOverrides) {\n if (themePropertyMap.has(property as string)) {\n allowedOverridesSet.add(themePropertyMap.get(property as string)!);\n }\n }\n\n js += `let matches = (overrides || '').match(/(?:^|\\\\s)(?:${[...allowedOverridesSet].join('|')})[^\\\\s]+/g) || [];\\n`;\n js += 'rules += matches.join(\\'\\');\\n';\n let loop = '';\n for (let property of rules.keys()) {\n let themeProperty = themePropertyMap.get(property);\n if (themeProperty && allowedOverridesSet.has(themeProperty)) {\n js += `let $${themeProperty} = false;\\n`;\n loop += ` if (/^\\\\s*${themeProperty}/.test(p)) $${themeProperty} = true;\\n`;\n }\n }\n if (loop) {\n js += 'for (let p of matches) {\\n';\n js += loop;\n js += '}\\n';\n }\n }\n\n // Generate JS and CSS for each rule.\n let isStatic = !(hasConditions || allowedOverrides);\n let className = ' .';\n let rulesByLayer = new Map<string, string[]>();\n for (let [property, propertyRules] of rules) {\n if (isStatic) {\n className += getStaticClassName(propertyRules);\n } else {\n let themeProperty = themePropertyMap.get(property);\n let allowsOverrides = themeProperty && allowedOverridesSet.has(themeProperty);\n if (allowsOverrides) {\n // Omit the value if an override was passed in.\n js += `if (!$${themeProperty}) {\\n`;\n }\n js += printJS(propertyRules) + '\\n';\n if (allowsOverrides) {\n js += '}\\n';\n }\n }\n for (let rule of propertyRules) {\n printRule(rule, rulesByLayer);\n }\n }\n\n for (let [layer, rules] of rulesByLayer) {\n css += `@layer ${layerName(layer)} {\\n`;\n css += rules.join('\\n\\n');\n css += '}\\n\\n';\n }\n\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n\n if (isStatic) {\n return className;\n }\n\n js += 'return rules;';\n if (allowedOverrides) {\n return new Function('props', 'overrides', js) as any;\n }\n return new Function('props', js) as any;\n };\n\n function compileValue(property: string, themeProperty: string, value: StyleValue<Value, Condition<T>, any>) {\n return conditionalToRules(value as any, 0, new Set(), new Set(), (value, priority, conditions, skipConditions) => {\n return compileRule(property, themeProperty, value, priority, conditions, skipConditions);\n });\n }\n\n function conditionalToRules<P extends CustomValue | any[]>(\n value: PropertyValueDefinition<P>,\n parentPriority: number,\n currentConditions: Set<string>,\n skipConditions: Set<string>,\n fn: (value: P, priority: number, conditions: Set<string>, skipConditions: Set<string>) => [number, Rule[]]\n ): [number, Rule[]] {\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n let rules: Rule[] = [];\n\n // Later conditions in parent rules override conditions in child rules.\n let subSkipConditions = new Set([...skipConditions, ...Object.keys(value)]);\n\n // Skip the default condition if we're already filtering by one of the other possible conditions.\n // For example, if someone specifies `dark: 'gray-400'`, only include the dark version of `gray-400` from the theme.\n let skipDefault = Object.keys(value).some(k => currentConditions.has(k));\n let wasCSSCondition = false;\n let priority = parentPriority;\n\n for (let condition in value) {\n if (skipConditions.has(condition) || (condition === 'default' && skipDefault)) {\n continue;\n }\n subSkipConditions.delete(condition);\n\n let val = value[condition];\n\n // If a theme condition comes after runtime conditions, create a new grouping.\n // This makes the CSS class unconditional so it appears outside the `else` block in the JS.\n // The @layer order in the generated CSS will ensure that it overrides classes applied by runtime conditions.\n let isCSSCondition = condition in theme.conditions || /^[@:]/.test(condition);\n if (!wasCSSCondition && isCSSCondition && rules.length) {\n rules = [{prelude: '', condition: '', layer: '', body: rules}];\n }\n wasCSSCondition = isCSSCondition;\n\n // Increment the current priority whenever we see a new CSS condition.\n if (isCSSCondition) {\n priority++;\n }\n\n // If this is a runtime condition, inherit the priority from the parent rule.\n // Otherwise, use the current maximum of the parent and current priorities.\n let rulePriority = isCSSCondition ? priority : parentPriority;\n\n if (condition === 'default' || isCSSCondition || /^is[A-Z]/.test(condition) || /^allows[A-Z]/.test(condition)) {\n let subConditions = currentConditions;\n if (isCSSCondition) {\n subConditions = new Set([...currentConditions, condition]);\n }\n let [subPriority, subRules] = conditionalToRules(val, rulePriority, subConditions, subSkipConditions, fn);\n rules.push(...compileCondition(currentConditions, condition, priority, subRules));\n priority = Math.max(priority, subPriority);\n } else if (val && typeof val === 'object' && !Array.isArray(val)) {\n for (let key in val) {\n let [subPriority, subRules] = conditionalToRules(val[key], rulePriority, currentConditions, subSkipConditions, fn);\n rules.push(...compileCondition(currentConditions, `${condition} === ${JSON.stringify(key)}`, priority, subRules));\n priority = Math.max(priority, subPriority);\n }\n }\n }\n return [priority, rules];\n } else {\n // @ts-ignore - broken in non-strict?\n return fn(value, parentPriority, currentConditions, skipConditions);\n }\n }\n\n function compileCondition(conditions: Set<string>, condition: string, priority: number, rules: Rule[]): Rule[] {\n if (condition === 'default' || conditions.has(condition)) {\n return [{prelude: '', condition: '', layer: '', body: rules}];\n }\n\n if (condition in theme.conditions || /^[@:]/.test(condition)) {\n // Conditions starting with : are CSS pseudo classes. Nest them inside the parent rule.\n let prelude = theme.conditions[condition] || condition;\n if (prelude.startsWith(':')) {\n return [{\n prelude: '',\n layer: generateName(priority, true),\n body: rules.map(rule => nestRule(rule, prelude)),\n condition: ''\n }];\n }\n\n // Otherwise, wrap the rule in the condition (e.g. @media).\n return [{\n // Top level layer is based on the priority of the rule, not the condition.\n // Also group in a sub-layer based on the condition so that lightningcss can more effectively deduplicate rules.\n layer: `${generateName(priority, true)}.${themeConditionMap.get(condition) || generateArbitraryValueSelector(condition, true)}`,\n prelude,\n body: rules,\n condition: ''\n }];\n }\n\n hasConditions = true;\n return [{prelude: '', layer: '', condition, body: rules}];\n }\n\n function compileRule(property: string, themeProperty: string, value: Value, priority: number, conditions: Set<string>, skipConditions: Set<string>): [number, Rule[]] {\n // Generate selector. This consists of three parts:\n // 1. Property. For custom properties we use a hash. For theme properties, we use the index within the theme.\n // 2. Conditions. This uses the index within the theme.\n // 3. Value. The index in the theme, or a hash for arbitrary values.\n let prelude = '.';\n if (property.startsWith('--')) {\n // Include both custom property name and theme property in case the same var is reused between multiple theme properties.\n prelude += generateArbitraryValueSelector(property, true) + '_' + themePropertyMap.get(themeProperty) + '-';\n } else {\n prelude += themePropertyMap.get(themeProperty);\n }\n\n let propertyFunction = propertyFunctions.get(themeProperty);\n if (propertyFunction) {\n // Expand value to conditional CSS values, and then to rules.\n let res = propertyFunction(value, property);\n return conditionalToRules(res, priority, conditions, skipConditions, (value, priority, conditions) => {\n let [obj, p] = value;\n let body = '';\n for (let key in obj) {\n let k = key as any;\n let value = obj[k];\n if (value === undefined) {\n continue;\n }\n if (typeof value === 'string') {\n // Replace self() references with variables and track the dependencies.\n value = value.replace(/self\\(([a-zA-Z]+)/g, (_, v) => {\n dependencies.add(v);\n return `var(--${themePropertyMap.get(v)}`;\n });\n }\n body += `${kebab(key)}: ${value};`;\n }\n\n let selector = prelude;\n if (conditions.size > 0) {\n for (let condition of conditions) {\n selector += themeConditionMap.get(condition) || generateArbitraryValueSelector(condition);\n }\n }\n\n let rules: Rule[] = [{\n condition: '',\n layer: '',\n prelude: selector + p,\n body\n }];\n\n return [0, rules];\n });\n } else {\n throw new Error('Unknown property ' + themeProperty);\n }\n }\n}\n\nfunction nestRule(rule: Rule, prelude: string): Rule {\n if (Array.isArray(rule.body)) {\n return {\n prelude: rule.prelude,\n layer: rule.layer,\n body: rule.body.map(r => nestRule(r, prelude)),\n condition: rule.condition\n };\n } else {\n return {\n prelude: rule.prelude,\n layer: rule.layer,\n body: [{...rule, prelude: '&' + prelude}],\n condition: ''\n };\n }\n}\n\nfunction kebab(property: string) {\n if (property.startsWith('--')) {\n return property;\n }\n return property.replace(/([a-z])([A-Z])/g, (_, a, b) => `${a}-${b.toLowerCase()}`);\n}\n\ninterface Rule {\n prelude: string,\n layer: string,\n condition: string,\n body: string | Rule[]\n}\n\n// Generate a class name from a number, e.g. index within the theme.\n// This maps to an alphabet containing lower case letters, upper case letters, and numbers.\n// For numbers larger than 62, an underscore is prepended.\n// This encoding allows easy parsing to enable runtime merging by property.\nfunction generateName(index: number, atStart = false): string {\n if (index < 26) {\n // lower case letters\n return String.fromCharCode(index + 97);\n }\n\n if (index < 52) {\n // upper case letters\n return String.fromCharCode((index - 26) + 65);\n }\n\n if (index < 62 && !atStart) {\n // numbers\n return String.fromCharCode((index - 52) + 48);\n }\n\n return '_' + generateName(index - (atStart ? 52 : 62));\n}\n\n// For arbitrary values, we use a hash of the string to generate the class name.\nfunction generateArbitraryValueSelector(v: string, atStart = false) {\n let c = hash(v).toString(36);\n if (atStart && /^[0-9]/.test(c)) {\n c = `_${c}`;\n }\n return `-${c}`;\n}\n\n// djb2 hash function.\n// http://www.cse.yorku.ca/~oz/hash.html\nfunction hash(v: string) {\n let hash = 5381;\n for (let i = 0; i < v.length; i++) {\n hash = ((hash << 5) + hash) + v.charCodeAt(i) >>> 0;\n }\n return hash;\n}\n\nfunction layerName(name: string) {\n // All of our layers should be sub-layers of a single parent layer, so that\n // the unsafe overrides layer always comes after.\n return `_.${name}`;\n}\n\nfunction printRule(rule: Rule, rulesByLayer: Map<string, string[]>, preludes: string[] = [], layer = 'a') {\n if (rule.prelude) {\n preludes.push(rule.prelude);\n }\n\n if (typeof rule.body === 'string') {\n // Nest rule in our stack of preludes (e.g. media queries/selectors).\n let content = ' ';\n preludes.forEach((p, i) => {\n content += `${p} {\\n${' '.repeat((i + 2) * 2)}`;\n });\n content += rule.body + '\\n';\n preludes.map((_, i) => {\n content += `${' '.repeat((preludes.length - i) * 2)}}\\n`;\n });\n\n // Group rule into the appropriate layer.\n let rules = rulesByLayer.get(rule.layer || layer);\n if (!rules) {\n rules = [];\n rulesByLayer.set(rule.layer || layer, rules);\n }\n rules.push(content);\n } else {\n for (let b of rule.body) {\n printRule(b, rulesByLayer, preludes, rule.layer || layer);\n }\n }\n\n if (rule.prelude) {\n preludes.pop();\n }\n}\n\nfunction printJS(rules: Rule[], indent = ''): string {\n rules = rules.slice().reverse();\n\n let conditional = rules.filter(rule => rule.condition).map((rule, i) => {\n return `${i > 0 ? ' else ' : ''}if (props.${rule.condition}) {\\n${indent} ${printRuleChildren(rule, indent + ' ')}\\n${indent}}`;\n });\n\n let elseCases = rules.filter(rule => !rule.condition).map(rule => printRuleChildren(rule, indent + ' '));\n\n if (conditional.length && elseCases.length) {\n return `${conditional.join('')} else {\\n${indent} ${elseCases.join('\\n' + indent + ' ')}\\n${indent}}`;\n }\n\n if (conditional.length) {\n return conditional.join('');\n }\n\n return elseCases.join('\\n' + indent);\n}\n\nfunction printRuleChildren(rule: Rule, indent = '') {\n let res = '';\n if (rule.prelude.startsWith('.')) {\n res += `rules += ' ${rule.prelude.slice(1)}';`;\n }\n\n if (Array.isArray(rule.body)) {\n res += printJS(rule.body, indent);\n }\n\n return res;\n}\n\nfunction getStaticClassName(rules: Rule[]): string {\n return rules.map(rule => (rule.prelude.startsWith('.') ? ' ' + rule.prelude.slice(1) : '') + (Array.isArray(rule.body) ? getStaticClassName(rule.body) : '')).join('');\n}\n\nexport function raw(this: MacroContext | void, css: string, layer = '_.a') {\n let className = generateArbitraryValueSelector(css, true);\n css = `@layer ${layer} {\n .${className} {\n ${css}\n }\n}`;\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n return className;\n}\n\nexport function keyframes(this: MacroContext | void, css: string) {\n let name = generateArbitraryValueSelector(css, true);\n css = `@keyframes ${name} {\n ${css}\n}`;\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n return name;\n}\n"],"names":[],"version":3,"file":"style-macro.cjs.map","sourceRoot":"../../../../../"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAID,IAAI,iDAA2B,CAAkB,OAAU,WAAsB,CAAA;QAAC,CAAC,SAAS,EAAE;IAAK,CAAA;AAC5F,SAAS,0CAAyC,KAAoD,8CAAwB;IACnI,OAAO,CAAC,OAAO;QACb,IAAI,WAAW,MAAM,OAAO,CAAC,SAAS,qDAA+B,MAAM,GAAG,CAAC,CAAA,IAAK,OAAO,IAAI,IAAI,CAAC,OAAO,qDAA+B,OAAO;QACjJ,OAAO;YAAC,SAAS;gBAAC,GAAG,OAAO;gBAAW;aAAS;QAAA;IAClD;AACF;AAEA,SAAS,sCAAgB,GAAW;IAClC,OAAO,OAAO,MAAM,CAAC,KAAK,OAAO,CAAC,CAAA,IAAK,OAAO,MAAM,WAAW,sCAAgB,KAAK;YAAC;SAAE;AACzF;AAEO,SAAS,0CAAyC,EAAsD,EAAE,MAAsC;IACrJ,IAAI,WAAW,wCAAkB,MAAM,OAAO,CAAC,UAAU,SAAS,sCAAgB;IAClF,OAAO,CAAC,OAAO;QACb,IAAI,IAAI,0CAAoB;QAC5B,IAAI,GACF,OAAO;YAAC,SAAS;gBAAC,GAAG,CAAC,CAAC,EAAE,EAAE;gBAAW,CAAC,CAAC,EAAE;aAAC;QAAA;QAG7C,IAAI,MAAM,MAAM,OAAO,CAAC,UAAU,QAAQ,MAAM,CAAC,OAAO,OAAO;QAC/D,OAAO,0CAAoB,KAAK,CAAA;YAC9B,OAAO;gBAAC,GAAG,OAAO;gBAAW,SAAS,GAAG,CAAC;aAAQ;QACpD;IACF;AACF;AAEO,SAAS,0CAA0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AAW;IAC9D,sGAAsG;IACtG,iFAAiF;IACjF,+DAA+D;IAC/D,aAAa;IACb,2BAA2B;IAC3B,IAAI,AAAC,CAAA,IAAI,IAAI,QAAQ,IAAI,KAAK,UAAS,KAAM,QAAQ,GAAG,CAAC,QAAQ,KAAK,QACpE,MAAM,IAAI,MAAM;IAElB,IAAI,OAAO,qDAA+B,KAAK;IAC/C,MAAM,CAAC,WAAW,EAAE,KAAK;EACzB,EAAE,IAAI;CACP,CAAC;IACA,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,YACnC,IAAI,CAAC,QAAQ,CAAC;QACZ,MAAM;QACN,SAAS;IACX;IAEF,OAAO;AACT","sources":["packages/@react-spectrum/s2/style/style-macro.ts"],"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 type {Condition, CSSProperties, CSSValue, CustomValue, PropertyFunction, PropertyValueDefinition, PropertyValueMap, RenderProps, ShorthandProperty, StyleFunction, StyleValue, Theme, ThemeProperties, Value} from './types';\n\nlet defaultArbitraryProperty = <T extends Value>(value: T, property: string) => ({[property]: value} as CSSProperties);\nexport function createArbitraryProperty<T extends Value>(fn: (value: T, property: string) => CSSProperties = defaultArbitraryProperty): PropertyFunction<T> {\n return (value, property) => {\n let selector = Array.isArray(value) ? generateArbitraryValueSelector(value.map(v => String(v)).join('')) : generateArbitraryValueSelector(String(value));\n return {default: [fn(value, property), selector]};\n };\n}\n\nfunction recursiveValues(obj: object): string[] {\n return Object.values(obj).flatMap(v => typeof v === 'object' ? recursiveValues(v) : [v]);\n}\n\nexport function createMappedProperty<T extends CSSValue>(fn: (value: string, property: string) => CSSProperties, values: PropertyValueMap<T> | string[]): PropertyFunction<T> {\n let valueMap = createValueLookup(Array.isArray(values) ? values : recursiveValues(values));\n return (value, property) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [fn(v[0], property), v[1]]};\n }\n\n let val = Array.isArray(values) ? value : values[String(value)];\n return mapConditionalValue(val, value => {\n return [fn(value, property), valueMap.get(value)!];\n });\n };\n}\n\nexport function createRenamedProperty<T extends CSSValue>(name: string, values: PropertyValueMap<T> | string[]): PropertyFunction<T> {\n return createMappedProperty((value, property) => ({[property.startsWith('--') ? property : name]: value}), values);\n}\n\nexport function createSizingProperty<T extends CSSValue>(values: PropertyValueMap<T>, fn: (value: number) => string): PropertyFunction<T | (number & {})> {\n let valueMap = createValueLookup(Array.isArray(values) ? values : recursiveValues(values));\n return (value, property) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [{[property]: v[0]}, v[1]]};\n }\n\n let val = values[String(value)];\n if (val != null) {\n return mapConditionalValue(val, value => {\n return [{[property]: value}, valueMap.get(value)!];\n });\n }\n\n if (typeof value === 'number') {\n let cssValue = value === 0 ? '0px' : fn(value);\n return {default: [{[property]: cssValue}, generateName(value + valueMap.size)]};\n }\n\n throw new Error('Invalid sizing value: ' + value);\n };\n}\n\nexport type Color<C extends string> = C | `${string}/${number}`;\nexport function createColorProperty<C extends string>(colors: PropertyValueMap<C>, property?: keyof CSSProperties): PropertyFunction<Color<C>> {\n let valueMap = createValueLookup(Object.values(colors).flatMap((v: any) => typeof v === 'object' ? Object.values(v) : [v]));\n return (value: Color<C>, key: string) => {\n let v = parseArbitraryValue(value);\n if (v) {\n return {default: [{[property || key]: v[0]}, v[1]]};\n }\n\n let [color, opacity] = value.split('/');\n let c = colors[color];\n return mapConditionalValue(c, value => {\n let css = opacity ? `rgb(from ${value} r g b / ${opacity}%)` : value;\n let selector = valueMap.get(value)! + (opacity ? opacity.replace('.', '-') : '');\n return [{[property || key]: css}, selector];\n });\n };\n}\n\nfunction mapConditionalValue<T, U>(value: PropertyValueDefinition<T>, fn: (value: T) => U): PropertyValueDefinition<U> {\n if (typeof value === 'object') {\n let res: PropertyValueDefinition<U> = {};\n for (let condition in value) {\n res[condition] = mapConditionalValue((value as any)[condition], fn);\n }\n return res;\n } else {\n return fn(value);\n }\n}\n\nfunction mapConditionalShorthand<T, C extends string, R extends RenderProps<string>>(value: PropertyValueDefinition<T>, fn: ShorthandProperty<T>): {[property: string]: StyleValue<Value, C, R>} {\n if (typeof value === 'object') {\n let res = {};\n for (let condition in value) {\n let properties = mapConditionalShorthand(value[condition], fn);\n for (let property in properties) {\n res[property] ??= {};\n res[property][condition] = properties[property];\n }\n }\n return res;\n } else {\n return fn(value);\n }\n}\n\nfunction createValueLookup(values: Array<CSSValue>, atStart = false) {\n let map = new Map<CSSValue, string>();\n for (let value of values) {\n if (!map.has(value)) {\n map.set(value, generateName(map.size, atStart));\n }\n }\n return map;\n}\n\nexport function parseArbitraryValue(value: any) {\n if (typeof value === 'string' && value.startsWith('--')) {\n return [`var(${value})`, generateArbitraryValueSelector(value)];\n } else if (typeof value === 'string' && value[0] === '[' && value[value.length - 1] === ']') {\n let s = generateArbitraryValueSelector(value.slice(1, -1));\n return [value.slice(1, -1), s];\n }\n}\n\ninterface MacroContext {\n addAsset(asset: {type: string, content: string}): void\n}\n\nexport function createTheme<T extends Theme>(theme: T): StyleFunction<ThemeProperties<T>, 'default' | Extract<keyof T['conditions'], string>> {\n let themePropertyMap = createValueLookup(Object.keys(theme.properties), true);\n let themeConditionMap = createValueLookup(Object.keys(theme.conditions), true);\n let propertyFunctions = new Map(Object.entries(theme.properties).map(([k, v]) => {\n if (typeof v === 'function') {\n return [k, v];\n }\n return [k, createMappedProperty((value, p) => ({[p]: value}), v) as PropertyFunction<Value>];\n }));\n\n let dependencies = new Set<string>();\n let hasConditions = false;\n return function style(this: MacroContext | void, style, allowedOverrides?: readonly string[]) {\n // Check if `this` is undefined, which means style was not called as a macro but as a normal function.\n // We also check if this is globalThis, which happens in non-strict mode bundles.\n // Also allow style to be called as a normal function in tests.\n // @ts-ignore\n // eslint-disable-next-line\n if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') {\n throw new Error('The style macro must be imported with {type: \"macro\"}.');\n }\n\n // Generate rules for each property.\n let rules = new Map<string, Rule[]>();\n let values = new Map();\n dependencies.clear();\n let usedPriorities = 1;\n let setRules = (key: string, value: [number, Rule[]]) => {\n usedPriorities = Math.max(usedPriorities, value[0]);\n rules.set(key, value[1]);\n };\n\n hasConditions = false;\n for (let key in style) {\n let value = style[key]!;\n let themeProperty = key;\n values.set(key, value);\n\n // Get the type of custom properties in the theme.\n if (key.startsWith('--')) {\n themeProperty = value.type;\n value = value.value;\n }\n\n // Expand shorthands to longhands so that merging works as expected.\n if (theme.shorthands[key]) {\n let shorthand = theme.shorthands[key];\n if (typeof shorthand === 'function') {\n let expanded = mapConditionalShorthand(value, shorthand);\n for (let k in expanded) {\n let v = expanded[k];\n values.set(k, v);\n setRules(k, compileValue(k, k, v));\n }\n } else {\n for (let prop of shorthand) {\n values.set(prop, value);\n setRules(prop, compileValue(prop, prop, value));\n }\n }\n } else if (themeProperty in theme.properties) {\n setRules(key, compileValue(key, themeProperty, value));\n }\n }\n\n // For properties referenced by self(), rewrite the declarations to assign\n // to an intermediary custom property so we can access the value.\n for (let dep of dependencies) {\n let value = values.get(dep);\n if (value != null) {\n if (!(dep in theme.properties)) {\n throw new Error(`Unknown dependency ${dep}`);\n }\n let name = `--${themePropertyMap.get(dep)}`;\n // Could potentially use @property to prevent the var from inheriting in children.\n setRules(name, compileValue(name, dep, value));\n setRules(dep, compileValue(dep, dep, name));\n }\n }\n dependencies.clear();\n\n // Prevent all global styles from leaking into this element.\n // The :not(#a#b) raises the specificity of the selector by 2 ids,\n // which can never occur on a real element, and will win over other\n // selectors such as class and element selectors.\n let css = '.\\\\.:not(#a#b) { all: revert-layer }\\n\\n';\n\n // Declare layers for each priority ahead of time so the order is always correct.\n css += '@layer ';\n let first = true;\n for (let i = 0; i <= usedPriorities; i++) {\n if (first) {\n first = false;\n } else {\n css += ', ';\n }\n css += layerName(generateName(i, true));\n }\n css += ', UNSAFE_overrides;\\n\\n';\n\n // If allowed overrides are provided, generate code to match the input override string and include only allowed classes.\n // Also generate a variable for each overridable property that overlaps with the style definition. If those are defined,\n // the defaults from the style definition are omitted.\n let allowedOverridesSet = new Set<string>();\n let js = 'let rules = \" .\";\\n';\n if (allowedOverrides?.length) {\n for (let property of allowedOverrides) {\n if (themePropertyMap.has(property as string)) {\n allowedOverridesSet.add(themePropertyMap.get(property as string)!);\n }\n }\n\n js += `let matches = (overrides || '').match(/(?:^|\\\\s)(?:${[...allowedOverridesSet].join('|')})[^\\\\s]+/g) || [];\\n`;\n js += 'rules += matches.join(\\'\\');\\n';\n let loop = '';\n for (let property of rules.keys()) {\n let themeProperty = themePropertyMap.get(property);\n if (themeProperty && allowedOverridesSet.has(themeProperty)) {\n js += `let $${themeProperty} = false;\\n`;\n loop += ` if (/^\\\\s*${themeProperty}/.test(p)) $${themeProperty} = true;\\n`;\n }\n }\n if (loop) {\n js += 'for (let p of matches) {\\n';\n js += loop;\n js += '}\\n';\n }\n }\n\n // Generate JS and CSS for each rule.\n let isStatic = !(hasConditions || allowedOverrides);\n let className = ' .';\n let rulesByLayer = new Map<string, string[]>();\n for (let [property, propertyRules] of rules) {\n if (isStatic) {\n className += getStaticClassName(propertyRules);\n } else {\n let themeProperty = themePropertyMap.get(property);\n let allowsOverrides = themeProperty && allowedOverridesSet.has(themeProperty);\n if (allowsOverrides) {\n // Omit the value if an override was passed in.\n js += `if (!$${themeProperty}) {\\n`;\n }\n js += printJS(propertyRules) + '\\n';\n if (allowsOverrides) {\n js += '}\\n';\n }\n }\n for (let rule of propertyRules) {\n printRule(rule, rulesByLayer);\n }\n }\n\n for (let [layer, rules] of rulesByLayer) {\n css += `@layer ${layerName(layer)} {\\n`;\n css += rules.join('\\n\\n');\n css += '}\\n\\n';\n }\n\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n\n if (isStatic) {\n return className;\n }\n\n js += 'return rules;';\n if (allowedOverrides) {\n return new Function('props', 'overrides', js) as any;\n }\n return new Function('props', js) as any;\n };\n\n function compileValue(property: string, themeProperty: string, value: StyleValue<Value, Condition<T>, any>) {\n return conditionalToRules(value as any, 0, new Set(), new Set(), (value, priority, conditions, skipConditions) => {\n return compileRule(property, themeProperty, value, priority, conditions, skipConditions);\n });\n }\n\n function conditionalToRules<P extends CustomValue | any[]>(\n value: PropertyValueDefinition<P>,\n parentPriority: number,\n currentConditions: Set<string>,\n skipConditions: Set<string>,\n fn: (value: P, priority: number, conditions: Set<string>, skipConditions: Set<string>) => [number, Rule[]]\n ): [number, Rule[]] {\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n let rules: Rule[] = [];\n\n // Later conditions in parent rules override conditions in child rules.\n let subSkipConditions = new Set([...skipConditions, ...Object.keys(value)]);\n\n // Skip the default condition if we're already filtering by one of the other possible conditions.\n // For example, if someone specifies `dark: 'gray-400'`, only include the dark version of `gray-400` from the theme.\n let skipDefault = Object.keys(value).some(k => currentConditions.has(k));\n let wasCSSCondition = false;\n let priority = parentPriority;\n\n for (let condition in value) {\n if (skipConditions.has(condition) || (condition === 'default' && skipDefault)) {\n continue;\n }\n subSkipConditions.delete(condition);\n\n let val = value[condition];\n\n // If a theme condition comes after runtime conditions, create a new grouping.\n // This makes the CSS class unconditional so it appears outside the `else` block in the JS.\n // The @layer order in the generated CSS will ensure that it overrides classes applied by runtime conditions.\n let isCSSCondition = condition in theme.conditions || /^[@:]/.test(condition);\n if (!wasCSSCondition && isCSSCondition && rules.length) {\n rules = [{prelude: '', condition: '', layer: '', body: rules}];\n }\n wasCSSCondition = isCSSCondition;\n\n // Increment the current priority whenever we see a new CSS condition.\n if (isCSSCondition) {\n priority++;\n }\n\n // If this is a runtime condition, inherit the priority from the parent rule.\n // Otherwise, use the current maximum of the parent and current priorities.\n let rulePriority = isCSSCondition ? priority : parentPriority;\n\n if (condition === 'default' || isCSSCondition || /^is[A-Z]/.test(condition) || /^allows[A-Z]/.test(condition)) {\n let subConditions = currentConditions;\n if (isCSSCondition) {\n subConditions = new Set([...currentConditions, condition]);\n }\n let [subPriority, subRules] = conditionalToRules(val, rulePriority, subConditions, subSkipConditions, fn);\n rules.push(...compileCondition(currentConditions, condition, priority, subRules));\n priority = Math.max(priority, subPriority);\n } else if (val && typeof val === 'object' && !Array.isArray(val)) {\n for (let key in val) {\n let [subPriority, subRules] = conditionalToRules(val[key], rulePriority, currentConditions, subSkipConditions, fn);\n rules.push(...compileCondition(currentConditions, `${condition} === ${JSON.stringify(key)}`, priority, subRules));\n priority = Math.max(priority, subPriority);\n }\n }\n }\n return [priority, rules];\n } else {\n // @ts-ignore - broken in non-strict?\n return fn(value, parentPriority, currentConditions, skipConditions);\n }\n }\n\n function compileCondition(conditions: Set<string>, condition: string, priority: number, rules: Rule[]): Rule[] {\n if (condition === 'default' || conditions.has(condition)) {\n return [{prelude: '', condition: '', layer: '', body: rules}];\n }\n\n if (condition in theme.conditions || /^[@:]/.test(condition)) {\n // Conditions starting with : are CSS pseudo classes. Nest them inside the parent rule.\n let prelude = theme.conditions[condition] || condition;\n if (prelude.startsWith(':')) {\n return [{\n prelude: '',\n layer: generateName(priority, true),\n body: rules.map(rule => nestRule(rule, prelude)),\n condition: ''\n }];\n }\n\n // Otherwise, wrap the rule in the condition (e.g. @media).\n return [{\n // Top level layer is based on the priority of the rule, not the condition.\n // Also group in a sub-layer based on the condition so that lightningcss can more effectively deduplicate rules.\n layer: `${generateName(priority, true)}.${themeConditionMap.get(condition) || generateArbitraryValueSelector(condition, true)}`,\n prelude,\n body: rules,\n condition: ''\n }];\n }\n\n hasConditions = true;\n return [{prelude: '', layer: '', condition, body: rules}];\n }\n\n function compileRule(property: string, themeProperty: string, value: Value, priority: number, conditions: Set<string>, skipConditions: Set<string>): [number, Rule[]] {\n // Generate selector. This consists of three parts:\n // 1. Property. For custom properties we use a hash. For theme properties, we use the index within the theme.\n // 2. Conditions. This uses the index within the theme.\n // 3. Value. The index in the theme, or a hash for arbitrary values.\n let prelude = '.';\n if (property.startsWith('--')) {\n // Include both custom property name and theme property in case the same var is reused between multiple theme properties.\n prelude += generateArbitraryValueSelector(property, true) + '_' + themePropertyMap.get(themeProperty) + '-';\n } else {\n prelude += themePropertyMap.get(themeProperty);\n }\n\n let propertyFunction = propertyFunctions.get(themeProperty);\n if (propertyFunction) {\n // Expand value to conditional CSS values, and then to rules.\n let res = propertyFunction(value, property);\n return conditionalToRules(res, priority, conditions, skipConditions, (value, priority, conditions) => {\n let [obj, p] = value;\n let body = '';\n for (let key in obj) {\n let k = key as any;\n let value = obj[k];\n if (value === undefined) {\n continue;\n }\n if (typeof value === 'string') {\n // Replace self() references with variables and track the dependencies.\n value = value.replace(/self\\(([a-zA-Z]+)/g, (_, v) => {\n dependencies.add(v);\n return `var(--${themePropertyMap.get(v)}`;\n });\n }\n body += `${kebab(key)}: ${value};`;\n }\n\n let selector = prelude;\n if (conditions.size > 0) {\n for (let condition of conditions) {\n selector += themeConditionMap.get(condition) || generateArbitraryValueSelector(condition);\n }\n }\n\n let rules: Rule[] = [{\n condition: '',\n layer: '',\n prelude: selector + p,\n body\n }];\n\n return [0, rules];\n });\n } else {\n throw new Error('Unknown property ' + themeProperty);\n }\n }\n}\n\nfunction nestRule(rule: Rule, prelude: string): Rule {\n if (Array.isArray(rule.body)) {\n return {\n prelude: rule.prelude,\n layer: rule.layer,\n body: rule.body.map(r => nestRule(r, prelude)),\n condition: rule.condition\n };\n } else {\n return {\n prelude: rule.prelude,\n layer: rule.layer,\n body: [{...rule, prelude: '&' + prelude}],\n condition: ''\n };\n }\n}\n\nfunction kebab(property: string) {\n if (property.startsWith('--')) {\n return property;\n }\n return property.replace(/([a-z])([A-Z])/g, (_, a, b) => `${a}-${b.toLowerCase()}`);\n}\n\ninterface Rule {\n prelude: string,\n layer: string,\n condition: string,\n body: string | Rule[]\n}\n\n// Generate a class name from a number, e.g. index within the theme.\n// This maps to an alphabet containing lower case letters, upper case letters, and numbers.\n// For numbers larger than 62, an underscore is prepended.\n// This encoding allows easy parsing to enable runtime merging by property.\nfunction generateName(index: number, atStart = false): string {\n if (index < 26) {\n // lower case letters\n return String.fromCharCode(index + 97);\n }\n\n if (index < 52) {\n // upper case letters\n return String.fromCharCode((index - 26) + 65);\n }\n\n if (index < 62 && !atStart) {\n // numbers\n return String.fromCharCode((index - 52) + 48);\n }\n\n return '_' + generateName(index - (atStart ? 52 : 62));\n}\n\n// For arbitrary values, we use a hash of the string to generate the class name.\nfunction generateArbitraryValueSelector(v: string, atStart = false) {\n let c = hash(v).toString(36);\n if (atStart && /^[0-9]/.test(c)) {\n c = `_${c}`;\n }\n return `-${c}`;\n}\n\n// djb2 hash function.\n// http://www.cse.yorku.ca/~oz/hash.html\nfunction hash(v: string) {\n let hash = 5381;\n for (let i = 0; i < v.length; i++) {\n hash = ((hash << 5) + hash) + v.charCodeAt(i) >>> 0;\n }\n return hash;\n}\n\nfunction layerName(name: string) {\n // All of our layers should be sub-layers of a single parent layer, so that\n // the unsafe overrides layer always comes after.\n return `_.${name}`;\n}\n\nfunction printRule(rule: Rule, rulesByLayer: Map<string, string[]>, preludes: string[] = [], layer = 'a') {\n if (rule.prelude) {\n preludes.push(rule.prelude);\n }\n\n if (typeof rule.body === 'string') {\n // Nest rule in our stack of preludes (e.g. media queries/selectors).\n let content = ' ';\n preludes.forEach((p, i) => {\n content += `${p} {\\n${' '.repeat((i + 2) * 2)}`;\n });\n content += rule.body + '\\n';\n preludes.map((_, i) => {\n content += `${' '.repeat((preludes.length - i) * 2)}}\\n`;\n });\n\n // Group rule into the appropriate layer.\n let rules = rulesByLayer.get(rule.layer || layer);\n if (!rules) {\n rules = [];\n rulesByLayer.set(rule.layer || layer, rules);\n }\n rules.push(content);\n } else {\n for (let b of rule.body) {\n printRule(b, rulesByLayer, preludes, rule.layer || layer);\n }\n }\n\n if (rule.prelude) {\n preludes.pop();\n }\n}\n\nfunction printJS(rules: Rule[], indent = ''): string {\n rules = rules.slice().reverse();\n\n let conditional = rules.filter(rule => rule.condition).map((rule, i) => {\n return `${i > 0 ? ' else ' : ''}if (props.${rule.condition}) {\\n${indent} ${printRuleChildren(rule, indent + ' ')}\\n${indent}}`;\n });\n\n let elseCases = rules.filter(rule => !rule.condition).map(rule => printRuleChildren(rule, indent + ' '));\n\n if (conditional.length && elseCases.length) {\n return `${conditional.join('')} else {\\n${indent} ${elseCases.join('\\n' + indent + ' ')}\\n${indent}}`;\n }\n\n if (conditional.length) {\n return conditional.join('');\n }\n\n return elseCases.join('\\n' + indent);\n}\n\nfunction printRuleChildren(rule: Rule, indent = '') {\n let res = '';\n if (rule.prelude.startsWith('.')) {\n res += `rules += ' ${rule.prelude.slice(1)}';`;\n }\n\n if (Array.isArray(rule.body)) {\n res += printJS(rule.body, indent);\n }\n\n return res;\n}\n\nfunction getStaticClassName(rules: Rule[]): string {\n return rules.map(rule => (rule.prelude.startsWith('.') ? ' ' + rule.prelude.slice(1) : '') + (Array.isArray(rule.body) ? getStaticClassName(rule.body) : '')).join('');\n}\n\nexport function raw(this: MacroContext | void, css: string, layer = '_.a') {\n // Check if `this` is undefined, which means style was not called as a macro but as a normal function.\n // We also check if this is globalThis, which happens in non-strict mode bundles.\n // Also allow style to be called as a normal function in tests.\n // @ts-ignore\n // eslint-disable-next-line\n if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') {\n throw new Error('The raw macro must be imported with {type: \"macro\"}.');\n }\n let className = generateArbitraryValueSelector(css, true);\n css = `@layer ${layer} {\n .${className} {\n ${css}\n }\n}`;\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n return className;\n}\n\nexport function keyframes(this: MacroContext | void, css: string) {\n // Check if `this` is undefined, which means style was not called as a macro but as a normal function.\n // We also check if this is globalThis, which happens in non-strict mode bundles.\n // Also allow style to be called as a normal function in tests.\n // @ts-ignore\n // eslint-disable-next-line\n if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') {\n throw new Error('The keyframes macro must be imported with {type: \"macro\"}.');\n }\n let name = generateArbitraryValueSelector(css, true);\n css = `@keyframes ${name} {\n ${css}\n}`;\n if (this && typeof this.addAsset === 'function') {\n this.addAsset({\n type: 'css',\n content: css\n });\n }\n return name;\n}\n"],"names":[],"version":3,"file":"style-macro.cjs.map","sourceRoot":"../../../../../"}
|
|
@@ -538,6 +538,12 @@ function $a42cf657cdea7060$var$getStaticClassName(rules) {
|
|
|
538
538
|
return rules.map((rule)=>(rule.prelude.startsWith('.') ? ' ' + rule.prelude.slice(1) : '') + (Array.isArray(rule.body) ? $a42cf657cdea7060$var$getStaticClassName(rule.body) : '')).join('');
|
|
539
539
|
}
|
|
540
540
|
function $a42cf657cdea7060$export$1776c186c69df29e(css, layer = '_.a') {
|
|
541
|
+
// Check if `this` is undefined, which means style was not called as a macro but as a normal function.
|
|
542
|
+
// We also check if this is globalThis, which happens in non-strict mode bundles.
|
|
543
|
+
// Also allow style to be called as a normal function in tests.
|
|
544
|
+
// @ts-ignore
|
|
545
|
+
// eslint-disable-next-line
|
|
546
|
+
if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') throw new Error('The raw macro must be imported with {type: "macro"}.');
|
|
541
547
|
let className = $a42cf657cdea7060$var$generateArbitraryValueSelector(css, true);
|
|
542
548
|
css = `@layer ${layer} {
|
|
543
549
|
.${className} {
|
|
@@ -551,6 +557,12 @@ function $a42cf657cdea7060$export$1776c186c69df29e(css, layer = '_.a') {
|
|
|
551
557
|
return className;
|
|
552
558
|
}
|
|
553
559
|
function $a42cf657cdea7060$export$d25ddfdf17c3ad3e(css) {
|
|
560
|
+
// Check if `this` is undefined, which means style was not called as a macro but as a normal function.
|
|
561
|
+
// We also check if this is globalThis, which happens in non-strict mode bundles.
|
|
562
|
+
// Also allow style to be called as a normal function in tests.
|
|
563
|
+
// @ts-ignore
|
|
564
|
+
// eslint-disable-next-line
|
|
565
|
+
if ((this == null || this === globalThis) && process.env.NODE_ENV !== 'test') throw new Error('The keyframes macro must be imported with {type: "macro"}.');
|
|
554
566
|
let name = $a42cf657cdea7060$var$generateArbitraryValueSelector(css, true);
|
|
555
567
|
css = `@keyframes ${name} {
|
|
556
568
|
${css}
|