@autoguru/overdrive 4.43.0-next.1 → 4.43.0-next.3
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/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +6 -2
- package/dist/components/Box/Box.stories.d.ts +3 -1
- package/dist/components/Box/Box.stories.d.ts.map +1 -1
- package/dist/components/Box/Box.test.d.ts +2 -0
- package/dist/components/Box/Box.test.d.ts.map +1 -0
- package/dist/components/Box/Box.test.js +113 -0
- package/dist/components/Box/boxStyles.d.ts +2 -2
- package/dist/components/Box/boxStyles.d.ts.map +1 -1
- package/dist/components/Box/boxStyles.js +2 -2
- package/dist/components/Box/useBox.d.ts +17 -13
- package/dist/components/Box/useBox.d.ts.map +1 -1
- package/dist/components/Box/useBox.js +14 -9
- package/dist/components/BulletText/BulletText.d.ts +3 -3
- package/dist/components/BulletText/BulletText.d.ts.map +1 -1
- package/dist/components/BulletText/BulletText.js +1 -1
- package/dist/components/BulletText/BulletText.stories.d.ts +1 -1
- package/dist/components/Columns/Column.css.d.ts +0 -14
- package/dist/components/Columns/Column.css.d.ts.map +1 -1
- package/dist/components/Columns/Column.css.js +0 -14
- package/dist/components/Columns/Column.d.ts +4 -6
- package/dist/components/Columns/Column.d.ts.map +1 -1
- package/dist/components/Columns/Column.js +11 -9
- package/dist/components/Columns/Columns.d.ts +1 -1
- package/dist/components/Columns/Columns.d.ts.map +1 -1
- package/dist/components/Columns/Columns.js +21 -12
- package/dist/components/Columns/Columns.stories.d.ts.map +1 -1
- package/dist/components/DropDown/DropDown.stories.d.ts +1 -1
- package/dist/components/Heading/Heading.js +1 -1
- package/dist/components/Inline/Inline.d.ts +3 -4
- package/dist/components/Inline/Inline.d.ts.map +1 -1
- package/dist/components/Inline/Inline.js +17 -12
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts +8 -6
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts.map +1 -1
- package/dist/components/Section/Section.d.ts +3 -4
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/Section/Section.stories.d.ts +375 -1
- package/dist/components/Section/Section.stories.d.ts.map +1 -1
- package/dist/components/Stack/Stack.d.ts +3 -3
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +9 -4
- package/dist/components/TextAreaInput/TextAreaInput.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextLink/TextLink.stories.d.ts +2 -2
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +3 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -2
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +1 -1
- package/dist/{components/Box/argTypes.d.ts → stories/shared/argTypes-box.d.ts} +2 -2
- package/dist/stories/shared/argTypes-box.d.ts.map +1 -0
- package/dist/styles/sprinkles.css.d.ts +4 -4
- package/dist/themes/helpers.d.ts.map +1 -1
- package/dist/utils/dataAttrs.d.ts.map +1 -1
- package/dist/utils/dataAttrs.js +1 -1
- package/dist/utils/sprinkles.d.ts +13 -6
- package/dist/utils/sprinkles.d.ts.map +1 -1
- package/dist/utils/sprinkles.js +30 -17
- package/package.json +3 -3
- package/dist/components/Box/Box.spec.d.ts +0 -2
- package/dist/components/Box/Box.spec.d.ts.map +0 -1
- package/dist/components/Box/argTypes.d.ts.map +0 -1
- package/dist/components/Box/argTypes.js +0 -81
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAyBpD,eAAO,MAAM,GAAG;KAAI,CAAC,SAAS,WAAW,kCAGtC,WAAW,CAAC,CAAC,CAAC;;CAUhB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
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 React from 'react';
|
|
8
|
+
import React, { cloneElement } from 'react';
|
|
9
9
|
import { useBox } from "./useBox.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export const Box = _ref => {
|
|
@@ -15,8 +15,12 @@ export const Box = _ref => {
|
|
|
15
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
16
|
const {
|
|
17
17
|
Component,
|
|
18
|
-
componentProps
|
|
18
|
+
componentProps,
|
|
19
|
+
reactElement
|
|
19
20
|
} = useBox(props);
|
|
21
|
+
if (reactElement) {
|
|
22
|
+
return cloneElement(reactElement, componentProps, children);
|
|
23
|
+
}
|
|
20
24
|
return _jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
21
25
|
children: children
|
|
22
26
|
}));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Box } from '
|
|
2
|
+
import { Box } from './Box';
|
|
3
3
|
declare const meta: Meta<typeof Box>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Standard: Story;
|
|
7
7
|
export declare const ResponsiveProps: Story;
|
|
8
|
+
export declare const DataAttributes: Story;
|
|
9
|
+
export declare const ComponentAsProp: Story;
|
|
8
10
|
//# sourceMappingURL=Box.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAGlD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,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;AAKF,eAAO,MAAM,cAAc,EAAE,KAU5B,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.test.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { composeStories } from '@storybook/react';
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Box } from "./Box.js";
|
|
7
|
+
import * as stories from "./Box.stories.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const {
|
|
10
|
+
ComponentAsProp,
|
|
11
|
+
DataAttributes,
|
|
12
|
+
ResponsiveProps,
|
|
13
|
+
Standard
|
|
14
|
+
} = composeStories(stories);
|
|
15
|
+
describe('Box', async () => {
|
|
16
|
+
await it('renders the standard Box story', async () => {
|
|
17
|
+
await Standard.run();
|
|
18
|
+
const text = Standard.args.children;
|
|
19
|
+
const boxElement = screen.getByText(text);
|
|
20
|
+
expect(boxElement.tagName).toBe('DIV');
|
|
21
|
+
});
|
|
22
|
+
await it('renders the Box story with responsive props', async () => {
|
|
23
|
+
await ResponsiveProps.run();
|
|
24
|
+
const boxElement = screen.getByText('Resize the viewport');
|
|
25
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
await it('merges custom className with component styles', () => {
|
|
28
|
+
render(_jsx(Box, {
|
|
29
|
+
padding: "3",
|
|
30
|
+
className: "my-custom-class another-class",
|
|
31
|
+
children: "Custom Class Box"
|
|
32
|
+
}));
|
|
33
|
+
const boxElement = screen.getByText('Custom Class Box');
|
|
34
|
+
expect(boxElement.className).toContain('my-custom-class');
|
|
35
|
+
expect(boxElement.className).toContain('another-class');
|
|
36
|
+
expect(boxElement).not.toHaveAttribute('padding');
|
|
37
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
await it('renders as a button element', () => {
|
|
40
|
+
render(_jsx(Box, {
|
|
41
|
+
as: "button",
|
|
42
|
+
children: "Button Box"
|
|
43
|
+
}));
|
|
44
|
+
const buttonElement = screen.getByRole('button', {
|
|
45
|
+
name: 'Button Box'
|
|
46
|
+
});
|
|
47
|
+
expect(buttonElement.tagName).toBe('BUTTON');
|
|
48
|
+
});
|
|
49
|
+
await it('renders using a React element passed to "as" prop', async () => {
|
|
50
|
+
await ComponentAsProp.run();
|
|
51
|
+
const boxElement = screen.getByText('Styled props merged with custom component');
|
|
52
|
+
expect(boxElement.tagName).toBe('A');
|
|
53
|
+
expect(boxElement).toHaveAttribute('href', '#hello');
|
|
54
|
+
expect(boxElement.className).toContain('keep-my-custom-class-name');
|
|
55
|
+
expect(boxElement).not.toHaveAttribute('backgroundColor');
|
|
56
|
+
expect(boxElement).not.toHaveAttribute('borderColor');
|
|
57
|
+
expect(boxElement).not.toHaveAttribute('borderWidth');
|
|
58
|
+
expect(boxElement).not.toHaveAttribute('p');
|
|
59
|
+
});
|
|
60
|
+
await it('renders as an anchor tag with href', () => {
|
|
61
|
+
render(_jsx(Box, {
|
|
62
|
+
as: "a",
|
|
63
|
+
href: "/test-link",
|
|
64
|
+
children: "Anchor Box"
|
|
65
|
+
}));
|
|
66
|
+
const anchorElement = screen.getByRole('link', {
|
|
67
|
+
name: 'Anchor Box'
|
|
68
|
+
});
|
|
69
|
+
expect(anchorElement.tagName).toBe('A');
|
|
70
|
+
expect(anchorElement).toHaveAttribute('href', '/test-link');
|
|
71
|
+
});
|
|
72
|
+
await it('renders with odComponent and testId props', async () => {
|
|
73
|
+
await DataAttributes.run();
|
|
74
|
+
const boxElement = screen.getByText('The most basic box (or is it?)');
|
|
75
|
+
expect(boxElement).toHaveAttribute('data-od-component', 'box-basic');
|
|
76
|
+
expect(boxElement).toHaveAttribute('data-test-id', 'so-basic');
|
|
77
|
+
expect(boxElement).toHaveAttribute('data-custom-attribute', 'somewhat less basic');
|
|
78
|
+
});
|
|
79
|
+
await it('applies basic style props (padding)', () => {
|
|
80
|
+
render(_jsx(Box, {
|
|
81
|
+
padding: "4",
|
|
82
|
+
children: "Padded Box"
|
|
83
|
+
}));
|
|
84
|
+
const boxElement = screen.getByText('Padded Box');
|
|
85
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
86
|
+
});
|
|
87
|
+
await it('applies responsive style props for padding', () => {
|
|
88
|
+
render(_jsx(Box, {
|
|
89
|
+
padding: ['2', '4', '6'],
|
|
90
|
+
children: "Responsive Padded Box"
|
|
91
|
+
}));
|
|
92
|
+
const boxElement = screen.getByText('Responsive Padded Box');
|
|
93
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
94
|
+
});
|
|
95
|
+
await it('applies colour and backgroundColour props', () => {
|
|
96
|
+
render(_jsx(Box, {
|
|
97
|
+
color: "onSurface",
|
|
98
|
+
backgroundColor: "danger",
|
|
99
|
+
children: "Coloured Box"
|
|
100
|
+
}));
|
|
101
|
+
const boxElement = screen.getByText('Coloured Box');
|
|
102
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
103
|
+
});
|
|
104
|
+
await it('applies border props correctly', () => {
|
|
105
|
+
render(_jsx(Box, {
|
|
106
|
+
borderColor: "warning",
|
|
107
|
+
borderWidth: "2",
|
|
108
|
+
children: "Bordered Box"
|
|
109
|
+
}));
|
|
110
|
+
const boxElement = screen.getByText('Bordered Box');
|
|
111
|
+
expect(boxElement.className).toMatchSnapshot();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementType } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export type BoxStylesProps<E extends ElementType = 'div'> =
|
|
2
|
+
import type { AsPolyProp, CustomProps, StyleProps } from './';
|
|
3
|
+
export type BoxStylesProps<E extends ElementType = 'div'> = AsPolyProp<E> & Pick<CustomProps, 'className'> & StyleProps;
|
|
4
4
|
export declare const boxStyles: <E extends ElementType = "div">({ as, className, ...props }: BoxStylesProps<E>) => string;
|
|
5
5
|
//# sourceMappingURL=boxStyles.d.ts.map
|
|
@@ -1 +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,
|
|
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,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAE9D,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,GACxE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAC9B,UAAU,CAAC;AA4BZ,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,6BAItD,cAAc,CAAC,CAAC,CAAC,WA4BnB,CAAC"}
|
|
@@ -5,7 +5,7 @@ const _excluded = ["as", "className"];
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { element } from "../../reset/reset.css.js";
|
|
7
7
|
import { sprinkles, sprinklesLegacyColours, sprinklesResponsive } from "../../styles/sprinkles.css.js";
|
|
8
|
-
import {
|
|
8
|
+
import { filterPropsWithStyles } from "../../utils/sprinkles.js";
|
|
9
9
|
const borderColorProps = ['borderColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'];
|
|
10
10
|
const borderStyleProps = ['borderStyle', 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'];
|
|
11
11
|
const borderWidthProps = ['borderWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'];
|
|
@@ -24,7 +24,7 @@ export const boxStyles = _ref => {
|
|
|
24
24
|
sprinklesProps,
|
|
25
25
|
sprinklesResponsiveProps,
|
|
26
26
|
sprinklesLegacyColourProps
|
|
27
|
-
} =
|
|
27
|
+
} = filterPropsWithStyles(props);
|
|
28
28
|
if (hasBorderColorOrWidth && !hasBorderStyle) {
|
|
29
29
|
sprinklesProps['borderStyle'] = 'solid';
|
|
30
30
|
}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import type { ClassValue as ClassName } from 'clsx';
|
|
2
|
-
import type
|
|
2
|
+
import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type ReactElement } from 'react';
|
|
3
3
|
import type { Sprinkles, SprinklesResponsive, SprinklesLegacyColours } from '../../styles/sprinkles.css';
|
|
4
|
-
export
|
|
5
|
-
|
|
4
|
+
export type StyleProps = Sprinkles & SprinklesResponsive & SprinklesLegacyColours;
|
|
5
|
+
export interface CustomProps extends PropsWithChildren {
|
|
6
6
|
className?: ClassName;
|
|
7
7
|
odComponent?: string;
|
|
8
|
+
testId?: string;
|
|
8
9
|
}
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
10
|
+
export type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
|
11
|
+
export type AsPolyProp<C extends ElementType> = {
|
|
12
|
+
as?: C | ReactElement;
|
|
13
|
+
};
|
|
14
|
+
export type RefPolyProp<C extends ElementType> = {
|
|
15
|
+
ref?: PolymorphicRef<C>;
|
|
16
|
+
};
|
|
17
|
+
export type PropsToOmit<C extends ElementType, P> = keyof (AsPolyProp<C> & P);
|
|
18
|
+
export type PolymorphicComponentProps<C extends ElementType, Props = object> = PropsWithChildren<Props & AsPolyProp<C> & RefPolyProp<C>> & Omit<ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
19
|
+
export type UseBoxProps<E extends ElementType = 'div'> = PolymorphicComponentProps<E, CustomProps & StyleProps>;
|
|
20
|
+
export declare const useBox: <E extends ElementType = "div">({ as: _as, className: _className, odComponent, testId, ...props }: UseBoxProps<E>) => {
|
|
14
21
|
Component: ElementType;
|
|
15
|
-
componentProps:
|
|
16
|
-
|
|
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
|
-
};
|
|
22
|
+
componentProps: ComponentPropsWithRef<E>;
|
|
23
|
+
reactElement: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
20
24
|
SemanticChild: ElementType | undefined;
|
|
21
25
|
};
|
|
22
26
|
//# sourceMappingURL=useBox.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAEN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,sBAAsB,EACtB,MAAM,4BAA4B,CAAC;AAOpC,MAAM,MAAM,UAAU,GAAG,SAAS,GACjC,mBAAmB,GACnB,sBAAsB,CAAC;AAMxB,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IAIrD,SAAS,CAAC,EAAE,SAAS,CAAC;IAItB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,IAC/C,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAGjC,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,WAAW,IAAI;IAC/C,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC;CACtB,CAAC;AAGF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,IAAI;IAChD,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAO9E,MAAM,MAAM,yBAAyB,CACpC,CAAC,SAAS,WAAW,EACrB,KAAK,GAAG,MAAM,IACX,iBAAiB,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAC5D,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAG1D,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IACpD,yBAAyB,CAAC,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;AAkBxD,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,mEAMnD,WAAW,CAAC,CAAC,CAAC;;;;;CA2ChB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
5
|
const _excluded = ["as", "className", "odComponent", "testId"];
|
|
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 { isValidElement } from 'react';
|
|
8
9
|
import { useDeepCompareMemo } from "../../hooks/index.js";
|
|
9
10
|
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
10
11
|
import { filterNonSprinklesProps } from "../../utils/sprinkles.js";
|
|
@@ -15,28 +16,32 @@ const LIST_TAGS = ['ul', 'ol'];
|
|
|
15
16
|
const OD_COMPONENT_ATTR = 'od-component';
|
|
16
17
|
export const useBox = _ref => {
|
|
17
18
|
let {
|
|
18
|
-
as,
|
|
19
|
-
className,
|
|
19
|
+
as: _as,
|
|
20
|
+
className: _className,
|
|
20
21
|
odComponent,
|
|
21
22
|
testId
|
|
22
23
|
} = _ref,
|
|
23
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
const isReactElement = typeof _as !== 'string' && isValidElement(_as);
|
|
26
|
+
const as = isReactElement ? undefined : _as !== null && _as !== void 0 ? _as : DEFAULT_TAG;
|
|
24
27
|
const Component = as !== null && as !== void 0 ? as : DEFAULT_TAG;
|
|
25
28
|
const isList = LIST_TAGS.includes(Component);
|
|
26
29
|
const SemanticChild = isList ? LIST_ITEM_TAG : undefined;
|
|
27
|
-
const
|
|
30
|
+
const className = useDeepCompareMemo(() => boxStyles(_objectSpread({
|
|
28
31
|
as,
|
|
29
|
-
className
|
|
30
|
-
}, props)), [
|
|
32
|
+
className: _className
|
|
33
|
+
}, props)), [as, _className, props]);
|
|
31
34
|
const remainingProps = useDeepCompareMemo(() => _objectSpread(_objectSpread({}, filterNonSprinklesProps(props)), dataAttrs({
|
|
32
35
|
[OD_COMPONENT_ATTR]: odComponent === null || odComponent === void 0 ? void 0 : odComponent.toLocaleLowerCase(),
|
|
33
36
|
testId
|
|
34
|
-
})), [props]);
|
|
37
|
+
})), [odComponent, props, testId]);
|
|
38
|
+
const componentProps = _objectSpread(_objectSpread({}, remainingProps), {}, {
|
|
39
|
+
className
|
|
40
|
+
});
|
|
35
41
|
return {
|
|
36
42
|
Component,
|
|
37
|
-
componentProps
|
|
38
|
-
|
|
39
|
-
}, remainingProps),
|
|
43
|
+
componentProps,
|
|
44
|
+
reactElement: isReactElement ? _as : undefined,
|
|
40
45
|
SemanticChild
|
|
41
46
|
};
|
|
42
47
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type ElementType, type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export interface Props
|
|
2
|
+
import { type UseBoxProps } from '../Box';
|
|
3
|
+
export interface Props {
|
|
4
4
|
bullet?: ReactNode;
|
|
5
5
|
variant?: 'primary' | 'secondary';
|
|
6
6
|
}
|
|
7
|
-
export declare const BulletText: <E extends ElementType>({ as, variant, children, bullet: Bullet, }:
|
|
7
|
+
export declare const BulletText: <E extends ElementType>({ as, variant, children, bullet: Bullet, }: UseBoxProps<E> & Props) => React.JSX.Element;
|
|
8
8
|
export default BulletText;
|
|
9
9
|
//# sourceMappingURL=BulletText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulletText.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BulletText.d.ts","sourceRoot":"","sources":["../../../lib/components/BulletText/BulletText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAEb,KAAK,WAAW,EAEhB,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAM/C,MAAM,WAAW,KAAK;IACrB,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,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,sBA2CxB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -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: <E extends React.ElementType>({ as, variant, children, bullet: Bullet, }: import("
|
|
6
|
+
component: <E extends React.ElementType>({ as, variant, children, bullet: Bullet, }: import("..").UseBoxProps<E> & import("./BulletText").Props) => React.JSX.Element;
|
|
7
7
|
args: {
|
|
8
8
|
as: "div";
|
|
9
9
|
children: string;
|
|
@@ -11,20 +11,6 @@ export declare const sprinklesColumnWidthResponsive: ((props: {
|
|
|
11
11
|
};
|
|
12
12
|
export type SprinklesColumnWidthResponsive = Parameters<typeof sprinklesColumnWidthResponsive>[0];
|
|
13
13
|
export declare const columnStyle: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
14
|
-
alignSelf: {
|
|
15
|
-
stretch: {
|
|
16
|
-
alignSelf: "stretch";
|
|
17
|
-
};
|
|
18
|
-
top: {
|
|
19
|
-
alignSelf: "flex-start";
|
|
20
|
-
};
|
|
21
|
-
center: {
|
|
22
|
-
alignSelf: "center";
|
|
23
|
-
};
|
|
24
|
-
bottom: {
|
|
25
|
-
alignSelf: "flex-end";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
14
|
grow: {
|
|
29
15
|
true: {
|
|
30
16
|
flexGrow: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Column.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA8BvE,eAAO,MAAM,8BAA8B;;;;;;;;;CAE1C,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,UAAU,CACtD,OAAO,8BAA8B,CACrC,CAAC,CAAC,CAAC,CAAC;AAEL,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"Column.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Column.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA8BvE,eAAO,MAAM,8BAA8B;;;;;;;;;CAE1C,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,UAAU,CACtD,OAAO,8BAA8B,CACrC,CAAC,CAAC,CAAC,CAAC;AAEL,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAgBtB,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAC7C,cAAc,CAAC,OAAO,WAAW,CAAC,CAClC,CAAC"}
|
|
@@ -32,20 +32,6 @@ export const sprinklesColumnWidthResponsive = createSprinkles(columnWidthRespons
|
|
|
32
32
|
export const columnStyle = recipe({
|
|
33
33
|
base: {},
|
|
34
34
|
variants: {
|
|
35
|
-
alignSelf: {
|
|
36
|
-
stretch: {
|
|
37
|
-
alignSelf: 'stretch'
|
|
38
|
-
},
|
|
39
|
-
top: {
|
|
40
|
-
alignSelf: 'flex-start'
|
|
41
|
-
},
|
|
42
|
-
center: {
|
|
43
|
-
alignSelf: 'center'
|
|
44
|
-
},
|
|
45
|
-
bottom: {
|
|
46
|
-
alignSelf: 'flex-end'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
35
|
grow: {
|
|
50
36
|
true: {
|
|
51
37
|
flexGrow: 1
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React, { type ElementType
|
|
2
|
-
import { type
|
|
1
|
+
import React, { type ElementType } from 'react';
|
|
2
|
+
import { type UseBoxProps } from '../Box';
|
|
3
3
|
import * as styles from './Column.css';
|
|
4
|
-
export interface ColumnProps
|
|
5
|
-
order?: StyleProps['order'];
|
|
6
|
-
ref?: Ref<E>;
|
|
4
|
+
export interface ColumnProps extends styles.ColumnRecipeVariants {
|
|
7
5
|
width?: styles.SprinklesColumnWidthResponsive['flexBasis'];
|
|
8
6
|
}
|
|
9
7
|
export declare const Column: {
|
|
10
|
-
<E extends ElementType>({
|
|
8
|
+
<E extends ElementType>({ children, grow, noShrink, order, ref, width, ...boxProps }: UseBoxProps<E> & ColumnProps): React.JSX.Element;
|
|
11
9
|
displayName: string;
|
|
12
10
|
};
|
|
13
11
|
//# sourceMappingURL=Column.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Column.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Column.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAgB,KAAK,WAAW,EAAc,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAGvC,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,oBAAoB;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC;CAC3D;AAQD,eAAO,MAAM,MAAM;KAAI,CAAC,SAAS,WAAW,gEAQzC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW;;CA2C9B,CAAC"}
|
|
@@ -2,18 +2,17 @@
|
|
|
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", "grow", "noShrink", "order", "ref", "width"];
|
|
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
8
|
import { invariant } from '@autoguru/utilities';
|
|
9
|
-
import React, { useContext } from 'react';
|
|
9
|
+
import React, { cloneElement, useContext } from 'react';
|
|
10
10
|
import { Box, useBox } from "../Box/index.js";
|
|
11
11
|
import * as styles from "./Column.css.js";
|
|
12
12
|
import { ColumnContext } from "./Columns.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
export const Column = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
alignSelf,
|
|
17
16
|
children,
|
|
18
17
|
grow = false,
|
|
19
18
|
noShrink = false,
|
|
@@ -31,12 +30,19 @@ export const Column = _ref => {
|
|
|
31
30
|
} = columnsContext;
|
|
32
31
|
const {
|
|
33
32
|
Component,
|
|
34
|
-
componentProps
|
|
33
|
+
componentProps,
|
|
34
|
+
reactElement
|
|
35
35
|
} = useBox(_objectSpread(_objectSpread({}, boxProps), {}, {
|
|
36
36
|
display: 'flex',
|
|
37
37
|
height: 'full',
|
|
38
38
|
width: 'full'
|
|
39
39
|
}));
|
|
40
|
+
const ColumnContent = () => reactElement ? (cloneElement(reactElement, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
41
|
+
ref
|
|
42
|
+
}), children)) : _jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
children: children
|
|
45
|
+
}));
|
|
40
46
|
return _jsx(Box, {
|
|
41
47
|
as: isList ? 'li' : 'div',
|
|
42
48
|
order: order,
|
|
@@ -45,14 +51,10 @@ export const Column = _ref => {
|
|
|
45
51
|
className: [spaceXCls, spaceYCls, styles.sprinklesColumnWidthResponsive({
|
|
46
52
|
flexBasis: width
|
|
47
53
|
}), styles.columnStyle({
|
|
48
|
-
alignSelf,
|
|
49
54
|
grow,
|
|
50
55
|
noShrink
|
|
51
56
|
})],
|
|
52
|
-
children: _jsx(
|
|
53
|
-
ref: ref,
|
|
54
|
-
children: children
|
|
55
|
-
}))
|
|
57
|
+
children: _jsx(ColumnContent, {})
|
|
56
58
|
});
|
|
57
59
|
};
|
|
58
60
|
Column.displayName = 'Column';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAMhF,OAAO,EACN,mBAAmB,EAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,KAAK,eAAe,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAEtD,MAAM,WAAW,YAAa,SAAQ,WAAW;IAIhD,KAAK,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAIrC,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAIvC,KAAK,CAAC,EAAE,eAAe,CAAC;IAIxB,MAAM,CAAC,EAAE,eAAe,CAAC;IAIzB,MAAM,CAAC,EAAE,eAAe,CAAC;IAIzB,iBAAiB,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;CAC7D;AAED,UAAU,kBAAkB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,0CAAiD,CAAC;AAgC5E,eAAO,MAAM,OAAO,kGA8EnB,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -5,8 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
5
|
const _excluded = ["as", "className", "children", "space", "spaceX", "spaceY", "noWrap", "wrappingDirection", "align"];
|
|
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 { createContext, forwardRef, useMemo } from 'react';
|
|
8
|
+
import React, { cloneElement, createContext, forwardRef, useMemo } from 'react';
|
|
10
9
|
import { useNegativeMarginLeft, useNegativeMarginTop } from "../../hooks/useNegativeMargin/useNegativeMargin.js";
|
|
11
10
|
import { sprinklesResponsive } from "../../styles/sprinkles.css.js";
|
|
12
11
|
import { useBox } from "../Box/index.js";
|
|
@@ -32,7 +31,8 @@ export const Columns = forwardRef((_ref, ref) => {
|
|
|
32
31
|
const marginTopFix = useNegativeMarginTop(resolvedSpaceY);
|
|
33
32
|
const {
|
|
34
33
|
Component,
|
|
35
|
-
componentProps
|
|
34
|
+
componentProps,
|
|
35
|
+
reactElement
|
|
36
36
|
} = useBox(_objectSpread(_objectSpread({}, boxProps), {}, {
|
|
37
37
|
as,
|
|
38
38
|
className: [styles.columnsStyle({
|
|
@@ -42,18 +42,27 @@ export const Columns = forwardRef((_ref, ref) => {
|
|
|
42
42
|
}), marginLeftFix, marginTopFix, className],
|
|
43
43
|
odComponent: 'columns'
|
|
44
44
|
}));
|
|
45
|
+
const contextValue = useMemo(() => ({
|
|
46
|
+
spaceXCls: sprinklesResponsive({
|
|
47
|
+
paddingLeft: resolvedSpaceX
|
|
48
|
+
}),
|
|
49
|
+
spaceYCls: sprinklesResponsive({
|
|
50
|
+
paddingTop: resolvedSpaceY
|
|
51
|
+
}),
|
|
52
|
+
isList: typeof as === 'string' && ['ul', 'ol'].includes(as)
|
|
53
|
+
}), [as, resolvedSpaceX, resolvedSpaceY]);
|
|
54
|
+
if (reactElement) {
|
|
55
|
+
return cloneElement(reactElement, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
56
|
+
ref
|
|
57
|
+
}), _jsx(ColumnContext.Provider, {
|
|
58
|
+
value: contextValue,
|
|
59
|
+
children: children
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
45
62
|
return _jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
46
63
|
ref: ref,
|
|
47
64
|
children: _jsx(ColumnContext.Provider, {
|
|
48
|
-
value:
|
|
49
|
-
spaceXCls: sprinklesResponsive({
|
|
50
|
-
paddingLeft: resolvedSpaceX
|
|
51
|
-
}),
|
|
52
|
-
spaceYCls: sprinklesResponsive({
|
|
53
|
-
paddingTop: resolvedSpaceY
|
|
54
|
-
}),
|
|
55
|
-
isList: typeof as === 'string' && ['ul', 'ol'].includes(as)
|
|
56
|
-
}), [as, resolvedSpaceX, resolvedSpaceY]),
|
|
65
|
+
value: contextValue,
|
|
57
66
|
children: children
|
|
58
67
|
})
|
|
59
68
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Columns.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAU,OAAO,
|
|
1
|
+
{"version":3,"file":"Columns.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAU,OAAO,EAAE,MAAM,GAAG,CAAC;AAIpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAwB9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,QAAQ,EAAE,KAyDtB,CAAC;AAOF,eAAO,MAAM,cAAc,EAAE,KAsE5B,CAAC"}
|
|
@@ -16,9 +16,9 @@ declare const meta: {
|
|
|
16
16
|
id?: string | undefined | undefined;
|
|
17
17
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
18
18
|
className?: string | undefined | undefined;
|
|
19
|
+
testId?: string | undefined;
|
|
19
20
|
lang?: Partial<Record<"loading", string>> | undefined;
|
|
20
21
|
"aria-label"?: string | undefined | undefined;
|
|
21
|
-
testId?: string | undefined;
|
|
22
22
|
type?: "submit" | "reset" | "button" | undefined | undefined;
|
|
23
23
|
rounded?: boolean | undefined;
|
|
24
24
|
minimal?: import("../Button/Button.css").ButtonMinimal | undefined;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { type ElementType, type ReactNode } from 'react';
|
|
2
2
|
import type { SprinklesResponsive } from '../../styles/sprinkles.css';
|
|
3
|
+
import { type UseBoxProps } from '../Box';
|
|
3
4
|
export type InlineDivider = ReactNode | boolean;
|
|
4
|
-
export interface InlineProps
|
|
5
|
+
export interface InlineProps {
|
|
5
6
|
alignX?: SprinklesResponsive['justifyContent'];
|
|
6
7
|
alignY?: SprinklesResponsive['alignItems'];
|
|
7
|
-
as?: E;
|
|
8
|
-
children: ReactNode;
|
|
9
8
|
dividers?: InlineDivider;
|
|
10
9
|
noWrap?: boolean;
|
|
11
10
|
reverse?: boolean;
|
|
12
11
|
space?: SprinklesResponsive['gap'];
|
|
13
12
|
width?: SprinklesResponsive['width'];
|
|
14
13
|
}
|
|
15
|
-
export declare const Inline: <E extends ElementType
|
|
14
|
+
export declare const Inline: <E extends ElementType>({ alignX, alignY, children, dividers, noWrap, reverse, space, ...props }: UseBoxProps<E> & InlineProps) => React.JSX.Element;
|
|
16
15
|
//# sourceMappingURL=Inline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../lib/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../lib/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIb,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGvD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;AAChD,MAAM,WAAW,WAAW;IAI3B,MAAM,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAK/C,MAAM,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAI3C,QAAQ,CAAC,EAAE,aAAa,CAAC;IAKzB,MAAM,CAAC,EAAE,OAAO,CAAC;IAIjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAKlB,KAAK,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAInC,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACrC;AAkCD,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,WAAW,EAAE,0EAS3C,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,sBAoD9B,CAAC"}
|