@wonderflow/react-components 10.7.1 → 10.9.0
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/accordion/accordion-context.d.ts +12 -0
- package/dist/components/accordion/accordion-context.d.ts.map +1 -0
- package/dist/components/accordion/accordion-context.js +13 -0
- package/dist/components/accordion/accordion-item.d.ts +10 -0
- package/dist/components/accordion/accordion-item.d.ts.map +1 -0
- package/dist/components/accordion/accordion-item.js +9 -0
- package/dist/components/accordion/accordion.d.ts +18 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +8 -0
- package/dist/components/accordion/accordion.module.css +1 -0
- package/dist/components/accordion/accordion.stories.d.ts +12 -0
- package/dist/components/accordion/accordion.stories.d.ts.map +1 -0
- package/dist/components/accordion/accordion.stories.js +17 -0
- package/dist/components/accordion/index.d.ts +5 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.stories.d.ts +6 -0
- package/dist/components/aspect-ratio/aspect-ratio.stories.d.ts.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.stories.js +12 -0
- package/dist/components/autocomplete/autocomplete.js +1 -1
- package/dist/components/autocomplete/autocomplete.stories.d.ts +15 -0
- package/dist/components/autocomplete/autocomplete.stories.d.ts.map +1 -0
- package/dist/components/autocomplete/autocomplete.stories.js +19 -0
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar/avatar.stories.d.ts +10 -0
- package/dist/components/avatar/avatar.stories.d.ts.map +1 -0
- package/dist/components/avatar/avatar.stories.js +19 -0
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.module.css +1 -1
- package/dist/components/button/button.stories.d.ts +9 -0
- package/dist/components/button/button.stories.d.ts.map +1 -0
- package/dist/components/button/button.stories.js +55 -0
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/card.module.css +1 -1
- package/dist/components/card/card.stories.d.ts +10 -0
- package/dist/components/card/card.stories.d.ts.map +1 -0
- package/dist/components/card/card.stories.js +47 -0
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/chip.stories.d.ts +6 -0
- package/dist/components/chip/chip.stories.d.ts.map +1 -0
- package/dist/components/chip/chip.stories.js +30 -0
- package/dist/components/circular-progress/circular-progress.js +1 -1
- package/dist/components/circular-progress/circular-progress.stories.d.ts +10 -0
- package/dist/components/circular-progress/circular-progress.stories.d.ts.map +1 -0
- package/dist/components/circular-progress/circular-progress.stories.js +30 -0
- package/dist/components/clamp-text/clamp-text.d.ts.map +1 -1
- package/dist/components/clamp-text/clamp-text.js +2 -1
- package/dist/components/clamp-text/clamp-text.module.css +1 -1
- package/dist/components/clamp-text/clamp-text.stories.d.ts +7 -0
- package/dist/components/clamp-text/clamp-text.stories.d.ts.map +1 -0
- package/dist/components/clamp-text/clamp-text.stories.js +25 -0
- package/dist/components/container/container.js +1 -1
- package/dist/components/container/container.stories.d.ts +10 -0
- package/dist/components/container/container.stories.d.ts.map +1 -0
- package/dist/components/container/container.stories.js +48 -0
- package/dist/components/datetime/datetime.stories.d.ts +7 -0
- package/dist/components/datetime/datetime.stories.d.ts.map +1 -0
- package/dist/components/datetime/datetime.stories.js +22 -0
- package/dist/components/disclosure/disclosure.d.ts +1 -1
- package/dist/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.js +9 -8
- package/dist/components/disclosure/disclosure.stories.d.ts +24 -0
- package/dist/components/disclosure/disclosure.stories.d.ts.map +1 -0
- package/dist/components/disclosure/disclosure.stories.js +32 -0
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/drawer.stories.d.ts +7 -0
- package/dist/components/drawer/drawer.stories.d.ts.map +1 -0
- package/dist/components/drawer/drawer.stories.js +36 -0
- package/dist/components/elevator/elevator.stories.d.ts +7 -0
- package/dist/components/elevator/elevator.stories.d.ts.map +1 -0
- package/dist/components/elevator/elevator.stories.js +17 -0
- package/dist/components/grid/grid.js +1 -1
- package/dist/components/grid/grid.stories.d.ts +9 -0
- package/dist/components/grid/grid.stories.d.ts.map +1 -0
- package/dist/components/grid/grid.stories.js +11 -0
- package/dist/components/grid/item/grid-item.js +1 -1
- package/dist/components/icon-button/icon-button.js +1 -1
- package/dist/components/icon-button/icon-button.stories.d.ts +6 -0
- package/dist/components/icon-button/icon-button.stories.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.stories.js +33 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/info-state/info-state.js +1 -1
- package/dist/components/info-state/info-state.stories.d.ts +71 -0
- package/dist/components/info-state/info-state.stories.d.ts.map +1 -0
- package/dist/components/info-state/info-state.stories.js +40 -0
- package/dist/components/input-group/input-group.js +1 -1
- package/dist/components/input-group/input-group.stories.d.ts +10 -0
- package/dist/components/input-group/input-group.stories.d.ts.map +1 -0
- package/dist/components/input-group/input-group.stories.js +13 -0
- package/dist/components/linear-progress/linear-progress.d.ts +1 -1
- package/dist/components/linear-progress/linear-progress.js +1 -1
- package/dist/components/linear-progress/linear-progress.stories.d.ts +18 -0
- package/dist/components/linear-progress/linear-progress.stories.d.ts.map +1 -0
- package/dist/components/linear-progress/linear-progress.stories.js +27 -0
- package/dist/components/list/list-item.js +1 -1
- package/dist/components/list/list.js +1 -1
- package/dist/components/list/list.stories.d.ts +15 -0
- package/dist/components/list/list.stories.d.ts.map +1 -0
- package/dist/components/list/list.stories.js +27 -0
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/masonry/masonry.stories.d.ts +7 -0
- package/dist/components/masonry/masonry.stories.d.ts.map +1 -0
- package/dist/components/masonry/masonry.stories.js +24 -0
- package/dist/components/menu/menu-item/menu-item.js +2 -2
- package/dist/components/menu/menu-item/menu-item.stories.d.ts +10 -0
- package/dist/components/menu/menu-item/menu-item.stories.d.ts.map +1 -0
- package/dist/components/menu/menu-item/menu-item.stories.js +33 -0
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/menu/menu.stories.d.ts +41 -0
- package/dist/components/menu/menu.stories.d.ts.map +1 -0
- package/dist/components/menu/menu.stories.js +24 -0
- package/dist/components/modal/content/modal-content.d.ts +4 -0
- package/dist/components/modal/content/modal-content.d.ts.map +1 -1
- package/dist/components/modal/content/modal-content.js +1 -1
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/modal/modal.stories.d.ts +12 -0
- package/dist/components/modal/modal.stories.d.ts.map +1 -0
- package/dist/components/modal/modal.stories.js +23 -0
- package/dist/components/overlay-container/overlay-container.js +1 -1
- package/dist/components/overlay-container/overlay-container.stories.d.ts +6 -0
- package/dist/components/overlay-container/overlay-container.stories.d.ts.map +1 -0
- package/dist/components/overlay-container/overlay-container.stories.js +17 -0
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/pagination/pagination.stories.d.ts +6 -0
- package/dist/components/pagination/pagination.stories.d.ts.map +1 -0
- package/dist/components/pagination/pagination.stories.js +421 -0
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/popover/popover.stories.d.ts +22 -0
- package/dist/components/popover/popover.stories.d.ts.map +1 -0
- package/dist/components/popover/popover.stories.js +45 -0
- package/dist/components/prose/prose.js +1 -1
- package/dist/components/prose/prose.stories.d.ts +7 -0
- package/dist/components/prose/prose.stories.d.ts.map +1 -0
- package/dist/components/prose/prose.stories.js +12 -0
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.stories.d.ts +33 -0
- package/dist/components/select/select.stories.d.ts.map +1 -0
- package/dist/components/select/select.stories.js +47 -0
- package/dist/components/selection-controls/checkbox.js +1 -1
- package/dist/components/selection-controls/checkbox.stories.d.ts +30 -0
- package/dist/components/selection-controls/checkbox.stories.d.ts.map +1 -0
- package/dist/components/selection-controls/checkbox.stories.js +34 -0
- package/dist/components/selection-controls/radio.js +1 -1
- package/dist/components/selection-controls/radio.stories.d.ts +21 -0
- package/dist/components/selection-controls/radio.stories.d.ts.map +1 -0
- package/dist/components/selection-controls/radio.stories.js +30 -0
- package/dist/components/selection-controls/toggle.js +1 -1
- package/dist/components/selection-controls/toggle.stories.d.ts +8 -0
- package/dist/components/selection-controls/toggle.stories.d.ts.map +1 -0
- package/dist/components/selection-controls/toggle.stories.js +22 -0
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/separator/separator.stories.d.ts +6 -0
- package/dist/components/separator/separator.stories.d.ts.map +1 -0
- package/dist/components/separator/separator.stories.js +8 -0
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/skeleton/skeleton.stories.d.ts +9 -0
- package/dist/components/skeleton/skeleton.stories.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.stories.js +38 -0
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/slider.stories.d.ts +39 -0
- package/dist/components/slider/slider.stories.d.ts.map +1 -0
- package/dist/components/slider/slider.stories.js +33 -0
- package/dist/components/snackbar/snackbar.js +1 -1
- package/dist/components/snackbar/snackbar.module.css +1 -1
- package/dist/components/snackbar/snackbar.stories.d.ts +7 -0
- package/dist/components/snackbar/snackbar.stories.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.stories.js +22 -0
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.stories.d.ts +10 -0
- package/dist/components/spinner/spinner.stories.d.ts.map +1 -0
- package/dist/components/spinner/spinner.stories.js +19 -0
- package/dist/components/split-button/split-button.js +1 -1
- package/dist/components/split-button/split-button.stories.d.ts +8 -0
- package/dist/components/split-button/split-button.stories.d.ts.map +1 -0
- package/dist/components/split-button/split-button.stories.js +36 -0
- package/dist/components/stack/stack.js +2 -2
- package/dist/components/stack/stack.stories.d.ts +6 -0
- package/dist/components/stack/stack.stories.d.ts.map +1 -0
- package/dist/components/stack/stack.stories.js +40 -0
- package/dist/components/star-meter/star-meter.js +1 -1
- package/dist/components/star-meter/star-meter.stories.d.ts +7 -0
- package/dist/components/star-meter/star-meter.stories.d.ts.map +1 -0
- package/dist/components/star-meter/star-meter.stories.js +24 -0
- package/dist/components/symbol/symbol.js +1 -1
- package/dist/components/symbol/symbol.stories.d.ts +16 -0
- package/dist/components/symbol/symbol.stories.d.ts.map +1 -0
- package/dist/components/symbol/symbol.stories.js +30 -0
- package/dist/components/tab/tab.js +1 -1
- package/dist/components/tab/tab.stories.d.ts +21 -0
- package/dist/components/tab/tab.stories.d.ts.map +1 -0
- package/dist/components/tab/tab.stories.js +46 -0
- package/dist/components/tab/tabs-panel.d.ts +1 -0
- package/dist/components/tab/tabs-panel.d.ts.map +1 -1
- package/dist/components/tab/tabs-panel.js +1 -1
- package/dist/components/table/table-cell/table-cell.js +1 -1
- package/dist/components/table/table-checkbox/table-checkbox.js +1 -1
- package/dist/components/table/table-expand/table-expand.js +1 -1
- package/dist/components/table/table-header/table-header.js +1 -1
- package/dist/components/table/table-row/table-row.js +1 -1
- package/dist/components/table/table.js +2 -2
- package/dist/components/table/table.stories.d.ts +22 -0
- package/dist/components/table/table.stories.d.ts.map +1 -0
- package/dist/components/table/table.stories.js +1187 -0
- package/dist/components/text/text.js +1 -1
- package/dist/components/text/text.stories.d.ts +7 -0
- package/dist/components/text/text.stories.d.ts.map +1 -0
- package/dist/components/text/text.stories.js +39 -0
- package/dist/components/textfield/base-field/base-field.js +1 -1
- package/dist/components/textfield/textfield.d.ts +1 -1
- package/dist/components/textfield/textfield.js +1 -1
- package/dist/components/textfield/textfield.stories.d.ts +62 -0
- package/dist/components/textfield/textfield.stories.d.ts.map +1 -0
- package/dist/components/textfield/textfield.stories.js +83 -0
- package/dist/components/title/title.d.ts.map +1 -1
- package/dist/components/title/title.js +4 -2
- package/dist/components/title/title.stories.d.ts +7 -0
- package/dist/components/title/title.stories.d.ts.map +1 -0
- package/dist/components/title/title.stories.js +38 -0
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/toggle-button/toggle-button.stories.d.ts +16 -0
- package/dist/components/toggle-button/toggle-button.stories.d.ts.map +1 -0
- package/dist/components/toggle-button/toggle-button.stories.js +29 -0
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/components/tooltip/tooltip.stories.d.ts +7 -0
- package/dist/components/tooltip/tooltip.stories.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.stories.js +22 -0
- package/package.json +11 -7
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Checkbox } from './checkbox';
|
|
4
|
+
declare const story: ComponentMeta<typeof Checkbox>;
|
|
5
|
+
export default story;
|
|
6
|
+
export declare const Default: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
indeterminate?: boolean | undefined;
|
|
9
|
+
dimension?: "small" | "regular" | undefined;
|
|
10
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
12
|
+
export declare const Checked: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
indeterminate?: boolean | undefined;
|
|
15
|
+
dimension?: "small" | "regular" | undefined;
|
|
16
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
18
|
+
export declare const DisabledChecked: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
19
|
+
disabled?: boolean | undefined;
|
|
20
|
+
indeterminate?: boolean | undefined;
|
|
21
|
+
dimension?: "small" | "regular" | undefined;
|
|
22
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
23
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
24
|
+
export declare const Indeterminate: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
|
+
indeterminate?: boolean | undefined;
|
|
27
|
+
dimension?: "small" | "regular" | undefined;
|
|
28
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
29
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
30
|
+
//# sourceMappingURL=checkbox.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,QAAQ,CAezC,CAAC;AAEF,eAAe,KAAK,CAAC;AAMrB,eAAO,MAAM,OAAO;;;;;2CAAoB,CAAC;AAEzC,eAAO,MAAM,OAAO;;;;;2CAAoB,CAAC;AAKzC,eAAO,MAAM,eAAe;;;;;2CAAoB,CAAC;AAMjD,eAAO,MAAM,aAAa;;;;;2CAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from './checkbox';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Inputs/Checkbox',
|
|
5
|
+
component: Checkbox,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onChange: {
|
|
8
|
+
action: 'changed',
|
|
9
|
+
table: {
|
|
10
|
+
disable: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
options: [true, false],
|
|
15
|
+
control: { type: 'inline-radio' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default story;
|
|
20
|
+
const Template = args => (_jsx(Checkbox, { ...args }));
|
|
21
|
+
export const Default = Template.bind({});
|
|
22
|
+
export const Checked = Template.bind({});
|
|
23
|
+
Checked.args = {
|
|
24
|
+
defaultChecked: true,
|
|
25
|
+
};
|
|
26
|
+
export const DisabledChecked = Template.bind({});
|
|
27
|
+
DisabledChecked.args = {
|
|
28
|
+
defaultChecked: true,
|
|
29
|
+
disabled: true,
|
|
30
|
+
};
|
|
31
|
+
export const Indeterminate = Template.bind({});
|
|
32
|
+
Indeterminate.args = {
|
|
33
|
+
indeterminate: true,
|
|
34
|
+
};
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { domAnimation, LazyMotion, m } from 'framer-motion';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import styles from './selection-controls.module.css';
|
|
5
|
+
import * as styles from './selection-controls.module.css';
|
|
6
6
|
export const Radio = forwardRef(({ className, disabled, dimension = 'regular', onChange, hidden, ...otherProps }, forwardedRef) => (_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: clsx(styles.InputWrapper, className), whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, "data-radio-control": hidden, children: _jsx("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: styles.RadioInput, ref: forwardedRef, hidden: hidden, ...otherProps }) }) })));
|
|
7
7
|
Radio.displayName = 'Radio';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Radio } from './radio';
|
|
4
|
+
declare const story: ComponentMeta<typeof Radio>;
|
|
5
|
+
export default story;
|
|
6
|
+
export declare const Default: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
dimension?: "small" | "regular" | undefined;
|
|
9
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
11
|
+
export declare const Checked: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
dimension?: "small" | "regular" | undefined;
|
|
14
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
16
|
+
export declare const DisabledChecked: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
17
|
+
disabled?: boolean | undefined;
|
|
18
|
+
dimension?: "small" | "regular" | undefined;
|
|
19
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
21
|
+
//# sourceMappingURL=radio.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.stories.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/radio.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,KAAK,CAetC,CAAC;AAEF,eAAe,KAAK,CAAC;AAMrB,eAAO,MAAM,OAAO;;;;2CAAoB,CAAC;AAEzC,eAAO,MAAM,OAAO;;;;2CAAoB,CAAC;AAKzC,eAAO,MAAM,eAAe;;;;2CAAoB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Radio } from './radio';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Inputs/Radio',
|
|
5
|
+
component: Radio,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onChange: {
|
|
8
|
+
action: 'changed',
|
|
9
|
+
table: {
|
|
10
|
+
disable: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
options: [true, false],
|
|
15
|
+
control: { type: 'inline-radio' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default story;
|
|
20
|
+
const Template = args => (_jsx(Radio, { ...args }));
|
|
21
|
+
export const Default = Template.bind({});
|
|
22
|
+
export const Checked = Template.bind({});
|
|
23
|
+
Checked.args = {
|
|
24
|
+
defaultChecked: true,
|
|
25
|
+
};
|
|
26
|
+
export const DisabledChecked = Template.bind({});
|
|
27
|
+
DisabledChecked.args = {
|
|
28
|
+
defaultChecked: true,
|
|
29
|
+
disabled: true,
|
|
30
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import styles from './selection-controls.module.css';
|
|
4
|
+
import * as styles from './selection-controls.module.css';
|
|
5
5
|
export const Toggle = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Toggle, className), ref: forwardedRef, ...otherProps })));
|
|
6
6
|
Toggle.displayName = 'Toggle';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Toggle } from './toggle';
|
|
3
|
+
declare const story: ComponentMeta<typeof Toggle>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<typeof Toggle>;
|
|
6
|
+
export declare const Checked: ComponentStory<typeof Toggle>;
|
|
7
|
+
export declare const DisabledChecked: ComponentStory<typeof Toggle>;
|
|
8
|
+
//# sourceMappingURL=toggle.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.stories.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/toggle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,MAAM,CAevC,CAAC;AAEF,eAAe,KAAK,CAAC;AAErB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,MAAM,CAAgC,CAAC;AACnF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,MAAM,CAA+C,CAAC;AAClG,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,MAAM,CAAwD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Toggle } from './toggle';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Inputs/Toggle',
|
|
5
|
+
component: Toggle,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onChange: {
|
|
8
|
+
action: 'changed',
|
|
9
|
+
table: {
|
|
10
|
+
disable: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
options: [true, false],
|
|
15
|
+
control: { type: 'inline-radio' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default story;
|
|
20
|
+
export const Default = args => _jsx(Toggle, { ...args });
|
|
21
|
+
export const Checked = args => _jsx(Toggle, { defaultChecked: true, ...args });
|
|
22
|
+
export const DisabledChecked = args => _jsx(Toggle, { defaultChecked: true, disabled: true, ...args });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import styles from './separator.module.css';
|
|
4
|
+
import * as styles from './separator.module.css';
|
|
5
5
|
export const Separator = forwardRef(({ className, ...otherProps }, forwardedRef) => (_jsx("hr", { ref: forwardedRef, className: clsx(styles.Separator, className), ...otherProps })));
|
|
6
6
|
Separator.displayName = 'Separator';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Separator } from './separator';
|
|
3
|
+
declare const story: ComponentMeta<typeof Separator>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<typeof Separator>;
|
|
6
|
+
//# sourceMappingURL=separator.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.stories.d.ts","sourceRoot":"","sources":["../../../src/components/separator/separator.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CAG1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAErB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,SAAS,CAAuB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
3
3
|
import { Fragment, useCallback } from 'react';
|
|
4
4
|
import { useUIDSeed } from 'react-uid';
|
|
5
|
-
import styles from './skeleton.module.css';
|
|
5
|
+
import * as styles from './skeleton.module.css';
|
|
6
6
|
export const Skeleton = ({ className, borderRadius = 4, style, width, height, count = 1, gap, enableAnimation = true, inline, circle, ...otherProps }) => {
|
|
7
7
|
const uid = useUIDSeed();
|
|
8
8
|
const computedWidth = typeof width === 'number' ? `${width}px` : width;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Skeleton } from './skeleton';
|
|
3
|
+
declare const story: ComponentMeta<typeof Skeleton>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<FCChildrenClass<import("./skeleton").SkeletonProps>>;
|
|
6
|
+
export declare const Circle: ComponentStory<FCChildrenClass<import("./skeleton").SkeletonProps>>;
|
|
7
|
+
export declare const Rounded: ComponentStory<FCChildrenClass<import("./skeleton").SkeletonProps>>;
|
|
8
|
+
export declare const WithGap: ComponentStory<FCChildrenClass<import("./skeleton").SkeletonProps>>;
|
|
9
|
+
//# sourceMappingURL=skeleton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,QAAQ,CASzC,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,qEAAoB,CAAC;AAOzC,eAAO,MAAM,MAAM,qEAAoB,CAAC;AAOxC,eAAO,MAAM,OAAO,qEAAoB,CAAC;AAOzC,eAAO,MAAM,OAAO,qEAAoB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from './skeleton';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Loading/Skeleton',
|
|
5
|
+
component: Skeleton,
|
|
6
|
+
args: {
|
|
7
|
+
borderRadius: 8,
|
|
8
|
+
gap: 8,
|
|
9
|
+
enableAnimation: true,
|
|
10
|
+
inline: false,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default story;
|
|
14
|
+
const Template = args => _jsx(Skeleton, { ...args });
|
|
15
|
+
export const Default = Template.bind({});
|
|
16
|
+
Default.args = {
|
|
17
|
+
width: '400px',
|
|
18
|
+
count: 4,
|
|
19
|
+
height: '48px',
|
|
20
|
+
};
|
|
21
|
+
export const Circle = Template.bind({});
|
|
22
|
+
Circle.args = {
|
|
23
|
+
circle: true,
|
|
24
|
+
width: '80px',
|
|
25
|
+
height: '80px',
|
|
26
|
+
};
|
|
27
|
+
export const Rounded = Template.bind({});
|
|
28
|
+
Rounded.args = {
|
|
29
|
+
width: '400px',
|
|
30
|
+
height: '48px',
|
|
31
|
+
borderRadius: 16,
|
|
32
|
+
};
|
|
33
|
+
export const WithGap = Template.bind({});
|
|
34
|
+
WithGap.args = {
|
|
35
|
+
gap: 32,
|
|
36
|
+
count: 4,
|
|
37
|
+
height: '48px',
|
|
38
|
+
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useCallback, useState, } from 'react';
|
|
4
4
|
import { Stack, Symbol, Text, Textfield, } from '../..';
|
|
5
|
-
import styles from './slider.module.css';
|
|
5
|
+
import * as styles from './slider.module.css';
|
|
6
6
|
export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className, defaultValue = 0, dimension = 'regular', showValues, iconMin, iconMax, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const [value, setValue] = useState(defaultValue);
|
|
8
8
|
const isSmall = dimension === 'small';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Slider } from './slider';
|
|
4
|
+
declare const story: ComponentMeta<typeof Slider>;
|
|
5
|
+
export default story;
|
|
6
|
+
export declare const Default: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
7
|
+
min?: number | undefined;
|
|
8
|
+
max?: number | undefined;
|
|
9
|
+
step?: number | undefined;
|
|
10
|
+
onInput?: ((value: number) => void) | undefined;
|
|
11
|
+
defaultValue?: number | undefined;
|
|
12
|
+
showValues?: boolean | undefined;
|
|
13
|
+
iconMin?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
14
|
+
iconMax?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
15
|
+
dimension?: "small" | "regular" | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
17
|
+
export declare const WithValues: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
18
|
+
min?: number | undefined;
|
|
19
|
+
max?: number | undefined;
|
|
20
|
+
step?: number | undefined;
|
|
21
|
+
onInput?: ((value: number) => void) | undefined;
|
|
22
|
+
defaultValue?: number | undefined;
|
|
23
|
+
showValues?: boolean | undefined;
|
|
24
|
+
iconMin?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
25
|
+
iconMax?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
26
|
+
dimension?: "small" | "regular" | undefined;
|
|
27
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
28
|
+
export declare const WithIcons: ComponentStory<React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
29
|
+
min?: number | undefined;
|
|
30
|
+
max?: number | undefined;
|
|
31
|
+
step?: number | undefined;
|
|
32
|
+
onInput?: ((value: number) => void) | undefined;
|
|
33
|
+
defaultValue?: number | undefined;
|
|
34
|
+
showValues?: boolean | undefined;
|
|
35
|
+
iconMin?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
36
|
+
iconMax?: import("packages/symbols/dist").SymbolNames | React.ReactElement<HTMLOrSVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
37
|
+
dimension?: "small" | "regular" | undefined;
|
|
38
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
|
39
|
+
//# sourceMappingURL=slider.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.stories.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,MAAM,CAkBvC,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO;;;;;;;;;;2CAAoB,CAAC;AACzC,eAAO,MAAM,UAAU;;;;;;;;;;2CAAoB,CAAC;AAI5C,eAAO,MAAM,SAAS;;;;;;;;;;2CAAoB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slider } from './slider';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Inputs/Slider',
|
|
5
|
+
component: Slider,
|
|
6
|
+
args: {
|
|
7
|
+
min: 0,
|
|
8
|
+
max: 100,
|
|
9
|
+
step: 1,
|
|
10
|
+
defaultValue: 0,
|
|
11
|
+
showValues: false,
|
|
12
|
+
dimension: 'regular',
|
|
13
|
+
disabled: false,
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
showValues: {
|
|
17
|
+
options: [true, false],
|
|
18
|
+
control: { type: 'inline-radio' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default story;
|
|
23
|
+
const Template = args => _jsx(Slider, { ...args });
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
export const WithValues = Template.bind({});
|
|
26
|
+
WithValues.args = {
|
|
27
|
+
showValues: true,
|
|
28
|
+
};
|
|
29
|
+
export const WithIcons = Template.bind({});
|
|
30
|
+
WithIcons.args = {
|
|
31
|
+
iconMin: 'moon',
|
|
32
|
+
iconMax: 'sun-bright',
|
|
33
|
+
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Button, Stack, Symbol, Text, Title, } from '../..';
|
|
5
|
-
import styles from './snackbar.module.css';
|
|
5
|
+
import * as styles from './snackbar.module.css';
|
|
6
6
|
export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = 'output', dismissable, dismissLabel = 'Dismiss', onDismiss, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const defaultIcons = {
|
|
8
8
|
info: 'circle-info',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Snackbar{background:var(--global-background);border:1px solid var(--global-vibrancy-background);border-radius:.5rem;display:block;overflow:hidden;padding:.5rem 1rem}.Snackbar p{font-size:1rem}.Snackbar[data-snackbar-kind=neutral]{--heading-foreground:var(--highlight-gray-foreground);--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--heading-foreground:var(--highlight-green-foreground);--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--heading-foreground:var(--highlight-yellow-foreground);--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--heading-foreground:var(--highlight-blue-foreground);--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--heading-foreground:var(--highlight-red-foreground);--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{color:var(--snackbar-fg);flex-grow:0;flex-shrink:0;height:1rem;margin-top:.5rem;max-width:1rem;width:1rem}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}.Action:is(.Action.Action):active{background-color:var(--snackbar-fg);color:var(--snackbar-bg);opacity:.8}
|
|
1
|
+
.Snackbar{background:var(--global-background);border:1px solid var(--global-vibrancy-background);border-radius:.5rem;display:block;overflow:hidden;padding:.5rem 1rem}.Snackbar p{font-size:1rem}.Snackbar[data-snackbar-kind=neutral]{--heading-foreground:var(--highlight-gray-foreground);--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--heading-foreground:var(--highlight-green-foreground);--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--heading-foreground:var(--highlight-yellow-foreground);--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--heading-foreground:var(--highlight-blue-foreground);--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--heading-foreground:var(--highlight-red-foreground);--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{color:var(--snackbar-fg);flex-grow:0;flex-shrink:0;height:1rem;margin-top:.5rem;max-width:1rem;width:1rem}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}.Action:is(.Action.Action):is(:active,:hover){background-color:var(--snackbar-fg);color:var(--snackbar-bg);opacity:.8}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Snackbar } from './snackbar';
|
|
3
|
+
declare const story: ComponentMeta<typeof Snackbar>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Single: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"output", import("./snackbar").SnackbarProps>>;
|
|
6
|
+
export declare const Dismissable: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"output", import("./snackbar").SnackbarProps>>;
|
|
7
|
+
//# sourceMappingURL=snackbar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/snackbar/snackbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,QAAQ,CASzC,CAAC;AAEF,eAAe,KAAK,CAAC;AAUrB,eAAO,MAAM,MAAM,qHAAoB,CAAC;AAIxC,eAAO,MAAM,WAAW,qHAAoB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Snackbar } from './snackbar';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Dialogs/Snackbar',
|
|
5
|
+
component: Snackbar,
|
|
6
|
+
argTypes: {
|
|
7
|
+
kind: {
|
|
8
|
+
options: ['info', 'warning', 'neutral', 'positive', 'danger'],
|
|
9
|
+
control: { type: 'radio' },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default story;
|
|
14
|
+
const Template = args => (_jsx(Snackbar, { ...args, children: "Cras ultricies, elit sit amet cursus consectetur, risus felis ullamcorper nulla, ut scelerisque sapien lorem non sem. Integer vestibulum ornare ligula, a placerat lectus volutpat ultrices. Aliquam commodo malesuada purus a mollis." }));
|
|
15
|
+
export const Single = Template.bind({});
|
|
16
|
+
Single.args = {
|
|
17
|
+
title: 'Sample title',
|
|
18
|
+
};
|
|
19
|
+
export const Dismissable = Template.bind({});
|
|
20
|
+
Dismissable.args = {
|
|
21
|
+
dismissable: true,
|
|
22
|
+
};
|
|
@@ -13,7 +13,7 @@ export declare const Spinner: import("react").ForwardRefExoticComponent<SVGAttri
|
|
|
13
13
|
/**
|
|
14
14
|
* Set the size of the spinner
|
|
15
15
|
*/
|
|
16
|
-
dimension?: "
|
|
16
|
+
dimension?: "small" | "regular" | "big" | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* Override the color of the spinner
|
|
19
19
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Spinner } from './spinner';
|
|
4
|
+
declare const story: ComponentMeta<typeof Spinner>;
|
|
5
|
+
export default story;
|
|
6
|
+
export declare const Default: ComponentStory<React.ForwardRefExoticComponent<React.SVGAttributes<SVGElement> & {
|
|
7
|
+
dimension?: "small" | "regular" | "big" | undefined;
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
} & React.RefAttributes<SVGSVGElement>>>;
|
|
10
|
+
//# sourceMappingURL=spinner.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.stories.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,OAAO,CAaxC,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO;;;wCAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner } from './spinner';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Components/Loading/Spinner',
|
|
5
|
+
component: Spinner,
|
|
6
|
+
args: {
|
|
7
|
+
dimension: 'big',
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
onClick: { action: 'clicked' },
|
|
11
|
+
dimension: {
|
|
12
|
+
options: ['small', 'regular', 'big'],
|
|
13
|
+
control: { type: 'radio' },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export default story;
|
|
18
|
+
const Template = args => _jsx(Spinner, { ...args });
|
|
19
|
+
export const Default = Template.bind({});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Button, Popover, Stack, } from '../..';
|
|
5
|
-
import styles from './split-button.module.css';
|
|
5
|
+
import * as styles from './split-button.module.css';
|
|
6
6
|
export const SplitButton = forwardRef(({ className, label, icon = 'chevron-down', kind, dimension, fullWidth, disabled, busy, children, placement, offset, onClick, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const commonProps = {
|
|
8
8
|
kind,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { SplitButton } from './split-button';
|
|
3
|
+
declare const story: ComponentMeta<typeof SplitButton>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"button", import("type-fest").Except<import("../..").ButtonProps, "iconPosition" | "iconColor" | "pressed"> & Pick<import("../..").PopoverProps, "offset" | "placement"> & {
|
|
6
|
+
label: string;
|
|
7
|
+
}>>;
|
|
8
|
+
//# sourceMappingURL=split-button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,WAAW,CA6B5C,CAAC;AAEF,eAAe,KAAK,CAAC;AAWrB,eAAO,MAAM,OAAO;;GAAoB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Menu } from '../..';
|
|
3
|
+
import { SplitButton } from './split-button';
|
|
4
|
+
const story = {
|
|
5
|
+
title: 'Components/Actions/Split button',
|
|
6
|
+
component: SplitButton,
|
|
7
|
+
args: {
|
|
8
|
+
dimension: 'regular',
|
|
9
|
+
kind: 'primary',
|
|
10
|
+
label: 'Click me',
|
|
11
|
+
fullWidth: false,
|
|
12
|
+
disabled: true,
|
|
13
|
+
busy: false,
|
|
14
|
+
placement: 'auto-start',
|
|
15
|
+
offset: 8,
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
onClick: {
|
|
19
|
+
action: 'clicked',
|
|
20
|
+
table: {
|
|
21
|
+
disable: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
dimension: {
|
|
25
|
+
options: ['small', 'regular', 'big'],
|
|
26
|
+
control: { type: 'radio' },
|
|
27
|
+
},
|
|
28
|
+
kind: {
|
|
29
|
+
options: ['primary', 'secondary', 'flat'],
|
|
30
|
+
control: { type: 'radio' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default story;
|
|
35
|
+
const Template = args => (_jsx(SplitButton, { ...args, children: _jsxs(Menu, { children: [_jsx(Menu.Item, { value: "1", padding: false, children: "Option 1" }), _jsx(Menu.Item, { value: "2", padding: false, children: "Option 2" })] }) }));
|
|
36
|
+
export const Default = Template.bind({});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import styles from './stack.module.css';
|
|
5
|
+
import * as styles from './stack.module.css';
|
|
6
6
|
export const Stack = forwardRef(({ children, className, rowGap, columnGap, as: Wrapper = 'div', inline = false, direction = 'column', wrap = false, fill = true, vAlign = 'initial', hAlign = 'initial', hPadding, vPadding, style, maxWidth, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const alignmentTemplate = (prop) => {
|
|
8
8
|
if (prop.includes('start') || prop.includes('end')) {
|
|
@@ -19,5 +19,5 @@ export const Stack = forwardRef(({ children, className, rowGap, columnGap, as: W
|
|
|
19
19
|
'--h-padding': hPadding ? tkns.space[hPadding] : 0,
|
|
20
20
|
'--max-w': maxWidth,
|
|
21
21
|
};
|
|
22
|
-
return (_jsx(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, "data-stack-has-padding": Boolean(hPadding ?? vPadding), className: clsx(styles.Stack,
|
|
22
|
+
return (_jsx(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, "data-stack-has-padding": Boolean(hPadding ?? vPadding), className: clsx(styles.Stack, className), ...otherProps, children: children }));
|
|
23
23
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Stack } from './stack';
|
|
3
|
+
declare const story: ComponentMeta<typeof Stack>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"div", import("./stack").StackProps>>;
|
|
6
|
+
//# sourceMappingURL=stack.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.stories.d.ts","sourceRoot":"","sources":["../../../src/components/stack/stack.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,KAAK,CA8BtC,CAAC;AAEF,eAAe,KAAK,CAAC;AAgBrB,eAAO,MAAM,OAAO,4GAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from './stack';
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'Layouts/Stack',
|
|
5
|
+
component: Stack,
|
|
6
|
+
argTypes: {
|
|
7
|
+
inline: {
|
|
8
|
+
options: [true, false],
|
|
9
|
+
control: { type: 'inline-radio' },
|
|
10
|
+
},
|
|
11
|
+
wrap: {
|
|
12
|
+
options: [true, false],
|
|
13
|
+
control: { type: 'inline-radio' },
|
|
14
|
+
},
|
|
15
|
+
fill: {
|
|
16
|
+
options: [true, false],
|
|
17
|
+
control: { type: 'inline-radio' },
|
|
18
|
+
},
|
|
19
|
+
direction: {
|
|
20
|
+
options: ['row', 'column'],
|
|
21
|
+
control: { type: 'inline-radio' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
direction: 'row',
|
|
26
|
+
vPadding: 16,
|
|
27
|
+
hPadding: 24,
|
|
28
|
+
columnGap: 16,
|
|
29
|
+
rowGap: 80,
|
|
30
|
+
wrap: true,
|
|
31
|
+
as: 'div',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default story;
|
|
35
|
+
const Template = args => (_jsxs(Stack, { ...args, children: [_jsx("div", { className: "DivEx", children: "01" }), _jsx("div", { className: "DivEx", children: "02" }), _jsx("div", { className: "DivEx", children: "03" }), _jsx("div", { className: "DivEx", children: "04" }), _jsx("div", { className: "DivEx", children: "05" }), _jsx("div", { className: "DivEx", children: "06" }), _jsx("div", { className: "DivEx", children: "07" }), _jsx("div", { className: "DivEx", children: "08" }), _jsx("div", { className: "DivEx", children: "09" })] }));
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
hAlign: 'start',
|
|
39
|
+
vAlign: 'start',
|
|
40
|
+
};
|
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { forwardRef, useCallback, useMemo, } from 'react';
|
|
4
4
|
import { useUIDSeed } from 'react-uid';
|
|
5
5
|
import { Stack, Symbol, Text, } from '../..';
|
|
6
|
-
import styles from './star-meter.module.css';
|
|
6
|
+
import * as styles from './star-meter.module.css';
|
|
7
7
|
export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, label, dimension = 'regular', hideLabel = false, ...otherProps }, forwardedRef) => {
|
|
8
8
|
const seedID = useUIDSeed();
|
|
9
9
|
const properties = useMemo(() => ({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { StarMeter } from './star-meter';
|
|
3
|
+
declare const story: ComponentMeta<typeof StarMeter>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Default: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"div", import("../..").StackProps & import("./star-meter").StarMeterProps>>;
|
|
6
|
+
export declare const CustomLabel: ComponentStory<import("../../types/polymorphic").ForwardRefComponent<"div", import("../..").StackProps & import("./star-meter").StarMeterProps>>;
|
|
7
|
+
//# sourceMappingURL=star-meter.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"star-meter.stories.d.ts","sourceRoot":"","sources":["../../../src/components/star-meter/star-meter.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CAa1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,kJAAoB,CAAC;AAEzC,eAAO,MAAM,WAAW,kJAAoB,CAAC"}
|