quirk-ui 0.1.73 → 0.1.76
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/AccordionItem.css.d.ts +13 -0
- package/dist/{CategoryFilters-CIWwf9VY.js → CategoryFilters-Dvx_tFs9.js} +1 -1
- package/dist/{CategoryFilters-CvmFCE3e.cjs → CategoryFilters-jaBdSByQ.cjs} +1 -1
- package/dist/CategoryFilters.css.d.ts +31 -0
- package/dist/FormField-BO1hKjUb.js +228 -0
- package/dist/FormField-wfYSN1Vd.cjs +1 -0
- package/dist/FormField.css +1 -0
- package/dist/FormField.css.d.ts +22 -0
- package/dist/HeroSubComponents.css.d.ts +30 -0
- package/dist/NavLink.css.d.ts +72 -0
- package/dist/core/components/Accordion/Accordion.test.cjs +1 -1
- package/dist/core/components/Accordion/Accordion.test.mjs +1 -1
- package/dist/core/components/Accordion/AccordionItem.test.cjs +1 -1
- package/dist/core/components/Accordion/AccordionItem.test.mjs +1 -1
- package/dist/core/components/Avatar/Avatar.test.cjs +1 -1
- package/dist/core/components/Avatar/Avatar.test.mjs +1 -1
- package/dist/core/components/Badge/Badge.test.cjs +1 -1
- package/dist/core/components/Badge/Badge.test.mjs +1 -1
- package/dist/core/components/Badge/index.cjs +1 -1
- package/dist/core/components/Badge/index.mjs +1 -1
- package/dist/core/components/Box/Box.test.cjs +1 -1
- package/dist/core/components/Box/Box.test.mjs +1 -1
- package/dist/core/components/Box/index.cjs +1 -1
- package/dist/core/components/Box/index.mjs +1 -1
- package/dist/core/components/Breadcrumbs/Breadcrumbs.test.cjs +1 -1
- package/dist/core/components/Breadcrumbs/Breadcrumbs.test.mjs +1 -1
- package/dist/core/components/Breadcrumbs/index.cjs +1 -1
- package/dist/core/components/Breadcrumbs/index.mjs +1 -1
- package/dist/core/components/Button/Button.test.cjs +1 -1
- package/dist/core/components/Button/Button.test.mjs +2 -2
- package/dist/core/components/Button/index.cjs +1 -1
- package/dist/core/components/Button/index.mjs +1 -1
- package/dist/core/components/ButtonGroup/ButtonGroup.test.cjs +1 -1
- package/dist/core/components/ButtonGroup/ButtonGroup.test.mjs +1 -1
- package/dist/core/components/Calendar/Calendar.test.cjs +1 -1
- package/dist/core/components/Calendar/Calendar.test.mjs +2 -2
- package/dist/core/components/Calendar/index.cjs +1 -1
- package/dist/core/components/Calendar/index.mjs +1 -1
- package/dist/core/components/Card/Card.test.cjs +1 -1
- package/dist/core/components/Card/Card.test.mjs +1 -1
- package/dist/core/components/Card/index.cjs +1 -1
- package/dist/core/components/Card/index.mjs +1 -1
- package/dist/core/components/Carousel/Carousel.test.cjs +1 -1
- package/dist/core/components/Carousel/Carousel.test.mjs +1 -1
- package/dist/core/components/Checkbox/Checkbox.test.cjs +1 -1
- package/dist/core/components/Checkbox/Checkbox.test.mjs +1 -1
- package/dist/core/components/Container/Container.test.cjs +1 -1
- package/dist/core/components/Container/Container.test.mjs +1 -1
- package/dist/core/components/Container/index.cjs +1 -1
- package/dist/core/components/Container/index.mjs +1 -1
- package/dist/core/components/DatePicker/DatePicker.test.cjs +1 -1
- package/dist/core/components/DatePicker/DatePicker.test.mjs +2 -2
- package/dist/core/components/DatePicker/index.cjs +1 -1
- package/dist/core/components/DatePicker/index.mjs +2 -2
- package/dist/core/components/Divider/Divider.test.cjs +1 -1
- package/dist/core/components/Divider/Divider.test.mjs +1 -1
- package/dist/core/components/Divider/index.cjs +1 -1
- package/dist/core/components/Divider/index.mjs +1 -1
- package/dist/core/components/Drawer/Drawer.test.cjs +1 -1
- package/dist/core/components/Drawer/Drawer.test.mjs +1 -1
- package/dist/core/components/Drawer/index.cjs +1 -1
- package/dist/core/components/Drawer/index.mjs +1 -1
- package/dist/core/components/Fieldset/Fieldset.test.cjs +1 -1
- package/dist/core/components/Fieldset/Fieldset.test.mjs +1 -1
- package/dist/core/components/Fieldset/index.cjs +1 -1
- package/dist/core/components/Fieldset/index.mjs +1 -1
- package/dist/core/components/FileUpload/FileUpload.test.cjs +1 -1
- package/dist/core/components/FileUpload/FileUpload.test.mjs +1 -1
- package/dist/core/components/FileUpload/index.cjs +1 -1
- package/dist/core/components/FileUpload/index.mjs +1 -1
- package/dist/core/components/FloatingActionButton/FloatingActionButton.test.cjs +1 -1
- package/dist/core/components/FloatingActionButton/FloatingActionButton.test.mjs +1 -1
- package/dist/core/components/FloatingActionButton/index.cjs +1 -1
- package/dist/core/components/FloatingActionButton/index.mjs +1 -1
- package/dist/core/components/Footer/Footer.test.cjs +1 -1
- package/dist/core/components/Footer/Footer.test.mjs +1 -1
- package/dist/core/components/Footer/index.cjs +1 -1
- package/dist/core/components/Footer/index.mjs +2 -2
- package/dist/core/components/Form/Form.test.cjs +1 -1
- package/dist/core/components/Form/Form.test.mjs +1 -1
- package/dist/core/components/Form/index.cjs +1 -1
- package/dist/core/components/Form/index.mjs +1 -1
- package/dist/core/components/Grid/Grid.test.cjs +1 -1
- package/dist/core/components/Grid/Grid.test.mjs +1 -1
- package/dist/core/components/Heading/Heading.test.cjs +1 -1
- package/dist/core/components/Heading/Heading.test.mjs +1 -1
- package/dist/core/components/Input/Input.test.cjs +1 -1
- package/dist/core/components/Input/Input.test.mjs +1 -1
- package/dist/core/components/Input/index.cjs +1 -1
- package/dist/core/components/Input/index.mjs +25 -31
- package/dist/core/components/Label/Label.test.cjs +1 -1
- package/dist/core/components/Label/Label.test.mjs +1 -1
- package/dist/core/components/Label/index.cjs +1 -1
- package/dist/core/components/Label/index.mjs +1 -1
- package/dist/core/components/List/List.test.cjs +1 -1
- package/dist/core/components/List/List.test.mjs +1 -1
- package/dist/core/components/List/index.cjs +1 -1
- package/dist/core/components/List/index.mjs +1 -1
- package/dist/core/components/Modal/Modal.test.cjs +1 -1
- package/dist/core/components/Modal/Modal.test.mjs +1 -1
- package/dist/core/components/Modal/index.cjs +1 -1
- package/dist/core/components/Modal/index.mjs +1 -1
- package/dist/core/components/NavBar/NavBar.test.cjs +1 -1
- package/dist/core/components/NavBar/NavBar.test.mjs +1 -1
- package/dist/core/components/NavBar/index.cjs +1 -1
- package/dist/core/components/NavBar/index.mjs +1 -1
- package/dist/core/components/Notification/Notification.test.cjs +1 -1
- package/dist/core/components/Notification/Notification.test.mjs +1 -1
- package/dist/core/components/Notification/index.cjs +1 -1
- package/dist/core/components/Notification/index.mjs +1 -1
- package/dist/core/components/NotificationContainer/NotificationContainer.test.cjs +1 -1
- package/dist/core/components/NotificationContainer/NotificationContainer.test.mjs +1 -1
- package/dist/core/components/NotificationContainer/index.cjs +1 -1
- package/dist/core/components/NotificationContainer/index.mjs +1 -1
- package/dist/core/components/ProgressBar/ProgressBar.test.cjs +1 -1
- package/dist/core/components/ProgressBar/ProgressBar.test.mjs +1 -1
- package/dist/core/components/ProgressBar/index.cjs +1 -1
- package/dist/core/components/ProgressBar/index.mjs +1 -1
- package/dist/core/components/Radio/Radio.test.cjs +1 -1
- package/dist/core/components/Radio/Radio.test.mjs +1 -1
- package/dist/core/components/Radio/index.cjs +1 -1
- package/dist/core/components/Radio/index.mjs +1 -1
- package/dist/core/components/Range/Range.test.cjs +1 -1
- package/dist/core/components/Range/Range.test.mjs +1 -1
- package/dist/core/components/Range/index.cjs +1 -1
- package/dist/core/components/Range/index.mjs +1 -1
- package/dist/core/components/Select/Select.test.cjs +1 -1
- package/dist/core/components/Select/Select.test.mjs +176 -106
- package/dist/core/components/Select/index.cjs +1 -1
- package/dist/core/components/Select/index.mjs +100 -80
- package/dist/core/components/Sidebar/Sidebar.test.cjs +1 -1
- package/dist/core/components/Sidebar/Sidebar.test.mjs +1 -1
- package/dist/core/components/Sidebar/index.cjs +1 -1
- package/dist/core/components/Sidebar/index.mjs +1 -1
- package/dist/core/components/Skeleton/Skeleton.test.cjs +1 -1
- package/dist/core/components/Skeleton/Skeleton.test.mjs +1 -1
- package/dist/core/components/Spacer/Spacer.test.cjs +1 -1
- package/dist/core/components/Spacer/Spacer.test.mjs +1 -1
- package/dist/core/components/Spinner/Spinner.test.cjs +1 -1
- package/dist/core/components/Spinner/Spinner.test.mjs +1 -1
- package/dist/core/components/Stack/Stack.test.cjs +1 -1
- package/dist/core/components/Stack/Stack.test.mjs +1 -1
- package/dist/core/components/Switch/Switch.test.cjs +1 -1
- package/dist/core/components/Switch/Switch.test.mjs +1 -1
- package/dist/core/components/Table/Table.test.cjs +1 -1
- package/dist/core/components/Table/Table.test.mjs +1 -1
- package/dist/core/components/Tabs/Tabs.test.cjs +1 -1
- package/dist/core/components/Tabs/Tabs.test.mjs +1 -1
- package/dist/core/components/Text/Text.test.cjs +1 -1
- package/dist/core/components/Text/Text.test.mjs +1 -1
- package/dist/core/components/Textarea/Textarea.test.cjs +1 -1
- package/dist/core/components/Textarea/Textarea.test.mjs +1 -1
- package/dist/core/components/Textarea/index.cjs +1 -1
- package/dist/core/components/Textarea/index.mjs +1 -1
- package/dist/core/components/Tooltip/Tooltip.test.cjs +1 -1
- package/dist/core/components/Tooltip/Tooltip.test.mjs +1 -1
- package/dist/core/components/Tooltip/index.cjs +1 -1
- package/dist/core/components/Tooltip/index.mjs +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +30 -43
- package/dist/core.mjs +42 -44
- package/dist/{index-BQV8LRFm.js → index-Ck6GdALV.js} +0 -1
- package/dist/{index-DITXfOUM.cjs → index-CvpbNrYS.cjs} +16 -16
- package/dist/{index-2ZLA4POI.js → index-DTDGFsW8.js} +1 -1
- package/dist/{index-D0ylyll7.cjs → index-hPJqlEOh.cjs} +1 -1
- package/dist/{index-CnlJ2RgH.js → index-paelIj6o.js} +1 -1
- package/dist/{index-odc0vuSq.cjs → index-rFLvzU5A.cjs} +1 -1
- package/dist/index.css.d.ts +1 -0
- package/dist/index10.css.d.ts +7 -0
- package/dist/index11.css.d.ts +26 -0
- package/dist/index12.css.d.ts +24 -0
- package/dist/index13.css.d.ts +33 -0
- package/dist/index14.css.d.ts +10 -0
- package/dist/index15.css.d.ts +18 -0
- package/dist/index16.css.d.ts +38 -0
- package/dist/index17.css.d.ts +16 -0
- package/dist/index18.css.d.ts +14 -0
- package/dist/index19.css.d.ts +17 -0
- package/dist/index2.css.d.ts +9 -0
- package/dist/index20.css.d.ts +13 -0
- package/dist/index21.css.d.ts +25 -0
- package/dist/index22.css.d.ts +5 -0
- package/dist/index23.css.d.ts +19 -0
- package/dist/index24.css.d.ts +21 -0
- package/dist/index25.css +1 -1
- package/dist/index25.css.d.ts +16 -0
- package/dist/index26.css.d.ts +10 -0
- package/dist/index27.css.d.ts +18 -0
- package/dist/index28.css.d.ts +16 -0
- package/dist/index29.css.d.ts +10 -0
- package/dist/index3.css.d.ts +12 -0
- package/dist/index30.css.d.ts +19 -0
- package/dist/index31.css.d.ts +15 -0
- package/dist/index32.css.d.ts +22 -0
- package/dist/index33.css.d.ts +15 -0
- package/dist/index34.css +1 -1
- package/dist/index34.css.d.ts +14 -0
- package/dist/index35.css +1 -1
- package/dist/index35.css.d.ts +23 -0
- package/dist/index36.css +1 -1
- package/dist/index36.css.d.ts +14 -0
- package/dist/index37.css +1 -1
- package/dist/index37.css.d.ts +18 -0
- package/dist/index38.css +1 -1
- package/dist/index38.css.d.ts +21 -0
- package/dist/index39.css +1 -1
- package/dist/index39.css.d.ts +20 -0
- package/dist/index4.css.d.ts +10 -0
- package/dist/index40.css +1 -1
- package/dist/index40.css.d.ts +17 -0
- package/dist/index41.css +1 -1
- package/dist/index41.css.d.ts +14 -0
- package/dist/index42.css +1 -1
- package/dist/index42.css.d.ts +22 -0
- package/dist/index43.css +1 -1
- package/dist/index43.css.d.ts +35 -0
- package/dist/index44.css +1 -1
- package/dist/index44.css.d.ts +13 -0
- package/dist/index45.css +1 -1
- package/dist/index45.css.d.ts +23 -0
- package/dist/index46.css +1 -1
- package/dist/index46.css.d.ts +12 -0
- package/dist/index47.css +1 -1
- package/dist/index47.css.d.ts +19 -0
- package/dist/index48.css +1 -1
- package/dist/index48.css.d.ts +20 -0
- package/dist/index49.css +1 -1
- package/dist/index49.css.d.ts +20 -0
- package/dist/index5.css.d.ts +22 -0
- package/dist/index50.css +1 -1
- package/dist/index50.css.d.ts +27 -0
- package/dist/index51.css +1 -1
- package/dist/index51.css.d.ts +17 -0
- package/dist/index52.css +1 -1
- package/dist/index52.css.d.ts +11 -0
- package/dist/index53.css.d.ts +12 -0
- package/dist/index54.css.d.ts +14 -0
- package/dist/index55.css.d.ts +20 -0
- package/dist/index56.css.d.ts +25 -0
- package/dist/index57.css.d.ts +13 -0
- package/dist/index58.css +1 -1
- package/dist/index58.css.d.ts +12 -0
- package/dist/index59.css +1 -1
- package/dist/index59.css.d.ts +20 -0
- package/dist/index6.css.d.ts +19 -0
- package/dist/index60.css +1 -1
- package/dist/index60.css.d.ts +20 -0
- package/dist/index61.css +1 -1
- package/dist/index61.css.d.ts +18 -0
- package/dist/index62.css +1 -1
- package/dist/index62.css.d.ts +22 -0
- package/dist/index63.css +1 -1
- package/dist/index63.css.d.ts +28 -0
- package/dist/index64.css +1 -1
- package/dist/index64.css.d.ts +26 -0
- package/dist/index65.css +1 -1
- package/dist/index65.css.d.ts +19 -0
- package/dist/index7.css.d.ts +40 -0
- package/dist/index8.css.d.ts +32 -0
- package/dist/index9.css.d.ts +9 -0
- package/dist/main.cjs +1 -1
- package/dist/main.d.ts +48 -43
- package/dist/main.mjs +94 -94
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.mjs +2 -2
- package/dist/next/blocks/DocumentListBlock/index.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/index.mjs +2 -2
- package/dist/next/blocks/FormBlock/FormField.cjs +1 -0
- package/dist/next/blocks/FormBlock/FormField.mjs +13 -0
- package/dist/next/blocks/FormBlock/index.cjs +1 -0
- package/dist/next/blocks/FormBlock/index.mjs +192 -0
- package/dist/next/blocks/FormBlock/validate.cjs +1 -0
- package/dist/next/blocks/FormBlock/validate.mjs +76 -0
- package/dist/next/blocks/TabsBlock/index.cjs +1 -1
- package/dist/next/blocks/TabsBlock/index.mjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/index.cjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/index.mjs +1 -1
- package/dist/next/cards/BlogArticleCard/index.cjs +1 -1
- package/dist/next/cards/BlogArticleCard/index.mjs +1 -1
- package/dist/next/cards/SpotlightCard/index.cjs +1 -1
- package/dist/next/cards/SpotlightCard/index.mjs +1 -1
- package/dist/next/ui/CallToAction/index.cjs +1 -1
- package/dist/next/ui/CallToAction/index.mjs +1 -1
- package/dist/next.cjs +1 -1
- package/dist/next.d.ts +18 -0
- package/dist/next.mjs +45 -43
- package/dist/styles.css.d.ts +1 -0
- package/dist/tokens.css.d.ts +1 -0
- package/package.json +1 -1
- package/dist/core/components/MultiSelect/MultiSelect.test.cjs +0 -6
- package/dist/core/components/MultiSelect/MultiSelect.test.mjs +0 -3518
- package/dist/core/components/MultiSelect/__mocks__/styles.module.css.cjs +0 -1
- package/dist/core/components/MultiSelect/__mocks__/styles.module.css.mjs +0 -14
- package/dist/core/components/MultiSelect/index.cjs +0 -1
- package/dist/core/components/MultiSelect/index.mjs +0 -94
- package/dist/index66.css +0 -1
package/dist/main.mjs
CHANGED
|
@@ -6,17 +6,17 @@ import { Badge as i } from "./core/components/Badge/index.mjs";
|
|
|
6
6
|
import { Box as l } from "./core/components/Box/index.mjs";
|
|
7
7
|
import { Breadcrumbs as n } from "./core/components/Breadcrumbs/index.mjs";
|
|
8
8
|
import { ButtonGroup as C } from "./core/components/ButtonGroup/index.mjs";
|
|
9
|
-
import { B as
|
|
9
|
+
import { B as s } from "./index-paelIj6o.js";
|
|
10
10
|
import { Card as T } from "./core/components/Card/index.mjs";
|
|
11
|
-
import { Carousel as
|
|
11
|
+
import { Carousel as S } from "./core/components/Carousel/index.mjs";
|
|
12
12
|
import { Checkbox as h } from "./core/components/Checkbox/index.mjs";
|
|
13
13
|
import { Container as R } from "./core/components/Container/index.mjs";
|
|
14
|
-
import { DatePicker as
|
|
15
|
-
import { Divider as
|
|
14
|
+
import { DatePicker as F } from "./core/components/DatePicker/index.mjs";
|
|
15
|
+
import { Divider as P } from "./core/components/Divider/index.mjs";
|
|
16
16
|
import { Drawer as G } from "./core/components/Drawer/index.mjs";
|
|
17
17
|
import { Fieldset as w } from "./core/components/Fieldset/index.mjs";
|
|
18
18
|
import { FileUpload as N } from "./core/components/FileUpload/index.mjs";
|
|
19
|
-
import { FloatingActionButton as
|
|
19
|
+
import { FloatingActionButton as E } from "./core/components/FloatingActionButton/index.mjs";
|
|
20
20
|
import { Footer as Q } from "./core/components/Footer/index.mjs";
|
|
21
21
|
import { Form as W } from "./core/components/Form/index.mjs";
|
|
22
22
|
import { Grid as _ } from "./core/components/Grid/index.mjs";
|
|
@@ -25,51 +25,51 @@ import { Input as J } from "./core/components/Input/index.mjs";
|
|
|
25
25
|
import { Label as O } from "./core/components/Label/index.mjs";
|
|
26
26
|
import { List as X } from "./core/components/List/index.mjs";
|
|
27
27
|
import { Modal as $ } from "./core/components/Modal/index.mjs";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import { SpotlightCard as
|
|
28
|
+
import { Navbar as ro } from "./core/components/NavBar/index.mjs";
|
|
29
|
+
import { Notification as to } from "./core/components/Notification/index.mjs";
|
|
30
|
+
import { NotificationContainer as mo } from "./core/components/NotificationContainer/index.mjs";
|
|
31
|
+
import { ProgressBar as fo } from "./core/components/ProgressBar/index.mjs";
|
|
32
|
+
import { Radio as io } from "./core/components/Radio/index.mjs";
|
|
33
|
+
import { Range as lo } from "./core/components/Range/index.mjs";
|
|
34
|
+
import { Select as Bo } from "./core/components/Select/index.mjs";
|
|
35
|
+
import { Sidebar as ko } from "./core/components/Sidebar/index.mjs";
|
|
36
|
+
import { Skeleton as uo } from "./core/components/Skeleton/index.mjs";
|
|
37
|
+
import { Spacer as Ao } from "./core/components/Spacer/index.mjs";
|
|
38
|
+
import { Spinner as go } from "./core/components/Spinner/index.mjs";
|
|
39
|
+
import { Stack as vo } from "./core/components/Stack/index.mjs";
|
|
40
|
+
import { Switch as bo } from "./core/components/Switch/index.mjs";
|
|
41
|
+
import { Table as Lo } from "./core/components/Table/index.mjs";
|
|
42
|
+
import { Tabs as Do } from "./core/components/Tabs/index.mjs";
|
|
43
|
+
import { Text as Ho } from "./core/components/Text/index.mjs";
|
|
44
|
+
import { Textarea as Io } from "./core/components/Textarea/index.mjs";
|
|
45
|
+
import { Tooltip as yo } from "./core/components/Tooltip/index.mjs";
|
|
46
|
+
import { ThemeProvider as Mo } from "./core/utils/ThemeProvider/index.mjs";
|
|
47
|
+
import { AccordionBlock as Uo } from "./next/blocks/AccordionBlock/index.mjs";
|
|
48
|
+
import { AdditionalCategoriesBlock as Yo } from "./next/blocks/AdditionalCategoriesBlock/index.mjs";
|
|
49
|
+
import { CardGridBlock as jo } from "./next/blocks/CardGridBlock/index.mjs";
|
|
50
|
+
import { CarouselBlock as zo } from "./next/blocks/CarouselBlock/index.mjs";
|
|
51
|
+
import { ContentBlock as Ko } from "./next/blocks/ContentBlock/index.mjs";
|
|
52
|
+
import { DocumentListBlock as Vo } from "./next/blocks/DocumentListBlock/index.mjs";
|
|
53
|
+
import { FeaturedDocumentsBlock as Zo } from "./next/blocks/FeaturedDocumentsBlock/index.mjs";
|
|
54
|
+
import { HeroBlock as or } from "./next/blocks/HeroBlock/index.mjs";
|
|
55
|
+
import { HeroProvider as er, useHeroContext as tr } from "./next/blocks/HeroBlock/HeroContext.mjs";
|
|
56
|
+
import { LocaleLink as mr } from "./next/ui/LocaleLink/index.mjs";
|
|
57
|
+
import { QuoteBlock as fr } from "./next/blocks/QuoteBlock/index.mjs";
|
|
58
|
+
import { RichTextBlock as ir } from "./next/blocks/RichTextBlock/index.mjs";
|
|
59
|
+
import { RichText as lr } from "./next/ui/PortableTextRenderer/index.mjs";
|
|
60
|
+
import { StickyScrollBlock as nr } from "./next/blocks/StickyScrollBlock/index.mjs";
|
|
61
|
+
import { TabsBlock as Cr } from "./next/blocks/TabsBlock/index.mjs";
|
|
62
|
+
import { WasHelpfulBlock as sr } from "./next/blocks/WasHelpfulBlock/index.mjs";
|
|
63
|
+
import { FormBlock as Tr } from "./next/blocks/FormBlock/index.mjs";
|
|
64
|
+
import { SpotlightCard as Sr } from "./next/cards/SpotlightCard/index.mjs";
|
|
65
65
|
import { BlogArticleCard as hr } from "./next/cards/BlogArticleCard/index.mjs";
|
|
66
66
|
import { SpotlightCardAdapter as Rr } from "./next/cards/SpotlightCardAdapter.mjs";
|
|
67
|
-
import { BlogArticleCardAdapter as
|
|
68
|
-
import { CARD_REGISTRY as
|
|
67
|
+
import { BlogArticleCardAdapter as Fr } from "./next/cards/BlogArticleCardAdapter.mjs";
|
|
68
|
+
import { CARD_REGISTRY as Pr, resolveCard as Dr } from "./next/cards/cardRegistry.mjs";
|
|
69
69
|
import { BioCard as Hr } from "./next/cards/BioCard/index.mjs";
|
|
70
70
|
import { GridCard as Ir } from "./next/cards/GridCard/index.mjs";
|
|
71
|
-
import { ProductCard as
|
|
72
|
-
import { ReviewCard as
|
|
71
|
+
import { ProductCard as yr } from "./next/cards/ProductCard/index.mjs";
|
|
72
|
+
import { ReviewCard as Mr } from "./next/cards/ReviewCard/index.mjs";
|
|
73
73
|
import { SegmentCard as Ur } from "./next/cards/SegmentCard/index.mjs";
|
|
74
74
|
import { ServiceCard as Yr } from "./next/cards/ServiceCard/index.mjs";
|
|
75
75
|
import { TestimonialCard as jr } from "./next/cards/TestimonialCard/index.mjs";
|
|
@@ -78,86 +78,86 @@ import { AppThemeProvider as Or, useTheme as Vr } from "./core/context/ThemeCont
|
|
|
78
78
|
import { extractText as Zr, renderCallToAction as $r, renderRichText as oe } from "./next/utils/blockRenderers.mjs";
|
|
79
79
|
export {
|
|
80
80
|
t as Accordion,
|
|
81
|
-
|
|
81
|
+
Uo as AccordionBlock,
|
|
82
82
|
m as AccordionItem,
|
|
83
|
-
|
|
83
|
+
Yo as AdditionalCategoriesBlock,
|
|
84
84
|
Or as AppThemeProvider,
|
|
85
85
|
f as Avatar,
|
|
86
86
|
i as Badge,
|
|
87
87
|
Hr as BioCard,
|
|
88
88
|
hr as BlogArticleCard,
|
|
89
|
-
|
|
89
|
+
Fr as BlogArticleCardAdapter,
|
|
90
90
|
l as Box,
|
|
91
91
|
n as Breadcrumbs,
|
|
92
|
-
|
|
92
|
+
s as Button,
|
|
93
93
|
C as ButtonGroup,
|
|
94
|
-
|
|
94
|
+
Pr as CARD_REGISTRY,
|
|
95
95
|
T as Card,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
jo as CardGridBlock,
|
|
97
|
+
S as Carousel,
|
|
98
|
+
zo as CarouselBlock,
|
|
99
99
|
h as Checkbox,
|
|
100
100
|
R as Container,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
Ko as ContentBlock,
|
|
102
|
+
F as DatePicker,
|
|
103
|
+
P as Divider,
|
|
104
|
+
Vo as DocumentListBlock,
|
|
105
105
|
G as Drawer,
|
|
106
|
-
|
|
106
|
+
Zo as FeaturedDocumentsBlock,
|
|
107
107
|
w as Fieldset,
|
|
108
108
|
N as FileUpload,
|
|
109
|
-
|
|
109
|
+
E as FloatingActionButton,
|
|
110
110
|
Q as Footer,
|
|
111
111
|
W as Form,
|
|
112
|
+
Tr as FormBlock,
|
|
112
113
|
_ as Grid,
|
|
113
114
|
Ir as GridCard,
|
|
114
115
|
q as Heading,
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
or as HeroBlock,
|
|
117
|
+
er as HeroProvider,
|
|
117
118
|
J as Input,
|
|
118
119
|
O as Label,
|
|
119
120
|
X as List,
|
|
120
121
|
zr as LocaleBridgeProvider,
|
|
121
|
-
|
|
122
|
+
mr as LocaleLink,
|
|
122
123
|
$ as Modal,
|
|
123
|
-
ro as
|
|
124
|
-
to as
|
|
125
|
-
mo as
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
lo as
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
lr as RichTextBlock,
|
|
124
|
+
ro as Navbar,
|
|
125
|
+
to as Notification,
|
|
126
|
+
mo as NotificationContainer,
|
|
127
|
+
yr as ProductCard,
|
|
128
|
+
fo as ProgressBar,
|
|
129
|
+
fr as QuoteBlock,
|
|
130
|
+
io as Radio,
|
|
131
|
+
lo as Range,
|
|
132
|
+
Mr as ReviewCard,
|
|
133
|
+
lr as RichText,
|
|
134
|
+
ir as RichTextBlock,
|
|
135
135
|
Ur as SegmentCard,
|
|
136
|
-
|
|
136
|
+
Bo as Select,
|
|
137
137
|
Yr as ServiceCard,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
ko as Sidebar,
|
|
139
|
+
uo as Skeleton,
|
|
140
|
+
Ao as Spacer,
|
|
141
|
+
go as Spinner,
|
|
142
|
+
Sr as SpotlightCard,
|
|
143
143
|
Rr as SpotlightCardAdapter,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
vo as Stack,
|
|
145
|
+
nr as StickyScrollBlock,
|
|
146
|
+
bo as Switch,
|
|
147
|
+
Lo as Table,
|
|
148
|
+
Do as Tabs,
|
|
149
|
+
Cr as TabsBlock,
|
|
150
150
|
jr as TestimonialCard,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
Ho as Text,
|
|
152
|
+
Io as Textarea,
|
|
153
|
+
Mo as ThemeProvider,
|
|
154
|
+
yo as Tooltip,
|
|
155
|
+
sr as WasHelpfulBlock,
|
|
156
156
|
Zr as extractText,
|
|
157
157
|
$r as renderCallToAction,
|
|
158
158
|
oe as renderRichText,
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Dr as resolveCard,
|
|
160
|
+
tr as useHeroContext,
|
|
161
161
|
Jr as useLocaleBridge,
|
|
162
162
|
Vr as useTheme
|
|
163
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("../../../CategoryFilters-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("../../../CategoryFilters-jaBdSByQ.cjs");require("../../../index-hPJqlEOh.cjs");require("../../../x-Dft9NVe_.cjs");exports.CategoryFilters=e.CategoryFilters;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { C as p } from "../../../CategoryFilters-
|
|
3
|
-
import "../../../index-
|
|
2
|
+
import { C as p } from "../../../CategoryFilters-Dvx_tFs9.js";
|
|
3
|
+
import "../../../index-paelIj6o.js";
|
|
4
4
|
import "../../../x-CnsEH4Ox.js";
|
|
5
5
|
export {
|
|
6
6
|
p as CategoryFilters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("react"),T=require("../../hooks/useStyleClasses.cjs"),ss=require("../../context/LocaleBridge.cjs"),B=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("react"),T=require("../../hooks/useStyleClasses.cjs"),ss=require("../../context/LocaleBridge.cjs"),B=require("../../../index-hPJqlEOh.cjs"),es=require("../../../core/components/Input/index.cjs"),ts=require("../../../core/components/Select/index.cjs"),t=require("../../../CategoryFilters-jaBdSByQ.cjs"),ls=require("../../../x-Dft9NVe_.cjs"),as=[{label:"Newest",value:"date-desc"},{label:"Oldest",value:"date-asc"},{label:"Title A-Z",value:"title-asc"},{label:"Title Z-A",value:"title-desc"},{label:"Most Popular",value:"popular-desc"}];function os({heading:c,layout:H="grid",includeFilters:S,excludeFilters:v,limit:p=3,categoryFilters:f,documentType:E,styleOptions:O,initialArticles:g=[],initialTotalCount:$=0,initialIncludeCategories:W=[],id:Z,renderRichText:a,renderCard:C}){const[U,i]=e.useState(g),[X,G]=e.useState($),[j,J]=e.useState("date-desc"),[u,M]=e.useState(W),[k,d]=e.useState(g.length),[o,z]=e.useState(!1),[N,w]=e.useState(!1),[_,r]=e.useState(g.length<$),[h,x]=e.useState(""),[m,K]=e.useState(""),{locale:A}=ss.useLocaleBridge(),Q=T.useStyleClasses(O),D=e.useRef(!1),V=H==="list"?t.styles.list:void 0,I=e.useCallback(()=>{w(l=>!l)},[]),Y=e.useCallback(l=>{J(l.target.value),i([]),d(0),r(!0)},[]),F=e.useCallback(()=>{i([]),d(0),r(!0),M([]),x(""),w(!1)},[]),R=e.useCallback(l=>{i([]),d(0),r(!0),M(l)},[]),P=e.useCallback(async(l=!1)=>{if(!l&&(o||!_))return;z(!0);const b=new URLSearchParams({start:l?"0":String(k),limit:String(p),sort:j,documentType:E,locale:A});m&&b.append("search",m),u.forEach(n=>b.append("categories",n)),S==null||S.forEach(n=>b.append("include",n._id)),v==null||v.forEach(n=>b.append("exclude",n._id));try{const y=await(await fetch(`/api/articles?${b.toString()}`)).json();i(q=>l?y.articles:[...q,...y.articles]),d(q=>l?p:q+p),G(y.totalCount),r((l?0:k)+y.articles.length<y.totalCount)}catch(n){console.error("Failed to load articles:",n),r(!1)}finally{z(!1)}},[o,_,k,p,j,E,A,m,u,S,v]),L=e.useCallback(()=>{window.innerWidth>768&&(w(!1),document.body.style.overflow="")},[]);return e.useEffect(()=>(window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)),[L]),e.useEffect(()=>(document.body.style.overflow=N?"hidden":"",()=>{document.body.style.overflow=""}),[N]),e.useEffect(()=>{const l=setTimeout(()=>K(h),500);return()=>clearTimeout(l)},[h]),e.useEffect(()=>{if(!D.current){D.current=!0;return}(m||j!=="date-desc"||u.length>0)&&P(!0)},[m,j,u.join(",")]),s.jsx("section",{id:Z,className:`${t.styles.documentList} ${Q}`,children:s.jsxs("article",{className:t.styles.container,children:[s.jsxs("div",{className:t.styles.heading,children:[s.jsxs("div",{children:[c.eyebrow&&(a==null?void 0:a({blocks:c.eyebrow,className:t.styles.eyebrow})),a==null?void 0:a({blocks:c.title,className:t.styles.title})]})," ",(c==null?void 0:c.description)&&(a==null?void 0:a({blocks:c.description}))]}),s.jsxs("div",{className:t.styles.listContainer,children:[f!=null&&f.length?s.jsxs("div",{className:t.styles.filterToggle,children:[s.jsx(B.Button,{as:"button",variant:"secondary",onClick:I,disabled:o,icon:"settings",iconAlignment:"left",children:"Filters"}),s.jsx(B.Button,{as:"button",variant:"link",onClick:F,disabled:o||u.length===0&&h.length===0,children:"Reset"})]}):null,f&&s.jsx(t.CategoryFilters,{categoryFilters:f,selectedCategories:u,onSelectionChange:R,showFilters:N,toggleFilters:I,isLoading:o}),s.jsxs("div",{className:t.styles.listWrapper,children:[s.jsxs("div",{className:t.styles.listHeader,children:[s.jsxs("div",{className:t.styles.listResults,children:["Results: ",s.jsx("span",{children:X})]}),s.jsxs("div",{className:t.styles.listHeaderFilters,children:[s.jsxs("div",{className:t.styles.listSearch,children:[s.jsx(es.Input,{type:"text",name:"list-search",placeholder:"Search articles",value:h,onChange:l=>{x(l.target.value),i([]),d(0),r(!0)}}),h&&s.jsx("button",{className:t.styles.clearSearch,onClick:()=>{x(""),i([]),d(0),r(!0)},children:s.jsx(ls.X,{size:21})})]}),s.jsx("div",{className:t.styles.listSort,children:s.jsx(ts.Select,{id:"list-sort",name:"list-sort","aria-label":"Sort by",options:as,onChange:Y})})]})]}),s.jsx("div",{className:`${t.styles.list} ${V??""}`,children:U.map(l=>C==null?void 0:C(l))}),_&&s.jsx("div",{className:t.styles.loadMore,children:s.jsx(B.Button,{as:"button",variant:"primary",onClick:()=>P(!1),disabled:o,icon:"refresh",iconAlignment:"left",className:o?t.styles.buttonIsLoading:"",children:o?"Loading...":"Load more"})})]})]})]})})}exports.DocumentListBlock=os;
|
|
@@ -2,10 +2,10 @@ import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as o, useRef as es, useCallback as f, useEffect as y } from "react";
|
|
3
3
|
import { useStyleClasses as as } from "../../hooks/useStyleClasses.mjs";
|
|
4
4
|
import { useLocaleBridge as os } from "../../context/LocaleBridge.mjs";
|
|
5
|
-
import { B as H } from "../../../index-
|
|
5
|
+
import { B as H } from "../../../index-paelIj6o.js";
|
|
6
6
|
import { Input as ls } from "../../../core/components/Input/index.mjs";
|
|
7
7
|
import { Select as ns } from "../../../core/components/Select/index.mjs";
|
|
8
|
-
import { s, C as cs } from "../../../CategoryFilters-
|
|
8
|
+
import { s, C as cs } from "../../../CategoryFilters-Dvx_tFs9.js";
|
|
9
9
|
import { X as rs } from "../../../x-CnsEH4Ox.js";
|
|
10
10
|
const is = [
|
|
11
11
|
{ label: "Newest", value: "date-desc" },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../../core/components/Input/index.cjs");require("../../../core/components/Textarea/index.cjs");require("../../../core/components/Select/index.cjs");require("../../../core/components/Checkbox/index.cjs");require("../../../core/components/Radio/index.cjs");require("../../../core/components/Fieldset/index.cjs");require("../../../core/components/DatePicker/index.cjs");require("../../../core/components/Range/index.cjs");const e=require("../../../FormField-wfYSN1Vd.cjs");exports.FormField=e.FormField;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../../core/components/Input/index.mjs";
|
|
3
|
+
import "../../../core/components/Textarea/index.mjs";
|
|
4
|
+
import "../../../core/components/Select/index.mjs";
|
|
5
|
+
import "../../../core/components/Checkbox/index.mjs";
|
|
6
|
+
import "../../../core/components/Radio/index.mjs";
|
|
7
|
+
import "../../../core/components/Fieldset/index.mjs";
|
|
8
|
+
import "../../../core/components/DatePicker/index.mjs";
|
|
9
|
+
import "../../../core/components/Range/index.mjs";
|
|
10
|
+
import { F as l } from "../../../FormField-BO1hKjUb.js";
|
|
11
|
+
export {
|
|
12
|
+
l as FormField
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),U=require("../../../core/components/Form/index.cjs"),E=require("../../../index-hPJqlEOh.cjs"),V=require("../../../core/components/ProgressBar/index.cjs"),$=require("../../hooks/useStyleClasses.cjs"),r=require("../../../FormField-wfYSN1Vd.cjs"),_=require("./validate.cjs");function I(t,s){switch(s.type){case"SET_VALUE":return{...t,values:{...t.values,[s.name]:s.value},errors:{...t.errors,[s.name]:""}};case"SET_ERRORS":return{...t,errors:s.errors};case"CLEAR_ERROR":return{...t,errors:{...t.errors,[s.name]:""}};case"NEXT_STEP":return{...t,currentStep:t.currentStep+1,errors:{}};case"PREV_STEP":return{...t,currentStep:t.currentStep-1,errors:{}};case"SET_SUBMITTING":return{...t,isSubmitting:s.value};case"SET_RESULT":return{...t,submitResult:s.result,isSubmitting:!1};case"RESET":return{...t,currentStep:0,errors:{},submitResult:null,isSubmitting:!1};default:return t}}function A({id:t,heading:s,layout:f="vertical",steps:S,submitLabel:B="Submit",nextLabel:x="Next",backLabel:T="Back",successMessage:C="Thank you! Your submission has been received.",errorMessage:y="Something went wrong. Please try again.",styleOptions:R,renderRichText:n,onSubmit:v}){const j=$.useStyleClasses(R??{}),F=i.useMemo(()=>_.buildInitialValues(S),[]),[P,c]=i.useReducer(I,{values:F,errors:{},currentStep:0,isSubmitting:!1,submitResult:null}),{values:u,errors:h,currentStep:m,isSubmitting:b,submitResult:a}=P,p=S.length,k=p>1,N=m===p-1,q=(m+1)/p*100,o=S[m],L=i.useCallback((l,d)=>{c({type:"SET_VALUE",name:l,value:d})},[]),g=i.useCallback(()=>{const l=_.validateStep(o.fields,u);if(Object.keys(l).length>0){c({type:"SET_ERRORS",errors:l});return}c({type:"NEXT_STEP"})},[o.fields,u]),w=i.useCallback(()=>{c({type:"PREV_STEP"})},[]),O=i.useCallback(async()=>{const l=_.validateStep(o.fields,u);if(Object.keys(l).length>0){c({type:"SET_ERRORS",errors:l});return}c({type:"SET_SUBMITTING",value:!0});try{const d=await v(u);c({type:"SET_RESULT",result:d})}catch{c({type:"SET_RESULT",result:{success:!1,message:y}})}},[o.fields,u,v,y]);return a!=null&&a.success?e.jsx("section",{id:t,className:`${r.styles.formBlock} ${j}`,children:e.jsx("div",{className:r.styles.container,children:e.jsxs("div",{className:r.styles.success,children:[e.jsx("p",{children:a.message??C}),e.jsx(E.Button,{as:"button",variant:"secondary",onClick:()=>c({type:"RESET"}),children:"Submit another response"})]})})}):e.jsx("section",{id:t,className:`${r.styles.formBlock} ${j}`,children:e.jsxs("div",{className:r.styles.container,children:[((s==null?void 0:s.title)||(s==null?void 0:s.description))&&e.jsxs("div",{className:r.styles.heading,children:[s.eyebrow&&(n==null?void 0:n({blocks:s.eyebrow,className:r.styles.eyebrow})),s.title&&(n==null?void 0:n({blocks:s.title,className:r.styles.title})),s.description&&(n==null?void 0:n({blocks:s.description}))]}),k&&e.jsxs("div",{className:r.styles.progress,children:[e.jsxs("div",{className:r.styles.progressHeader,children:[e.jsx("span",{className:r.styles.stepLabel,children:o.title}),e.jsxs("span",{className:r.styles.stepCount,children:[m+1," / ",p]})]}),e.jsx(V.ProgressBar,{progress:q,variant:"primary",size:"sm",showLabel:!1})]}),o.description&&e.jsx("p",{className:r.styles.stepDescription,children:o.description}),a&&!a.success&&e.jsx("div",{className:r.styles.errorBanner,role:"alert",children:a.message??y}),e.jsxs(U.Form,{layout:f,noValidate:!0,onSubmit:l=>{l.preventDefault(),N?O():g()},children:[e.jsx("div",{className:r.styles.fields,children:o.fields.map(l=>e.jsx(r.FormField,{field:l,value:u[l.name.current],error:h[l.name.current],onChange:L},l._key))}),e.jsxs("div",{className:r.styles.actions,children:[k&&m>0&&e.jsx(E.Button,{as:"button",type:"button",variant:"secondary",onClick:w,disabled:b,children:T}),e.jsx(E.Button,{as:"button",type:"submit",variant:"primary",disabled:b,className:r.styles.submitButton,children:b?"Submitting…":N?B:x})]})]})]})})}exports.FormBlock=A;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as l, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as $, useReducer as A, useCallback as S } from "react";
|
|
3
|
+
import { Form as D } from "../../../core/components/Form/index.mjs";
|
|
4
|
+
import { B as f } from "../../../index-paelIj6o.js";
|
|
5
|
+
import { ProgressBar as G } from "../../../core/components/ProgressBar/index.mjs";
|
|
6
|
+
import { useStyleClasses as M } from "../../hooks/useStyleClasses.mjs";
|
|
7
|
+
import { s as r, F as X } from "../../../FormField-BO1hKjUb.js";
|
|
8
|
+
import { buildInitialValues as z, validateStep as B } from "./validate.mjs";
|
|
9
|
+
function H(e, s) {
|
|
10
|
+
switch (s.type) {
|
|
11
|
+
case "SET_VALUE":
|
|
12
|
+
return {
|
|
13
|
+
...e,
|
|
14
|
+
values: { ...e.values, [s.name]: s.value },
|
|
15
|
+
errors: { ...e.errors, [s.name]: "" }
|
|
16
|
+
};
|
|
17
|
+
case "SET_ERRORS":
|
|
18
|
+
return { ...e, errors: s.errors };
|
|
19
|
+
case "CLEAR_ERROR":
|
|
20
|
+
return {
|
|
21
|
+
...e,
|
|
22
|
+
errors: { ...e.errors, [s.name]: "" }
|
|
23
|
+
};
|
|
24
|
+
case "NEXT_STEP":
|
|
25
|
+
return { ...e, currentStep: e.currentStep + 1, errors: {} };
|
|
26
|
+
case "PREV_STEP":
|
|
27
|
+
return { ...e, currentStep: e.currentStep - 1, errors: {} };
|
|
28
|
+
case "SET_SUBMITTING":
|
|
29
|
+
return { ...e, isSubmitting: s.value };
|
|
30
|
+
case "SET_RESULT":
|
|
31
|
+
return { ...e, submitResult: s.result, isSubmitting: !1 };
|
|
32
|
+
case "RESET":
|
|
33
|
+
return {
|
|
34
|
+
...e,
|
|
35
|
+
currentStep: 0,
|
|
36
|
+
errors: {},
|
|
37
|
+
submitResult: null,
|
|
38
|
+
isSubmitting: !1
|
|
39
|
+
};
|
|
40
|
+
default:
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function ss({
|
|
45
|
+
id: e,
|
|
46
|
+
heading: s,
|
|
47
|
+
layout: T = "vertical",
|
|
48
|
+
steps: E,
|
|
49
|
+
submitLabel: R = "Submit",
|
|
50
|
+
nextLabel: L = "Next",
|
|
51
|
+
backLabel: h = "Back",
|
|
52
|
+
successMessage: w = "Thank you! Your submission has been received.",
|
|
53
|
+
errorMessage: b = "Something went wrong. Please try again.",
|
|
54
|
+
styleOptions: C,
|
|
55
|
+
renderRichText: a,
|
|
56
|
+
onSubmit: v
|
|
57
|
+
}) {
|
|
58
|
+
const N = M(C ?? {}), P = $(
|
|
59
|
+
() => z(E),
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
[]
|
|
62
|
+
), [U, o] = A(H, {
|
|
63
|
+
values: P,
|
|
64
|
+
errors: {},
|
|
65
|
+
currentStep: 0,
|
|
66
|
+
isSubmitting: !1,
|
|
67
|
+
submitResult: null
|
|
68
|
+
}), { values: u, errors: V, currentStep: m, isSubmitting: y, submitResult: i } = U, p = E.length, _ = p > 1, k = m === p - 1, O = (m + 1) / p * 100, n = E[m], g = S((t, d) => {
|
|
69
|
+
o({ type: "SET_VALUE", name: t, value: d });
|
|
70
|
+
}, []), F = S(() => {
|
|
71
|
+
const t = B(n.fields, u);
|
|
72
|
+
if (Object.keys(t).length > 0) {
|
|
73
|
+
o({ type: "SET_ERRORS", errors: t });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
o({ type: "NEXT_STEP" });
|
|
77
|
+
}, [n.fields, u]), I = S(() => {
|
|
78
|
+
o({ type: "PREV_STEP" });
|
|
79
|
+
}, []), j = S(async () => {
|
|
80
|
+
const t = B(n.fields, u);
|
|
81
|
+
if (Object.keys(t).length > 0) {
|
|
82
|
+
o({ type: "SET_ERRORS", errors: t });
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
o({ type: "SET_SUBMITTING", value: !0 });
|
|
86
|
+
try {
|
|
87
|
+
const d = await v(u);
|
|
88
|
+
o({ type: "SET_RESULT", result: d });
|
|
89
|
+
} catch {
|
|
90
|
+
o({
|
|
91
|
+
type: "SET_RESULT",
|
|
92
|
+
result: { success: !1, message: b }
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, [n.fields, u, v, b]);
|
|
96
|
+
return i != null && i.success ? /* @__PURE__ */ l("section", { id: e, className: `${r.formBlock} ${N}`, children: /* @__PURE__ */ l("div", { className: r.container, children: /* @__PURE__ */ c("div", { className: r.success, children: [
|
|
97
|
+
/* @__PURE__ */ l("p", { children: i.message ?? w }),
|
|
98
|
+
/* @__PURE__ */ l(
|
|
99
|
+
f,
|
|
100
|
+
{
|
|
101
|
+
as: "button",
|
|
102
|
+
variant: "secondary",
|
|
103
|
+
onClick: () => o({ type: "RESET" }),
|
|
104
|
+
children: "Submit another response"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }) }) }) : /* @__PURE__ */ l("section", { id: e, className: `${r.formBlock} ${N}`, children: /* @__PURE__ */ c("div", { className: r.container, children: [
|
|
108
|
+
((s == null ? void 0 : s.title) || (s == null ? void 0 : s.description)) && /* @__PURE__ */ c("div", { className: r.heading, children: [
|
|
109
|
+
s.eyebrow && (a == null ? void 0 : a({
|
|
110
|
+
blocks: s.eyebrow,
|
|
111
|
+
className: r.eyebrow
|
|
112
|
+
})),
|
|
113
|
+
s.title && (a == null ? void 0 : a({
|
|
114
|
+
blocks: s.title,
|
|
115
|
+
className: r.title
|
|
116
|
+
})),
|
|
117
|
+
s.description && (a == null ? void 0 : a({
|
|
118
|
+
blocks: s.description
|
|
119
|
+
}))
|
|
120
|
+
] }),
|
|
121
|
+
_ && /* @__PURE__ */ c("div", { className: r.progress, children: [
|
|
122
|
+
/* @__PURE__ */ c("div", { className: r.progressHeader, children: [
|
|
123
|
+
/* @__PURE__ */ l("span", { className: r.stepLabel, children: n.title }),
|
|
124
|
+
/* @__PURE__ */ c("span", { className: r.stepCount, children: [
|
|
125
|
+
m + 1,
|
|
126
|
+
" / ",
|
|
127
|
+
p
|
|
128
|
+
] })
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ l(
|
|
131
|
+
G,
|
|
132
|
+
{
|
|
133
|
+
progress: O,
|
|
134
|
+
variant: "primary",
|
|
135
|
+
size: "sm",
|
|
136
|
+
showLabel: !1
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }),
|
|
140
|
+
n.description && /* @__PURE__ */ l("p", { className: r.stepDescription, children: n.description }),
|
|
141
|
+
i && !i.success && /* @__PURE__ */ l("div", { className: r.errorBanner, role: "alert", children: i.message ?? b }),
|
|
142
|
+
/* @__PURE__ */ c(
|
|
143
|
+
D,
|
|
144
|
+
{
|
|
145
|
+
layout: T,
|
|
146
|
+
noValidate: !0,
|
|
147
|
+
onSubmit: (t) => {
|
|
148
|
+
t.preventDefault(), k ? j() : F();
|
|
149
|
+
},
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ l("div", { className: r.fields, children: n.fields.map((t) => /* @__PURE__ */ l(
|
|
152
|
+
X,
|
|
153
|
+
{
|
|
154
|
+
field: t,
|
|
155
|
+
value: u[t.name.current],
|
|
156
|
+
error: V[t.name.current],
|
|
157
|
+
onChange: g
|
|
158
|
+
},
|
|
159
|
+
t._key
|
|
160
|
+
)) }),
|
|
161
|
+
/* @__PURE__ */ c("div", { className: r.actions, children: [
|
|
162
|
+
_ && m > 0 && /* @__PURE__ */ l(
|
|
163
|
+
f,
|
|
164
|
+
{
|
|
165
|
+
as: "button",
|
|
166
|
+
type: "button",
|
|
167
|
+
variant: "secondary",
|
|
168
|
+
onClick: I,
|
|
169
|
+
disabled: y,
|
|
170
|
+
children: h
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ l(
|
|
174
|
+
f,
|
|
175
|
+
{
|
|
176
|
+
as: "button",
|
|
177
|
+
type: "submit",
|
|
178
|
+
variant: "primary",
|
|
179
|
+
disabled: y,
|
|
180
|
+
className: r.submitButton,
|
|
181
|
+
children: y ? "Submitting…" : k ? R : L
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] }) });
|
|
189
|
+
}
|
|
190
|
+
export {
|
|
191
|
+
ss as FormBlock
|
|
192
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,t){const n=e.label||e.name.current;if(e.required){if(t==null||t==="")return`${n} is required`;if(Array.isArray(t)&&t.length===0)return`${n} is required`;if(typeof t=="boolean"&&t===!1&&e.fieldType==="checkbox")return`${n} must be checked`}if(t==null||t==="")return null;const r=String(t);if(e.minLength&&r.length<e.minLength)return`${n} must be at least ${e.minLength} characters`;if(e.maxLength&&r.length>e.maxLength)return`${n} must be no more than ${e.maxLength} characters`;if(e.fieldType==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return`${n} must be a valid email address`;if(e.fieldType==="url")try{new URL(r)}catch{return`${n} must be a valid URL`}if(e.fieldType==="phone"&&!/^[+\d\s\-().]{7,}$/.test(r))return`${n} must be a valid phone number`;if(e.pattern)try{if(!new RegExp(e.pattern).test(r))return e.patternMessage||`${n} is invalid`}catch{}return null}function c(e,t){const n={};for(const r of e){const a=r.name.current,i=s(r,t[a]);i&&(n[a]=i)}return n}function o(e,t){return e.reduce((n,r)=>({...n,...c(r.fields,t)}),{})}function u(e){const t={};for(const n of e)for(const r of n.fields){const a=r.name.current;switch(r.fieldType){case"checkbox":t[a]=!1;break;case"checkboxGroup":case"multiselect":t[a]=[];break;case"range":t[a]=r.rangeMin??0;break;case"hidden":t[a]=r.hiddenValue??"";break;default:t[a]=r.defaultValue??""}}return t}exports.buildInitialValues=u;exports.validateField=s;exports.validateForm=o;exports.validateStep=c;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function i(e, t) {
|
|
2
|
+
const r = e.label || e.name.current;
|
|
3
|
+
if (e.required) {
|
|
4
|
+
if (t == null || t === "")
|
|
5
|
+
return `${r} is required`;
|
|
6
|
+
if (Array.isArray(t) && t.length === 0)
|
|
7
|
+
return `${r} is required`;
|
|
8
|
+
if (typeof t == "boolean" && t === !1 && e.fieldType === "checkbox")
|
|
9
|
+
return `${r} must be checked`;
|
|
10
|
+
}
|
|
11
|
+
if (t == null || t === "") return null;
|
|
12
|
+
const n = String(t);
|
|
13
|
+
if (e.minLength && n.length < e.minLength)
|
|
14
|
+
return `${r} must be at least ${e.minLength} characters`;
|
|
15
|
+
if (e.maxLength && n.length > e.maxLength)
|
|
16
|
+
return `${r} must be no more than ${e.maxLength} characters`;
|
|
17
|
+
if (e.fieldType === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))
|
|
18
|
+
return `${r} must be a valid email address`;
|
|
19
|
+
if (e.fieldType === "url")
|
|
20
|
+
try {
|
|
21
|
+
new URL(n);
|
|
22
|
+
} catch {
|
|
23
|
+
return `${r} must be a valid URL`;
|
|
24
|
+
}
|
|
25
|
+
if (e.fieldType === "phone" && !/^[+\d\s\-().]{7,}$/.test(n))
|
|
26
|
+
return `${r} must be a valid phone number`;
|
|
27
|
+
if (e.pattern)
|
|
28
|
+
try {
|
|
29
|
+
if (!new RegExp(e.pattern).test(n))
|
|
30
|
+
return e.patternMessage || `${r} is invalid`;
|
|
31
|
+
} catch {
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function c(e, t) {
|
|
36
|
+
const r = {};
|
|
37
|
+
for (const n of e) {
|
|
38
|
+
const a = n.name.current, s = i(n, t[a]);
|
|
39
|
+
s && (r[a] = s);
|
|
40
|
+
}
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
function o(e, t) {
|
|
44
|
+
return e.reduce((r, n) => ({ ...r, ...c(n.fields, t) }), {});
|
|
45
|
+
}
|
|
46
|
+
function u(e) {
|
|
47
|
+
const t = {};
|
|
48
|
+
for (const r of e)
|
|
49
|
+
for (const n of r.fields) {
|
|
50
|
+
const a = n.name.current;
|
|
51
|
+
switch (n.fieldType) {
|
|
52
|
+
case "checkbox":
|
|
53
|
+
t[a] = !1;
|
|
54
|
+
break;
|
|
55
|
+
case "checkboxGroup":
|
|
56
|
+
case "multiselect":
|
|
57
|
+
t[a] = [];
|
|
58
|
+
break;
|
|
59
|
+
case "range":
|
|
60
|
+
t[a] = n.rangeMin ?? 0;
|
|
61
|
+
break;
|
|
62
|
+
case "hidden":
|
|
63
|
+
t[a] = n.hiddenValue ?? "";
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
t[a] = n.defaultValue ?? "";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return t;
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
u as buildInitialValues,
|
|
73
|
+
i as validateField,
|
|
74
|
+
o as validateForm,
|
|
75
|
+
c as validateStep
|
|
76
|
+
};
|