@uva-glass/component-library 1.48.1 → 1.50.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/MultiSelect-Ckf3uGw5.js.map +1 -1
- package/dist/assets/CheckboxButton.css +1 -0
- package/dist/assets/CheckboxButtonBar.css +1 -0
- package/dist/assets/CheckboxTree.css +1 -1
- package/dist/assets/Label.css +1 -1
- package/dist/assets/PeriodSelector.css +1 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.stories.js +14 -13
- package/dist/components/Button/Button.stories.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +3 -0
- package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.stories.js +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.stories.js.map +1 -1
- package/dist/components/Card/Card.d.ts +6 -0
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.stories.js +14 -13
- package/dist/components/Card/Card.stories.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +17 -16
- package/dist/components/Checkbox/Checkbox.stories.js.map +1 -1
- package/dist/components/CheckboxButton/CheckboxButton.d.ts +16 -0
- package/dist/components/CheckboxButton/CheckboxButton.js +51 -0
- package/dist/components/CheckboxButton/CheckboxButton.js.map +1 -0
- package/dist/components/CheckboxButton/CheckboxButton.stories.d.ts +5 -0
- package/dist/components/CheckboxButton/CheckboxButton.stories.js +48 -0
- package/dist/components/CheckboxButton/CheckboxButton.stories.js.map +1 -0
- package/dist/components/CheckboxButton/index.d.ts +1 -0
- package/dist/components/CheckboxButton/index.js +5 -0
- package/dist/components/CheckboxButton/index.js.map +1 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.d.ts +22 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +62 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.d.ts +5 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +70 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -0
- package/dist/components/CheckboxButtonBar/index.d.ts +1 -0
- package/dist/components/CheckboxButtonBar/index.js +5 -0
- package/dist/components/CheckboxButtonBar/index.js.map +1 -0
- package/dist/components/CheckboxTree/CheckboxTree.d.ts +5 -3
- package/dist/components/CheckboxTree/CheckboxTree.js +42 -42
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +6 -0
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.stories.js +16 -15
- package/dist/components/Drawer/Drawer.stories.js.map +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.d.ts +3 -0
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.js.map +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js +3 -2
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js.map +1 -1
- package/dist/components/FeedbackBox/FeedbackBox.d.ts +4 -0
- package/dist/components/FeedbackBox/FeedbackBox.js.map +1 -1
- package/dist/components/FeedbackBox/FeedbackBox.stories.js +10 -9
- package/dist/components/FeedbackBox/FeedbackBox.stories.js.map +1 -1
- package/dist/components/FieldHint/FieldHint.d.ts +4 -0
- package/dist/components/FieldHint/FieldHint.js.map +1 -1
- package/dist/components/FieldHint/FieldHint.stories.js +1 -0
- package/dist/components/FieldHint/FieldHint.stories.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +5 -0
- package/dist/components/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.stories.js +20 -19
- package/dist/components/Fieldset/Fieldset.stories.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +3 -0
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/FormField.stories.js +16 -15
- package/dist/components/FormField/FormField.stories.js.map +1 -1
- package/dist/components/GridRow/GridRow.d.ts +4 -0
- package/dist/components/GridRow/GridRow.js +4 -4
- package/dist/components/GridRow/GridRow.js.map +1 -1
- package/dist/components/GridRow/GridRow.stories.js +1 -0
- package/dist/components/GridRow/GridRow.stories.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.d.ts +3 -0
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.stories.js +7 -6
- package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +4 -0
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Icon/Icon.stories.js +1 -0
- package/dist/components/Icon/Icon.stories.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +5 -0
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton/IconButton.stories.js +8 -7
- package/dist/components/IconButton/IconButton.stories.js.map +1 -1
- package/dist/components/InfoMessage/InfoMessage.d.ts +3 -0
- package/dist/components/InfoMessage/InfoMessage.js.map +1 -1
- package/dist/components/InfoMessage/InfoMessage.stories.js +4 -3
- package/dist/components/InfoMessage/InfoMessage.stories.js.map +1 -1
- package/dist/components/Input/Input.d.ts +6 -0
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.stories.js +11 -10
- package/dist/components/Input/Input.stories.js.map +1 -1
- package/dist/components/InputField/InputField.d.ts +6 -0
- package/dist/components/InputField/InputField.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +16 -15
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/Label/Label.d.ts +6 -1
- package/dist/components/Label/Label.js +12 -10
- package/dist/components/Label/Label.js.map +1 -1
- package/dist/components/Label/Label.stories.js +1 -0
- package/dist/components/Label/Label.stories.js.map +1 -1
- package/dist/components/MenuButton/MenuButton.d.ts +4 -0
- package/dist/components/MenuButton/MenuButton.js +1 -1
- package/dist/components/MenuButton/MenuButton.js.map +1 -1
- package/dist/components/MenuButton/MenuButton.stories.js +19 -18
- package/dist/components/MenuButton/MenuButton.stories.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.d.ts +1 -0
- package/dist/components/MenuLink/MenuLink.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.stories.js +5 -4
- package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
- package/dist/components/MetaDataList/MetaDataList.d.ts +2 -0
- package/dist/components/MetaDataList/MetaDataList.js.map +1 -1
- package/dist/components/MetaDataList/MetaDataList.stories.js +5 -4
- package/dist/components/MetaDataList/MetaDataList.stories.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +20 -1
- package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +9 -8
- package/dist/components/ModalDialog/ModalDialog.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +4 -0
- package/dist/components/MultiSelect/MultiSelect.stories.js +23 -22
- package/dist/components/MultiSelect/MultiSelect.stories.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.d.ts +3 -0
- package/dist/components/OverlayCloseButton/OverlayCloseButton.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +11 -10
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.d.ts +16 -0
- package/dist/components/PeriodSelector/PeriodSelector.js +74 -0
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -0
- package/dist/components/PeriodSelector/PeriodSelector.stories.d.ts +5 -0
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +25 -0
- package/dist/components/PeriodSelector/PeriodSelector.stories.js.map +1 -0
- package/dist/components/PeriodSelector/index.d.ts +1 -0
- package/dist/components/PeriodSelector/index.js +5 -0
- package/dist/components/PeriodSelector/index.js.map +1 -0
- package/dist/components/Periods/Periods.d.ts +4 -0
- package/dist/components/Periods/Periods.js.map +1 -1
- package/dist/components/Periods/Periods.stories.js +1 -0
- package/dist/components/Periods/Periods.stories.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.d.ts +4 -0
- package/dist/components/ProgrammeCard/ProgrammeCard.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +19 -18
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +5 -0
- package/dist/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.stories.js +9 -8
- package/dist/components/RadioButton/RadioButton.stories.js.map +1 -1
- package/dist/components/Repeater/Repeater.d.ts +3 -0
- package/dist/components/Repeater/Repeater.js.map +1 -1
- package/dist/components/Repeater/Repeater.stories.js +6 -5
- package/dist/components/Repeater/Repeater.stories.js.map +1 -1
- package/dist/components/SectionNotification/SectionNotification.d.ts +2 -0
- package/dist/components/SectionNotification/SectionNotification.js.map +1 -1
- package/dist/components/SectionNotification/SectionNotification.stories.js +1 -0
- package/dist/components/SectionNotification/SectionNotification.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.d.ts +2 -2
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -0
- package/dist/components/SelectListbox/SelectListBox.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectListbox.d.ts +12 -0
- package/dist/components/SelectListbox/SelectListbox.js +9 -9
- package/dist/components/SelectListbox/SelectListbox.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +3 -1
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner/Spinner.stories.js +4 -3
- package/dist/components/Spinner/Spinner.stories.js.map +1 -1
- package/dist/components/StatusPill/StatusPill.d.ts +4 -0
- package/dist/components/StatusPill/StatusPill.js.map +1 -1
- package/dist/components/StatusPill/StatusPill.stories.js +7 -6
- package/dist/components/StatusPill/StatusPill.stories.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.js +10 -9
- package/dist/components/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +73 -67
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +73 -67
- package/dist/index.js.map +1 -1
- package/package.json +17 -17
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { fn as r } from "../../index-MQ0yPLdl.js";
|
|
3
|
-
import { IconButton as
|
|
3
|
+
import { IconButton as t } from "./IconButton.js";
|
|
4
4
|
import { Icon as i } from "../Icon/Icon.js";
|
|
5
5
|
const l = `<IconButton variant={variant} aria-label={aria-label} onClick={onClickFunction}>
|
|
6
6
|
<Icon name={iconName} size={size} />
|
|
7
7
|
</IconButton>`, b = {
|
|
8
8
|
title: "Atoms/IconButton",
|
|
9
|
-
component:
|
|
9
|
+
component: t,
|
|
10
10
|
argTypes: {
|
|
11
11
|
variant: {
|
|
12
12
|
options: ["destructive"],
|
|
@@ -36,11 +36,12 @@ const l = `<IconButton variant={variant} aria-label={aria-label} onClick={onClic
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
parameters: {
|
|
39
|
+
inspectComponent: t,
|
|
39
40
|
codeString: l
|
|
40
41
|
}
|
|
41
|
-
}, s = (
|
|
42
|
-
const e =
|
|
43
|
-
return /* @__PURE__ */
|
|
42
|
+
}, s = (o) => {
|
|
43
|
+
const e = o.variant ?? [], a = { ...o, variant: e.toString() };
|
|
44
|
+
return /* @__PURE__ */ n(t, { ...a });
|
|
44
45
|
}, c = s.bind({});
|
|
45
46
|
c.args = {
|
|
46
47
|
"aria-label": "Trash",
|
|
@@ -48,7 +49,7 @@ c.args = {
|
|
|
48
49
|
noBorder: !1,
|
|
49
50
|
wide: !1,
|
|
50
51
|
disabled: !1,
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ n(i, { name: "Trash" }),
|
|
52
53
|
onClick: r()
|
|
53
54
|
};
|
|
54
55
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\nconst codeString = `<IconButton variant={variant} aria-label={aria-label} onClick={onClickFunction}>\n <Icon name={iconName} size={size} />\n </IconButton>`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n const iconButtonArgs = { ...args, ...{ variant: variantArray.toString() } } as IconButtonProps;\n\n return <IconButton {...iconButtonArgs} />;\n};\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n 'aria-label': 'Trash',\n variant: 'destructive',\n noBorder: false,\n wide: false,\n disabled: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["codeString","IconButton_stories","IconButton","Template","args","variantArray","iconButtonArgs","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AAQA,MAAMA,IAAa;AAAA;AAAA,kBAKJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAS;AAE7C,QAAAC,IAAgBD,EAAK,WAAmC,IACxDE,IAAiB,EAAE,GAAGF,GAAW,SAASC,EAAa,SAAS;AAE/D,SAAA,gBAAAE,EAACL,GAAY,EAAA,GAAGI,EAAgB,CAAA;AACzC,GAEaE,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
|
|
1
|
+
{"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\nconst codeString = `<IconButton variant={variant} aria-label={aria-label} onClick={onClickFunction}>\n <Icon name={iconName} size={size} />\n </IconButton>`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: IconButton,\n codeString: codeString,\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n const iconButtonArgs = { ...args, ...{ variant: variantArray.toString() } } as IconButtonProps;\n\n return <IconButton {...iconButtonArgs} />;\n};\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n 'aria-label': 'Trash',\n variant: 'destructive',\n noBorder: false,\n wide: false,\n disabled: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["codeString","IconButton_stories","IconButton","Template","args","variantArray","iconButtonArgs","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AAQA,MAAMA,IAAa;AAAA;AAAA,kBAKJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAS;AAE7C,QAAAC,IAAgBD,EAAK,WAAmC,IACxDE,IAAiB,EAAE,GAAGF,GAAW,SAASC,EAAa,SAAS;AAE/D,SAAA,gBAAAE,EAACL,GAAY,EAAA,GAAGI,EAAgB,CAAA;AACzC,GAEaE,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
export interface InfoMessageProps {
|
|
3
|
+
/** The message to show. */
|
|
3
4
|
message: string;
|
|
5
|
+
/** `true` if the info message should be wrapped in a container; otherwise, `false`. */
|
|
4
6
|
hasOwnContainer?: boolean;
|
|
5
7
|
}
|
|
8
|
+
/** Represents a component to show an info message. */
|
|
6
9
|
export declare const InfoMessage: ({ message, hasOwnContainer }: PropsWithChildren<InfoMessageProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoMessage.js","sources":["../../../src/components/InfoMessage/InfoMessage.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { PropsWithChildren } from 'react';\n\nimport styles from './InfoMessage.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport interface InfoMessageProps {\n message: string;\n hasOwnContainer?: boolean;\n}\n\nexport const InfoMessage = ({ message, hasOwnContainer = false }: PropsWithChildren<InfoMessageProps>) => (\n <div\n className={clsx(styles['info-message'], {\n [styles['info-message__container']]: hasOwnContainer,\n })}\n >\n <Icon name=\"InformationCircleFillMini\" className={styles['info-message__icon']} />\n {message}\n </div>\n);\n"],"names":["InfoMessage","message","hasOwnContainer","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"InfoMessage.js","sources":["../../../src/components/InfoMessage/InfoMessage.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { PropsWithChildren } from 'react';\n\nimport styles from './InfoMessage.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport interface InfoMessageProps {\n /** The message to show. */\n message: string;\n /** `true` if the info message should be wrapped in a container; otherwise, `false`. */\n hasOwnContainer?: boolean;\n}\n\n/** Represents a component to show an info message. */\nexport const InfoMessage = ({ message, hasOwnContainer = false }: PropsWithChildren<InfoMessageProps>) => (\n <div\n className={clsx(styles['info-message'], {\n [styles['info-message__container']]: hasOwnContainer,\n })}\n >\n <Icon name=\"InformationCircleFillMini\" className={styles['info-message__icon']} />\n {message}\n </div>\n);\n"],"names":["InfoMessage","message","hasOwnContainer","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;GAgBaA,IAAc,CAAC,EAAE,SAAAC,GAAS,iBAAAC,IAAkB,GACvD,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,cAAc,GAAG;AAAA,MACtC,CAACA,EAAO,yBAAyB,CAAC,GAAGH;AAAA,IAAA,CACtC;AAAA,IAED,UAAA;AAAA,MAAA,gBAAAI,EAACC,KAAK,MAAK,6BAA4B,WAAWF,EAAO,oBAAoB,GAAG;AAAA,MAC/EJ;AAAA,IAAA;AAAA,EAAA;AACH;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { InfoMessage as e } from "./InfoMessage.js";
|
|
3
|
-
const
|
|
3
|
+
const n = "<InfoMessage message={message} />", g = {
|
|
4
4
|
title: "Atoms/InfoMessage",
|
|
5
5
|
component: e,
|
|
6
6
|
argTypes: {
|
|
@@ -12,9 +12,10 @@ const a = "<InfoMessage message={message} />", g = {
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
parameters: {
|
|
15
|
-
|
|
15
|
+
inspectComponent: e,
|
|
16
|
+
codeString: n
|
|
16
17
|
}
|
|
17
|
-
},
|
|
18
|
+
}, a = (s) => /* @__PURE__ */ o(e, { ...s }), t = a.bind({});
|
|
18
19
|
t.args = {
|
|
19
20
|
message: "This is an example info message",
|
|
20
21
|
hasOwnContainer: !1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoMessage.stories.js","sources":["../../../src/components/InfoMessage/InfoMessage.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InfoMessageProps } from './InfoMessage';\n\nimport { InfoMessage } from './InfoMessage';\n\nconst codeString = '<InfoMessage message={message} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InfoMessage',\n component: InfoMessage,\n argTypes: {\n message: {\n control: 'text',\n },\n hasOwnContainer: {\n control: 'boolean',\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<InfoMessageProps>;\n\nconst Template: StoryFn<InfoMessageProps> = (args) => <InfoMessage {...args} />;\n\nexport const InfoMessageExample = Template.bind({});\nInfoMessageExample.args = {\n message: 'This is an example info message',\n hasOwnContainer: false,\n};\n"],"names":["codeString","InfoMessage_stories","InfoMessage","Template","args","jsx","InfoMessageExample"],"mappings":";;AAKA,MAAMA,IAAa,qCAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAa,GAAGE,EAAM,CAAA,GAEhEE,IAAqBH,EAAS,KAAK,EAAE;AAClDG,EAAmB,OAAO;AAAA,EACxB,SAAS;AAAA,EACT,iBAAiB;AACnB;"}
|
|
1
|
+
{"version":3,"file":"InfoMessage.stories.js","sources":["../../../src/components/InfoMessage/InfoMessage.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InfoMessageProps } from './InfoMessage';\n\nimport { InfoMessage } from './InfoMessage';\n\nconst codeString = '<InfoMessage message={message} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InfoMessage',\n component: InfoMessage,\n argTypes: {\n message: {\n control: 'text',\n },\n hasOwnContainer: {\n control: 'boolean',\n },\n },\n parameters: {\n inspectComponent: InfoMessage,\n codeString: codeString,\n },\n} as Meta<InfoMessageProps>;\n\nconst Template: StoryFn<InfoMessageProps> = (args) => <InfoMessage {...args} />;\n\nexport const InfoMessageExample = Template.bind({});\nInfoMessageExample.args = {\n message: 'This is an example info message',\n hasOwnContainer: false,\n};\n"],"names":["codeString","InfoMessage_stories","InfoMessage","Template","args","jsx","InfoMessageExample"],"mappings":";;AAKA,MAAMA,IAAa,qCAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAa,GAAGE,EAAM,CAAA,GAEhEE,IAAqBH,EAAS,KAAK,EAAE;AAClDG,EAAmB,OAAO;AAAA,EACxB,SAAS;AAAA,EACT,iBAAiB;AACnB;"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {
|
|
3
|
+
/** The appearance of the element. Possible values: `error`. */
|
|
3
4
|
appearance?: 'error';
|
|
5
|
+
/** The type of the input element. */
|
|
4
6
|
type?: 'text' | 'search' | 'password' | 'email' | 'file';
|
|
7
|
+
/** `true` if the element should render at full width of its container; otherwise, `false`. The default is `false`. */
|
|
5
8
|
fullWidth?: boolean;
|
|
9
|
+
/** The id of the element. */
|
|
6
10
|
id: string;
|
|
11
|
+
/** `true` if the element is used for numeric values; otherwise, `false`. The default is `false`. */
|
|
7
12
|
isNumeric?: boolean;
|
|
8
13
|
}
|
|
14
|
+
/** Represents a component for an input element. */
|
|
9
15
|
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { InputHTMLAttributes } from 'react';\n\nimport styles from './Input.module.css';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {\n appearance?: 'error';\n type?: 'text' | 'search' | 'password' | 'email' | 'file';\n fullWidth?: boolean;\n id: string;\n isNumeric?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { id, appearance, type = 'text', isNumeric, fullWidth, ...restProps }: InputProps,\n forwardedRef\n) {\n return (\n <input\n {...restProps}\n ref={forwardedRef}\n id={id}\n className={clsx(styles['input'], {\n [styles['input--error']]: appearance === 'error',\n [styles['input--full-with']]: fullWidth,\n [styles['input--numeric']]: isNumeric,\n })}\n type={type}\n />\n );\n});\n"],"names":["Input","forwardRef","id","appearance","type","isNumeric","fullWidth","restProps","forwardedRef","jsx","clsx","styles"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { InputHTMLAttributes } from 'react';\n\nimport styles from './Input.module.css';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {\n /** The appearance of the element. Possible values: `error`. */\n appearance?: 'error';\n /** The type of the input element. */\n type?: 'text' | 'search' | 'password' | 'email' | 'file';\n /** `true` if the element should render at full width of its container; otherwise, `false`. The default is `false`. */\n fullWidth?: boolean;\n /** The id of the element. */\n id: string;\n /** `true` if the element is used for numeric values; otherwise, `false`. The default is `false`. */\n isNumeric?: boolean;\n}\n\n/** Represents a component for an input element. */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { id, appearance, type = 'text', isNumeric, fullWidth, ...restProps }: InputProps,\n forwardedRef\n) {\n return (\n <input\n {...restProps}\n ref={forwardedRef}\n id={id}\n className={clsx(styles['input'], {\n [styles['input--error']]: appearance === 'error',\n [styles['input--full-with']]: fullWidth,\n [styles['input--numeric']]: isNumeric,\n })}\n type={type}\n />\n );\n});\n"],"names":["Input","forwardRef","id","appearance","type","isNumeric","fullWidth","restProps","forwardedRef","jsx","clsx","styles"],"mappings":";;;;;;;;GAqBaA,IAAQC,EAAyC,SAC5D,EAAE,IAAAC,GAAI,YAAAC,GAAY,MAAAC,IAAO,QAAQ,WAAAC,GAAW,WAAAC,GAAW,GAAGC,EAAA,GAC1DC,GACA;AAEE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,KAAKC;AAAA,MACL,IAAAN;AAAA,MACA,WAAWQ,EAAKC,EAAO,OAAU;AAAA,QAC/B,CAACA,EAAO,cAAc,CAAC,GAAGR,MAAe;AAAA,QACzC,CAACQ,EAAO,kBAAkB,CAAC,GAAGL;AAAA,QAC9B,CAACK,EAAO,gBAAgB,CAAC,GAAGN;AAAA,MAAA,CAC7B;AAAA,MACD,MAAAD;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { Input as t } from "./Input.js";
|
|
3
|
-
const
|
|
3
|
+
const r = `
|
|
4
4
|
// Has all HTMLInputElement props available except "className" and "style"
|
|
5
5
|
<Input id={id} type={type} aria-label={aria-label} onChange={onChangeFunction} value={value}/>
|
|
6
6
|
`, u = {
|
|
@@ -21,16 +21,17 @@ const n = `
|
|
|
21
21
|
type: "text"
|
|
22
22
|
},
|
|
23
23
|
parameters: {
|
|
24
|
-
|
|
24
|
+
inspectComponent: t,
|
|
25
|
+
codeString: r
|
|
25
26
|
}
|
|
26
|
-
}, e = (a) => /* @__PURE__ */
|
|
27
|
+
}, e = (a) => /* @__PURE__ */ n(t, { ...a }), p = e.bind({});
|
|
27
28
|
p.args = {};
|
|
28
|
-
const i = e.bind({});
|
|
29
|
-
i.args = {
|
|
30
|
-
fullWidth: !0
|
|
31
|
-
};
|
|
32
29
|
const o = e.bind({});
|
|
33
30
|
o.args = {
|
|
31
|
+
fullWidth: !0
|
|
32
|
+
};
|
|
33
|
+
const i = e.bind({});
|
|
34
|
+
i.args = {
|
|
34
35
|
isNumeric: !0
|
|
35
36
|
};
|
|
36
37
|
const s = e.bind({});
|
|
@@ -38,9 +39,9 @@ s.args = {
|
|
|
38
39
|
appearance: "error"
|
|
39
40
|
};
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
o as FullWidth,
|
|
42
43
|
p as InputExample,
|
|
43
|
-
|
|
44
|
+
i as Numeric,
|
|
44
45
|
s as WithErrorAppearance,
|
|
45
46
|
u as default
|
|
46
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.js","sources":["../../../src/components/Input/Input.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InputProps } from './Input';\n\nimport { Input } from './Input';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<Input id={id} type={type} aria-label={aria-label} onChange={onChangeFunction} value={value}/>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Input',\n component: Input,\n argTypes: {\n appearance: {\n table: {\n disable: true,\n },\n },\n type: {\n control: 'inline-radio',\n },\n },\n args: {\n id: '30daa7c7',\n type: 'text',\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<InputProps>;\n\nconst Template: StoryFn<InputProps> = (args) => {\n return <Input {...args} />;\n};\n\nexport const InputExample = Template.bind({});\nInputExample.args = {};\n\nexport const FullWidth = Template.bind({});\nFullWidth.args = {\n fullWidth: true,\n};\n\nexport const Numeric = Template.bind({});\nNumeric.args = {\n isNumeric: true,\n};\n\nexport const WithErrorAppearance = Template.bind({});\nWithErrorAppearance.args = {\n appearance: 'error',\n};\n"],"names":["codeString","Input_stories","Input","Template","args","jsx","InputExample","FullWidth","Numeric","WithErrorAppearance"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAC9B,gBAAAC,EAACH,GAAO,EAAA,GAAGE,EAAM,CAAA,GAGbE,IAAeH,EAAS,KAAK,EAAE;AAC5CG,EAAa,OAAO,CAAA;AAEb,MAAMC,IAAYJ,EAAS,KAAK,EAAE;AACzCI,EAAU,OAAO;AAAA,EACf,WAAW;AACb;AAEO,MAAMC,IAAUL,EAAS,KAAK,EAAE;AACvCK,EAAQ,OAAO;AAAA,EACb,WAAW;AACb;AAEO,MAAMC,IAAsBN,EAAS,KAAK,EAAE;AACnDM,EAAoB,OAAO;AAAA,EACzB,YAAY;AACd;"}
|
|
1
|
+
{"version":3,"file":"Input.stories.js","sources":["../../../src/components/Input/Input.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InputProps } from './Input';\n\nimport { Input } from './Input';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<Input id={id} type={type} aria-label={aria-label} onChange={onChangeFunction} value={value}/>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Input',\n component: Input,\n argTypes: {\n appearance: {\n table: {\n disable: true,\n },\n },\n type: {\n control: 'inline-radio',\n },\n },\n args: {\n id: '30daa7c7',\n type: 'text',\n },\n parameters: {\n inspectComponent: Input,\n codeString: codeString,\n },\n} as Meta<InputProps>;\n\nconst Template: StoryFn<InputProps> = (args) => {\n return <Input {...args} />;\n};\n\nexport const InputExample = Template.bind({});\nInputExample.args = {};\n\nexport const FullWidth = Template.bind({});\nFullWidth.args = {\n fullWidth: true,\n};\n\nexport const Numeric = Template.bind({});\nNumeric.args = {\n isNumeric: true,\n};\n\nexport const WithErrorAppearance = Template.bind({});\nWithErrorAppearance.args = {\n appearance: 'error',\n};\n"],"names":["codeString","Input_stories","Input","Template","args","jsx","InputExample","FullWidth","Numeric","WithErrorAppearance"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAC9B,gBAAAC,EAACH,GAAO,EAAA,GAAGE,EAAM,CAAA,GAGbE,IAAeH,EAAS,KAAK,EAAE;AAC5CG,EAAa,OAAO,CAAA;AAEb,MAAMC,IAAYJ,EAAS,KAAK,EAAE;AACzCI,EAAU,OAAO;AAAA,EACf,WAAW;AACb;AAEO,MAAMC,IAAUL,EAAS,KAAK,EAAE;AACvCK,EAAQ,OAAO;AAAA,EACb,WAAW;AACb;AAEO,MAAMC,IAAsBN,EAAS,KAAK,EAAE;AACnDM,EAAoB,OAAO;AAAA,EACzB,YAAY;AACd;"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface InputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {
|
|
3
|
+
/** The variant to render. Possible values: `undefined`, `large`. The default is `undefined`. */
|
|
3
4
|
variant?: 'large';
|
|
5
|
+
/** The type of the input element. */
|
|
4
6
|
type?: 'text' | 'password' | 'email';
|
|
7
|
+
/** The id of the input element. */
|
|
5
8
|
id: string;
|
|
9
|
+
/** An element that represents a clear button. */
|
|
6
10
|
clearTrigger?: ReactNode;
|
|
11
|
+
/** The callback that is invoked when the clear button is triggered. */
|
|
7
12
|
onClear?: () => void;
|
|
8
13
|
}
|
|
14
|
+
/** Represents a component that renders an input field which can have a clear button. */
|
|
9
15
|
export declare const InputField: import('react').ForwardRefExoticComponent<InputFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.js","sources":["../../../src/components/InputField/InputField.tsx"],"sourcesContent":["import { forwardRef,
|
|
1
|
+
{"version":3,"file":"InputField.js","sources":["../../../src/components/InputField/InputField.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { InputHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './InputField.module.css';\n\nexport interface InputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {\n /** The variant to render. Possible values: `undefined`, `large`. The default is `undefined`. */\n variant?: 'large';\n /** The type of the input element. */\n type?: 'text' | 'password' | 'email';\n /** The id of the input element. */\n id: string;\n /** An element that represents a clear button. */\n clearTrigger?: ReactNode;\n /** The callback that is invoked when the clear button is triggered. */\n onClear?: () => void;\n}\n\n/** Represents a component that renders an input field which can have a clear button. */\nexport const InputField = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n { autoComplete = 'off', id, value, variant, type = 'text', clearTrigger, onClear, ...restProps }: InputFieldProps,\n forwardedRef\n ) => {\n const [clearButtonWidth, setClearButtonWidth] = useState<number>(0);\n const clearButtonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (clearButtonRef.current) {\n setClearButtonWidth(clearButtonRef.current.offsetWidth);\n }\n }, [value]);\n\n const handleClearTriggerClick = () => {\n if (onClear && forwardedRef && 'current' in forwardedRef && forwardedRef.current) {\n onClear();\n forwardedRef.current.focus();\n }\n };\n\n return (\n <div className={styles['input-field-wrapper']}>\n <input\n {...restProps}\n autoComplete={autoComplete}\n ref={forwardedRef}\n id={id}\n className={clsx(styles['input-field'], {\n [styles['input-field--large']]: variant === 'large',\n })}\n type={type}\n value={value}\n style={{ paddingRight: value && clearTrigger ? clearButtonWidth : undefined }}\n />\n {value && clearTrigger && (\n <button\n type=\"button\"\n className={styles['input-field__clear-button']}\n onClick={handleClearTriggerClick}\n ref={clearButtonRef}\n aria-label={`clear trigger for ${id}`}\n >\n {clearTrigger}\n </button>\n )}\n </div>\n );\n }\n);\n"],"names":["InputField","forwardRef","autoComplete","id","value","variant","type","clearTrigger","onClear","restProps","forwardedRef","clearButtonWidth","setClearButtonWidth","useState","clearButtonRef","useRef","useEffect","handleClearTriggerClick","jsxs","styles","jsx","clsx"],"mappings":";;;;;;;;GAqBaA,IAAaC;AAAA,EACxB,CACE,EAAE,cAAAC,IAAe,OAAO,IAAAC,GAAI,OAAAC,GAAO,SAAAC,GAAS,MAAAC,IAAO,QAAQ,cAAAC,GAAc,SAAAC,GAAS,GAAGC,EAAA,GACrFC,MACG;AACH,UAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAiB,CAAC,GAC5DC,IAAiBC,EAA0B,IAAI;AAErD,IAAAC,EAAU,MAAM;AACd,MAAIF,EAAe,WACGF,EAAAE,EAAe,QAAQ,WAAW;AAAA,IACxD,GACC,CAACV,CAAK,CAAC;AAEV,UAAMa,IAA0B,MAAM;AACpC,MAAIT,KAAWE,KAAgB,aAAaA,KAAgBA,EAAa,YAC/DF,KACRE,EAAa,QAAQ;IACvB;AAGF,WACG,gBAAAQ,EAAA,OAAA,EAAI,WAAWC,EAAO,qBAAqB,GAC1C,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAGX;AAAA,UACJ,cAAAP;AAAA,UACA,KAAKQ;AAAA,UACL,IAAAP;AAAA,UACA,WAAWkB,EAAKF,EAAO,aAAa,GAAG;AAAA,YACrC,CAACA,EAAO,oBAAoB,CAAC,GAAGd,MAAY;AAAA,UAAA,CAC7C;AAAA,UACD,MAAAC;AAAA,UACA,OAAAF;AAAA,UACA,OAAO,EAAE,cAAcA,KAASG,IAAeI,IAAmB,OAAU;AAAA,QAAA;AAAA,MAC9E;AAAA,MACCP,KAASG,KACR,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAWD,EAAO,2BAA2B;AAAA,UAC7C,SAASF;AAAA,UACT,KAAKH;AAAA,UACL,cAAY,qBAAqBX,CAAE;AAAA,UAElC,UAAAI;AAAA,QAAA;AAAA,MACH;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useRef as g } from "react";
|
|
3
|
-
import { fn as
|
|
4
|
-
import { InputField as
|
|
3
|
+
import { fn as l } from "../../index-MQ0yPLdl.js";
|
|
4
|
+
import { InputField as a } from "./InputField.js";
|
|
5
5
|
import { Container as u } from "../../storyComponents/Container/Container.js";
|
|
6
6
|
import { Icon as f } from "../Icon/Icon.js";
|
|
7
7
|
import "@react-aria/button";
|
|
@@ -26,7 +26,7 @@ const C = `
|
|
|
26
26
|
return { ...t, variant: e.toString() };
|
|
27
27
|
}, z = {
|
|
28
28
|
title: "Atoms/InputField",
|
|
29
|
-
component:
|
|
29
|
+
component: a,
|
|
30
30
|
argTypes: {
|
|
31
31
|
variant: {
|
|
32
32
|
options: ["large"],
|
|
@@ -46,16 +46,17 @@ const C = `
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
parameters: {
|
|
49
|
+
inspectComponent: a,
|
|
49
50
|
codeString: C
|
|
50
51
|
}
|
|
51
|
-
},
|
|
52
|
-
const [e,
|
|
53
|
-
|
|
52
|
+
}, o = (t) => {
|
|
53
|
+
const [e, i] = d(""), p = g(null), s = (c) => {
|
|
54
|
+
i(c.target.value), l()("handleChange");
|
|
54
55
|
}, m = () => {
|
|
55
|
-
|
|
56
|
+
i(""), l()("handleClear");
|
|
56
57
|
};
|
|
57
58
|
return /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
|
|
58
|
-
|
|
59
|
+
a,
|
|
59
60
|
{
|
|
60
61
|
...h(t),
|
|
61
62
|
value: e,
|
|
@@ -64,22 +65,22 @@ const C = `
|
|
|
64
65
|
ref: p
|
|
65
66
|
}
|
|
66
67
|
) });
|
|
67
|
-
},
|
|
68
|
+
}, n = {
|
|
68
69
|
type: "text",
|
|
69
70
|
variant: void 0,
|
|
70
71
|
id: "4f9ca77d"
|
|
71
|
-
}, v =
|
|
72
|
+
}, v = o.bind({});
|
|
72
73
|
v.args = {
|
|
73
|
-
...
|
|
74
|
+
...n
|
|
74
75
|
};
|
|
75
|
-
const b =
|
|
76
|
+
const b = o.bind({});
|
|
76
77
|
b.args = {
|
|
77
|
-
...
|
|
78
|
+
...n,
|
|
78
79
|
clearTrigger: "Clear"
|
|
79
80
|
};
|
|
80
|
-
const y =
|
|
81
|
+
const y = o.bind({});
|
|
81
82
|
y.args = {
|
|
82
|
-
...
|
|
83
|
+
...n,
|
|
83
84
|
clearTrigger: /* @__PURE__ */ r(f, { name: "Cross" })
|
|
84
85
|
};
|
|
85
86
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from '@storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA,GAMbC,IAAgB,CAACC,MAA0B;AAEzC,QAAAC,IAAgBD,EAAK,WAAmC;AACvD,SAAA,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAS;AACxD,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,OAAO;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAL;AAAA,EACF;AACF,GAEMM,IAAqC,CAACJ,MAAS;AACnD,QAAM,CAACK,GAAYC,CAAa,IAAIC,EAAmC,EAAE,GACnEC,IAAWC,EAAyB,IAAI,GAExCC,IAAe,CAACC,MAAyC;AAC/C,IAAAL,EAAAK,EAAM,OAAO,KAAK,GAChCC,EAAA,EAAK,cAAc;AAAA,EAAA,GAGfC,IAAc,MAAM;AACxB,IAAAP,EAAc,EAAE,GAChBM,EAAA,EAAK,aAAa;AAAA,EAAA;AAGpB,2BACGE,GACC,EAAA,UAAA,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAcC,CAAI;AAAA,MACtB,OAAOK;AAAA,MACP,UAAUK;AAAA,MACV,SAASG;AAAA,MACT,KAAKL;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAEJ,GAEMQ,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN,GAEaC,IAAoBb,EAAS,KAAK,EAAE;AACjDa,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAyBd,EAAS,KAAK,EAAE;AACtDc,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,cAAc;AAChB;AAEO,MAAMG,IAAuBf,EAAS,KAAK,EAAE;AACpDe,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,cAAc,gBAAAD,EAACK,GAAK,EAAA,MAAK,QAAQ,CAAA;AACnC;"}
|
|
1
|
+
{"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from '@storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: InputField,\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA,GAMbC,IAAgB,CAACC,MAA0B;AAEzC,QAAAC,IAAgBD,EAAK,WAAmC;AACvD,SAAA,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAS;AACxD,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,OAAO;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAL;AAAA,EACF;AACF,GAEMM,IAAqC,CAACJ,MAAS;AACnD,QAAM,CAACK,GAAYC,CAAa,IAAIC,EAAmC,EAAE,GACnEC,IAAWC,EAAyB,IAAI,GAExCC,IAAe,CAACC,MAAyC;AAC/C,IAAAL,EAAAK,EAAM,OAAO,KAAK,GAChCC,EAAA,EAAK,cAAc;AAAA,EAAA,GAGfC,IAAc,MAAM;AACxB,IAAAP,EAAc,EAAE,GAChBM,EAAA,EAAK,aAAa;AAAA,EAAA;AAGpB,2BACGE,GACC,EAAA,UAAA,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAcC,CAAI;AAAA,MACtB,OAAOK;AAAA,MACP,UAAUK;AAAA,MACV,SAASG;AAAA,MACT,KAAKL;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAEJ,GAEMQ,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN,GAEaC,IAAoBb,EAAS,KAAK,EAAE;AACjDa,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAyBd,EAAS,KAAK,EAAE;AACtDc,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,cAAc;AAChB;AAEO,MAAMG,IAAuBf,EAAS,KAAK,EAAE;AACpDe,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,cAAc,gBAAAD,EAACK,GAAK,EAAA,MAAK,QAAQ,CAAA;AACnC;"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { LabelHTMLAttributes } from 'react';
|
|
2
2
|
export interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {
|
|
3
|
+
/** The id of the element for which the label is intended. */
|
|
3
4
|
htmlFor: string;
|
|
5
|
+
/** `true` if the font-weight needs to be unset; otherwise, `false`. The default is `false`. */
|
|
4
6
|
noFontWeight?: boolean;
|
|
7
|
+
/** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */
|
|
8
|
+
required?: boolean;
|
|
5
9
|
}
|
|
6
|
-
|
|
10
|
+
/** Represents a component that renders a label for an input element. */
|
|
11
|
+
export declare const Label: ({ children, htmlFor, noFontWeight, required, ...restProps }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/Label.css';const n = "
|
|
2
|
+
import { c as r } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import '../../assets/Label.css';const n = "_label_ok9qo_1", e = {
|
|
4
4
|
label: n,
|
|
5
|
-
"label--
|
|
6
|
-
|
|
5
|
+
"label--required": "_label--required_ok9qo_6",
|
|
6
|
+
"label--unset-font-weight": "_label--unset-font-weight_ok9qo_14"
|
|
7
|
+
}, c = ({ children: l, htmlFor: o, noFontWeight: a, required: t = !1, ...s }) => /* @__PURE__ */ b(
|
|
7
8
|
"label",
|
|
8
9
|
{
|
|
9
|
-
...
|
|
10
|
-
htmlFor:
|
|
11
|
-
className:
|
|
12
|
-
[
|
|
10
|
+
...s,
|
|
11
|
+
htmlFor: o,
|
|
12
|
+
className: r(e.label, {
|
|
13
|
+
[e["label--unset-font-weight"]]: a,
|
|
14
|
+
[e["label--required"]]: t
|
|
13
15
|
}),
|
|
14
|
-
children:
|
|
16
|
+
children: l
|
|
15
17
|
}
|
|
16
18
|
);
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
c as Label
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { LabelHTMLAttributes } from 'react';\n\nimport styles from './Label.module.css';\n\nexport interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {\n htmlFor: string;\n noFontWeight?: boolean;\n}\n\nexport const Label = ({ children, htmlFor, noFontWeight, ...restProps }: LabelProps) => (\n <label\n {...restProps}\n htmlFor={htmlFor}\n className={clsx(styles['label'], {\n [styles['label--unset-font-weight']]: noFontWeight,\n })}\n >\n {children}\n </label>\n);\n"],"names":["Label","children","htmlFor","noFontWeight","restProps","jsx","clsx","styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { LabelHTMLAttributes } from 'react';\n\nimport styles from './Label.module.css';\n\nexport interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {\n /** The id of the element for which the label is intended. */\n htmlFor: string;\n /** `true` if the font-weight needs to be unset; otherwise, `false`. The default is `false`. */\n noFontWeight?: boolean;\n /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */\n required?: boolean;\n}\n\n/** Represents a component that renders a label for an input element. */\nexport const Label = ({ children, htmlFor, noFontWeight, required = false, ...restProps }: LabelProps) => (\n <label\n {...restProps}\n htmlFor={htmlFor}\n className={clsx(styles['label'], {\n [styles['label--unset-font-weight']]: noFontWeight,\n [styles['label--required']]: required,\n })}\n >\n {children}\n </label>\n);\n"],"names":["Label","children","htmlFor","noFontWeight","required","restProps","jsx","clsx","styles"],"mappings":";;;;;;GAgBaA,IAAQ,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,GAAc,UAAAC,IAAW,IAAO,GAAGC,EAAA,MAC5E,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,SAAAH;AAAA,IACA,WAAWK,EAAKC,EAAO,OAAU;AAAA,MAC/B,CAACA,EAAO,0BAA0B,CAAC,GAAGL;AAAA,MACtC,CAACK,EAAO,iBAAiB,CAAC,GAAGJ;AAAA,IAAA,CAC9B;AAAA,IAEA,UAAAH;AAAA,EAAA;AACH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.stories.js","sources":["../../../src/components/Label/Label.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { LabelProps } from './Label';\n\nimport { Label } from './Label';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <Label htmlFor={htmlFor}>{children}</Label>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Label',\n component: Label,\n argTypes: {\n htmlFor: {\n control: 'text',\n },\n children: {\n control: 'text',\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<LabelProps>;\n\nconst Template: StoryFn<LabelProps> = (args) => <Label {...args} />;\n\nconst defaultArgs: Partial<LabelProps> = {\n children: 'Lorem Ipsum',\n htmlFor: 'bd79f7ec',\n};\n\nexport const LabelExample = Template.bind({});\nLabelExample.args = {\n ...defaultArgs,\n};\n\nexport const WithNoFontWeight = Template.bind({});\nWithNoFontWeight.args = {\n ...defaultArgs,\n noFontWeight: true,\n};\n"],"names":["codeString","Label_stories","Label","Template","args","jsx","defaultArgs","LabelExample","WithNoFontWeight"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAO,GAAGE,EAAM,CAAA,GAE3DE,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AACX,GAEaC,IAAeJ,EAAS,KAAK,EAAE;AAC5CI,EAAa,OAAO;AAAA,EAClB,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,GAAGF;AAAA,EACH,cAAc;AAChB;"}
|
|
1
|
+
{"version":3,"file":"Label.stories.js","sources":["../../../src/components/Label/Label.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { LabelProps } from './Label';\n\nimport { Label } from './Label';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <Label htmlFor={htmlFor}>{children}</Label>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Label',\n component: Label,\n argTypes: {\n htmlFor: {\n control: 'text',\n },\n children: {\n control: 'text',\n },\n },\n parameters: {\n inspectComponent: Label,\n codeString: codeString,\n },\n} as Meta<LabelProps>;\n\nconst Template: StoryFn<LabelProps> = (args) => <Label {...args} />;\n\nconst defaultArgs: Partial<LabelProps> = {\n children: 'Lorem Ipsum',\n htmlFor: 'bd79f7ec',\n};\n\nexport const LabelExample = Template.bind({});\nLabelExample.args = {\n ...defaultArgs,\n};\n\nexport const WithNoFontWeight = Template.bind({});\nWithNoFontWeight.args = {\n ...defaultArgs,\n noFontWeight: true,\n};\n"],"names":["codeString","Label_stories","Label","Template","args","jsx","defaultArgs","LabelExample","WithNoFontWeight"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAO,GAAGE,EAAM,CAAA,GAE3DE,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AACX,GAEaC,IAAeJ,EAAS,KAAK,EAAE;AAC5CI,EAAa,OAAO;AAAA,EAClB,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,GAAGF;AAAA,EACH,cAAc;AAChB;"}
|
|
@@ -4,8 +4,12 @@ import { MouseEvent, RefObject } from 'react';
|
|
|
4
4
|
import { UIButtonVariant } from 'types/UserInterface';
|
|
5
5
|
export interface MenuButtonProps extends AriaButtonProps<'button'> {
|
|
6
6
|
buttonRef: RefObject<HTMLButtonElement>;
|
|
7
|
+
/** The variant of the button. */
|
|
7
8
|
variant: UIButtonVariant;
|
|
9
|
+
/** The icon to show. */
|
|
8
10
|
iconName?: IconProps['name'];
|
|
11
|
+
/** The callback function that is invoked when the button is clicked. */
|
|
9
12
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
10
13
|
}
|
|
14
|
+
/** Represents a button that is used to open a menu. */
|
|
11
15
|
export declare function MenuButton({ buttonRef, variant, iconName, children, ...restProps }: MenuButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as e, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { useButton as c } from "@react-aria/button";
|
|
3
3
|
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { s as r } from "../../Button.module-Gr3KvBvb.js";
|
|
5
4
|
import { Icon as i } from "../Icon/Icon.js";
|
|
5
|
+
import { s as r } from "../../Button.module-Gr3KvBvb.js";
|
|
6
6
|
function B({ buttonRef: t, variant: s, iconName: o, children: n, ...m }) {
|
|
7
7
|
const { buttonProps: u } = c(m, t);
|
|
8
8
|
return /* @__PURE__ */ e("button", { ...u, ref: t, className: f(r.button, r[`button--${s}`]), children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import { useButton } from '@react-aria/button';\nimport { clsx } from 'clsx';\n\nimport type { AriaButtonProps } from '@react-aria/button';\nimport type { IconProps } from 'components/Icon';\nimport type { MouseEvent, RefObject } from 'react';\nimport type { UIButtonVariant } from 'types/UserInterface';\n\nimport
|
|
1
|
+
{"version":3,"file":"MenuButton.js","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import { useButton } from '@react-aria/button';\nimport { clsx } from 'clsx';\n\nimport type { AriaButtonProps } from '@react-aria/button';\nimport type { IconProps } from 'components/Icon';\nimport type { MouseEvent, RefObject } from 'react';\nimport type { UIButtonVariant } from 'types/UserInterface';\n\nimport { Icon } from 'components/Icon';\nimport styles from 'components/Button/Button.module.css';\n\nexport interface MenuButtonProps extends AriaButtonProps<'button'> {\n buttonRef: RefObject<HTMLButtonElement>;\n /** The variant of the button. */\n variant: UIButtonVariant;\n /** The icon to show. */\n iconName?: IconProps['name'];\n /** The callback function that is invoked when the button is clicked. */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** Represents a button that is used to open a menu. */\nexport function MenuButton({ buttonRef, variant, iconName, children, ...restProps }: MenuButtonProps) {\n const { buttonProps } = useButton(restProps, buttonRef);\n\n return (\n <button {...buttonProps} ref={buttonRef} className={clsx(styles['button'], styles[`button--${variant}`])}>\n {children}\n {iconName && <Icon name={iconName} />}\n </button>\n );\n}\n"],"names":["MenuButton","buttonRef","variant","iconName","children","restProps","buttonProps","useButton","clsx","styles","jsx","Icon"],"mappings":";;;;;AAsBgB,SAAAA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,UAAAC,GAAU,GAAGC,KAA8B;AACpG,QAAM,EAAE,aAAAC,EAAgB,IAAAC,EAAUF,GAAWJ,CAAS;AAEtD,2BACG,UAAQ,EAAA,GAAGK,GAAa,KAAKL,GAAW,WAAWO,EAAKC,EAAO,QAAWA,EAAO,WAAWP,CAAO,EAAE,CAAC,GACpG,UAAA;AAAA,IAAAE;AAAA,IACAD,KAAY,gBAAAO,EAACC,GAAK,EAAA,MAAMR,EAAU,CAAA;AAAA,EACrC,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, Fragment as l, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { fn as c } from "../../index-MQ0yPLdl.js";
|
|
3
|
-
import { MenuButton as
|
|
3
|
+
import { MenuButton as e } from "./MenuButton.js";
|
|
4
4
|
const d = `
|
|
5
5
|
// Has all LabelHTMLAttributes props available except "className" and "style"
|
|
6
6
|
<MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>
|
|
7
7
|
`, b = {
|
|
8
8
|
title: "Atoms/MenuButton",
|
|
9
|
-
component:
|
|
9
|
+
component: e,
|
|
10
10
|
argTypes: {
|
|
11
11
|
variant: {
|
|
12
12
|
options: ["primary", "secondary", "destructive-primary", "destructive-secondary", "blank", "blank-icon"],
|
|
@@ -14,23 +14,24 @@ const d = `
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
parameters: {
|
|
17
|
+
inspectComponent: e,
|
|
17
18
|
codeString: d
|
|
18
19
|
}
|
|
19
|
-
}, r = (
|
|
20
|
+
}, r = (a) => /* @__PURE__ */ n(e, { ...a }), o = {
|
|
20
21
|
variant: "primary",
|
|
21
22
|
onClick: c()
|
|
22
23
|
}, p = r.bind({});
|
|
23
24
|
p.args = {
|
|
24
25
|
children: "Click me!",
|
|
25
|
-
...
|
|
26
|
+
...o
|
|
26
27
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
...
|
|
28
|
+
const t = r.bind({});
|
|
29
|
+
t.args = {
|
|
30
|
+
...o,
|
|
30
31
|
iconName: "EllipsisVertical"
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
-
...
|
|
33
|
+
t.argTypes = {
|
|
34
|
+
...t.argTypes,
|
|
34
35
|
children: {
|
|
35
36
|
table: {
|
|
36
37
|
disable: !0
|
|
@@ -38,16 +39,16 @@ e.argTypes = {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
...
|
|
44
|
-
children: /* @__PURE__ */ l
|
|
42
|
+
const i = r.bind({});
|
|
43
|
+
i.args = {
|
|
44
|
+
...o,
|
|
45
|
+
children: /* @__PURE__ */ s(l, { children: [
|
|
45
46
|
/* @__PURE__ */ n("div", { children: "Child 1" }),
|
|
46
47
|
/* @__PURE__ */ n("div", { children: "Child 2" })
|
|
47
48
|
] })
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
-
...
|
|
50
|
+
i.argTypes = {
|
|
51
|
+
...i.argTypes,
|
|
51
52
|
children: {
|
|
52
53
|
table: {
|
|
53
54
|
disable: !0
|
|
@@ -57,8 +58,8 @@ t.argTypes = {
|
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
60
|
p as MenuButtonExample,
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
t as WithIconChildren,
|
|
62
|
+
i as WithMultipleChildren,
|
|
62
63
|
b as default
|
|
63
64
|
};
|
|
64
65
|
//# sourceMappingURL=MenuButton.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.stories.js","sources":["../../../src/components/MenuButton/MenuButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { MenuButtonProps } from './MenuButton';\n\nimport { MenuButton } from './MenuButton';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuButton',\n component: MenuButton,\n argTypes: {\n variant: {\n options: ['primary', 'secondary', 'destructive-primary', 'destructive-secondary', 'blank', 'blank-icon'],\n control: { type: 'radio' },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<MenuButtonProps>;\n\nconst Template: StoryFn<MenuButtonProps> = (args) => <MenuButton {...args} />;\n\nconst defaultArgs: Partial<MenuButtonProps> = {\n variant: 'primary',\n onClick: fn(),\n};\n\nexport const MenuButtonExample = Template.bind({});\nMenuButtonExample.args = {\n children: 'Click me!',\n ...defaultArgs,\n};\n\nexport const WithIconChildren = Template.bind({});\nWithIconChildren.args = {\n ...defaultArgs,\n iconName: 'EllipsisVertical',\n};\n\nWithIconChildren.argTypes = {\n ...WithIconChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n\nexport const WithMultipleChildren = Template.bind({});\nWithMultipleChildren.args = {\n ...defaultArgs,\n children: (\n <>\n <div>Child 1</div>\n <div>Child 2</div>\n </>\n ),\n};\n\nWithMultipleChildren.argTypes = {\n ...WithMultipleChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n"],"names":["codeString","MenuButton_stories","MenuButton","Template","args","jsx","defaultArgs","fn","MenuButtonExample","WithIconChildren","WithMultipleChildren","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,WAAW,aAAa,uBAAuB,yBAAyB,SAAS,YAAY;AAAA,MACvG,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAErEE,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,SAASC,EAAG;AACd,GAEaC,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,UAAU;AAAA,EACV,GAAGF;AACL;AAEO,MAAMG,IAAmBN,EAAS,KAAK,EAAE;AAChDM,EAAiB,OAAO;AAAA,EACtB,GAAGH;AAAA,EACH,UAAU;AACZ;AAEAG,EAAiB,WAAW;AAAA,EAC1B,GAAGA,EAAiB;AAAA,EACpB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;AAEO,MAAMC,IAAuBP,EAAS,KAAK,EAAE;AACpDO,EAAqB,OAAO;AAAA,EAC1B,GAAGJ;AAAA,EACH,UAEI,gBAAAK,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAP,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,IACZ,gBAAAA,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,EAAA,GACd;AAEJ;AAEAK,EAAqB,WAAW;AAAA,EAC9B,GAAGA,EAAqB;AAAA,EACxB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;"}
|
|
1
|
+
{"version":3,"file":"MenuButton.stories.js","sources":["../../../src/components/MenuButton/MenuButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { MenuButtonProps } from './MenuButton';\n\nimport { MenuButton } from './MenuButton';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuButton',\n component: MenuButton,\n argTypes: {\n variant: {\n options: ['primary', 'secondary', 'destructive-primary', 'destructive-secondary', 'blank', 'blank-icon'],\n control: { type: 'radio' },\n },\n },\n parameters: {\n inspectComponent: MenuButton,\n codeString: codeString,\n },\n} as Meta<MenuButtonProps>;\n\nconst Template: StoryFn<MenuButtonProps> = (args) => <MenuButton {...args} />;\n\nconst defaultArgs: Partial<MenuButtonProps> = {\n variant: 'primary',\n onClick: fn(),\n};\n\nexport const MenuButtonExample = Template.bind({});\nMenuButtonExample.args = {\n children: 'Click me!',\n ...defaultArgs,\n};\n\nexport const WithIconChildren = Template.bind({});\nWithIconChildren.args = {\n ...defaultArgs,\n iconName: 'EllipsisVertical',\n};\n\nWithIconChildren.argTypes = {\n ...WithIconChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n\nexport const WithMultipleChildren = Template.bind({});\nWithMultipleChildren.args = {\n ...defaultArgs,\n children: (\n <>\n <div>Child 1</div>\n <div>Child 2</div>\n </>\n ),\n};\n\nWithMultipleChildren.argTypes = {\n ...WithMultipleChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n"],"names":["codeString","MenuButton_stories","MenuButton","Template","args","jsx","defaultArgs","fn","MenuButtonExample","WithIconChildren","WithMultipleChildren","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,WAAW,aAAa,uBAAuB,yBAAyB,SAAS,YAAY;AAAA,MACvG,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAErEE,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,SAASC,EAAG;AACd,GAEaC,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,UAAU;AAAA,EACV,GAAGF;AACL;AAEO,MAAMG,IAAmBN,EAAS,KAAK,EAAE;AAChDM,EAAiB,OAAO;AAAA,EACtB,GAAGH;AAAA,EACH,UAAU;AACZ;AAEAG,EAAiB,WAAW;AAAA,EAC1B,GAAGA,EAAiB;AAAA,EACpB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;AAEO,MAAMC,IAAuBP,EAAS,KAAK,EAAE;AACpDO,EAAqB,OAAO;AAAA,EAC1B,GAAGJ;AAAA,EACH,UAEI,gBAAAK,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAP,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,IACZ,gBAAAA,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,EAAA,GACd;AAEJ;AAEAK,EAAqB,WAAW;AAAA,EAC9B,GAAGA,EAAqB;AAAA,EACxB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { NavLinkProps } from 'react-router-dom';
|
|
2
|
+
/** Represents a component for a [NavLink](https://reactrouter.com/en/main/components/nav-link) with styling. */
|
|
2
3
|
export declare const MenuLink: (props: Omit<NavLinkProps, "style">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuLink.js","sources":["../../../src/components/MenuLink/MenuLink.tsx"],"sourcesContent":["import classNames from 'clsx';\nimport { NavLink } from 'react-router-dom';\n\nimport type { NavLinkProps } from 'react-router-dom';\n\nimport styles from './MenuLink.module.css';\n\n// Omit style so it cannot be accidentally used\nexport const MenuLink = (props: Omit<NavLinkProps, 'style'>) => (\n <NavLink\n {...props}\n className={({ isActive }) => classNames(styles['menu-link'], { [styles['menu-link--active']]: isActive })}\n />\n);\n"],"names":["MenuLink","props","jsx","NavLink","isActive","classNames","styles"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"MenuLink.js","sources":["../../../src/components/MenuLink/MenuLink.tsx"],"sourcesContent":["import classNames from 'clsx';\nimport { NavLink } from 'react-router-dom';\n\nimport type { NavLinkProps } from 'react-router-dom';\n\nimport styles from './MenuLink.module.css';\n\n/** Represents a component for a [NavLink](https://reactrouter.com/en/main/components/nav-link) with styling. */\n// Omit style so it cannot be accidentally used\nexport const MenuLink = (props: Omit<NavLinkProps, 'style'>) => (\n <NavLink\n {...props}\n className={({ isActive }) => classNames(styles['menu-link'], { [styles['menu-link--active']]: isActive })}\n />\n);\n"],"names":["MenuLink","props","jsx","NavLink","isActive","classNames","styles"],"mappings":";;;;;;GASaA,IAAW,CAACC,MACvB,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACE,GAAGF;AAAA,IACJ,WAAW,CAAC,EAAE,UAAAG,EAAS,MAAMC,EAAWC,EAAO,WAAW,GAAG,EAAE,CAACA,EAAO,mBAAmB,CAAC,GAAGF,GAAU;AAAA,EAAA;AAC1G;"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { MemoryRouter as o } from "react-router-dom";
|
|
3
|
-
import { MenuLink as
|
|
3
|
+
import { MenuLink as t } from "./MenuLink.js";
|
|
4
4
|
import '../../assets/MenuLink2.css';const r = `
|
|
5
5
|
// Can only be used wrapped in a 'react-router-dom' <MemoryRouter />
|
|
6
6
|
<MenuLink to={linkUrl}>{children}</MenuLink>
|
|
7
7
|
`, s = {
|
|
8
8
|
title: "Atoms/MenuLink",
|
|
9
|
-
component:
|
|
9
|
+
component: t,
|
|
10
10
|
parameters: {
|
|
11
|
+
inspectComponent: t,
|
|
11
12
|
codeString: r
|
|
12
13
|
}
|
|
13
|
-
},
|
|
14
|
+
}, i = [
|
|
14
15
|
{ to: "/menu-link-1", title: "Menu Link One" },
|
|
15
16
|
{ to: "/menu-link-2", title: "Menu Link Two" },
|
|
16
17
|
{ to: "/menu-link-3", title: "Menu Link Three" }
|
|
17
|
-
], m = () => /* @__PURE__ */ e(o, { initialEntries:
|
|
18
|
+
], m = () => /* @__PURE__ */ e(o, { initialEntries: i.map((n) => n.to), initialIndex: 0, children: /* @__PURE__ */ e("nav", { className: "navbar", children: i.map((n) => /* @__PURE__ */ e(t, { to: n.to, children: n.title }, n.to)) }) }), c = m.bind({});
|
|
18
19
|
export {
|
|
19
20
|
c as MenuLinkExample,
|
|
20
21
|
s as default
|