@uva-glass/component-library 3.57.3 → 3.57.5
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/{AddCatalogueLinkForm-Di0xm7Ep.js → AddCatalogueLinkForm-CvJoaUFz.js} +2 -2
- package/dist/{AddCatalogueLinkForm-Di0xm7Ep.js.map → AddCatalogueLinkForm-CvJoaUFz.js.map} +1 -1
- package/dist/{DataTable-Cgn_RKTA.js → DataTable-UslvEf3c.js} +54 -50
- package/dist/DataTable-UslvEf3c.js.map +1 -0
- package/dist/{FeedbackBar-DEDpoNy7.js → FeedbackBar-DsOWAAGt.js} +2 -2
- package/dist/{FeedbackBar-DEDpoNy7.js.map → FeedbackBar-DsOWAAGt.js.map} +1 -1
- package/dist/{Lexical.prod-Dy5aDppc.js → Lexical.prod-BlUfEvo-.js} +1461 -1476
- package/dist/{Lexical.prod-Dy5aDppc.js.map → Lexical.prod-BlUfEvo-.js.map} +1 -1
- package/dist/{LexicalClipboard.prod-CS8a49uL.js → LexicalClipboard.prod-DQbm50C_.js} +132 -131
- package/dist/LexicalClipboard.prod-DQbm50C_.js.map +1 -0
- package/dist/LexicalHtml.prod-Czkg35Fe.js +1129 -0
- package/dist/LexicalHtml.prod-Czkg35Fe.js.map +1 -0
- package/dist/{LexicalLink.prod-DzgwWhQM.js → LexicalLink.prod-6gI2ABQo.js} +141 -141
- package/dist/{LexicalLink.prod-DzgwWhQM.js.map → LexicalLink.prod-6gI2ABQo.js.map} +1 -1
- package/dist/{LexicalList.prod-icY8mpm6.js → LexicalList.prod-CMGvSM1c.js} +265 -265
- package/dist/{LexicalList.prod-icY8mpm6.js.map → LexicalList.prod-CMGvSM1c.js.map} +1 -1
- package/dist/LexicalSelection.prod-DS_R6Cl1.js +99 -0
- package/dist/LexicalSelection.prod-DS_R6Cl1.js.map +1 -0
- package/dist/{LexicalTable.prod-Bf0is-op.js → LexicalTable.prod-D3FUVxbr.js} +582 -582
- package/dist/LexicalTable.prod-D3FUVxbr.js.map +1 -0
- package/dist/LexicalUtils.prod-CNWf_0sq.js +164 -0
- package/dist/LexicalUtils.prod-CNWf_0sq.js.map +1 -0
- package/dist/{LinkContextMenu-C8ehPbP8.js → LinkContextMenu-59-rbxa2.js} +2 -2
- package/dist/{LinkContextMenu-C8ehPbP8.js.map → LinkContextMenu-59-rbxa2.js.map} +1 -1
- package/dist/{PasteHandlerPlugin-CSo_lOE8.js → PasteHandlerPlugin-CTzYRyAx.js} +9 -9
- package/dist/{PasteHandlerPlugin-CSo_lOE8.js.map → PasteHandlerPlugin-CTzYRyAx.js.map} +1 -1
- package/dist/Repeater-DUo13Mq6.js +23 -0
- package/dist/Repeater-DUo13Mq6.js.map +1 -0
- package/dist/{Slider-Czd2xAGf.js → Slider-CqYFsgRL.js} +3 -3
- package/dist/{Slider-Czd2xAGf.js.map → Slider-CqYFsgRL.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-Bb2blXnq.js → TableCellResizerPlugin-D-fX5I3p.js} +12 -5
- package/dist/{TableCellResizerPlugin-Bb2blXnq.js.map → TableCellResizerPlugin-D-fX5I3p.js.map} +1 -1
- package/dist/assets/DataTable.css +1 -1
- package/dist/assets/Repeater.css +1 -1
- package/dist/{chunk-5WKL7XVT-CvOIS3NE.js → chunk-SNLGT2ZI--XVeLAcq.js} +2540 -2881
- package/dist/chunk-SNLGT2ZI--XVeLAcq.js.map +1 -0
- package/dist/{client-CXlG3hNo.js → client-CTHUtwUP.js} +4 -4
- package/dist/{client-CXlG3hNo.js.map → client-CTHUtwUP.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +15 -14
- package/dist/components/Accordion/Accordion.test.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.test.js +20 -19
- package/dist/components/AccordionCard/AccordionCard.test.js.map +1 -1
- package/dist/components/ActionList/ActionList.test.js +26 -25
- package/dist/components/ActionList/ActionList.test.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.test.js +6 -5
- package/dist/components/AppStatusBar/AppStatusBar.test.js.map +1 -1
- package/dist/components/Attention/Attention.test.js +5 -4
- package/dist/components/Attention/Attention.test.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +5 -4
- package/dist/components/Backdrop/Backdrop.test.js.map +1 -1
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +20 -19
- package/dist/components/Buttons/Button.test.js.map +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +22 -21
- package/dist/components/Buttons/LinkButton.test.js.map +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +20 -19
- package/dist/components/Buttons/MenuButton.test.js.map +1 -1
- package/dist/components/Card/Card.test.js +5 -4
- package/dist/components/Card/Card.test.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +9 -8
- package/dist/components/Checkbox/Checkbox.test.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +16 -15
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +3 -3
- package/dist/components/CheckboxTree/index.js +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/DataTable/DataTable.d.ts +3 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/DataTable.stories.js +47 -56
- package/dist/components/DataTable/DataTable.stories.js.map +1 -1
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/ExpandableInfoPanel/ExpandableInfoPanel.stories.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.stories.js +2 -2
- package/dist/components/FeedbackBar/FeedbackBar.test.js +8 -7
- package/dist/components/FeedbackBar/FeedbackBar.test.js.map +1 -1
- package/dist/components/FeedbackBar/index.js +1 -1
- package/dist/components/FeedbackBox/FeedbackBox.stories.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +2 -2
- package/dist/components/FormInput/index.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/Label/Label.test.js +12 -11
- package/dist/components/Label/Label.test.js.map +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.test.js +5 -4
- package/dist/components/MetaDataBar/MetaDataBar.test.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +12 -11
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js.map +1 -1
- package/dist/components/Notification/Notification.stories.js +1 -1
- package/dist/components/Notification/Notification.test.js +8 -7
- package/dist/components/Notification/Notification.test.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PageOverlay/PageOverlay.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +2 -2
- package/dist/components/PeriodSelector/index.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +10 -9
- package/dist/components/RadioGroup/Radiogroup.test.js.map +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +2 -2
- package/dist/components/RadioTabSelector/index.js +1 -1
- package/dist/components/Repeater/Repeater.d.ts +1 -1
- package/dist/components/Repeater/Repeater.js +1 -1
- package/dist/components/Repeater/Repeater.stories.js +1 -1
- package/dist/components/Repeater/index.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/EditorHeader/index.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js +1 -1
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js +1 -1
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +21 -21
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +12 -12
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/index.js +3 -3
- package/dist/components/RteEditor/RteEditor.js +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +1 -1
- package/dist/components/RteEditor/helpers.js +5 -5
- package/dist/components/RteEditor/index.js +1 -1
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +14 -14
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +20 -19
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/SelectProvider.js +2 -1
- package/dist/components/SelectListbox/SelectProvider.js.map +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.stories.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/Sortable/components/SortableItem.js +2 -2
- package/dist/components/Sortable/components/SortableItem.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +7 -6
- package/dist/components/StatusBadge/StatusBadge.test.js.map +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +14 -13
- package/dist/components/TextArea/TextArea.test.js.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +26 -25
- package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -1
- package/dist/components/hooks/useResponsive.js +1 -1
- package/dist/components/hooks/useResponsive.js.map +1 -1
- package/dist/components/index.js +5 -5
- package/dist/{components-CgBF6db6.js → components-D2rPfyIW.js} +438 -408
- package/dist/components-D2rPfyIW.js.map +1 -0
- package/dist/{dist-oLwM--0y.js → dist-CuwCMU7Y.js} +4 -4
- package/dist/{dist-oLwM--0y.js.map → dist-CuwCMU7Y.js.map} +1 -1
- package/dist/{react.esm-DwWzhs9e.js → dom.esm-S0SD0DBW.js} +938 -1029
- package/dist/dom.esm-S0SD0DBW.js.map +1 -0
- package/dist/{esm-BXzGXYWZ.js → esm-Bfz5h0_d.js} +5 -5
- package/dist/{esm-BXzGXYWZ.js.map → esm-Bfz5h0_d.js.map} +1 -1
- package/dist/index.js +5 -5
- package/dist/{react-18-BwdnKC48.js → react-18-yf-KbRra.js} +3 -3
- package/dist/{react-18-BwdnKC48.js.map → react-18-yf-KbRra.js.map} +1 -1
- package/dist/react.esm-D50lAl1F.js +226 -0
- package/dist/react.esm-D50lAl1F.js.map +1 -0
- package/dist/setupTests.js +1 -1
- package/dist/storybook__react.d.js +22 -22
- package/dist/storybook__react.d.js.map +1 -1
- package/dist/{test-Gtly6H2f.js → test-BjtC-Q32.js} +3684 -6919
- package/dist/test-BjtC-Q32.js.map +1 -0
- package/package.json +16 -16
- package/dist/DataTable-Cgn_RKTA.js.map +0 -1
- package/dist/LexicalClipboard.prod-CS8a49uL.js.map +0 -1
- package/dist/LexicalHtml.prod-BtzosUOH.js +0 -1611
- package/dist/LexicalHtml.prod-BtzosUOH.js.map +0 -1
- package/dist/LexicalTable.prod-Bf0is-op.js.map +0 -1
- package/dist/LexicalUtils.prod-CjGUKarD.js +0 -259
- package/dist/LexicalUtils.prod-CjGUKarD.js.map +0 -1
- package/dist/Repeater-BAEfOMZI.js +0 -22
- package/dist/Repeater-BAEfOMZI.js.map +0 -1
- package/dist/chunk-5WKL7XVT-CvOIS3NE.js.map +0 -1
- package/dist/components-CgBF6db6.js.map +0 -1
- package/dist/helpers-MMNO9vlK.js +0 -34
- package/dist/helpers-MMNO9vlK.js.map +0 -1
- package/dist/react.esm-DwWzhs9e.js.map +0 -1
- package/dist/test-Gtly6H2f.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { s as e } from "../../dom.esm-S0SD0DBW.js";
|
|
2
|
+
import "../../dist-CuwCMU7Y.js";
|
|
3
|
+
import { t } from "../../StatusBage-hJmNPqtk.js";
|
|
4
|
+
import { n } from "../../react.esm-D50lAl1F.js";
|
|
4
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/StatusBadge/StatusBadge.test.tsx
|
|
6
7
|
describe("StatusBadge", () => {
|
|
7
8
|
it("should render with message", () => {
|
|
8
|
-
n(/* @__PURE__ */ r(
|
|
9
|
+
n(/* @__PURE__ */ r(t, { label: "Status message" })), expect(e.getByText("Status message")).toBeInTheDocument();
|
|
9
10
|
}), it("should render with highContract", () => {
|
|
10
|
-
n(/* @__PURE__ */ r(
|
|
11
|
+
n(/* @__PURE__ */ r(t, {
|
|
11
12
|
label: "Status message",
|
|
12
13
|
highContrast: !0
|
|
13
|
-
})), expect(
|
|
14
|
+
})), expect(e.getByText("Status message")).toHaveClass("statusbadge--high-contrast");
|
|
14
15
|
});
|
|
15
16
|
});
|
|
16
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.test.js","names":[],"sources":["../../../src/components/StatusBadge/StatusBadge.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen } from '@testing-library/react';\n\nimport { StatusBadge } from './StatusBage';\n\ndescribe('StatusBadge', () => {\n it('should render with message', () => {\n render(<StatusBadge label=\"Status message\" />);\n expect(screen.getByText('Status message')).toBeInTheDocument();\n });\n\n it('should render with highContract', () => {\n render(<StatusBadge label=\"Status message\" highContrast={true} />);\n expect(screen.getByText('Status message')).toHaveClass('statusbadge--high-contrast');\n });\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusBadge.test.js","names":[],"sources":["../../../src/components/StatusBadge/StatusBadge.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen } from '@testing-library/react';\n\nimport { StatusBadge } from './StatusBage';\n\ndescribe('StatusBadge', () => {\n it('should render with message', () => {\n render(<StatusBadge label=\"Status message\" />);\n expect(screen.getByText('Status message')).toBeInTheDocument();\n });\n\n it('should render with highContract', () => {\n render(<StatusBadge label=\"Status message\" highContrast={true} />);\n expect(screen.getByText('Status message')).toHaveClass('statusbadge--high-contrast');\n });\n});\n"],"mappings":";;;;;;AAKA,SAAS,qBAAqB;CAM5B,AALA,GAAG,oCAAoC;EAErC,AADA,EAAO,kBAAC,GAAD,EAAa,OAAM,iBAAkB,CAAA,CAAC,GAC7C,OAAO,EAAO,UAAU,gBAAgB,CAAC,CAAC,CAAC,kBAAkB;CAC/D,CAAC,GAED,GAAG,yCAAyC;EAE1C,AADA,EAAO,kBAAC,GAAD;GAAa,OAAM;GAAiB,cAAc;EAAO,CAAA,CAAC,GACjE,OAAO,EAAO,UAAU,gBAAgB,CAAC,CAAC,CAAC,YAAY,4BAA4B;CACrF,CAAC;AACH,CAAC"}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
import { s as e } from "../../dom.esm-S0SD0DBW.js";
|
|
2
|
+
import "../../dist-CuwCMU7Y.js";
|
|
3
|
+
import { t } from "../../TextArea-D_VoyGIO.js";
|
|
4
|
+
import { n, t as r } from "../../react.esm-D50lAl1F.js";
|
|
5
|
+
import { t as i } from "../../esm-Bfz5h0_d.js";
|
|
5
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/TextArea/TextArea.test.tsx
|
|
7
8
|
describe("TextArea", () => {
|
|
8
9
|
it("should render correctly with label", () => {
|
|
9
|
-
n(/* @__PURE__ */ a(
|
|
10
|
+
n(/* @__PURE__ */ a(t, {
|
|
10
11
|
onChange: jest.fn(),
|
|
11
12
|
label: "Test Label"
|
|
12
|
-
})), expect(
|
|
13
|
+
})), expect(e.getByText("Test Label")).toBeInTheDocument();
|
|
13
14
|
}), it("should call onChange when text is entered", () => {
|
|
14
15
|
let i = jest.fn();
|
|
15
|
-
n(/* @__PURE__ */ a(
|
|
16
|
-
let o =
|
|
16
|
+
n(/* @__PURE__ */ a(t, { onChange: i }));
|
|
17
|
+
let o = e.getByRole("textbox");
|
|
17
18
|
r.input(o, { target: { value: "Hello" } }), expect(i).toHaveBeenCalledWith("Hello");
|
|
18
19
|
}), it("should update character count", () => {
|
|
19
|
-
n(/* @__PURE__ */ a(
|
|
20
|
+
n(/* @__PURE__ */ a(t, {
|
|
20
21
|
onChange: jest.fn(),
|
|
21
22
|
label: "Test",
|
|
22
23
|
maxCharacters: 10
|
|
23
24
|
}));
|
|
24
|
-
let i =
|
|
25
|
-
r.input(i, { target: { value: "Test" } }), expect(
|
|
25
|
+
let i = e.getByRole("textbox");
|
|
26
|
+
r.input(i, { target: { value: "Test" } }), expect(e.getByText("4")).toBeInTheDocument(), expect(e.getByText("/ 10")).toBeInTheDocument();
|
|
26
27
|
}), it("should not exceed max characters limit", async () => {
|
|
27
28
|
let r = jest.fn();
|
|
28
|
-
n(/* @__PURE__ */ a(
|
|
29
|
+
n(/* @__PURE__ */ a(t, {
|
|
29
30
|
onChange: r,
|
|
30
31
|
maxCharacters: 5
|
|
31
32
|
}));
|
|
32
|
-
let o =
|
|
33
|
+
let o = e.getByRole("textbox");
|
|
33
34
|
await i.type(o, "ExceedsLimit"), expect(r).toHaveBeenCalled(), expect(r.mock.calls[r.mock.calls.length - 1][0].length).toBe(5);
|
|
34
35
|
});
|
|
35
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.test.js","names":[],"sources":["../../../src/components/TextArea/TextArea.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen, fireEvent } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport { TextArea } from './TextArea';\n\ndescribe('TextArea', () => {\n it('should render correctly with label', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test Label\" />);\n expect(screen.getByText('Test Label')).toBeInTheDocument();\n });\n\n it('should call onChange when text is entered', () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Hello' } });\n expect(handleChange).toHaveBeenCalledWith('Hello');\n });\n\n it('should update character count', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test\" maxCharacters={10} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Test' } });\n\n expect(screen.getByText('4')).toBeInTheDocument();\n expect(screen.getByText('/ 10')).toBeInTheDocument();\n });\n\n it('should not exceed max characters limit', async () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} maxCharacters={5} />);\n\n const textarea = screen.getByRole('textbox');\n\n await userEvent.type(textarea, 'ExceedsLimit');\n\n expect(handleChange).toHaveBeenCalled();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n expect(handleChange.mock.calls[handleChange.mock.calls.length - 1][0].length).toBe(5);\n });\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.test.js","names":[],"sources":["../../../src/components/TextArea/TextArea.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen, fireEvent } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport { TextArea } from './TextArea';\n\ndescribe('TextArea', () => {\n it('should render correctly with label', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test Label\" />);\n expect(screen.getByText('Test Label')).toBeInTheDocument();\n });\n\n it('should call onChange when text is entered', () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Hello' } });\n expect(handleChange).toHaveBeenCalledWith('Hello');\n });\n\n it('should update character count', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test\" maxCharacters={10} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Test' } });\n\n expect(screen.getByText('4')).toBeInTheDocument();\n expect(screen.getByText('/ 10')).toBeInTheDocument();\n });\n\n it('should not exceed max characters limit', async () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} maxCharacters={5} />);\n\n const textarea = screen.getByRole('textbox');\n\n await userEvent.type(textarea, 'ExceedsLimit');\n\n expect(handleChange).toHaveBeenCalled();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n expect(handleChange.mock.calls[handleChange.mock.calls.length - 1][0].length).toBe(5);\n });\n});\n"],"mappings":";;;;;;;AAMA,SAAS,kBAAkB;CAyBzB,AAxBA,GAAG,4CAA4C;EAE7C,AADA,EAAO,kBAAC,GAAD;GAAU,UAAU,KAAK,GAAG;GAAG,OAAM;EAAc,CAAA,CAAC,GAC3D,OAAO,EAAO,UAAU,YAAY,CAAC,CAAC,CAAC,kBAAkB;CAC3D,CAAC,GAED,GAAG,mDAAmD;EACpD,IAAM,IAAe,KAAK,GAAG;EAC7B,EAAO,kBAAC,GAAD,EAAU,UAAU,EAAe,CAAA,CAAC;EAE3C,IAAM,IAAW,EAAO,UAAU,SAAS;EAE3C,AADA,EAAU,MAAM,GAAU,EAAE,QAAQ,EAAE,OAAO,QAAQ,EAAE,CAAC,GACxD,OAAO,CAAY,CAAC,CAAC,qBAAqB,OAAO;CACnD,CAAC,GAED,GAAG,uCAAuC;EACxC,EAAO,kBAAC,GAAD;GAAU,UAAU,KAAK,GAAG;GAAG,OAAM;GAAO,eAAe;EAAK,CAAA,CAAC;EAExE,IAAM,IAAW,EAAO,UAAU,SAAS;EAI3C,AAHA,EAAU,MAAM,GAAU,EAAE,QAAQ,EAAE,OAAO,OAAO,EAAE,CAAC,GAEvD,OAAO,EAAO,UAAU,GAAG,CAAC,CAAC,CAAC,kBAAkB,GAChD,OAAO,EAAO,UAAU,MAAM,CAAC,CAAC,CAAC,kBAAkB;CACrD,CAAC,GAED,GAAG,0CAA0C,YAAY;EACvD,IAAM,IAAe,KAAK,GAAG;EAC7B,EAAO,kBAAC,GAAD;GAAU,UAAU;GAAc,eAAe;EAAI,CAAA,CAAC;EAE7D,IAAM,IAAW,EAAO,UAAU,SAAS;EAM3C,AAJA,MAAM,EAAU,KAAK,GAAU,cAAc,GAE7C,OAAO,CAAY,CAAC,CAAC,iBAAiB,GAEtC,OAAO,EAAa,KAAK,MAAM,EAAa,KAAK,MAAM,SAAS,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;CACtF,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { c as e, s as t } from "../../dom.esm-S0SD0DBW.js";
|
|
2
|
+
import "../../dist-CuwCMU7Y.js";
|
|
3
|
+
import { t as n } from "../../VarIndicator-D0cnlcIf.js";
|
|
4
|
+
import { n as r } from "../../react.esm-D50lAl1F.js";
|
|
5
|
+
import { t as i } from "../../esm-Bfz5h0_d.js";
|
|
5
6
|
import { useState as a } from "react";
|
|
6
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/VarIndicator/VarIndicator.test.tsx
|
|
@@ -13,13 +14,13 @@ var s = {
|
|
|
13
14
|
};
|
|
14
15
|
jest.mock("components/Icon", () => ({ Icon: ({ name: e }) => /* @__PURE__ */ o("svg", { "data-testid": e }) }));
|
|
15
16
|
var c = () => {
|
|
16
|
-
let [
|
|
17
|
-
return /* @__PURE__ */ o(
|
|
17
|
+
let [e, t] = a(1);
|
|
18
|
+
return /* @__PURE__ */ o(n, {
|
|
18
19
|
label: s,
|
|
19
20
|
variant: "SUBMITTED",
|
|
20
21
|
maxSteps: 3,
|
|
21
|
-
currentStep:
|
|
22
|
-
onClick: () =>
|
|
22
|
+
currentStep: e,
|
|
23
|
+
onClick: () => t(2)
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
26
|
describe("VarIndicator", () => {
|
|
@@ -27,44 +28,44 @@ describe("VarIndicator", () => {
|
|
|
27
28
|
beforeEach(() => {
|
|
28
29
|
a.mockClear();
|
|
29
30
|
}), it("should render Concept (DRAFT)", () => {
|
|
30
|
-
r(/* @__PURE__ */ o(
|
|
31
|
+
r(/* @__PURE__ */ o(n, {
|
|
31
32
|
label: s,
|
|
32
33
|
variant: "DRAFT"
|
|
33
|
-
})), expect(
|
|
34
|
+
})), expect(t.getByText("Concept")).toBeInTheDocument();
|
|
34
35
|
}), it("should render Concept (REJECTED)", () => {
|
|
35
|
-
r(/* @__PURE__ */ o(
|
|
36
|
+
r(/* @__PURE__ */ o(n, {
|
|
36
37
|
label: s,
|
|
37
38
|
variant: "REJECTED"
|
|
38
|
-
})), expect(
|
|
39
|
+
})), expect(t.getByText("Concept")).toBeInTheDocument();
|
|
39
40
|
}), it("should render Concept (ACTIVE)", () => {
|
|
40
|
-
r(/* @__PURE__ */ o(
|
|
41
|
+
r(/* @__PURE__ */ o(n, {
|
|
41
42
|
label: s,
|
|
42
43
|
variant: "ACTIVE"
|
|
43
|
-
})), expect(
|
|
44
|
+
})), expect(t.getByText("Actief")).toBeInTheDocument();
|
|
44
45
|
}), it("should render dots (SUBMITTED)", () => {
|
|
45
|
-
r(/* @__PURE__ */ o(
|
|
46
|
+
r(/* @__PURE__ */ o(n, {
|
|
46
47
|
label: s,
|
|
47
48
|
variant: "SUBMITTED",
|
|
48
49
|
maxSteps: 3,
|
|
49
50
|
currentStep: 0
|
|
50
|
-
})), expect(
|
|
51
|
+
})), expect(t.getByText("Verificatie")).toBeInTheDocument(), expect(t.getAllByTestId("CircleSmall")).toHaveLength(3), expect(t.queryByTestId("CircleSmallFilled")).not.toBeInTheDocument();
|
|
51
52
|
}), it("should render filled dots when currentStep != 0 (SUBMITTED)", () => {
|
|
52
|
-
r(/* @__PURE__ */ o(
|
|
53
|
+
r(/* @__PURE__ */ o(n, {
|
|
53
54
|
label: s,
|
|
54
55
|
variant: "SUBMITTED",
|
|
55
56
|
maxSteps: 3,
|
|
56
57
|
currentStep: 1,
|
|
57
58
|
onClick: a
|
|
58
59
|
}));
|
|
59
|
-
let
|
|
60
|
-
expect(
|
|
60
|
+
let e = t.getByText("Verificatie");
|
|
61
|
+
expect(e).toBeInTheDocument(), expect(t.getAllByTestId("CircleSmallFilled")).toHaveLength(1), expect(t.getAllByTestId("CircleSmall")).toHaveLength(2);
|
|
61
62
|
}), it("should render filled dots currentStep is updated (SUBMITTED)", async () => {
|
|
62
|
-
r(/* @__PURE__ */ o(c, {})), expect(
|
|
63
|
-
let
|
|
64
|
-
await i.click(
|
|
65
|
-
expect(
|
|
66
|
-
}), await
|
|
67
|
-
expect(
|
|
63
|
+
r(/* @__PURE__ */ o(c, {})), expect(t.getAllByTestId("CircleSmallFilled")).toHaveLength(1), expect(t.getAllByTestId("CircleSmall")).toHaveLength(2);
|
|
64
|
+
let n = t.getByText("Verificatie");
|
|
65
|
+
await i.click(n), await e(() => {
|
|
66
|
+
expect(t.getAllByTestId("CircleSmallFilled")).toHaveLength(2);
|
|
67
|
+
}), await e(() => {
|
|
68
|
+
expect(t.getAllByTestId("CircleSmall")).toHaveLength(1);
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarIndicator.test.js","names":[],"sources":["../../../src/components/VarIndicator/VarIndicator.test.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport '@testing-library/jest-dom';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { useState } from 'react';\n\nimport { VarIndicator } from './VarIndicator';\n\nconst LABELS = {\n DRAFT: 'Concept',\n REJECTED: 'Concept',\n SUBMITTED: 'Verificatie',\n ACTIVE: 'Actief',\n};\n\njest.mock('components/Icon', () => ({\n Icon: ({ name }: { name: string }) => <svg data-testid={name} />,\n}));\n\nconst TestWrapper = () => {\n const [currentStep, setCurrentStep] = useState(1);\n return (\n // When clicked the onClick callback updates currentStep from 1 to 2.\n <VarIndicator\n label={LABELS}\n variant=\"SUBMITTED\"\n maxSteps={3}\n currentStep={currentStep}\n onClick={() => setCurrentStep(2)}\n />\n );\n};\n\ndescribe('VarIndicator', () => {\n const onClickSpy = jest.fn();\n\n beforeEach(() => {\n onClickSpy.mockClear();\n });\n\n it('should render Concept (DRAFT)', () => {\n render(<VarIndicator label={LABELS} variant=\"DRAFT\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (REJECTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"REJECTED\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (ACTIVE)', () => {\n render(<VarIndicator label={LABELS} variant=\"ACTIVE\" />);\n expect(screen.getByText('Actief')).toBeInTheDocument();\n });\n\n it('should render dots (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={0} />);\n expect(screen.getByText('Verificatie')).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(3);\n expect(screen.queryByTestId('CircleSmallFilled')).not.toBeInTheDocument();\n });\n\n it('should render filled dots when currentStep != 0 (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={1} onClick={onClickSpy} />);\n const verificationButton = screen.getByText('Verificatie');\n expect(verificationButton).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n });\n\n it('should render filled dots currentStep is updated (SUBMITTED)', async () => {\n render(<TestWrapper />);\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n const verificationButton = screen.getByText('Verificatie');\n await userEvent.click(verificationButton);\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(2);\n });\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(1);\n });\n });\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"VarIndicator.test.js","names":[],"sources":["../../../src/components/VarIndicator/VarIndicator.test.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport '@testing-library/jest-dom';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { useState } from 'react';\n\nimport { VarIndicator } from './VarIndicator';\n\nconst LABELS = {\n DRAFT: 'Concept',\n REJECTED: 'Concept',\n SUBMITTED: 'Verificatie',\n ACTIVE: 'Actief',\n};\n\njest.mock('components/Icon', () => ({\n Icon: ({ name }: { name: string }) => <svg data-testid={name} />,\n}));\n\nconst TestWrapper = () => {\n const [currentStep, setCurrentStep] = useState(1);\n return (\n // When clicked the onClick callback updates currentStep from 1 to 2.\n <VarIndicator\n label={LABELS}\n variant=\"SUBMITTED\"\n maxSteps={3}\n currentStep={currentStep}\n onClick={() => setCurrentStep(2)}\n />\n );\n};\n\ndescribe('VarIndicator', () => {\n const onClickSpy = jest.fn();\n\n beforeEach(() => {\n onClickSpy.mockClear();\n });\n\n it('should render Concept (DRAFT)', () => {\n render(<VarIndicator label={LABELS} variant=\"DRAFT\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (REJECTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"REJECTED\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (ACTIVE)', () => {\n render(<VarIndicator label={LABELS} variant=\"ACTIVE\" />);\n expect(screen.getByText('Actief')).toBeInTheDocument();\n });\n\n it('should render dots (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={0} />);\n expect(screen.getByText('Verificatie')).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(3);\n expect(screen.queryByTestId('CircleSmallFilled')).not.toBeInTheDocument();\n });\n\n it('should render filled dots when currentStep != 0 (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={1} onClick={onClickSpy} />);\n const verificationButton = screen.getByText('Verificatie');\n expect(verificationButton).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n });\n\n it('should render filled dots currentStep is updated (SUBMITTED)', async () => {\n render(<TestWrapper />);\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n const verificationButton = screen.getByText('Verificatie');\n await userEvent.click(verificationButton);\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(2);\n });\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(1);\n });\n });\n});\n"],"mappings":";;;;;;;;AAQA,IAAM,IAAS;CACb,OAAO;CACP,UAAU;CACV,WAAW;CACX,QAAQ;AACV;AAEA,KAAK,KAAK,0BAA0B,EAClC,OAAO,EAAE,cAA6B,kBAAC,OAAD,EAAK,eAAa,EAAO,CAAA,EACjE,EAAE;AAEF,IAAM,UAAoB;CACxB,IAAM,CAAC,GAAa,KAAkB,EAAS,CAAC;CAChD,OAEE,kBAAC,GAAD;EACE,OAAO;EACP,SAAQ;EACR,UAAU;EACG;EACb,eAAe,EAAe,CAAC;CAChC,CAAA;AAEL;AAEA,SAAS,sBAAsB;CAC7B,IAAM,IAAa,KAAK,GAAG;CAoC3B,AAlCA,iBAAiB;EACf,EAAW,UAAU;CACvB,CAAC,GAED,GAAG,uCAAuC;EAExC,AADA,EAAO,kBAAC,GAAD;GAAc,OAAO;GAAQ,SAAQ;EAAS,CAAA,CAAC,GACtD,OAAO,EAAO,UAAU,SAAS,CAAC,CAAC,CAAC,kBAAkB;CACxD,CAAC,GAED,GAAG,0CAA0C;EAE3C,AADA,EAAO,kBAAC,GAAD;GAAc,OAAO;GAAQ,SAAQ;EAAY,CAAA,CAAC,GACzD,OAAO,EAAO,UAAU,SAAS,CAAC,CAAC,CAAC,kBAAkB;CACxD,CAAC,GAED,GAAG,wCAAwC;EAEzC,AADA,EAAO,kBAAC,GAAD;GAAc,OAAO;GAAQ,SAAQ;EAAU,CAAA,CAAC,GACvD,OAAO,EAAO,UAAU,QAAQ,CAAC,CAAC,CAAC,kBAAkB;CACvD,CAAC,GAED,GAAG,wCAAwC;EAIzC,AAHA,EAAO,kBAAC,GAAD;GAAc,OAAO;GAAQ,SAAQ;GAAY,UAAU;GAAG,aAAa;EAAI,CAAA,CAAC,GACvF,OAAO,EAAO,UAAU,aAAa,CAAC,CAAC,CAAC,kBAAkB,GAC1D,OAAO,EAAO,eAAe,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,GAC3D,OAAO,EAAO,cAAc,mBAAmB,CAAC,CAAC,CAAC,IAAI,kBAAkB;CAC1E,CAAC,GAED,GAAG,qEAAqE;EACtE,EAAO,kBAAC,GAAD;GAAc,OAAO;GAAQ,SAAQ;GAAY,UAAU;GAAG,aAAa;GAAG,SAAS;EAAa,CAAA,CAAC;EAC5G,IAAM,IAAqB,EAAO,UAAU,aAAa;EAGzD,AAFA,OAAO,CAAkB,CAAC,CAAC,kBAAkB,GAC7C,OAAO,EAAO,eAAe,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,GACjE,OAAO,EAAO,eAAe,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;CAC7D,CAAC,GAED,GAAG,gEAAgE,YAAY;EAG7E,AAFA,EAAO,kBAAC,GAAD,CAAc,CAAA,CAAC,GACtB,OAAO,EAAO,eAAe,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,GACjE,OAAO,EAAO,eAAe,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;EAC3D,IAAM,IAAqB,EAAO,UAAU,aAAa;EAKzD,AAJA,MAAM,EAAU,MAAM,CAAkB,GACxC,MAAM,QAAc;GAClB,OAAO,EAAO,eAAe,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC;EACnE,CAAC,GACD,MAAM,QAAc;GAClB,OAAO,EAAO,eAAe,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;EAC7D,CAAC;CACH,CAAC;AACH,CAAC"}
|
|
@@ -8,7 +8,7 @@ var n = {
|
|
|
8
8
|
xl: 1200,
|
|
9
9
|
xxl: 1400
|
|
10
10
|
}, r = () => {
|
|
11
|
-
let r = (e, t) => t ? `(min-width: ${e}px)` : `(max-width: ${e - 1}px)`, i = (e) => typeof window < "u"
|
|
11
|
+
let r = (e, t) => t ? `(min-width: ${e}px)` : `(max-width: ${e - 1}px)`, i = (e) => typeof window < "u" && window.matchMedia(e).matches, a = () => {
|
|
12
12
|
let e = {
|
|
13
13
|
xs: !1,
|
|
14
14
|
sm: !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResponsive.js","names":[],"sources":["../../../src/components/hooks/useResponsive.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst BREAKPOINTS = {\n xs: 375,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400,\n};\n\ntype BreakpointState = Record<keyof typeof BREAKPOINTS, boolean>;\ntype InitialBreakpoints = keyof typeof BREAKPOINTS | '_initial';\ntype Orientation = 'portrait' | 'landscape' | null;\ntype ResponsiveState = {\n greaterThan: BreakpointState;\n lessThan: BreakpointState;\n orientation: Orientation;\n mediaType: InitialBreakpoints;\n};\n\nexport const useResponsive = (): ResponsiveState => {\n const getMediaQuery = (size: number, greater: boolean): string => {\n return greater ? `(min-width: ${size}px)` : `(max-width: ${size - 1}px)`;\n };\n\n const getMatches = (query: string) => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(query).matches;\n }\n return false;\n };\n\n const createResponsiveObject = () => {\n const initialBreakpointState: BreakpointState = {\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false,\n };\n\n const greaterThan = { ...initialBreakpointState };\n const lessThan = { ...initialBreakpointState };\n\n Object.entries(BREAKPOINTS).forEach(([key, size]) => {\n greaterThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, true));\n lessThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, false));\n });\n\n const orientation: Orientation = getMatches('(orientation: portrait)')\n ? 'portrait'\n : getMatches('(orientation: landscape)')\n ? 'landscape'\n : null;\n\n const mediaType = (Object.keys(greaterThan).findLast((key) => greaterThan[key as keyof typeof greaterThan]) ||\n '_initial') as InitialBreakpoints;\n\n return { greaterThan, lessThan, orientation, mediaType };\n };\n\n const [responsive, setResponsive] = useState(createResponsiveObject());\n\n useEffect(() => {\n const handleChange = () => setResponsive(createResponsiveObject());\n\n window.addEventListener('resize', handleChange);\n\n return () => window.removeEventListener('resize', handleChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return responsive;\n};\n"],"mappings":";;AAEA,IAAM,IAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;AACP,GAYa,UAAuC;CAClD,IAAM,KAAiB,GAAc,MAC5B,IAAU,eAAe,EAAK,OAAO,eAAe,IAAO,EAAE,MAGhE,KAAc,MACd,OAAO,SAAW,
|
|
1
|
+
{"version":3,"file":"useResponsive.js","names":[],"sources":["../../../src/components/hooks/useResponsive.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst BREAKPOINTS = {\n xs: 375,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400,\n};\n\ntype BreakpointState = Record<keyof typeof BREAKPOINTS, boolean>;\ntype InitialBreakpoints = keyof typeof BREAKPOINTS | '_initial';\ntype Orientation = 'portrait' | 'landscape' | null;\ntype ResponsiveState = {\n greaterThan: BreakpointState;\n lessThan: BreakpointState;\n orientation: Orientation;\n mediaType: InitialBreakpoints;\n};\n\nexport const useResponsive = (): ResponsiveState => {\n const getMediaQuery = (size: number, greater: boolean): string => {\n return greater ? `(min-width: ${size}px)` : `(max-width: ${size - 1}px)`;\n };\n\n const getMatches = (query: string) => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(query).matches;\n }\n return false;\n };\n\n const createResponsiveObject = () => {\n const initialBreakpointState: BreakpointState = {\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false,\n };\n\n const greaterThan = { ...initialBreakpointState };\n const lessThan = { ...initialBreakpointState };\n\n Object.entries(BREAKPOINTS).forEach(([key, size]) => {\n greaterThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, true));\n lessThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, false));\n });\n\n const orientation: Orientation = getMatches('(orientation: portrait)')\n ? 'portrait'\n : getMatches('(orientation: landscape)')\n ? 'landscape'\n : null;\n\n const mediaType = (Object.keys(greaterThan).findLast((key) => greaterThan[key as keyof typeof greaterThan]) ||\n '_initial') as InitialBreakpoints;\n\n return { greaterThan, lessThan, orientation, mediaType };\n };\n\n const [responsive, setResponsive] = useState(createResponsiveObject());\n\n useEffect(() => {\n const handleChange = () => setResponsive(createResponsiveObject());\n\n window.addEventListener('resize', handleChange);\n\n return () => window.removeEventListener('resize', handleChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return responsive;\n};\n"],"mappings":";;AAEA,IAAM,IAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;AACP,GAYa,UAAuC;CAClD,IAAM,KAAiB,GAAc,MAC5B,IAAU,eAAe,EAAK,OAAO,eAAe,IAAO,EAAE,MAGhE,KAAc,MACd,OAAO,SAAW,OACb,OAAO,WAAW,CAAK,CAAC,CAAC,SAK9B,UAA+B;EACnC,IAAM,IAA0C;GAC9C,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,KAAK;EACP,GAEM,IAAc,EAAE,GAAG,EAAuB,GAC1C,IAAW,EAAE,GAAG,EAAuB;EAgB7C,OAdA,OAAO,QAAQ,CAAW,CAAC,CAAC,SAAS,CAAC,GAAK,OAAU;GAEnD,AADA,EAAY,KAAmC,EAAW,EAAc,GAAM,EAAI,CAAC,GACnF,EAAS,KAAmC,EAAW,EAAc,GAAM,EAAK,CAAC;EACnF,CAAC,GAWM;GAAE;GAAa;GAAU,aATC,EAAW,yBAAyB,IACjE,aACA,EAAW,0BAA0B,IACnC,cACA;GAKuC,WAH1B,OAAO,KAAK,CAAW,CAAC,CAAC,UAAU,MAAQ,EAAY,EAAgC,KACxG;EAEqD;CACzD,GAEM,CAAC,GAAY,KAAiB,EAAS,EAAuB,CAAC;CAWrE,OATA,QAAgB;EACd,IAAM,UAAqB,EAAc,EAAuB,CAAC;EAIjE,OAFA,OAAO,iBAAiB,UAAU,CAAY,SAEjC,OAAO,oBAAoB,UAAU,CAAY;CAEhE,GAAG,CAAC,CAAC,GAEE;AACT"}
|
package/dist/components/index.js
CHANGED
|
@@ -17,16 +17,16 @@ import { t as h } from "../CheckboxButtonBar-OrJSqUTN.js";
|
|
|
17
17
|
import { t as g } from "../Label-52ny6d06.js";
|
|
18
18
|
import { t as _ } from "../FeedbackBox-BpOf_dxg.js";
|
|
19
19
|
import { t as v } from "../ControlsButton-Byx4XQtB.js";
|
|
20
|
-
import { d as y, f as b, h as x, m as S, n as C, t as w, u as T } from "../components-
|
|
20
|
+
import { d as y, f as b, h as x, m as S, n as C, t as w, u as T } from "../components-D2rPfyIW.js";
|
|
21
21
|
import { t as E } from "../Chip-9XnXFhoJ.js";
|
|
22
22
|
import { t as D } from "../CopyableText-BKsM-TuS.js";
|
|
23
|
-
import { t as O } from "../DataTable-
|
|
23
|
+
import { t as O } from "../DataTable-UslvEf3c.js";
|
|
24
24
|
import { t as k } from "../Drawer-fUw0LEuj.js";
|
|
25
25
|
import { t as A } from "../OverlayCloseButton-Dt6Yec8G.js";
|
|
26
26
|
import { t as j } from "../EmptyStateDataDisplay-FBDAGO88.js";
|
|
27
27
|
import { t as M } from "../ExpandableInfoPanel-BmbgbAjf.js";
|
|
28
|
-
import { t as N } from "../FeedbackBar-
|
|
29
|
-
import { t as P } from "../Repeater-
|
|
28
|
+
import { t as N } from "../FeedbackBar-DsOWAAGt.js";
|
|
29
|
+
import { t as P } from "../Repeater-DUo13Mq6.js";
|
|
30
30
|
import { t as F } from "../FieldHint-FEBzgLI_.js";
|
|
31
31
|
import { t as I } from "../Spinner-BmPjd2Bv.js";
|
|
32
32
|
import { t as L } from "../Fieldset-CgnLyAyS.js";
|
|
@@ -53,7 +53,7 @@ import { t as re } from "../RadioGroup-DlQjMmpa.js";
|
|
|
53
53
|
import { SearchField as ie } from "./SearchField/SearchField.js";
|
|
54
54
|
import { SelectProvider as ae, useSelect as oe } from "./SelectListbox/SelectProvider.js";
|
|
55
55
|
import { SelectListbox as se } from "./SelectListbox/SelectListbox.js";
|
|
56
|
-
import { t as ce } from "../Slider-
|
|
56
|
+
import { t as ce } from "../Slider-CqYFsgRL.js";
|
|
57
57
|
import { Sortable as le } from "./Sortable/Sortable.js";
|
|
58
58
|
import { t as ue } from "../StatusBage-hJmNPqtk.js";
|
|
59
59
|
import { t as de } from "../StatusPill-vdqU92pW.js";
|