@autoguru/overdrive 4.42.0 → 4.43.0-next.1
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/components/Actions/Actions.d.ts +4 -3
- package/dist/components/Actions/Actions.d.ts.map +1 -1
- package/dist/components/Actions/Actions.js +5 -9
- package/dist/components/Actions/Actions.stories.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +13 -17
- package/dist/components/Anchor/Anchor.js +3 -3
- package/dist/components/AutoSuggest/AutoSuggest.js +2 -2
- package/dist/components/Box/Box.d.ts +6 -9
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +12 -117
- package/dist/components/Box/Box.stories.d.ts +3 -20
- package/dist/components/Box/Box.stories.d.ts.map +1 -1
- package/dist/components/Box/argTypes.d.ts.map +1 -1
- package/dist/components/Box/argTypes.js +1 -1
- package/dist/components/Box/boxStyles.d.ts +5 -0
- package/dist/components/Box/boxStyles.d.ts.map +1 -0
- package/dist/components/Box/boxStyles.js +32 -0
- package/dist/components/Box/index.d.ts +3 -3
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/index.js +3 -2
- package/dist/components/Box/useBox.d.ts +22 -0
- package/dist/components/Box/useBox.d.ts.map +1 -0
- package/dist/components/Box/useBox.js +42 -0
- package/dist/components/BulletText/BulletText.d.ts +4 -5
- package/dist/components/BulletText/BulletText.d.ts.map +1 -1
- package/dist/components/BulletText/BulletText.js +6 -8
- package/dist/components/BulletText/BulletText.stories.d.ts +1 -1
- package/dist/components/BulletText/BulletText.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.js +4 -4
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/ColourInput/ColourInput.js +4 -4
- package/dist/components/Columns/Column.css.d.ts +43 -2
- package/dist/components/Columns/Column.css.d.ts.map +1 -1
- package/dist/components/Columns/Column.css.js +61 -27
- package/dist/components/Columns/Column.d.ts +10 -13
- package/dist/components/Columns/Column.d.ts.map +1 -1
- package/dist/components/Columns/Column.js +28 -23
- package/dist/components/Columns/ColumnGrid.css.d.ts +35 -0
- package/dist/components/Columns/ColumnGrid.css.d.ts.map +1 -0
- package/dist/components/Columns/ColumnGrid.css.js +71 -0
- package/dist/components/Columns/Columns.css.d.ts +36 -6
- package/dist/components/Columns/Columns.css.d.ts.map +1 -1
- package/dist/components/Columns/Columns.css.js +42 -33
- package/dist/components/Columns/Columns.d.ts +13 -17
- package/dist/components/Columns/Columns.d.ts.map +1 -1
- package/dist/components/Columns/Columns.js +30 -23
- package/dist/components/Columns/Columns.stories.d.ts +7 -904
- package/dist/components/Columns/Columns.stories.d.ts.map +1 -1
- package/dist/components/Columns/index.d.ts +2 -2
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Columns/index.js +2 -2
- package/dist/components/DateInput/DateInput.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +3 -3
- package/dist/components/DividerLine/DividerLine.js +2 -2
- package/dist/components/DropDown/DropDown.stories.d.ts +4 -4
- package/dist/components/DropDown/DropDown.stories.d.ts.map +1 -1
- package/dist/components/DropDown/DropDownOption.js +2 -2
- package/dist/components/DropDown/DropDownOptionsList.js +2 -1
- package/dist/components/EditableText/EditableText.d.ts +2 -2
- package/dist/components/EditableText/EditableText.d.ts.map +1 -1
- package/dist/components/EditableText/EditableText.js +2 -2
- package/dist/components/EditableText/EditableText.stories.d.ts +1 -1
- package/dist/components/EditableText/EditableText.stories.d.ts.map +1 -1
- package/dist/components/FillHeightBox/FillHeightBox.stories.d.ts +1 -1
- package/dist/components/Flyout/Flyout.stories.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +4 -4
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/Heading/Heading.js +10 -12
- package/dist/components/Heading/Heading.stories.d.ts +1 -8
- package/dist/components/Heading/Heading.stories.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.d.ts +12 -0
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.js +33 -0
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +5 -4
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +46 -35
- package/dist/components/Icon/Icon.d.ts +2 -2
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Inline/Inline.d.ts +13 -13
- package/dist/components/Inline/Inline.d.ts.map +1 -1
- package/dist/components/Inline/Inline.js +54 -56
- package/dist/components/Inline/Inline.stories.d.ts +3 -32
- package/dist/components/Inline/Inline.stories.d.ts.map +1 -1
- package/dist/components/Inline/index.d.ts +1 -1
- package/dist/components/Inline/index.d.ts.map +1 -1
- package/dist/components/Inline/index.js +1 -1
- package/dist/components/IntentStripe/IntentStripe.d.ts +1 -2
- package/dist/components/IntentStripe/IntentStripe.d.ts.map +1 -1
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.d.ts.map +1 -1
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +1 -0
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts +376 -431
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts.map +1 -1
- package/dist/components/Meta/Meta.js +1 -1
- package/dist/components/MinimalModal/MinimalModal.css.d.ts +1 -1
- package/dist/components/MinimalModal/MinimalModal.stories.d.ts +6 -1
- package/dist/components/MinimalModal/MinimalModal.stories.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/NumberBubble/NumberBubble.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.js +3 -3
- package/dist/components/OptionGrid/OptionGrid.css.js +1 -1
- package/dist/components/OptionList/OptionList.d.ts +2 -2
- package/dist/components/OptionList/OptionListItem.js +1 -1
- package/dist/components/Pagination/Bubble.js +1 -1
- package/dist/components/Pagination/Pagination.js +3 -3
- package/dist/components/ProgressSpinner/ProgressSpinner.js +3 -3
- package/dist/components/ScrollPane/ScrollPane.d.ts +3 -3
- package/dist/components/ScrollPane/ScrollPane.d.ts.map +1 -1
- package/dist/components/ScrollPane/ScrollPane.js +1 -2
- package/dist/components/ScrollPane/ScrollPane.stories.d.ts +1 -1
- package/dist/components/ScrollPane/ScrollPane.stories.d.ts.map +1 -1
- package/dist/components/Section/Section.d.ts +4 -5
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/Section/Section.js +18 -13
- package/dist/components/Section/Section.stories.d.ts +1 -1
- package/dist/components/SimplePagination/SimplePagination.js +1 -1
- package/dist/components/SliderProgress/ProgressStep.js +2 -1
- package/dist/components/SliderProgress/SliderProgress.js +2 -1
- package/dist/components/SliderProgress/SliderProgress.stories.d.ts +1 -1
- package/dist/components/Stack/Divider.css.d.ts +1 -1
- package/dist/components/Stack/Divider.css.d.ts.map +1 -1
- package/dist/components/Stack/Divider.css.js +8 -3
- package/dist/components/Stack/Stack.d.ts +8 -9
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +48 -35
- package/dist/components/Stack/Stack.stories.d.ts +2 -17
- package/dist/components/Stack/Stack.stories.d.ts.map +1 -1
- package/dist/components/StandardModal/StandardModal.js +2 -2
- package/dist/components/StarRating/StarRating.d.ts.map +1 -1
- package/dist/components/StarRating/StarRating.js +3 -2
- package/dist/components/Stepper/Stepper.css.d.ts +1 -2
- package/dist/components/Stepper/Stepper.css.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.css.js +7 -12
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +15 -30
- package/dist/components/Table/TableCell.d.ts.map +1 -1
- package/dist/components/Table/TableCell.js +2 -2
- package/dist/components/Table/TableHeadCell.d.ts +1 -1
- package/dist/components/Table/TableHeadCell.d.ts.map +1 -1
- package/dist/components/Table/TableHeadCell.js +4 -2
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Text/Text.d.ts +4 -2
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +2 -5
- package/dist/components/Text/Text.stories.d.ts.map +1 -1
- package/dist/components/Text/useTextStyles.css.d.ts +1 -1
- package/dist/components/Text/useTextStyles.css.d.ts.map +1 -1
- package/dist/components/Text/useTextStyles.css.js +5 -1
- package/dist/components/Text/useTextStyles.d.ts +4 -5
- package/dist/components/Text/useTextStyles.d.ts.map +1 -1
- package/dist/components/Text/useTextStyles.js +3 -4
- package/dist/components/TextAreaInput/TextAreaInput.d.ts.map +1 -1
- package/dist/components/TextAreaInput/TextAreaInput.js +7 -6
- package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
- package/dist/components/TextBubble/TextBubble.js +3 -3
- package/dist/components/TextContainer/TextContainer.d.ts +0 -1
- package/dist/components/TextContainer/TextContainer.d.ts.map +1 -1
- package/dist/components/TextContainer/TextContainer.js +13 -25
- package/dist/components/TextContainer/TextContainer.stories.d.ts +3 -6
- package/dist/components/TextContainer/TextContainer.stories.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.d.ts +2 -2
- package/dist/components/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.js +8 -8
- package/dist/components/TextLink/TextLink.stories.d.ts +24 -19
- package/dist/components/TextLink/TextLink.stories.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +5 -4
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +9 -3
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +1 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts.map +1 -1
- package/dist/components/private/CheckableBase/CheckableBase.d.ts.map +1 -1
- package/dist/components/private/CheckableBase/CheckableBase.js +10 -10
- package/dist/components/private/InputBase/HintText.js +5 -5
- package/dist/components/private/InputBase/withEnhancedInput.d.ts +3 -3
- package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.js +4 -4
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDeepCompareMemo/index.d.ts +2 -0
- package/dist/hooks/useDeepCompareMemo/index.d.ts.map +1 -0
- package/dist/hooks/useDeepCompareMemo/index.js +13 -0
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.d.ts +1 -3
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.d.ts.map +1 -1
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.js +1 -2
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.d.ts +1 -3
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.d.ts.map +1 -1
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.js +1 -2
- package/dist/reset/globalReset.css.js +30 -13
- package/dist/reset/reset.css.d.ts.map +1 -1
- package/dist/reset/reset.css.js +94 -37
- package/dist/stories/helpers/index.d.ts +1 -1
- package/dist/stories/helpers/index.d.ts.map +1 -1
- package/dist/stories/helpers/sprinkles.css.d.ts +1 -1
- package/dist/stories/helpers/stack.css.d.ts.map +1 -0
- package/dist/styles/layers.css.d.ts +2 -0
- package/dist/styles/layers.css.d.ts.map +1 -1
- package/dist/styles/layers.css.js +2 -0
- package/dist/styles/sprinkles.css.d.ts +386 -71
- package/dist/styles/sprinkles.css.d.ts.map +1 -1
- package/dist/styles/sprinkles.css.js +174 -22
- package/dist/styles/vars.css.d.ts +2 -0
- package/dist/styles/vars.css.d.ts.map +1 -0
- package/dist/styles/vars.css.js +7 -0
- package/dist/test/vitest.setup.d.ts +2 -0
- package/dist/test/vitest.setup.d.ts.map +1 -0
- package/dist/themes/makeTheme.d.ts +1 -0
- package/dist/themes/makeTheme.d.ts.map +1 -1
- package/dist/themes/makeTheme.js +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/sprinkles.d.ts +11 -0
- package/dist/utils/sprinkles.d.ts.map +1 -0
- package/dist/utils/sprinkles.js +34 -0
- package/package.json +26 -23
- package/dist/components/Box/useBoxStyles.css.d.ts +0 -48
- package/dist/components/Box/useBoxStyles.css.d.ts.map +0 -1
- package/dist/components/Box/useBoxStyles.css.js +0 -141
- package/dist/components/Box/useBoxStyles.d.ts +0 -69
- package/dist/components/Box/useBoxStyles.d.ts.map +0 -1
- package/dist/components/Box/useBoxStyles.js +0 -80
- package/dist/components/Stack/Divider.d.ts +0 -3
- package/dist/components/Stack/Divider.d.ts.map +0 -1
- package/dist/components/Stack/Divider.js +0 -14
- package/dist/components/Stack/Stack.css.d.ts +0 -5
- package/dist/components/Stack/Stack.css.d.ts.map +0 -1
- package/dist/components/Stack/Stack.css.js +0 -18
- package/dist/styles/stack.css.d.ts.map +0 -1
- package/dist/styles/stack.css.js +0 -44
- package/dist/test/vitest-setup.d.ts +0 -2
- package/dist/test/vitest-setup.d.ts.map +0 -1
- /package/dist/{styles → stories/helpers}/stack.css.d.ts +0 -0
- /package/dist/test/{vitest-setup.js → vitest.setup.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface Props extends
|
|
1
|
+
import { type FunctionComponent, type ReactElement } from 'react';
|
|
2
|
+
import { type InlineProps } from '../Inline';
|
|
3
|
+
export interface Props extends Pick<InlineProps, 'noWrap'> {
|
|
4
4
|
children: ReactElement | ReactElement[];
|
|
5
5
|
className?: string;
|
|
6
|
+
wrappingDirection?: 'default' | 'reverse';
|
|
6
7
|
}
|
|
7
8
|
export declare const Actions: FunctionComponent<Props>;
|
|
8
9
|
export default Actions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../lib/components/Actions/Actions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../lib/components/Actions/Actions.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IACzD,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC1C;AAED,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAY5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import flattenChildren from 'react-keyed-flatten-children';
|
|
6
|
-
import { Column, Columns } from "../Columns/index.js";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Inline } from "../Inline/index.js";
|
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
export const Actions = _ref => {
|
|
9
7
|
let {
|
|
@@ -11,13 +9,11 @@ export const Actions = _ref => {
|
|
|
11
9
|
noWrap,
|
|
12
10
|
wrappingDirection
|
|
13
11
|
} = _ref;
|
|
14
|
-
return _jsx(
|
|
12
|
+
return _jsx(Inline, {
|
|
15
13
|
space: "3",
|
|
16
14
|
noWrap: noWrap,
|
|
17
|
-
wrappingDirection:
|
|
18
|
-
children:
|
|
19
|
-
children: child
|
|
20
|
-
}))
|
|
15
|
+
reverse: wrappingDirection === 'reverse' ? true : undefined,
|
|
16
|
+
children: children
|
|
21
17
|
});
|
|
22
18
|
};
|
|
23
19
|
export default Actions;
|
|
@@ -7,8 +7,8 @@ declare const meta: {
|
|
|
7
7
|
decorators: ((story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
8
|
children: React.ReactElement | React.ReactElement[];
|
|
9
9
|
className?: string | undefined;
|
|
10
|
+
wrappingDirection?: "default" | "reverse" | undefined;
|
|
10
11
|
noWrap?: boolean | undefined;
|
|
11
|
-
wrappingDirection?: keyof typeof import("../Columns/Columns.css").wrapping | undefined;
|
|
12
12
|
}>) => React.JSX.Element)[];
|
|
13
13
|
};
|
|
14
14
|
export default meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK/C,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAG7D,MAAM,WAAW,KAAM,SAAQ,iBAAiB;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAC1D;AASD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAuE1C,CAAC"}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import { AlertCircleIcon, AlertIcon, CheckCircleIcon, InformationIcon, WindowCloseIcon } from '@autoguru/icons';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { Box,
|
|
6
|
+
import { Box, boxStyles } from "../Box/index.js";
|
|
7
7
|
import { Button } from "../Button/index.js";
|
|
8
|
-
import { Column, Columns } from "../Columns/index.js";
|
|
9
8
|
import { Icon } from "../Icon/index.js";
|
|
10
9
|
import { IntentStripe } from "../IntentStripe/index.js";
|
|
11
10
|
import { Text, useTextStyles } from "../Text/index.js";
|
|
@@ -45,35 +44,33 @@ export const Alert = _ref => {
|
|
|
45
44
|
borderRadius: "1",
|
|
46
45
|
boxShadow: inline ? 'none' : '4',
|
|
47
46
|
padding: "2",
|
|
47
|
+
"data-od-component": "alert",
|
|
48
48
|
children: [_jsx(IntentStripe, {
|
|
49
49
|
intent: intent
|
|
50
|
-
}), _jsxs(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children: [_jsx(
|
|
54
|
-
|
|
55
|
-
alignSelf: "top",
|
|
50
|
+
}), _jsxs(Box, {
|
|
51
|
+
display: "flex",
|
|
52
|
+
gap: "2",
|
|
53
|
+
children: [_jsx(Box, {
|
|
54
|
+
alignSelf: "flex-start",
|
|
56
55
|
children: _jsx(Icon, {
|
|
57
56
|
icon: iconMapForIntent[intent],
|
|
58
57
|
size: "medium",
|
|
59
|
-
className:
|
|
58
|
+
className: boxStyles({
|
|
60
59
|
marginY: '2',
|
|
61
60
|
marginLeft: '2'
|
|
62
61
|
})
|
|
63
62
|
})
|
|
64
|
-
}), _jsx(
|
|
65
|
-
|
|
63
|
+
}), _jsx(Box, {
|
|
64
|
+
alignSelf: "center",
|
|
66
65
|
width: "auto",
|
|
67
|
-
alignSelf: "centre",
|
|
68
66
|
className: useTextStyles({
|
|
69
67
|
colour: 'dark'
|
|
70
68
|
}),
|
|
71
69
|
children: typeof children === 'string' ? _jsx(Text, {
|
|
72
70
|
children: children
|
|
73
71
|
}) : children
|
|
74
|
-
}), _jsx(
|
|
75
|
-
|
|
76
|
-
alignSelf: "top",
|
|
72
|
+
}), _jsx(Box, {
|
|
73
|
+
ml: "auto",
|
|
77
74
|
children: dismissible && _jsx(Button, {
|
|
78
75
|
minimal: true,
|
|
79
76
|
rounded: true,
|
|
@@ -90,5 +87,4 @@ export const Alert = _ref => {
|
|
|
90
87
|
})]
|
|
91
88
|
})]
|
|
92
89
|
});
|
|
93
|
-
};
|
|
94
|
-
export default Alert;
|
|
90
|
+
};
|
|
@@ -8,7 +8,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { cloneElement, createElement, isValidElement } from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { boxStyles } from "../Box/index.js";
|
|
12
12
|
import { Icon } from "../Icon/index.js";
|
|
13
13
|
import { Inline } from "../Inline/index.js";
|
|
14
14
|
import { Text, useTextStyles } from "../Text/index.js";
|
|
@@ -27,8 +27,8 @@ export const Anchor = _ref => {
|
|
|
27
27
|
colour: 'link'
|
|
28
28
|
});
|
|
29
29
|
const props = _objectSpread({
|
|
30
|
-
className: clsx(styles.root, textStyles,
|
|
31
|
-
|
|
30
|
+
className: clsx(styles.root, textStyles, boxStyles({
|
|
31
|
+
as: typeof Component === 'string' ? Component : undefined,
|
|
32
32
|
display: 'inline'
|
|
33
33
|
}), className),
|
|
34
34
|
disabled
|
|
@@ -391,8 +391,8 @@ const SuggestionsList = _ref4 => {
|
|
|
391
391
|
suggestionListRef
|
|
392
392
|
} = _ref4;
|
|
393
393
|
return _jsxs(Box, {
|
|
394
|
-
ref: suggestionListRef,
|
|
395
394
|
as: "ul",
|
|
395
|
+
ref: suggestionListRef,
|
|
396
396
|
backgroundColour: "white",
|
|
397
397
|
className: [styles.suggestionList.defaults, className],
|
|
398
398
|
id: suggestionListId,
|
|
@@ -403,8 +403,8 @@ const SuggestionsList = _ref4 => {
|
|
|
403
403
|
}), suggestions.map((suggestion, idx) => {
|
|
404
404
|
const highlight = highlightIndex === idx;
|
|
405
405
|
return _jsx(Box, {
|
|
406
|
-
ref: highlight ? highlightRef : undefined,
|
|
407
406
|
as: "li",
|
|
407
|
+
ref: highlight ? highlightRef : undefined,
|
|
408
408
|
id: getSuggestionId(suggestionListId, idx),
|
|
409
409
|
role: "option",
|
|
410
410
|
"aria-selected": highlight,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export declare const Box: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
9
|
-
export default Box;
|
|
1
|
+
import React, { type ElementType } from 'react';
|
|
2
|
+
import { type UseBoxProps } from './useBox';
|
|
3
|
+
export declare const Box: {
|
|
4
|
+
<E extends ElementType = "div">({ children, ...props }: UseBoxProps<E>): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
10
7
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAoBpD,eAAO,MAAM,GAAG;KAAI,CAAC,SAAS,WAAW,kCAGtC,WAAW,CAAC,CAAC,CAAC;;CAIhB,CAAC"}
|
|
@@ -2,128 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["children"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { forwardRef } from 'react';
|
|
11
|
-
import { useBoxStyles } from "./useBoxStyles.js";
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { useBox } from "./useBox.js";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export const Box =
|
|
11
|
+
export const Box = _ref => {
|
|
14
12
|
let {
|
|
15
|
-
as = 'div',
|
|
16
|
-
is = as,
|
|
17
|
-
padding,
|
|
18
|
-
paddingX,
|
|
19
|
-
paddingY,
|
|
20
|
-
paddingTop,
|
|
21
|
-
paddingBottom,
|
|
22
|
-
paddingLeft,
|
|
23
|
-
paddingRight,
|
|
24
|
-
margin,
|
|
25
|
-
marginX,
|
|
26
|
-
marginY,
|
|
27
|
-
marginTop,
|
|
28
|
-
marginBottom,
|
|
29
|
-
marginLeft,
|
|
30
|
-
marginRight,
|
|
31
|
-
display,
|
|
32
|
-
width,
|
|
33
|
-
height,
|
|
34
|
-
position,
|
|
35
|
-
overflow,
|
|
36
|
-
userSelect,
|
|
37
|
-
textAlign,
|
|
38
|
-
pointerEvents,
|
|
39
|
-
borderColour,
|
|
40
|
-
borderColourX,
|
|
41
|
-
borderColourY,
|
|
42
|
-
borderColourTop,
|
|
43
|
-
borderColourRight,
|
|
44
|
-
borderColourBottom,
|
|
45
|
-
borderColourLeft,
|
|
46
|
-
borderWidth,
|
|
47
|
-
borderWidthX,
|
|
48
|
-
borderWidthY,
|
|
49
|
-
borderWidthTop,
|
|
50
|
-
borderWidthRight,
|
|
51
|
-
borderWidthBottom,
|
|
52
|
-
borderWidthLeft,
|
|
53
|
-
boxShadow,
|
|
54
|
-
borderRadius,
|
|
55
|
-
backgroundColour,
|
|
56
|
-
colour,
|
|
57
|
-
opacity,
|
|
58
|
-
className = '',
|
|
59
|
-
alignItems,
|
|
60
|
-
order,
|
|
61
|
-
flexDirection,
|
|
62
|
-
flexGrow,
|
|
63
|
-
flexShrink,
|
|
64
|
-
flexWrap,
|
|
65
|
-
justifyContent,
|
|
66
13
|
children
|
|
67
14
|
} = _ref,
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
colour,
|
|
75
|
-
borderColour,
|
|
76
|
-
borderColourBottom,
|
|
77
|
-
borderColourLeft,
|
|
78
|
-
borderColourRight,
|
|
79
|
-
borderColourTop,
|
|
80
|
-
borderColourX,
|
|
81
|
-
borderColourY,
|
|
82
|
-
borderRadius,
|
|
83
|
-
borderWidth,
|
|
84
|
-
borderWidthBottom,
|
|
85
|
-
borderWidthLeft,
|
|
86
|
-
borderWidthRight,
|
|
87
|
-
borderWidthTop,
|
|
88
|
-
borderWidthX,
|
|
89
|
-
borderWidthY,
|
|
90
|
-
boxShadow,
|
|
91
|
-
display,
|
|
92
|
-
flexDirection,
|
|
93
|
-
flexGrow,
|
|
94
|
-
flexShrink,
|
|
95
|
-
flexWrap,
|
|
96
|
-
height,
|
|
97
|
-
justifyContent,
|
|
98
|
-
margin,
|
|
99
|
-
marginBottom,
|
|
100
|
-
marginLeft,
|
|
101
|
-
marginRight,
|
|
102
|
-
marginTop,
|
|
103
|
-
marginX,
|
|
104
|
-
marginY,
|
|
105
|
-
opacity,
|
|
106
|
-
overflow,
|
|
107
|
-
padding,
|
|
108
|
-
paddingBottom,
|
|
109
|
-
paddingLeft,
|
|
110
|
-
paddingRight,
|
|
111
|
-
paddingTop,
|
|
112
|
-
paddingX,
|
|
113
|
-
paddingY,
|
|
114
|
-
pointerEvents,
|
|
115
|
-
position,
|
|
116
|
-
textAlign,
|
|
117
|
-
userSelect,
|
|
118
|
-
width
|
|
119
|
-
});
|
|
120
|
-
const Component = is;
|
|
121
|
-
return _jsx(Component, _objectSpread(_objectSpread({
|
|
122
|
-
ref: ref,
|
|
123
|
-
className: clsx(cls, className)
|
|
124
|
-
}, allOtherProps), {}, {
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
const {
|
|
17
|
+
Component,
|
|
18
|
+
componentProps
|
|
19
|
+
} = useBox(props);
|
|
20
|
+
return _jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
125
21
|
children: children
|
|
126
22
|
}));
|
|
127
|
-
}
|
|
128
|
-
Box.displayName = 'Box';
|
|
129
|
-
export default Box;
|
|
23
|
+
};
|
|
24
|
+
Box.displayName = 'Box';
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<import("./Box").Props & import("react").RefAttributes<HTMLElement>>;
|
|
5
|
-
args: {
|
|
6
|
-
as: "div";
|
|
7
|
-
children: string;
|
|
8
|
-
colour: "primary";
|
|
9
|
-
backgroundColour: "primary";
|
|
10
|
-
borderRadius: string;
|
|
11
|
-
borderColour: "light";
|
|
12
|
-
borderWidth: "1";
|
|
13
|
-
boxShadow: string;
|
|
14
|
-
display: "inlineFlex";
|
|
15
|
-
margin: undefined;
|
|
16
|
-
padding: "6";
|
|
17
|
-
textAlign: undefined;
|
|
18
|
-
};
|
|
19
|
-
argTypes: Partial<import("@storybook/react").ArgTypes<import("./Box").Props & import("react").RefAttributes<HTMLElement>>>;
|
|
20
|
-
};
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Box } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Box>;
|
|
21
4
|
export default meta;
|
|
22
5
|
type Story = StoryObj<typeof meta>;
|
|
23
6
|
export declare const Standard: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Box.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAExB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,GAAG,CAgB1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAAU,CAAC;AAKlC,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argTypes.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/argTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,eAAO,MAAM,YAAY,UAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"argTypes.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/argTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,eAAO,MAAM,YAAY,UAA8B,CAAC;AAuBxD,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAoErE,CAAC"}
|
|
@@ -9,7 +9,7 @@ export const scaleOptions = Object.values(tokens.space);
|
|
|
9
9
|
const boxShadowOptions = Object.keys(tokens.elevation);
|
|
10
10
|
const borderRadiusOptions = Object.keys(tokens.border.radius);
|
|
11
11
|
const scaledProps = ['padding', 'paddingX', 'paddingY', 'paddingTop', 'paddingRight', 'paddingLeft', 'margin', 'marginX', 'marginY', 'marginTop', 'marginRight', 'marginLeft'];
|
|
12
|
-
const widthOptions = ['full'
|
|
12
|
+
const widthOptions = ['full'];
|
|
13
13
|
const orderOptions = [0, 1, 2];
|
|
14
14
|
export const boxArgTypes = _objectSpread({
|
|
15
15
|
backgroundColour: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { BoxBasedProps, StyleProps } from './';
|
|
3
|
+
export type BoxStylesProps<E extends ElementType = 'div'> = StyleProps & Omit<BoxBasedProps<E>, 'children'>;
|
|
4
|
+
export declare const boxStyles: <E extends ElementType = "div">({ as, className, ...props }: BoxStylesProps<E>) => string;
|
|
5
|
+
//# sourceMappingURL=boxStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxStyles.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/boxStyles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAUzC,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEpD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,UAAU,GACrE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AA4BpC,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,6BAItD,cAAc,CAAC,CAAC,CAAC,WA2BnB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
const _excluded = ["as", "className"];
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { element } from "../../reset/reset.css.js";
|
|
7
|
+
import { sprinkles, sprinklesLegacyColours, sprinklesResponsive } from "../../styles/sprinkles.css.js";
|
|
8
|
+
import { filterSprinklesProps } from "../../utils/sprinkles.js";
|
|
9
|
+
const borderColorProps = ['borderColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'];
|
|
10
|
+
const borderStyleProps = ['borderStyle', 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'];
|
|
11
|
+
const borderWidthProps = ['borderWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'];
|
|
12
|
+
export const boxStyles = _ref => {
|
|
13
|
+
var _as$toString;
|
|
14
|
+
let {
|
|
15
|
+
as,
|
|
16
|
+
className
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
const tagName = (_as$toString = as === null || as === void 0 ? void 0 : as.toString()) !== null && _as$toString !== void 0 ? _as$toString : 'div';
|
|
20
|
+
const resets = tagName in element ? element[tagName] : '';
|
|
21
|
+
const hasBorderStyle = borderStyleProps.some(key => !!props[key]);
|
|
22
|
+
const hasBorderColorOrWidth = [].concat(borderColorProps, borderWidthProps).some(key => !!props[key]);
|
|
23
|
+
const {
|
|
24
|
+
sprinklesProps,
|
|
25
|
+
sprinklesResponsiveProps,
|
|
26
|
+
sprinklesLegacyColourProps
|
|
27
|
+
} = filterSprinklesProps(props);
|
|
28
|
+
if (hasBorderColorOrWidth && !hasBorderStyle) {
|
|
29
|
+
sprinklesProps['borderStyle'] = 'solid';
|
|
30
|
+
}
|
|
31
|
+
return clsx(resets, sprinkles(sprinklesProps), sprinklesResponsive(sprinklesResponsiveProps), sprinklesLegacyColours(sprinklesLegacyColourProps), className);
|
|
32
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './Box';
|
|
2
|
+
export * from './useBox';
|
|
3
|
+
export { boxStyles } from './boxStyles';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClassValue as ClassName } from 'clsx';
|
|
2
|
+
import type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';
|
|
3
|
+
import type { Sprinkles, SprinklesResponsive, SprinklesLegacyColours } from '../../styles/sprinkles.css';
|
|
4
|
+
export interface BoxBasedProps<E extends ElementType> extends PropsWithChildren {
|
|
5
|
+
as?: E;
|
|
6
|
+
className?: ClassName;
|
|
7
|
+
odComponent?: string;
|
|
8
|
+
}
|
|
9
|
+
export type StyleProps = Sprinkles & SprinklesResponsive & SprinklesLegacyColours;
|
|
10
|
+
export type PolymorphicBoxProps<E extends ElementType, Props = object> = BoxBasedProps<E> & Omit<ComponentPropsWithRef<E>, keyof Props | 'as' | 'className'> & Props;
|
|
11
|
+
export type UseBoxProps<E extends ElementType = 'div'> = PolymorphicBoxProps<E, StyleProps>;
|
|
12
|
+
export type ComponentProps<E extends ElementType> = Omit<ComponentPropsWithRef<E>, 'as'>;
|
|
13
|
+
export declare const useBox: <E extends ElementType = "div">({ as, className, odComponent, testId, ...props }: UseBoxProps<E>) => {
|
|
14
|
+
Component: ElementType;
|
|
15
|
+
componentProps: {
|
|
16
|
+
className: string;
|
|
17
|
+
} & (Omit<UseBoxProps<E>, "className" | "as" | "odComponent" | "testId"> extends infer T extends object ? { [K in keyof T]: Omit<UseBoxProps<E>, "className" | "as" | "odComponent" | "testId">[K]; } : never) & {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
SemanticChild: ElementType | undefined;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBox.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/useBox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EACX,qBAAqB,EACrB,WAAW,EAEX,iBAAiB,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,sBAAsB,EACtB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,WAAW,CACnD,SAAQ,iBAAiB;IAKzB,EAAE,CAAC,EAAE,CAAC,CAAC;IAIP,SAAS,CAAC,EAAE,SAAS,CAAC;IAItB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,UAAU,GAAG,SAAS,GACjC,mBAAmB,GACnB,sBAAsB,CAAC;AAGxB,MAAM,MAAM,mBAAmB,CAC9B,CAAC,SAAS,WAAW,EACrB,KAAK,GAAG,MAAM,IACX,aAAa,CAAC,CAAC,CAAC,GACnB,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,GAAG,IAAI,GAAG,WAAW,CAAC,GAChE,KAAK,CAAC;AAGP,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,mBAAmB,CAC3E,CAAC,EACD,UAAU,CACV,CAAC;AAGF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,IAAI,IAAI,CACvD,qBAAqB,CAAC,CAAC,CAAC,EACxB,IAAI,CACJ,CAAC;AAcF,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,kDAMnD,WAAW,CAAC,CAAC,CAAC;;;;;;;;CAoChB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["as", "className", "odComponent", "testId"];
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
import { useDeepCompareMemo } from "../../hooks/index.js";
|
|
9
|
+
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
10
|
+
import { filterNonSprinklesProps } from "../../utils/sprinkles.js";
|
|
11
|
+
import { boxStyles } from "./boxStyles.js";
|
|
12
|
+
const DEFAULT_TAG = 'div';
|
|
13
|
+
const LIST_ITEM_TAG = 'li';
|
|
14
|
+
const LIST_TAGS = ['ul', 'ol'];
|
|
15
|
+
const OD_COMPONENT_ATTR = 'od-component';
|
|
16
|
+
export const useBox = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
as,
|
|
19
|
+
className,
|
|
20
|
+
odComponent,
|
|
21
|
+
testId
|
|
22
|
+
} = _ref,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
const Component = as !== null && as !== void 0 ? as : DEFAULT_TAG;
|
|
25
|
+
const isList = LIST_TAGS.includes(Component);
|
|
26
|
+
const SemanticChild = isList ? LIST_ITEM_TAG : undefined;
|
|
27
|
+
const style = useDeepCompareMemo(() => boxStyles(_objectSpread({
|
|
28
|
+
as,
|
|
29
|
+
className
|
|
30
|
+
}, props)), [className, props]);
|
|
31
|
+
const remainingProps = useDeepCompareMemo(() => _objectSpread(_objectSpread({}, filterNonSprinklesProps(props)), dataAttrs({
|
|
32
|
+
[OD_COMPONENT_ATTR]: odComponent === null || odComponent === void 0 ? void 0 : odComponent.toLocaleLowerCase(),
|
|
33
|
+
testId
|
|
34
|
+
})), [props]);
|
|
35
|
+
return {
|
|
36
|
+
Component,
|
|
37
|
+
componentProps: _objectSpread({
|
|
38
|
+
className: style
|
|
39
|
+
}, remainingProps),
|
|
40
|
+
SemanticChild
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface Props extends
|
|
1
|
+
import React, { type ElementType, type ReactNode } from 'react';
|
|
2
|
+
import { type BoxBasedProps } from '../Box';
|
|
3
|
+
export interface Props<E extends ElementType> extends BoxBasedProps<E> {
|
|
4
4
|
bullet?: ReactNode;
|
|
5
5
|
variant?: 'primary' | 'secondary';
|
|
6
|
-
children?: ReactNode;
|
|
7
6
|
}
|
|
8
|
-
export declare const BulletText:
|
|
7
|
+
export declare const BulletText: <E extends ElementType>({ as, variant, children, bullet: Bullet, }: Props<E>) => React.JSX.Element;
|
|
9
8
|
export default BulletText;
|
|
10
9
|
//# sourceMappingURL=BulletText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulletText.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BulletText.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,WAAW,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,KAAK,aAAa,EAAO,MAAM,QAAQ,CAAC;AAMjD,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACrE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CAClC;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAAE,4CAK/C,KAAK,CAAC,CAAC,CAAC,sBAqCV,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import
|
|
5
|
-
import { isValidElement } from 'react';
|
|
4
|
+
import React, { isValidElement } from 'react';
|
|
6
5
|
import { Box } from "../Box/index.js";
|
|
7
6
|
import { Inline } from "../Inline/index.js";
|
|
8
7
|
import { Text } from "../Text/index.js";
|
|
@@ -10,17 +9,16 @@ import * as styles from "./BulletText.css.js";
|
|
|
10
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
10
|
export const BulletText = _ref => {
|
|
12
11
|
let {
|
|
12
|
+
as,
|
|
13
13
|
variant = 'primary',
|
|
14
14
|
children,
|
|
15
|
-
as = 'div',
|
|
16
|
-
is: Component = as,
|
|
17
15
|
bullet: Bullet = '•'
|
|
18
16
|
} = _ref;
|
|
19
17
|
return _jsxs(Inline, {
|
|
20
18
|
noWrap: true,
|
|
21
19
|
space: "3",
|
|
22
|
-
|
|
23
|
-
alignX: "
|
|
20
|
+
as: as,
|
|
21
|
+
alignX: "flex-start",
|
|
24
22
|
alignY: "center",
|
|
25
23
|
children: [isValidElement(Bullet) ? _jsx(Box, {
|
|
26
24
|
position: "relative",
|
|
@@ -42,14 +40,14 @@ export const BulletText = _ref => {
|
|
|
42
40
|
[styles.primaryText]: variant === 'primary',
|
|
43
41
|
[styles.secondaryText]: variant !== 'primary'
|
|
44
42
|
}),
|
|
45
|
-
|
|
43
|
+
as: "span",
|
|
46
44
|
size: "2",
|
|
47
45
|
children: Bullet
|
|
48
46
|
})
|
|
49
47
|
}), _jsx(Box, {
|
|
50
48
|
flexGrow: 1,
|
|
51
49
|
children: _jsx(Text, {
|
|
52
|
-
|
|
50
|
+
as: "span",
|
|
53
51
|
size: "4",
|
|
54
52
|
display: "block",
|
|
55
53
|
children: children
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { BulletText } from '.';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.
|
|
6
|
+
component: <E extends React.ElementType>({ as, variant, children, bullet: Bullet, }: import("./BulletText").Props<E>) => React.JSX.Element;
|
|
7
7
|
args: {
|
|
8
8
|
as: "div";
|
|
9
9
|
children: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulletText.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAE/B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;CAoByB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BulletText.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAE/B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;CAoByB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAC"}
|