@openedx/paragon 23.0.0-alpha.2 → 23.0.0-alpha.4
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/bin/paragon-scripts.js +10 -0
- package/dist/Annotation/index.scss +16 -0
- package/dist/Button/index.d.ts +35 -0
- package/dist/Button/index.js +37 -15
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/CardDeck.js +0 -2
- package/dist/Card/CardDeck.js.map +1 -1
- package/dist/Card/index.scss +6 -6
- package/dist/Carousel/index.scss +24 -1
- package/dist/Chip/ChipIcon.d.ts +13 -8
- package/dist/Chip/ChipIcon.js +0 -2
- package/dist/Chip/ChipIcon.js.map +1 -1
- package/dist/Chip/constants.d.ts +4 -0
- package/dist/Chip/constants.js +3 -2
- package/dist/Chip/constants.js.map +1 -0
- package/dist/Chip/index.d.ts +4 -3
- package/dist/Chip/index.js +2 -4
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +0 -2
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/CloseButton/index.scss +8 -0
- package/dist/ColorPicker/index.scss +1 -1
- package/dist/DataTable/index.scss +12 -0
- package/dist/Dropdown/dropdown-bootstrap.scss +6 -0
- package/dist/Dropzone/index.scss +34 -0
- package/dist/Form/_FormText.scss +1 -1
- package/dist/Form/_bootstrap-custom-forms.scss +40 -0
- package/dist/Form/_index.scss +9 -0
- package/dist/Form/_mixins.scss +22 -0
- package/dist/Hyperlink/index.d.ts +24 -0
- package/dist/Hyperlink/index.js +20 -32
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Icon/index.d.ts +4 -2
- package/dist/Icon/index.js +1 -1
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.d.ts +342 -0
- package/dist/IconButton/index.js +18 -26
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButton/index.scss +146 -0
- package/dist/Menu/index.scss +8 -0
- package/dist/Modal/ModalDialog.js +8 -4
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalPopup.js +7 -1
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/_ModalDialog.scss +26 -2
- package/dist/Nav/index.scss +8 -0
- package/dist/Overlay/index.d.ts +128 -0
- package/dist/Overlay/index.js +8 -2
- package/dist/Overlay/index.js.map +1 -1
- package/dist/PageBanner/index.scss +2 -2
- package/dist/Pagination/pagination-bootstrap.scss +9 -0
- package/dist/Popover/index.scss +1 -1
- package/dist/ProductTour/Checkpoint.scss +1 -1
- package/dist/ProgressBar/bootstrap-progress.scss +20 -5
- package/dist/ProgressBar/index.scss +3 -3
- package/dist/Stepper/index.scss +1 -1
- package/dist/Sticky/index.scss +12 -0
- package/dist/Toast/index.scss +13 -1
- package/dist/Tooltip/index.d.ts +7 -0
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/Tooltip/index.scss +16 -0
- package/dist/core.css +914 -470
- package/dist/core.css.map +1 -1
- package/dist/core.min.css +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/light.css +2035 -1315
- package/dist/light.css.map +1 -1
- package/dist/light.min.css +1 -1
- package/dist/setupTest.d.ts +2 -0
- package/dist/setupTest.js.map +1 -0
- package/dist/utils/types/bootstrap.d.ts +39 -0
- package/dist/utils/types/bootstrap.js +2 -0
- package/dist/utils/types/bootstrap.js.map +1 -0
- package/lib/build-tokens.js +67 -31
- package/package.json +11 -8
- package/src/Annotation/index.scss +16 -0
- package/src/Button/{Button.test.jsx → Button.test.tsx} +14 -2
- package/src/Button/__snapshots__/{Button.test.jsx.snap → Button.test.tsx.snap} +19 -2
- package/src/Button/{index.jsx → index.tsx} +58 -16
- package/src/Card/CardDeck.jsx +0 -3
- package/src/Card/README.md +0 -31
- package/src/Card/index.scss +6 -6
- package/src/Carousel/index.scss +24 -1
- package/src/Chip/{Chip.test.jsx → Chip.test.tsx} +5 -7
- package/src/Chip/ChipIcon.tsx +8 -8
- package/src/Chip/{constants.js → constants.ts} +1 -1
- package/src/Chip/index.tsx +6 -8
- package/src/ChipCarousel/index.tsx +0 -2
- package/src/CloseButton/index.scss +8 -0
- package/src/ColorPicker/index.scss +1 -1
- package/src/DataTable/index.scss +12 -0
- package/src/Dropdown/dropdown-bootstrap.scss +6 -0
- package/src/Dropzone/index.scss +34 -0
- package/src/Form/_FormText.scss +1 -1
- package/src/Form/_bootstrap-custom-forms.scss +40 -0
- package/src/Form/_index.scss +9 -0
- package/src/Form/_mixins.scss +22 -0
- package/src/Hyperlink/{Hyperlink.test.jsx → Hyperlink.test.tsx} +21 -10
- package/src/Hyperlink/{index.jsx → index.tsx} +41 -37
- package/src/Icon/index.d.ts +4 -2
- package/src/Icon/index.jsx +1 -1
- package/src/IconButton/{IconButton.test.jsx → IconButton.test.tsx} +24 -3
- package/src/IconButton/__snapshots__/IconButton.test.tsx.snap +90 -0
- package/src/IconButton/index.scss +146 -0
- package/src/IconButton/{index.jsx → index.tsx} +66 -26
- package/src/Menu/index.scss +8 -0
- package/src/Modal/ModalDialog.jsx +7 -3
- package/src/Modal/ModalPopup.jsx +9 -1
- package/src/Modal/_ModalDialog.scss +26 -2
- package/src/Modal/modal-dialog.mdx +95 -6
- package/src/Modal/tests/ModalDialog.test.jsx +2 -0
- package/src/Modal/tests/ModalPopupNoMock.test.jsx +29 -0
- package/src/Nav/index.scss +8 -0
- package/src/Overlay/{index.jsx → index.tsx} +13 -8
- package/src/PageBanner/index.scss +2 -2
- package/src/Pagination/pagination-bootstrap.scss +9 -0
- package/src/Popover/index.scss +1 -1
- package/src/ProductTour/Checkpoint.scss +1 -1
- package/src/ProgressBar/bootstrap-progress.scss +20 -5
- package/src/ProgressBar/index.scss +3 -3
- package/src/Stepper/index.scss +1 -1
- package/src/Sticky/index.scss +12 -0
- package/src/Toast/index.scss +13 -1
- package/src/Tooltip/index.scss +16 -0
- package/src/Tooltip/{index.jsx → index.tsx} +9 -3
- package/src/index.d.ts +5 -5
- package/src/index.js +7 -7
- package/src/{setupTest.js → setupTest.ts} +1 -0
- package/src/utils/types/bootstrap.test.tsx +86 -0
- package/src/utils/types/bootstrap.ts +43 -0
- package/styles/css/core/abstraction-variables.css +44 -0
- package/styles/css/core/custom-media-breakpoints.css +3 -4
- package/styles/css/core/index.css +2 -1
- package/styles/css/core/variables.css +494 -430
- package/styles/css/themes/light/abstraction-variables.css +304 -0
- package/styles/css/themes/light/index.css +1 -0
- package/styles/css/themes/light/utility-classes.css +2 -3
- package/styles/css/themes/light/variables.css +1753 -1334
- package/styles/scss/core/_typography.scss +16 -4
- package/styles/scss/core/_utilities.scss +7 -3
- package/styles/scss/core/_variables.scss +43 -30
- package/styles/scss/core/core.scss +1 -0
- package/tokens/src/core/alias/size.json +6 -5
- package/tokens/src/core/components/ActionRow.json +3 -2
- package/tokens/src/core/components/Alert.json +12 -10
- package/tokens/src/core/components/Annotation.json +9 -7
- package/tokens/src/core/components/Avatar.json +9 -9
- package/tokens/src/core/components/AvatarButton.json +4 -3
- package/tokens/src/core/components/Badge.json +12 -9
- package/tokens/src/core/components/Breadcrumb.json +7 -5
- package/tokens/src/core/components/Bubble.json +4 -3
- package/tokens/src/core/components/Button/core.json +35 -59
- package/tokens/src/core/components/Card.json +33 -44
- package/tokens/src/core/components/Carousel.json +39 -13
- package/tokens/src/core/components/Chip.json +13 -21
- package/tokens/src/core/components/ChipCarousel.json +4 -5
- package/tokens/src/core/components/CloseButton.json +2 -6
- package/tokens/src/core/components/Code.json +9 -8
- package/tokens/src/core/components/Collapsible.json +10 -13
- package/tokens/src/core/components/ColorPicker.json +3 -2
- package/tokens/src/core/components/Container.json +6 -5
- package/tokens/src/core/components/DataTable.json +17 -9
- package/tokens/src/core/components/Dropdown.json +24 -29
- package/tokens/src/core/components/Dropzone.json +5 -7
- package/tokens/src/core/components/Form/other.json +5 -4
- package/tokens/src/core/components/Form/size.json +72 -119
- package/tokens/src/core/components/Form/spacing.json +39 -83
- package/tokens/src/core/components/Form/transition.json +43 -7
- package/tokens/src/core/components/Form/typography.json +24 -88
- package/tokens/src/core/components/Icon.json +6 -5
- package/tokens/src/core/components/IconButton.json +4 -7
- package/tokens/src/core/components/Image.json +7 -6
- package/tokens/src/core/components/Menu.json +14 -12
- package/tokens/src/core/components/Modal.json +26 -21
- package/tokens/src/core/components/Nav.json +14 -16
- package/tokens/src/core/components/Navbar.json +15 -30
- package/tokens/src/core/components/Pagination.json +23 -24
- package/tokens/src/core/components/Popover.json +18 -14
- package/tokens/src/core/components/ProductTour.json +8 -14
- package/tokens/src/core/components/ProgressBar.json +29 -14
- package/tokens/src/core/components/SearchField.json +7 -9
- package/tokens/src/core/components/SelectableBox.json +4 -3
- package/tokens/src/core/components/Sheet.json +3 -2
- package/tokens/src/core/components/Spinner.json +9 -7
- package/tokens/src/core/components/Stack.json +2 -1
- package/tokens/src/core/components/Stepper.json +12 -14
- package/tokens/src/core/components/Sticky.json +2 -1
- package/tokens/src/core/components/Tab.json +8 -7
- package/tokens/src/core/components/Tabs.json +5 -5
- package/tokens/src/core/components/Toast.json +11 -8
- package/tokens/src/core/components/Tooltip.json +13 -11
- package/tokens/src/core/components/general/caret.json +5 -3
- package/tokens/src/core/components/general/headings.json +5 -4
- package/tokens/src/core/components/general/hr.json +3 -2
- package/tokens/src/core/components/general/input.json +19 -19
- package/tokens/src/core/components/general/link.json +13 -12
- package/tokens/src/core/components/general/list.json +9 -6
- package/tokens/src/core/components/general/text.json +6 -12
- package/tokens/src/core/global/breakpoints.json +25 -6
- package/tokens/src/core/global/elevation.json +55 -13
- package/tokens/src/core/global/other.json +5 -1
- package/tokens/src/core/global/spacing.json +70 -17
- package/tokens/src/core/global/transition.json +41 -4
- package/tokens/src/core/global/typography.json +248 -53
- package/tokens/src/core/utilities/color.json +35 -4
- package/tokens/src/themes/light/alias/color.json +276 -75
- package/tokens/src/themes/light/components/Alert.json +15 -26
- package/tokens/src/themes/light/components/Annotation.json +27 -13
- package/tokens/src/themes/light/components/Avatar.json +2 -1
- package/tokens/src/themes/light/components/Badge.json +57 -122
- package/tokens/src/themes/light/components/Breadcrumb.json +6 -5
- package/tokens/src/themes/light/components/Bubble.json +9 -8
- package/tokens/src/themes/light/components/Button/brand.json +171 -119
- package/tokens/src/themes/light/components/Button/core.json +8 -9
- package/tokens/src/themes/light/components/Button/danger.json +171 -112
- package/tokens/src/themes/light/components/Button/dark.json +188 -106
- package/tokens/src/themes/light/components/Button/info.json +186 -112
- package/tokens/src/themes/light/components/Button/light.json +186 -110
- package/tokens/src/themes/light/components/Button/primary.json +178 -116
- package/tokens/src/themes/light/components/Button/secondary.json +166 -132
- package/tokens/src/themes/light/components/Button/success.json +176 -117
- package/tokens/src/themes/light/components/Button/tertiary.json +34 -60
- package/tokens/src/themes/light/components/Button/warning.json +164 -128
- package/tokens/src/themes/light/components/Card.json +10 -21
- package/tokens/src/themes/light/components/Carousel.json +12 -11
- package/tokens/src/themes/light/components/Chip.json +14 -26
- package/tokens/src/themes/light/components/CloseButton.json +12 -2
- package/tokens/src/themes/light/components/Code.json +7 -9
- package/tokens/src/themes/light/components/DataTable.json +7 -11
- package/tokens/src/themes/light/components/Dropdown.json +17 -20
- package/tokens/src/themes/light/components/Dropzone.json +49 -11
- package/tokens/src/themes/light/components/Form/color.json +101 -155
- package/tokens/src/themes/light/components/Form/elevation.json +38 -42
- package/tokens/src/themes/light/components/Form/other.json +44 -41
- package/tokens/src/themes/light/components/IconButton.json +408 -256
- package/tokens/src/themes/light/components/Image.json +7 -4
- package/tokens/src/themes/light/components/Menu.json +12 -10
- package/tokens/src/themes/light/components/Modal.json +22 -12
- package/tokens/src/themes/light/components/Nav.json +82 -94
- package/tokens/src/themes/light/components/Navbar.json +32 -76
- package/tokens/src/themes/light/components/OverflowScroll.json +3 -1
- package/tokens/src/themes/light/components/PageBanner.json +11 -10
- package/tokens/src/themes/light/components/Pagination.json +19 -23
- package/tokens/src/themes/light/components/Popover.json +22 -27
- package/tokens/src/themes/light/components/ProductTour.json +9 -20
- package/tokens/src/themes/light/components/ProgressBar.json +12 -10
- package/tokens/src/themes/light/components/Scrollable.json +3 -3
- package/tokens/src/themes/light/components/SearchField.json +9 -9
- package/tokens/src/themes/light/components/Sheet.json +6 -7
- package/tokens/src/themes/light/components/Stepper.json +12 -17
- package/tokens/src/themes/light/components/Sticky.json +31 -6
- package/tokens/src/themes/light/components/Tab.json +47 -24
- package/tokens/src/themes/light/components/Toast.json +26 -14
- package/tokens/src/themes/light/components/Tooltip.json +25 -10
- package/tokens/src/themes/light/components/general/body.json +3 -2
- package/tokens/src/themes/light/components/general/headings.json +2 -1
- package/tokens/src/themes/light/components/general/hr.json +3 -6
- package/tokens/src/themes/light/components/general/input.json +11 -4
- package/tokens/src/themes/light/components/general/link.json +34 -43
- package/tokens/src/themes/light/components/general/list.json +15 -19
- package/tokens/src/themes/light/components/general/text.json +5 -6
- package/tokens/src/themes/light/global/color.json +1592 -867
- package/tokens/src/themes/light/global/elevation.json +481 -93
- package/tokens/style-dictionary.js +342 -144
- package/tokens/utils.js +176 -6
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +0 -20
- package/tokens/src/core/global/display.json +0 -22
- /package/src/Button/{ButtonGroup.test.jsx → ButtonGroup.test.tsx} +0 -0
- /package/src/Button/{ButtonToolbar.test.jsx → ButtonToolbar.test.tsx} +0 -0
- /package/src/Button/__snapshots__/{ButtonGroup.test.jsx.snap → ButtonGroup.test.tsx.snap} +0 -0
- /package/src/Button/__snapshots__/{ButtonToolbar.test.jsx.snap → ButtonToolbar.test.tsx.snap} +0 -0
- /package/src/Chip/__snapshots__/{Chip.test.jsx.snap → Chip.test.tsx.snap} +0 -0
- /package/src/Tooltip/{Tooltip.test.jsx → Tooltip.test.tsx} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { BsPropsWithAs, ComponentWithAsProp } from './bootstrap';
|
|
4
|
+
|
|
5
|
+
// Note: these are type-only tests. They don't actually do much at runtime; the important checks are at transpile time.
|
|
6
|
+
|
|
7
|
+
describe('BsPropsWithAs', () => {
|
|
8
|
+
interface Props<As extends React.ElementType = 'table'> extends BsPropsWithAs<As> {
|
|
9
|
+
otherProp?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
it('defines optional bsPrefix, className, and as but no other props', () => {
|
|
13
|
+
const checkProps = <As extends React.ElementType = 'table'>(_props: Props<As>) => {};
|
|
14
|
+
// These are all valid props per the prop definition:
|
|
15
|
+
checkProps({ });
|
|
16
|
+
checkProps({ bsPrefix: 'bs' });
|
|
17
|
+
checkProps({ className: 'foo bar' });
|
|
18
|
+
checkProps({ as: 'tr' });
|
|
19
|
+
checkProps({ className: 'foo bar', as: 'button', otherProp: 15 });
|
|
20
|
+
// But these are all invalid:
|
|
21
|
+
// @ts-expect-error
|
|
22
|
+
checkProps({ newProp: 10 });
|
|
23
|
+
// @ts-expect-error
|
|
24
|
+
checkProps({ onClick: () => {} });
|
|
25
|
+
// @ts-expect-error
|
|
26
|
+
checkProps({ id: 'id' });
|
|
27
|
+
// @ts-expect-error
|
|
28
|
+
checkProps({ children: <tr /> });
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('ComponentWithAsProp', () => {
|
|
33
|
+
interface MyProps extends BsPropsWithAs {
|
|
34
|
+
customProp?: string;
|
|
35
|
+
}
|
|
36
|
+
const MyComponent: ComponentWithAsProp<'div', MyProps> = (
|
|
37
|
+
React.forwardRef<HTMLDivElement, MyProps>(
|
|
38
|
+
({ as: Inner = 'div', ...props }, ref) => <Inner {...props} ref={ref} />,
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line react/function-component-definition
|
|
43
|
+
const CustomComponent: React.FC<{ requiredProp: string }> = () => <span />;
|
|
44
|
+
|
|
45
|
+
it('is defined to wrap a <div> by default, and accepts related props', () => {
|
|
46
|
+
// This is valid - by default it is a DIV so accepts props and ref related to DIV:
|
|
47
|
+
const divClick: React.MouseEventHandler<HTMLDivElement> = () => {};
|
|
48
|
+
const divRef: React.RefObject<HTMLDivElement> = { current: null };
|
|
49
|
+
const valid = <MyComponent ref={divRef} onClick={divClick} customProp="foo" />;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('is defined to wrap a <div> by default, and rejects unrelated props', () => {
|
|
53
|
+
const btnRef: React.RefObject<HTMLButtonElement> = { current: null };
|
|
54
|
+
// @ts-expect-error because the ref is to a <button> ref, but this is wrapping a <div>
|
|
55
|
+
const invalidRef = <MyComponent ref={btnRef} customProp="foo" />;
|
|
56
|
+
|
|
57
|
+
const btnClick: React.MouseEventHandler<HTMLButtonElement> = () => {};
|
|
58
|
+
// @ts-expect-error because the handler is for a <button> event, but this is wrapping a <div>
|
|
59
|
+
const invalidClick = <MyComponent onClick={btnClick} />;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('can be changed to wrap a <canvas>, and accepts related props', () => {
|
|
63
|
+
const canvasClick: React.MouseEventHandler<HTMLCanvasElement> = () => {};
|
|
64
|
+
const canvasRef: React.RefObject<HTMLCanvasElement> = { current: null };
|
|
65
|
+
const valid = <MyComponent as="canvas" ref={canvasRef} onClick={canvasClick} customProp="foo" />;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('can be changed to wrap a <canvas>, and rejects unrelated props', () => {
|
|
69
|
+
const btnRef: React.RefObject<HTMLButtonElement> = { current: null };
|
|
70
|
+
// @ts-expect-error because the ref is to a <button> ref, but this is wrapping an <canvas>
|
|
71
|
+
const invalidRef = <MyComponent as="canvas" ref={btnRef} customProp="foo" />;
|
|
72
|
+
|
|
73
|
+
const btnClick: React.MouseEventHandler<HTMLButtonElement> = () => {};
|
|
74
|
+
// @ts-expect-error because the handler is for a <button> event, but this is wrapping an <canvas>
|
|
75
|
+
const invalidClick = <MyComponent as="canvas" onClick={btnClick} />;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('can be changed to wrap a custom component, and accepts related props', () => {
|
|
79
|
+
const valid = <MyComponent as={CustomComponent} requiredProp="hello" />;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('can be changed to wrap a custom component, and rejects unrelated props', () => {
|
|
83
|
+
// @ts-expect-error The onClick prop has not been declared for our custom component.
|
|
84
|
+
const valid = <MyComponent as={CustomComponent} requiredProp="hello" onClick={() => {}} />;
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types related to bootstrap components
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import type { BsPrefixProps, BsPrefixRefForwardingComponent } from 'react-bootstrap/esm/helpers';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Type helper for defining props of a component that wraps a bootstrap
|
|
10
|
+
* component. This type defines three props:
|
|
11
|
+
* 1. `className`: this component accepts additional CSS classes.
|
|
12
|
+
* 2. `bsPrefix`: locally change the class name prefix used for this component.
|
|
13
|
+
* 3. `as`: optionally specify which HTML element or Component is used, e.g. `"div"`
|
|
14
|
+
*
|
|
15
|
+
* This type assumes no `children` are allowed, but you can extend it to allow children.
|
|
16
|
+
*/
|
|
17
|
+
export type BsPropsWithAs<As extends React.ElementType = React.ElementType> = BsPrefixProps<As>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is a helper that can be used to define the type of a Paragon component
|
|
21
|
+
* that accepts an `as` prop.
|
|
22
|
+
*
|
|
23
|
+
* It:
|
|
24
|
+
* - assumes you are using `forwardRef`, and sets the type of the `ref` prop
|
|
25
|
+
* to match the type of the component passed in the `as` prop.
|
|
26
|
+
* - assumes you are passing all unused props to the component, so adds any
|
|
27
|
+
* props from the `as` component type to the props you specify as `Props`.
|
|
28
|
+
*
|
|
29
|
+
* Example;
|
|
30
|
+
* ```
|
|
31
|
+
* interface MyProps extends BsPropsWithAs {
|
|
32
|
+
* customProp?: string;
|
|
33
|
+
* }
|
|
34
|
+
* export const MyComponent: ComponentWithAsProp<'div', MyProps> = (
|
|
35
|
+
* React.forwardRef<HTMLDivElement, MyProps>(
|
|
36
|
+
* ({ as: Inner = 'div', ...props }, ref) => <Inner {...props} ref={ref} />,
|
|
37
|
+
* )
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
* Note that you need to define the default (e.g. `'div'`) in three different places.
|
|
41
|
+
*/
|
|
42
|
+
export type ComponentWithAsProp<DefaultElementType extends React.ElementType, Props>
|
|
43
|
+
= BsPrefixRefForwardingComponent<DefaultElementType, Props>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/**
|
|
3
|
+
* TRANSITION
|
|
4
|
+
*/
|
|
5
|
+
--pgn-transition-base:
|
|
6
|
+
var(--pgn-transition-base-property)
|
|
7
|
+
var(--pgn-transition-base-duration)
|
|
8
|
+
var(--pgn-transition-base-timing-function)
|
|
9
|
+
var(--pgn-transition-base-delay)
|
|
10
|
+
var(--pgn-transition-base-behavior);
|
|
11
|
+
|
|
12
|
+
--pgn-transition-fade:
|
|
13
|
+
var(--pgn-transition-fade-property)
|
|
14
|
+
var(--pgn-transition-fade-duration)
|
|
15
|
+
var(--pgn-transition-fade-timing-function)
|
|
16
|
+
var(--pgn-transition-fade-delay)
|
|
17
|
+
var(--pgn-transition-fade-behavior);
|
|
18
|
+
|
|
19
|
+
--pgn-transition-collapse-height:
|
|
20
|
+
var(--pgn-transition-collapse-height-property)
|
|
21
|
+
var(--pgn-transition-collapse-height-duration)
|
|
22
|
+
var(--pgn-transition-collapse-height-timing-function)
|
|
23
|
+
var(--pgn-transition-collapse-height-delay)
|
|
24
|
+
var(--pgn-transition-collapse-height-behavior);
|
|
25
|
+
|
|
26
|
+
--pgn-transition-collapse-width:
|
|
27
|
+
var(--pgn-transition-collapse-width-property)
|
|
28
|
+
var(--pgn-transition-collapse-width-duration)
|
|
29
|
+
var(--pgn-transition-collapse-width-timing-function)
|
|
30
|
+
var(--pgn-transition-collapse-width-delay)
|
|
31
|
+
var(--pgn-transition-collapse-width-behavior);
|
|
32
|
+
|
|
33
|
+
--pgn-transition-form-input:
|
|
34
|
+
var(--pgn-transition-form-input-1-property)
|
|
35
|
+
var(--pgn-transition-form-input-1-duration)
|
|
36
|
+
var(--pgn-transition-form-input-1-timing-function)
|
|
37
|
+
var(--pgn-transition-form-input-1-delay)
|
|
38
|
+
var(--pgn-transition-form-input-1-behavior),
|
|
39
|
+
var(--pgn-transition-form-input-2-property)
|
|
40
|
+
var(--pgn-transition-form-input-2-duration)
|
|
41
|
+
var(--pgn-transition-form-input-2-timing-function)
|
|
42
|
+
var(--pgn-transition-form-input-2-delay)
|
|
43
|
+
var(--pgn-transition-form-input-2-behavior);
|
|
44
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Generated on Fri, 22 Sep 2023 08:20:17 GMT
|
|
2
|
+
* Do not edit directly, this file was auto-generated. while transforming design tokens.
|
|
3
|
+
* See <root>/tokens/README.md for more details.
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
@custom-media --pgn-size-breakpoint-min-width-xs (min-width:
|
|
6
|
+
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0px);
|
|
8
7
|
@custom-media --pgn-size-breakpoint-max-width-xs (max-width: 576px);
|
|
9
8
|
@custom-media --pgn-size-breakpoint-min-width-sm (min-width: 576px);
|
|
10
9
|
@custom-media --pgn-size-breakpoint-max-width-sm (max-width: 768px);
|