@uva-glass/component-library 1.55.1 → 1.57.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/Button.module-FL3-CODh.js +15 -0
- package/dist/Button.module-FL3-CODh.js.map +1 -0
- package/dist/{Lexical.prod-BiuZHlIm.js → Lexical.prod-CO0gPAfo.js} +583 -607
- package/dist/Lexical.prod-CO0gPAfo.js.map +1 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js +27 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js.map +1 -0
- package/dist/LexicalList.prod-BceA-cJD.js +562 -0
- package/dist/LexicalList.prod-BceA-cJD.js.map +1 -0
- package/dist/{LexicalUtils.prod-BZOm66mY.js → LexicalUtils.prod-PbdOb6JG.js} +6 -6
- package/dist/{LexicalUtils.prod-BZOm66mY.js.map → LexicalUtils.prod-PbdOb6JG.js.map} +1 -1
- package/dist/RteEditor.module-Dz9a8vaK.js +29 -0
- package/dist/RteEditor.module-Dz9a8vaK.js.map +1 -0
- package/dist/Sortable.module-uk_YuFs1.js +24 -0
- package/dist/{Sortable.module-B-93knlb.js.map → Sortable.module-uk_YuFs1.js.map} +1 -1
- package/dist/{SortableProvider-BMm77PpY.js → SortableProvider-i4PDjRS_.js} +2 -2
- package/dist/{SortableProvider-BMm77PpY.js.map → SortableProvider-i4PDjRS_.js.map} +1 -1
- package/dist/TablePlugin-1L5UZfDH.js +249 -0
- package/dist/TablePlugin-1L5UZfDH.js.map +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Container.css +1 -1
- package/dist/assets/EditorHeader.css +1 -0
- package/dist/assets/Flyout.css +1 -0
- package/dist/assets/Periods.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/assets/TableCellContextMenu.css +1 -0
- package/dist/assets/TablePlugin.css +1 -0
- package/dist/components/Buttons/Button.js +1 -1
- package/dist/components/Buttons/LinkButton.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +13 -5
- package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
- package/dist/components/Buttons/MenuButton.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +13 -11
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/Icon/icons/index.d.ts +21 -18
- package/dist/components/Icon/icons/index.js +125 -120
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +16 -14
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +5 -3
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/Periods/Periods.js +12 -12
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +6 -4
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.d.ts +7 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +53 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -0
- package/dist/components/RteEditor/EditorHeader/index.d.ts +1 -0
- package/dist/components/RteEditor/EditorHeader/index.js +5 -0
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -10
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +18 -15
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +2 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +7 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +2 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +63 -49
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +3 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +6 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +31 -8
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +6 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +8 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +44 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +5 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.d.ts +9 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +8 -6
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.d.ts +7 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +4 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -0
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +48 -38
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +10 -8
- package/dist/components/RteEditor/Plugins/index.js.map +1 -1
- package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +10 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js +18 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -0
- package/dist/components/RteEditor/RteEditor.d.ts +9 -1
- package/dist/components/RteEditor/RteEditor.js +476 -401
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -0
- package/dist/components/RteEditor/RteEditor.stories.js +106 -15
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.d.ts +7 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js +14 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +16 -20
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.d.ts +61 -0
- package/dist/components/RteEditor/hooks/useTranslation.js +10 -0
- package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -0
- package/dist/components/RteEditor/index.js +3 -2
- package/dist/components/RteEditor/mockRteContent.d.ts +1 -0
- package/dist/components/RteEditor/mockRteContent.js +98 -0
- package/dist/components/RteEditor/mockRteContent.js.map +1 -0
- package/dist/components/RteEditor/translations.d.ts +64 -0
- package/dist/components/RteEditor/translations.js +68 -0
- package/dist/components/RteEditor/translations.js.map +1 -0
- package/dist/components/Sortable/Sortable.js +1 -1
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.js +2 -2
- package/dist/components/Sortable/components/SortableHandle.js +1 -1
- package/dist/components/Sortable/components/SortableItem.js +2 -2
- package/dist/components/index.js +20 -19
- package/dist/helpers-BewZrn6E.js +1512 -0
- package/dist/helpers-BewZrn6E.js.map +1 -0
- package/dist/{helpers-CJF7fErD.js → helpers-Ec7CfNnA.js} +72 -59
- package/dist/helpers-Ec7CfNnA.js.map +1 -0
- package/dist/index.js +20 -19
- package/dist/storyComponents/Container/Container.d.ts +1 -1
- package/dist/storyComponents/Container/Container.js +18 -16
- package/dist/storyComponents/Container/Container.js.map +1 -1
- package/dist/types/UserInterface.d.ts +1 -1
- package/package.json +12 -12
- package/dist/AddTableFrom-u1gSA461.js +0 -162
- package/dist/AddTableFrom-u1gSA461.js.map +0 -1
- package/dist/Button.module-Gr3KvBvb.js +0 -14
- package/dist/Button.module-Gr3KvBvb.js.map +0 -1
- package/dist/Lexical.prod-BiuZHlIm.js.map +0 -1
- package/dist/ListPlugin-DFFbKLaN.js +0 -588
- package/dist/ListPlugin-DFFbKLaN.js.map +0 -1
- package/dist/RteEditor.module-BBbfV1rk.js +0 -24
- package/dist/RteEditor.module-BBbfV1rk.js.map +0 -1
- package/dist/Sortable.module-B-93knlb.js +0 -24
- package/dist/TablePlugin-acQeRCt0.js +0 -1506
- package/dist/TablePlugin-acQeRCt0.js.map +0 -1
- package/dist/assets/AddTableFrom.css +0 -1
- package/dist/assets/useFlyout.css +0 -1
- package/dist/components/RteEditor/hooks/index.d.ts +0 -1
- package/dist/components/RteEditor/hooks/index.js +0 -5
- package/dist/helpers-CJF7fErD.js.map +0 -1
- /package/dist/components/RteEditor/{hooks → EditorHeader}/index.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._context-menu__wrapper_1ygrn_1{left:0;min-width:10rem;position:absolute;top:0;z-index:1000}._context-menu__button_1ygrn_9{align-items:center;background-color:var(--color-grey-100);border:0;border-radius:4px;color:var(--color-grey-500);display:flex;height:1.35rem;justify-content:center;position:absolute;right:.25rem;top:-1.6rem;width:1.35rem}._context-menu_1ygrn_1{background-color:var(--color-white);border:1px solid var(--color-grey-300);border-radius:4px;box-shadow:0 2px 6px #0003;height:0;list-style-type:none;margin:-2px 0 0;overflow:hidden;padding:0;visibility:hidden}._context-menu--open_1ygrn_37{height:auto;visibility:visible}._context-menu__item_1ygrn_42{align-items:center;background-color:var(--color-white);border:none;color:var(--color-black);display:flex;padding:.65rem;width:100%}._context-menu__item_1ygrn_42:hover{background-color:var(--color-grey-100)}._context-menu__item-divider_1ygrn_56{border-bottom:1px solid var(--color-grey-300)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._linkform_1u5p2_1{width:24rem}._linkform__input-field_1u5p2_5{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem}._linkform__footer_1u5p2_12{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}._tableform_t5fpq_1{width:18rem}._tableform__input-field_t5fpq_5{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem}._tableform__footer_t5fpq_12{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { c as u } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { forwardRef as a } from "react";
|
|
4
|
-
import { s as t } from "../../Button.module-
|
|
4
|
+
import { s as t } from "../../Button.module-FL3-CODh.js";
|
|
5
5
|
const p = a(
|
|
6
6
|
({ children: o, type: r = "button", variant: s, displayColumn: m = !1, ...n }, e) => /* @__PURE__ */ f(
|
|
7
7
|
"button",
|
|
@@ -2,7 +2,7 @@ import { jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
3
|
import { Link as i } from "react-router-dom";
|
|
4
4
|
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
5
|
-
import { s as o } from "../../Button.module-
|
|
5
|
+
import { s as o } from "../../Button.module-FL3-CODh.js";
|
|
6
6
|
const l = f(
|
|
7
7
|
({ variant: r, ...t }, m) => /* @__PURE__ */ s(i, { ...t, className: n(o.button, o[`button--${r}`]), ref: m })
|
|
8
8
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
2
|
-
import { fn as
|
|
1
|
+
import { jsxs as a, Fragment as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { fn as s } from "../../index-MQ0yPLdl.js";
|
|
3
3
|
import { BrowserRouter as c } from "react-router-dom";
|
|
4
4
|
import { LinkButton as n } from "./LinkButton.js";
|
|
5
5
|
const d = `
|
|
@@ -10,7 +10,15 @@ const d = `
|
|
|
10
10
|
component: n,
|
|
11
11
|
argTypes: {
|
|
12
12
|
variant: {
|
|
13
|
-
options: [
|
|
13
|
+
options: [
|
|
14
|
+
"primary",
|
|
15
|
+
"secondary",
|
|
16
|
+
"destructive-primary",
|
|
17
|
+
"destructive-secondary",
|
|
18
|
+
"blank",
|
|
19
|
+
"blank-subtle",
|
|
20
|
+
"blank-icon"
|
|
21
|
+
],
|
|
14
22
|
control: { type: "radio" }
|
|
15
23
|
}
|
|
16
24
|
},
|
|
@@ -20,7 +28,7 @@ const d = `
|
|
|
20
28
|
}
|
|
21
29
|
}, r = (o) => /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(n, { ...o }) }), i = {
|
|
22
30
|
variant: "primary",
|
|
23
|
-
onClick:
|
|
31
|
+
onClick: s()
|
|
24
32
|
}, p = r.bind({});
|
|
25
33
|
p.args = {
|
|
26
34
|
children: "Click me!",
|
|
@@ -29,7 +37,7 @@ p.args = {
|
|
|
29
37
|
const e = r.bind({});
|
|
30
38
|
e.args = {
|
|
31
39
|
...i,
|
|
32
|
-
children: /* @__PURE__ */ a(
|
|
40
|
+
children: /* @__PURE__ */ a(l, { children: [
|
|
33
41
|
/* @__PURE__ */ t("div", { children: "Child 1" }),
|
|
34
42
|
/* @__PURE__ */ t("div", { children: "Child 2" })
|
|
35
43
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.stories.js","sources":["../../../src/components/Buttons/LinkButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { LinkButtonProps } from './LinkButton';\n\nimport { LinkButton } from './LinkButton';\n\nconst codeString = `\n// Has all HTMLAnchorElement props available except \"className\" and \"style\" \n <LinkButton variant={variant} to={to} replace={replace} buttonRef={buttonRef}>{children}</LinkButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Buttons/LinkButton',\n component: LinkButton,\n argTypes: {\n variant: {\n options: ['primary'
|
|
1
|
+
{"version":3,"file":"LinkButton.stories.js","sources":["../../../src/components/Buttons/LinkButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { LinkButtonProps } from './LinkButton';\n\nimport { LinkButton } from './LinkButton';\n\nconst codeString = `\n// Has all HTMLAnchorElement props available except \"className\" and \"style\" \n <LinkButton variant={variant} to={to} replace={replace} buttonRef={buttonRef}>{children}</LinkButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Buttons/LinkButton',\n component: LinkButton,\n argTypes: {\n variant: {\n options: [\n 'primary',\n 'secondary',\n 'destructive-primary',\n 'destructive-secondary',\n 'blank',\n 'blank-subtle',\n 'blank-icon',\n ],\n control: { type: 'radio' },\n },\n },\n parameters: {\n inspectComponent: LinkButton,\n codeString: codeString,\n },\n} as Meta<LinkButtonProps>;\n\nconst Template: StoryFn<LinkButtonProps> = (args) => (\n <BrowserRouter>\n <LinkButton {...args} />\n </BrowserRouter>\n);\n\nconst defaultArgs: Partial<LinkButtonProps> = {\n variant: 'primary',\n onClick: fn(),\n};\n\nexport const LinkButtonExample = Template.bind({});\nLinkButtonExample.args = {\n children: 'Click me!',\n ...defaultArgs,\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","LinkButton_stories","LinkButton","Template","args","jsx","BrowserRouter","defaultArgs","fn","LinkButtonExample","WithMultipleChildren","jsxs","Fragment"],"mappings":";;;;AAQA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAC1C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,EACxB,CAAA,GAGIG,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,SAASC,EAAG;AACd,GAEaC,IAAoBN,EAAS,KAAK,EAAE;AACjDM,EAAkB,OAAO;AAAA,EACvB,UAAU;AAAA,EACV,GAAGF;AACL;AAEO,MAAMG,IAAuBP,EAAS,KAAK,EAAE;AACpDO,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,UAEI,gBAAAI,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;"}
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { Icon as i } from "../Icon/Icon.js";
|
|
5
|
-
import { s as r } from "../../Button.module-
|
|
5
|
+
import { s as r } from "../../Button.module-FL3-CODh.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,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as T, useEffect as N } from "react";
|
|
3
3
|
import { c as g } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { Icon as L } from "../Icon/Icon.js";
|
|
@@ -17,11 +17,13 @@ import "../IconButton/IconButton.js";
|
|
|
17
17
|
import "../Input/Input.js";
|
|
18
18
|
import "../InputField/InputField.js";
|
|
19
19
|
import "react-router-dom";
|
|
20
|
-
import "../../
|
|
20
|
+
import "../../TablePlugin-1L5UZfDH.js";
|
|
21
|
+
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
|
+
import "../RteEditor/Providers/LanguageProvider.js";
|
|
21
23
|
import "../SelectListbox/SelectListbox.js";
|
|
22
24
|
import "../SelectListbox/SelectProvider.js";
|
|
23
25
|
import "../Sortable/components/SortableItem.js";
|
|
24
|
-
import "../../SortableProvider-
|
|
26
|
+
import "../../SortableProvider-i4PDjRS_.js";
|
|
25
27
|
import { useResponsive as j } from "../hooks/useResponsive.js";
|
|
26
28
|
import '../../assets/CheckboxTree.css';const o = {
|
|
27
29
|
"checkbox-tree__header": "_checkbox-tree__header_xbe4e_1",
|
|
@@ -32,7 +34,7 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
32
34
|
"checkbox-tree__leaves": "_checkbox-tree__leaves_xbe4e_39",
|
|
33
35
|
"checkbox-tree__leaves--expanded": "_checkbox-tree__leaves--expanded_xbe4e_48",
|
|
34
36
|
"checkbox-tree__leaf": "_checkbox-tree__leaf_xbe4e_52"
|
|
35
|
-
},
|
|
37
|
+
}, ne = ({ title: p, checkboxTree: A, defaultValue: l, onChange: x }) => {
|
|
36
38
|
const s = T([]), { lessThan: n } = j(), _ = (r, e = document) => [].slice.call(e.querySelectorAll(r)), E = () => {
|
|
37
39
|
const r = s.current.reduce((e, t) => (t.name && t.checked && e.push(t.value), e), []);
|
|
38
40
|
x && x(r);
|
|
@@ -72,19 +74,19 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
72
74
|
return N(() => {
|
|
73
75
|
s.current = _("input") || [];
|
|
74
76
|
}, []), N(() => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
l && s.current.forEach((r) => {
|
|
78
|
+
l.includes(r.value) && (r.checked = !0, m(r));
|
|
77
79
|
});
|
|
78
|
-
}, [
|
|
80
|
+
}, [l]), /* @__PURE__ */ i("div", { children: [
|
|
79
81
|
p && /* @__PURE__ */ a("span", { className: o["checkbox-tree__header"], children: p }),
|
|
80
|
-
/* @__PURE__ */ a("div", { onClick: q, "data-ul": !0, role: "tree", tabIndex: 0, children: A.map(({ itemName: r, children: e }) => /* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ a("div", { onClick: q, "data-ul": !0, role: "tree", tabIndex: 0, children: A.map(({ itemName: r, children: e }) => /* @__PURE__ */ i(
|
|
81
83
|
"div",
|
|
82
84
|
{
|
|
83
85
|
className: o["checkbox-tree__branch"],
|
|
84
86
|
"data-li": !0,
|
|
85
87
|
"aria-expanded": n.md ? "false" : "true",
|
|
86
88
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ i(C, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
|
|
88
90
|
/* @__PURE__ */ a(R, { variant: "blank", onClick: B, children: /* @__PURE__ */ a(
|
|
89
91
|
L,
|
|
90
92
|
{
|
|
@@ -105,7 +107,7 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
105
107
|
[o["checkbox-tree__leaves--expanded"]]: !n.md
|
|
106
108
|
}),
|
|
107
109
|
"data-ul": !0,
|
|
108
|
-
children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */
|
|
110
|
+
children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */ i(C, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
|
|
109
111
|
/* @__PURE__ */ a(y, { id: t, name: t, value: d, disabled: c }),
|
|
110
112
|
/* @__PURE__ */ a(S, { htmlFor: t, children: t })
|
|
111
113
|
] }) }, t))
|
|
@@ -118,6 +120,6 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
118
120
|
] });
|
|
119
121
|
};
|
|
120
122
|
export {
|
|
121
|
-
|
|
123
|
+
ne as CheckboxTree
|
|
122
124
|
};
|
|
123
125
|
//# sourceMappingURL=CheckboxTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxTree.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport type { MouseEventHandler } from 'react';\n\nimport styles from './CheckboxTree.module.css';\n\nimport { Button, Checkbox, FormField, Icon, Label } from 'components';\nimport { useResponsive } from 'components/hooks/useResponsive';\n\n// TODO: Currently the checkbox tree shows odd behavior when a disabled checkbox is checked. When deselecting the parent checkbox, the disabled checkbox is deselected, and will never be checked again. We'll leave this for now, until we run into a real world example where this is necessary.\n\ntype CheckboxLeaf = {\n itemName: string;\n itemValue: string;\n disabled?: boolean;\n};\n\ntype CheckboxBranch = {\n itemName: string;\n children: CheckboxLeaf[];\n};\n\nexport interface CheckboxTreeProps {\n /** The title of the component. */\n title?: string;\n /** Array of checkbox groups with a label and array of children (itemName, itemValue and disabled boolean). */\n checkboxTree: CheckboxBranch[];\n /** Array of selected values. */\n defaultValue?: string[];\n /** Returns array of selected values. */\n onChange?: (value: string[]) => void;\n}\n\n/** Represents a component to render a tree of checkboxes. */\nexport const CheckboxTree = ({ title, checkboxTree, defaultValue, onChange }: CheckboxTreeProps) => {\n const checkboxNodes = useRef<HTMLInputElement[]>([]);\n const { lessThan } = useResponsive();\n\n const nodeArray = (selector: string, parent = document) => [].slice.call(parent.querySelectorAll(selector));\n\n const setValue = () => {\n const values = checkboxNodes.current.reduce((values, checkbox) => {\n if (checkbox.name && checkbox.checked) {\n values.push(checkbox.value);\n }\n return values;\n }, [] as string[]);\n\n if (onChange) onChange(values);\n };\n\n const setCheckboxesState = (check: HTMLInputElement) => {\n while (check) {\n const parent = check.closest('[data-ul]')?.parentNode?.querySelector('input');\n const siblings: HTMLInputElement[] = nodeArray(\n 'input',\n parent?.closest('[data-li]')?.querySelector('[data-ul]') as Document | undefined\n );\n\n const checkStatus = siblings.reduce((status, check) => {\n if (!check.disabled) status.push(check.checked);\n return status;\n }, [] as boolean[]);\n\n const every = checkStatus.every(Boolean);\n const some = checkStatus.some(Boolean);\n\n if (parent) {\n parent.checked = every;\n parent.indeterminate = !every && every !== some;\n }\n\n if (!parent || check === parent) {\n break;\n }\n\n check = parent;\n }\n };\n\n const setExpandedAttributes = (trigger: HTMLButtonElement, container: Element | null) => {\n const children = container?.querySelector('[data-ul]');\n\n (trigger.childNodes[0] as Element).classList.toggle(styles['checkbox-tree__branch--icon--expanded']);\n container\n ?.closest('[data-li]')\n ?.setAttribute(\n 'aria-expanded',\n container?.closest('[data-li]')?.getAttribute('aria-expanded') === 'false' ? 'true' : 'false'\n );\n\n if (children) {\n children.classList.toggle(styles['checkbox-tree__leaves--expanded']);\n }\n };\n\n const handleChange: MouseEventHandler<HTMLDivElement> = (event) => {\n const check = event.target as HTMLInputElement;\n\n if (!check || !check.parentNode || !check.parentNode.parentNode) return;\n const parentCheckbox = check.parentNode.parentNode as HTMLElement;\n\n if (\n lessThan.md &&\n check.previousElementSibling?.tagName === 'BUTTON' &&\n parentCheckbox.getAttribute('aria-expanded') === 'false'\n ) {\n event.preventDefault();\n setExpandedAttributes(parentCheckbox.querySelector('button') as HTMLButtonElement, parentCheckbox);\n return;\n }\n\n if (checkboxNodes.current.indexOf(check) === -1) return;\n\n const children: HTMLInputElement[] = (check.parentNode.parentNode as Document)\n ? nodeArray('input', check.parentNode.parentNode as Document)\n : [];\n\n children.forEach((child) => {\n return (child.checked = child.disabled ? false : check.checked);\n });\n\n setCheckboxesState(check);\n setValue();\n };\n\n const handleExpanded: MouseEventHandler<HTMLButtonElement> = (event) => {\n const target = event.target as HTMLButtonElement;\n const parent = target.closest('[data-li]');\n setExpandedAttributes(target, parent);\n };\n\n useEffect(() => {\n checkboxNodes.current = nodeArray('input') || [];\n }, []);\n\n useEffect(() => {\n if (defaultValue) {\n checkboxNodes.current.forEach((checkbox) => {\n if (defaultValue.includes(checkbox.value)) {\n checkbox.checked = true;\n setCheckboxesState(checkbox);\n }\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [defaultValue]);\n\n return (\n <div>\n {title && <span className={styles['checkbox-tree__header']}>{title}</span>}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n <div onClick={handleChange} data-ul role=\"tree\" tabIndex={0}>\n {checkboxTree.map(({ itemName, children }) => (\n <div\n key={itemName}\n className={styles['checkbox-tree__branch']}\n data-li\n aria-expanded={lessThan.md ? 'false' : 'true'}\n >\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Button variant=\"blank\" onClick={handleExpanded}>\n <Icon\n name=\"CheveronRight\"\n size={16}\n className={clsx(styles['checkbox-tree__branch--icon'], {\n [styles['checkbox-tree__branch--icon--expanded']]: !lessThan.md,\n })}\n />\n </Button>\n <Checkbox id={itemName} disabled={children.every((checkbox) => checkbox.disabled)} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n <div\n className={clsx(styles['checkbox-tree__leaves'], {\n [styles['checkbox-tree__leaves--expanded']]: !lessThan.md,\n })}\n data-ul\n >\n {children.map(({ itemName, itemValue, disabled }) => (\n <div key={itemName} className={styles['checkbox-tree__leaf']} data-li>\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Checkbox id={itemName} name={itemName} value={itemValue} disabled={disabled} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxTree","title","checkboxTree","defaultValue","onChange","checkboxNodes","useRef","lessThan","useResponsive","nodeArray","selector","parent","setValue","values","checkbox","setCheckboxesState","check","_b","_a","checkStatus","_c","status","every","some","setExpandedAttributes","trigger","container","children","styles","handleChange","event","parentCheckbox","child","handleExpanded","target","useEffect","itemName","jsxs","FormField","jsx","Button","Icon","clsx","Checkbox","Label","itemValue","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCaA,KAAe,CAAC,EAAE,OAAAC,GAAO,cAAAC,GAAc,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAAC,IAAgBC,EAA2B,CAAA,CAAE,GAC7C,EAAE,UAAAC,MAAaC,KAEfC,IAAY,CAACC,GAAkBC,IAAS,aAAa,CAAA,EAAG,MAAM,KAA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UAAAC,GAAoB;AAAA,gBAC7E,gBAAAP,EAAAK,GAAA,EAAM,SAASR,GAAW,UAAAA,GAAS;AAAA,cAAA,GACtC,EAAA,GAJQA,CAKV,CACD;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAhCKA;AAAA,IAkCR,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"CheckboxTree.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport type { MouseEventHandler } from 'react';\n\nimport styles from './CheckboxTree.module.css';\n\nimport { Button, Checkbox, FormField, Icon, Label } from 'components';\nimport { useResponsive } from 'components/hooks/useResponsive';\n\n// TODO: Currently the checkbox tree shows odd behavior when a disabled checkbox is checked. When deselecting the parent checkbox, the disabled checkbox is deselected, and will never be checked again. We'll leave this for now, until we run into a real world example where this is necessary.\n\ntype CheckboxLeaf = {\n itemName: string;\n itemValue: string;\n disabled?: boolean;\n};\n\ntype CheckboxBranch = {\n itemName: string;\n children: CheckboxLeaf[];\n};\n\nexport interface CheckboxTreeProps {\n /** The title of the component. */\n title?: string;\n /** Array of checkbox groups with a label and array of children (itemName, itemValue and disabled boolean). */\n checkboxTree: CheckboxBranch[];\n /** Array of selected values. */\n defaultValue?: string[];\n /** Returns array of selected values. */\n onChange?: (value: string[]) => void;\n}\n\n/** Represents a component to render a tree of checkboxes. */\nexport const CheckboxTree = ({ title, checkboxTree, defaultValue, onChange }: CheckboxTreeProps) => {\n const checkboxNodes = useRef<HTMLInputElement[]>([]);\n const { lessThan } = useResponsive();\n\n const nodeArray = (selector: string, parent = document) => [].slice.call(parent.querySelectorAll(selector));\n\n const setValue = () => {\n const values = checkboxNodes.current.reduce((values, checkbox) => {\n if (checkbox.name && checkbox.checked) {\n values.push(checkbox.value);\n }\n return values;\n }, [] as string[]);\n\n if (onChange) onChange(values);\n };\n\n const setCheckboxesState = (check: HTMLInputElement) => {\n while (check) {\n const parent = check.closest('[data-ul]')?.parentNode?.querySelector('input');\n const siblings: HTMLInputElement[] = nodeArray(\n 'input',\n parent?.closest('[data-li]')?.querySelector('[data-ul]') as Document | undefined\n );\n\n const checkStatus = siblings.reduce((status, check) => {\n if (!check.disabled) status.push(check.checked);\n return status;\n }, [] as boolean[]);\n\n const every = checkStatus.every(Boolean);\n const some = checkStatus.some(Boolean);\n\n if (parent) {\n parent.checked = every;\n parent.indeterminate = !every && every !== some;\n }\n\n if (!parent || check === parent) {\n break;\n }\n\n check = parent;\n }\n };\n\n const setExpandedAttributes = (trigger: HTMLButtonElement, container: Element | null) => {\n const children = container?.querySelector('[data-ul]');\n\n (trigger.childNodes[0] as Element).classList.toggle(styles['checkbox-tree__branch--icon--expanded']);\n container\n ?.closest('[data-li]')\n ?.setAttribute(\n 'aria-expanded',\n container?.closest('[data-li]')?.getAttribute('aria-expanded') === 'false' ? 'true' : 'false'\n );\n\n if (children) {\n children.classList.toggle(styles['checkbox-tree__leaves--expanded']);\n }\n };\n\n const handleChange: MouseEventHandler<HTMLDivElement> = (event) => {\n const check = event.target as HTMLInputElement;\n\n if (!check || !check.parentNode || !check.parentNode.parentNode) return;\n const parentCheckbox = check.parentNode.parentNode as HTMLElement;\n\n if (\n lessThan.md &&\n check.previousElementSibling?.tagName === 'BUTTON' &&\n parentCheckbox.getAttribute('aria-expanded') === 'false'\n ) {\n event.preventDefault();\n setExpandedAttributes(parentCheckbox.querySelector('button') as HTMLButtonElement, parentCheckbox);\n return;\n }\n\n if (checkboxNodes.current.indexOf(check) === -1) return;\n\n const children: HTMLInputElement[] = (check.parentNode.parentNode as Document)\n ? nodeArray('input', check.parentNode.parentNode as Document)\n : [];\n\n children.forEach((child) => {\n return (child.checked = child.disabled ? false : check.checked);\n });\n\n setCheckboxesState(check);\n setValue();\n };\n\n const handleExpanded: MouseEventHandler<HTMLButtonElement> = (event) => {\n const target = event.target as HTMLButtonElement;\n const parent = target.closest('[data-li]');\n setExpandedAttributes(target, parent);\n };\n\n useEffect(() => {\n checkboxNodes.current = nodeArray('input') || [];\n }, []);\n\n useEffect(() => {\n if (defaultValue) {\n checkboxNodes.current.forEach((checkbox) => {\n if (defaultValue.includes(checkbox.value)) {\n checkbox.checked = true;\n setCheckboxesState(checkbox);\n }\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [defaultValue]);\n\n return (\n <div>\n {title && <span className={styles['checkbox-tree__header']}>{title}</span>}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n <div onClick={handleChange} data-ul role=\"tree\" tabIndex={0}>\n {checkboxTree.map(({ itemName, children }) => (\n <div\n key={itemName}\n className={styles['checkbox-tree__branch']}\n data-li\n aria-expanded={lessThan.md ? 'false' : 'true'}\n >\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Button variant=\"blank\" onClick={handleExpanded}>\n <Icon\n name=\"CheveronRight\"\n size={16}\n className={clsx(styles['checkbox-tree__branch--icon'], {\n [styles['checkbox-tree__branch--icon--expanded']]: !lessThan.md,\n })}\n />\n </Button>\n <Checkbox id={itemName} disabled={children.every((checkbox) => checkbox.disabled)} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n <div\n className={clsx(styles['checkbox-tree__leaves'], {\n [styles['checkbox-tree__leaves--expanded']]: !lessThan.md,\n })}\n data-ul\n >\n {children.map(({ itemName, itemValue, disabled }) => (\n <div key={itemName} className={styles['checkbox-tree__leaf']} data-li>\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Checkbox id={itemName} name={itemName} value={itemValue} disabled={disabled} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxTree","title","checkboxTree","defaultValue","onChange","checkboxNodes","useRef","lessThan","useResponsive","nodeArray","selector","parent","setValue","values","checkbox","setCheckboxesState","check","_b","_a","checkStatus","_c","status","every","some","setExpandedAttributes","trigger","container","children","styles","handleChange","event","parentCheckbox","child","handleExpanded","target","useEffect","itemName","jsxs","FormField","jsx","Button","Icon","clsx","Checkbox","Label","itemValue","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCaA,KAAe,CAAC,EAAE,OAAAC,GAAO,cAAAC,GAAc,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAAC,IAAgBC,EAA2B,CAAA,CAAE,GAC7C,EAAE,UAAAC,MAAaC,KAEfC,IAAY,CAACC,GAAkBC,IAAS,aAAa,CAAA,EAAG,MAAM,KAAKA,EAAO,iBAAiBD,CAAQ,CAAC,GAEpGE,IAAW,MAAM;AACrB,UAAMC,IAASR,EAAc,QAAQ,OAAO,CAACQ,GAAQC,OAC/CA,EAAS,QAAQA,EAAS,WAC5BD,EAAO,KAAKC,EAAS,KAAK,GAErBD,IACN,CAAc,CAAA;AAEb,IAAAT,OAAmBS,CAAM;AAAA,EAAA,GAGzBE,IAAqB,CAACC,MAA4B;;AACtD,WAAOA,KAAO;AACZ,YAAML,KAASM,KAAAC,IAAAF,EAAM,QAAQ,WAAW,MAAzB,gBAAAE,EAA4B,eAA5B,gBAAAD,EAAwC,cAAc,UAM/DE,IAL+BV;AAAA,QACnC;AAAA,SACAW,IAAAT,KAAA,gBAAAA,EAAQ,QAAQ,iBAAhB,gBAAAS,EAA8B,cAAc;AAAA,MAAW,EAG5B,OAAO,CAACC,GAAQL,OACtCA,EAAM,YAAiBK,EAAA,KAAKL,EAAM,OAAO,GACvCK,IACN,CAAe,CAAA,GAEZC,IAAQH,EAAY,MAAM,OAAO,GACjCI,IAAOJ,EAAY,KAAK,OAAO;AAOjC,UALAR,MACFA,EAAO,UAAUW,GACVX,EAAA,gBAAgB,CAACW,KAASA,MAAUC,IAGzC,CAACZ,KAAUK,MAAUL;AACvB;AAGM,MAAAK,IAAAL;AAAA,IACV;AAAA,EAAA,GAGIa,IAAwB,CAACC,GAA4BC,MA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AAO,iCAAiC,CAAC,GAAG,CAACrB,EAAS;AAAA,cAAA,CACxD;AAAA,cACD,WAAO;AAAA,cAEN,UAAAoB,EAAS,IAAI,CAAC,EAAE,UAAAS,GAAU,WAAAS,GAAW,UAAAC,EACpC,MAAA,gBAAAP,EAAC,OAAmB,EAAA,WAAWX,EAAO,qBAAqB,GAAG,WAAO,IACnE,UAAC,gBAAAS,EAAAC,GAAA,EAAU,QAAM,IAAC,WAAWV,EAAO,kCAAkC,GACpE,UAAA;AAAA,gBAAA,gBAAAW,EAACI,KAAS,IAAIP,GAAU,MAAMA,GAAU,OAAOS,GAAW,UAAAC,GAAoB;AAAA,gBAC7E,gBAAAP,EAAAK,GAAA,EAAM,SAASR,GAAW,UAAAA,GAAS;AAAA,cAAA,GACtC,EAAA,GAJQA,CAKV,CACD;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAhCKA;AAAA,IAkCR,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -35,6 +35,9 @@ export declare const Icons: {
|
|
|
35
35
|
ArrowUpOnSquare: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
36
36
|
title?: string;
|
|
37
37
|
}>;
|
|
38
|
+
Bold: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
39
|
+
title?: string;
|
|
40
|
+
}>;
|
|
38
41
|
BrowserBlocked: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
39
42
|
title?: string;
|
|
40
43
|
}>;
|
|
@@ -44,9 +47,15 @@ export declare const Icons: {
|
|
|
44
47
|
BuildingOffice: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
45
48
|
title?: string;
|
|
46
49
|
}>;
|
|
50
|
+
BulletList: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
51
|
+
title?: string;
|
|
52
|
+
}>;
|
|
47
53
|
Calendar: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
48
54
|
title?: string;
|
|
49
55
|
}>;
|
|
56
|
+
ChainLink: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
57
|
+
title?: string;
|
|
58
|
+
}>;
|
|
50
59
|
Check: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
51
60
|
title?: string;
|
|
52
61
|
}>;
|
|
@@ -134,18 +143,6 @@ export declare const Icons: {
|
|
|
134
143
|
FaceFrown: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
135
144
|
title?: string;
|
|
136
145
|
}>;
|
|
137
|
-
FormatBold: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
138
|
-
title?: string;
|
|
139
|
-
}>;
|
|
140
|
-
FormatItalic: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
141
|
-
title?: string;
|
|
142
|
-
}>;
|
|
143
|
-
FormatOrderedLists: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
144
|
-
title?: string;
|
|
145
|
-
}>;
|
|
146
|
-
FormatUnorderedList: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
147
|
-
title?: string;
|
|
148
|
-
}>;
|
|
149
146
|
Hamburger: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
150
147
|
title?: string;
|
|
151
148
|
}>;
|
|
@@ -161,6 +158,9 @@ export declare const Icons: {
|
|
|
161
158
|
InformationCircleMini: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
162
159
|
title?: string;
|
|
163
160
|
}>;
|
|
161
|
+
Italic: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
162
|
+
title?: string;
|
|
163
|
+
}>;
|
|
164
164
|
Language: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
165
165
|
title?: string;
|
|
166
166
|
}>;
|
|
@@ -185,6 +185,9 @@ export declare const Icons: {
|
|
|
185
185
|
MinusCircleFillMini: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
186
186
|
title?: string;
|
|
187
187
|
}>;
|
|
188
|
+
NumberedList: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
189
|
+
title?: string;
|
|
190
|
+
}>;
|
|
188
191
|
PencilSquare: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
189
192
|
title?: string;
|
|
190
193
|
}>;
|
|
@@ -194,15 +197,18 @@ export declare const Icons: {
|
|
|
194
197
|
QuestionMarkCircleFillMini: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
195
198
|
title?: string;
|
|
196
199
|
}>;
|
|
197
|
-
Redo: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
198
|
-
title?: string;
|
|
199
|
-
}>;
|
|
200
200
|
Sparkles: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
201
201
|
title?: string;
|
|
202
202
|
}>;
|
|
203
203
|
Star: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
204
204
|
title?: string;
|
|
205
205
|
}>;
|
|
206
|
+
StepBack: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
207
|
+
title?: string;
|
|
208
|
+
}>;
|
|
209
|
+
StepForwards: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
210
|
+
title?: string;
|
|
211
|
+
}>;
|
|
206
212
|
Swap: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
207
213
|
title?: string;
|
|
208
214
|
}>;
|
|
@@ -221,9 +227,6 @@ export declare const Icons: {
|
|
|
221
227
|
TrashStrikethrough: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
222
228
|
title?: string;
|
|
223
229
|
}>;
|
|
224
|
-
Undo: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
225
|
-
title?: string;
|
|
226
|
-
}>;
|
|
227
230
|
User: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
228
231
|
title?: string;
|
|
229
232
|
}>;
|