@utahdts/utah-design-system 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -370,4 +370,14 @@
370
370
  .utds-icon-after-mail-open::after {
371
371
  content: "\e93f";
372
372
  }
373
+
374
+ .utds-icon-before-ai::before,
375
+ .utds-icon-after-ai::after {
376
+ content: "\e940";
377
+ }
378
+
379
+ .utds-icon-before-send::before,
380
+ .utds-icon-after-send::after {
381
+ content: "\e941";
382
+ }
373
383
  }
@@ -13,6 +13,7 @@ component specific, BEM (Block, Element, Modifier)
13
13
  @use "base-components/buttons/button";
14
14
  @use "base-components/buttons/icon-button";
15
15
  @use "base-components/buttons/tag";
16
+ @use "base-components/chatbot/chatbot";
16
17
  @use "base-components/footer/footer-agency-information";
17
18
  @use "base-components/footer/footer-social-media-bar";
18
19
  @use "base-components/forms/input-wrapper";
@@ -0,0 +1,94 @@
1
+ @use "../../../1-settings/class-vars";
2
+
3
+ #{class-vars.$base-class} {
4
+ .chatbot {
5
+ &__wrapper {
6
+ max-width: calc(100% - 2 * (1rem + var(--spacing-2xs)));
7
+
8
+ .button--confirm {
9
+ padding: 0 var(--spacing-xs);
10
+ }
11
+ }
12
+
13
+ &__input-wrapper {
14
+ background: var(--gray-light-color);
15
+ border-radius: var(--radius-small);
16
+ padding: var(--spacing-s) var(--spacing);
17
+
18
+ label.text-area__label {
19
+ /*
20
+ display: flex;
21
+ align-items: center;
22
+ position: relative;
23
+ margin-left: calc(1rem + var(--spacing-2xs));
24
+
25
+ &:before {
26
+ content: '\e940';
27
+ display: inline-block;
28
+ font-family: "utah design system";
29
+ font-style: normal;
30
+ font-weight: normal;
31
+ font-size: 1em;
32
+ line-height: 1;
33
+ -webkit-font-smoothing: antialiased;
34
+ -moz-osx-font-smoothing: grayscale;
35
+ position: absolute;
36
+ left: calc(-1rem - var(--spacing-2xs));
37
+ }
38
+ */
39
+ }
40
+
41
+ textarea {
42
+ border: none;
43
+ background: none;
44
+ padding: var(--spacing-xs) 0;
45
+ field-sizing: content;
46
+ }
47
+ }
48
+
49
+ &__answer-wrapper {
50
+ display: flex;
51
+ flex-direction: column;
52
+ }
53
+
54
+ &__answer-user {
55
+ align-self: flex-end;
56
+ background-color: var(--gray-light-color);
57
+ padding: var(--spacing-s) var(--spacing);
58
+ border-radius: var(--radius-medium) var(--radius-medium) 0 var(--radius-medium);
59
+ margin-bottom: var(--spacing);
60
+ max-width: 85%;
61
+ position: relative;
62
+ &:after {
63
+ content: '';
64
+ display: block;
65
+ width: 0;
66
+ height: 0;
67
+ position: absolute;
68
+ bottom: 0;
69
+ right: -10px;
70
+ border-style: solid;
71
+ border-width: 5px;
72
+ border-color: transparent transparent var(--gray-light-color) var(--gray-light-color);
73
+ }
74
+ }
75
+
76
+ &__answer-ai {
77
+ position: relative;
78
+ padding-left: calc(1rem + var(--spacing-2xs));
79
+ &:before {
80
+ content: '\e940';
81
+ display: inline-block;
82
+ font-family: "utah design system";
83
+ font-style: normal;
84
+ font-weight: normal;
85
+ font-size: 1em;
86
+ line-height: 1;
87
+ -webkit-font-smoothing: antialiased;
88
+ -moz-osx-font-smoothing: grayscale;
89
+ position: absolute;
90
+ left: 0;
91
+ }
92
+ }
93
+ }
94
+ }
@@ -1,4 +1,5 @@
1
1
  @use "../../../1-settings/class-vars";
2
+ @use "../../../1-settings/media-size-vars";
2
3
 
3
4
  #{class-vars.$base-class} {
4
5
  .on-this-page {
@@ -31,3 +32,13 @@
31
32
  }
32
33
  }
33
34
  }
35
+
36
+ @media screen and (max-width: #{media-size-vars.$media-size-tablet-portrait}) {
37
+ #{class-vars.$base-class} {
38
+ .on-this-page__list {
39
+ .back-to-top {
40
+ display: none;
41
+ }
42
+ }
43
+ }
44
+ }
package/dist/style.css CHANGED
@@ -766,6 +766,14 @@ variables and settings
766
766
  .utah-design-system .utds-icon-after-mail-open::after {
767
767
  content: "\e93f";
768
768
  }
769
+ .utah-design-system .utds-icon-before-ai::before,
770
+ .utah-design-system .utds-icon-after-ai::after {
771
+ content: "\e940";
772
+ }
773
+ .utah-design-system .utds-icon-before-send::before,
774
+ .utah-design-system .utds-icon-after-send::after {
775
+ content: "\e941";
776
+ }
769
777
  /*
770
778
  ############ _media-size-vars.scss ############
771
779
  Media Sizes - SCSS Variables
@@ -2422,6 +2430,87 @@ component specific, BEM (Block, Element, Modifier)
2422
2430
  .utah-design-system .tag--clearable .tag--small {
2423
2431
  padding: 0 0 0 var(--spacing-xs);
2424
2432
  }
2433
+ .utah-design-system .chatbot__wrapper {
2434
+ max-width: calc(100% - 2 * (1rem + var(--spacing-2xs)));
2435
+ }
2436
+ .utah-design-system .chatbot__wrapper .button--confirm {
2437
+ padding: 0 var(--spacing-xs);
2438
+ }
2439
+ .utah-design-system .chatbot__input-wrapper {
2440
+ background: var(--gray-light-color);
2441
+ border-radius: var(--radius-small);
2442
+ padding: var(--spacing-s) var(--spacing);
2443
+ }
2444
+ .utah-design-system .chatbot__input-wrapper label.text-area__label {
2445
+ /*
2446
+ display: flex;
2447
+ align-items: center;
2448
+ position: relative;
2449
+ margin-left: calc(1rem + var(--spacing-2xs));
2450
+
2451
+ &:before {
2452
+ content: '\e940';
2453
+ display: inline-block;
2454
+ font-family: "utah design system";
2455
+ font-style: normal;
2456
+ font-weight: normal;
2457
+ font-size: 1em;
2458
+ line-height: 1;
2459
+ -webkit-font-smoothing: antialiased;
2460
+ -moz-osx-font-smoothing: grayscale;
2461
+ position: absolute;
2462
+ left: calc(-1rem - var(--spacing-2xs));
2463
+ }
2464
+ */
2465
+ }
2466
+ .utah-design-system .chatbot__input-wrapper textarea {
2467
+ border: none;
2468
+ background: none;
2469
+ padding: var(--spacing-xs) 0;
2470
+ field-sizing: content;
2471
+ }
2472
+ .utah-design-system .chatbot__answer-wrapper {
2473
+ display: flex;
2474
+ flex-direction: column;
2475
+ }
2476
+ .utah-design-system .chatbot__answer-user {
2477
+ align-self: flex-end;
2478
+ background-color: var(--gray-light-color);
2479
+ padding: var(--spacing-s) var(--spacing);
2480
+ border-radius: var(--radius-medium) var(--radius-medium) 0 var(--radius-medium);
2481
+ margin-bottom: var(--spacing);
2482
+ max-width: 85%;
2483
+ position: relative;
2484
+ }
2485
+ .utah-design-system .chatbot__answer-user:after {
2486
+ content: "";
2487
+ display: block;
2488
+ width: 0;
2489
+ height: 0;
2490
+ position: absolute;
2491
+ bottom: 0;
2492
+ right: -10px;
2493
+ border-style: solid;
2494
+ border-width: 5px;
2495
+ border-color: transparent transparent var(--gray-light-color) var(--gray-light-color);
2496
+ }
2497
+ .utah-design-system .chatbot__answer-ai {
2498
+ position: relative;
2499
+ padding-left: calc(1rem + var(--spacing-2xs));
2500
+ }
2501
+ .utah-design-system .chatbot__answer-ai:before {
2502
+ content: "\e940";
2503
+ display: inline-block;
2504
+ font-family: "utah design system";
2505
+ font-style: normal;
2506
+ font-weight: normal;
2507
+ font-size: 1em;
2508
+ line-height: 1;
2509
+ -webkit-font-smoothing: antialiased;
2510
+ -moz-osx-font-smoothing: grayscale;
2511
+ position: absolute;
2512
+ left: 0;
2513
+ }
2425
2514
  .utah-design-system .footer-agency-information {
2426
2515
  background: var(--gray-color);
2427
2516
  color: white;
@@ -5084,6 +5173,11 @@ BEM standard: Block, Element, Modifier
5084
5173
  box-shadow: inset 0 0 0 1000px var(--hover-gray-color);
5085
5174
  color: var(--primary-color);
5086
5175
  }
5176
+ @media screen and (max-width: 768px) {
5177
+ .utah-design-system .on-this-page__list .back-to-top {
5178
+ display: none;
5179
+ }
5180
+ }
5087
5181
  /* ---- Project Components ---- */
5088
5182
  /*
5089
5183
  ############ _popup.scss ############
@@ -10,7 +10,7 @@ var package_default = {
10
10
  name: "@utahdts/utah-design-system",
11
11
  description: "Utah Design System React Library",
12
12
  displayName: "Utah Design System React Library",
13
- version: "5.0.1",
13
+ version: "5.1.0",
14
14
  exports: {
15
15
  ".": {
16
16
  "development-local": "./index.js",
@@ -73,7 +73,7 @@ var package_default = {
73
73
  peerDependencies: { "react": "^18.0.0 || ^19.0.0" },
74
74
  dependencies: {
75
75
  "@floating-ui/react-dom": "^2.1.8",
76
- "@utahdts/utah-design-system-header": "5.0.1",
76
+ "@utahdts/utah-design-system-header": "5.1.0",
77
77
  "date-fns": "4.1.0",
78
78
  "immer": "11.1.4",
79
79
  "lodash-es": "4.18.1",
@@ -702,7 +702,10 @@ function Accordion({ children, className, contentClassName, headingLevel = 2, he
702
702
  id: `accordion-button__${id}`,
703
703
  onClick: handleEvent(toggleAccordion),
704
704
  type: "button",
705
- children: [/* @__PURE__ */ jsx(HeadingTag, { children: headerContent }), /* @__PURE__ */ jsx("span", {
705
+ children: [/* @__PURE__ */ jsx(HeadingTag, {
706
+ id: `accordion-heading__${id}`,
707
+ children: headerContent
708
+ }), /* @__PURE__ */ jsx("span", {
706
709
  className: `utds-icon-before-circle-chevron-up icon-button__icon ${stateIsOpen ? "" : "icon-button__icon--rotate180"}`,
707
710
  "aria-hidden": "true"
708
711
  })]
@@ -1234,7 +1237,7 @@ function FooterAgencyInformationColumn({ children }) {
1234
1237
  /**
1235
1238
  * @param {object} props
1236
1239
  * @param {string} props.agencyTitleFirstLine ie Utah Department of (smaller font above main title)
1237
- * @param {string} props.agencyTitleSecondLine ie Government Operations (larger font below firstLine)
1240
+ * @param {string} [props.agencyTitleSecondLine] ie Government Operations (larger font below firstLine)
1238
1241
  * @param {Address} props.address
1239
1242
  * @param {string} props.email
1240
1243
  * @param {import('react').ReactNode} props.logo
@@ -4440,19 +4443,26 @@ function htmlDecode(input) {
4440
4443
  /**
4441
4444
  * @param {object} props
4442
4445
  * @param {HierarchyNode[]} props.headersLevel
4446
+ * @param {boolean} [props.backToTop]
4443
4447
  * @returns {import('react').JSX.Element}
4444
4448
  */
4445
- function OnThisPageHeadersLevel({ headersLevel }) {
4446
- return /* @__PURE__ */ jsx("ul", {
4449
+ function OnThisPageHeadersLevel({ headersLevel, backToTop = false }) {
4450
+ return /* @__PURE__ */ jsxs("ul", {
4447
4451
  className: "on-this-page__list",
4448
- children: headersLevel.map((header) => {
4452
+ children: [backToTop ? /* @__PURE__ */ jsx("li", {
4453
+ className: "back-to-top",
4454
+ children: /* @__PURE__ */ jsx("a", {
4455
+ href: "#",
4456
+ children: "Back to top"
4457
+ })
4458
+ }) : "", headersLevel.map((header) => {
4449
4459
  let node = null;
4450
4460
  if (header.node.id) node = /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("a", {
4451
4461
  href: `#${header.node.id}`,
4452
4462
  children: htmlDecode(header.node.innerHTML)
4453
4463
  }), header.children?.length ? /* @__PURE__ */ jsx(OnThisPageHeadersLevel, { headersLevel: header.children }) : null] }, `on-this-page-ul-${header.node.id}`);
4454
4464
  return node;
4455
- })
4465
+ })]
4456
4466
  });
4457
4467
  }
4458
4468
  //#endregion
@@ -4536,20 +4546,13 @@ function OnThisPage({ contentRef }) {
4536
4546
  const headersTree = groupElementsByHeaderLevel(findElementsByTagNameMatch(contentRef.current));
4537
4547
  return /* @__PURE__ */ jsx("div", {
4538
4548
  className: "on-this-page",
4539
- children: headersTree?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
4540
- /* @__PURE__ */ jsx("h2", {
4541
- className: "on-this-page__header",
4542
- children: "On this page"
4543
- }),
4544
- /* @__PURE__ */ jsx("ul", {
4545
- className: "on-this-page__list",
4546
- children: /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
4547
- href: "#",
4548
- children: "Back to top"
4549
- }) })
4550
- }),
4551
- /* @__PURE__ */ jsx(OnThisPageHeadersLevel, { headersLevel: headersTree })
4552
- ] }) : null
4549
+ children: headersTree?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h2", {
4550
+ className: "on-this-page__header",
4551
+ children: "On this page"
4552
+ }), /* @__PURE__ */ jsx(OnThisPageHeadersLevel, {
4553
+ headersLevel: headersTree,
4554
+ backToTop: true
4555
+ })] }) : null
4553
4556
  });
4554
4557
  }
4555
4558
  //#endregion
@@ -39,7 +39,7 @@
39
39
  name: "@utahdts/utah-design-system",
40
40
  description: "Utah Design System React Library",
41
41
  displayName: "Utah Design System React Library",
42
- version: "5.0.1",
42
+ version: "5.1.0",
43
43
  exports: {
44
44
  ".": {
45
45
  "development-local": "./index.js",
@@ -102,7 +102,7 @@
102
102
  peerDependencies: { "react": "^18.0.0 || ^19.0.0" },
103
103
  dependencies: {
104
104
  "@floating-ui/react-dom": "^2.1.8",
105
- "@utahdts/utah-design-system-header": "5.0.1",
105
+ "@utahdts/utah-design-system-header": "5.1.0",
106
106
  "date-fns": "4.1.0",
107
107
  "immer": "11.1.4",
108
108
  "lodash-es": "4.18.1",
@@ -731,7 +731,10 @@
731
731
  id: `accordion-button__${id}`,
732
732
  onClick: handleEvent(toggleAccordion),
733
733
  type: "button",
734
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingTag, { children: headerContent }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
734
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingTag, {
735
+ id: `accordion-heading__${id}`,
736
+ children: headerContent
737
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
735
738
  className: `utds-icon-before-circle-chevron-up icon-button__icon ${stateIsOpen ? "" : "icon-button__icon--rotate180"}`,
736
739
  "aria-hidden": "true"
737
740
  })]
@@ -1263,7 +1266,7 @@
1263
1266
  /**
1264
1267
  * @param {object} props
1265
1268
  * @param {string} props.agencyTitleFirstLine ie Utah Department of (smaller font above main title)
1266
- * @param {string} props.agencyTitleSecondLine ie Government Operations (larger font below firstLine)
1269
+ * @param {string} [props.agencyTitleSecondLine] ie Government Operations (larger font below firstLine)
1267
1270
  * @param {Address} props.address
1268
1271
  * @param {string} props.email
1269
1272
  * @param {import('react').ReactNode} props.logo
@@ -4469,19 +4472,26 @@
4469
4472
  /**
4470
4473
  * @param {object} props
4471
4474
  * @param {HierarchyNode[]} props.headersLevel
4475
+ * @param {boolean} [props.backToTop]
4472
4476
  * @returns {import('react').JSX.Element}
4473
4477
  */
4474
- function OnThisPageHeadersLevel({ headersLevel }) {
4475
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4478
+ function OnThisPageHeadersLevel({ headersLevel, backToTop = false }) {
4479
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
4476
4480
  className: "on-this-page__list",
4477
- children: headersLevel.map((header) => {
4481
+ children: [backToTop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
4482
+ className: "back-to-top",
4483
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
4484
+ href: "#",
4485
+ children: "Back to top"
4486
+ })
4487
+ }) : "", headersLevel.map((header) => {
4478
4488
  let node = null;
4479
4489
  if (header.node.id) node = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
4480
4490
  href: `#${header.node.id}`,
4481
4491
  children: htmlDecode(header.node.innerHTML)
4482
4492
  }), header.children?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OnThisPageHeadersLevel, { headersLevel: header.children }) : null] }, `on-this-page-ul-${header.node.id}`);
4483
4493
  return node;
4484
- })
4494
+ })]
4485
4495
  });
4486
4496
  }
4487
4497
  //#endregion
@@ -4565,20 +4575,13 @@
4565
4575
  const headersTree = groupElementsByHeaderLevel(findElementsByTagNameMatch(contentRef.current));
4566
4576
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4567
4577
  className: "on-this-page",
4568
- children: headersTree?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
4569
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
4570
- className: "on-this-page__header",
4571
- children: "On this page"
4572
- }),
4573
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4574
- className: "on-this-page__list",
4575
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
4576
- href: "#",
4577
- children: "Back to top"
4578
- }) })
4579
- }),
4580
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OnThisPageHeadersLevel, { headersLevel: headersTree })
4581
- ] }) : null
4578
+ children: headersTree?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
4579
+ className: "on-this-page__header",
4580
+ children: "On this page"
4581
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OnThisPageHeadersLevel, {
4582
+ headersLevel: headersTree,
4583
+ backToTop: true
4584
+ })] }) : null
4582
4585
  });
4583
4586
  }
4584
4587
  //#endregion
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@utahdts/utah-design-system",
3
3
  "description": "Utah Design System React Library",
4
4
  "displayName": "Utah Design System React Library",
5
- "version": "5.0.1",
5
+ "version": "5.1.0",
6
6
  "exports": {
7
7
  ".": {
8
8
  "development-local": "./index.js",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@floating-ui/react-dom": "^2.1.8",
72
- "@utahdts/utah-design-system-header": "5.0.1",
72
+ "@utahdts/utah-design-system-header": "5.1.0",
73
73
  "date-fns": "4.1.0",
74
74
  "immer": "11.1.4",
75
75
  "lodash-es": "4.18.1",
@@ -52,7 +52,7 @@ export function Accordion({
52
52
  type="button"
53
53
  >
54
54
  {/* @ts-expect-error */}
55
- <HeadingTag>{headerContent}</HeadingTag>
55
+ <HeadingTag id={`accordion-heading__${id}`}>{headerContent}</HeadingTag>
56
56
  <span className={`utds-icon-before-circle-chevron-up icon-button__icon ${stateIsOpen ? '' : 'icon-button__icon--rotate180'}`} aria-hidden="true" />
57
57
  </button>
58
58
 
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * @param {object} props
5
5
  * @param {string} props.agencyTitleFirstLine ie Utah Department of (smaller font above main title)
6
- * @param {string} props.agencyTitleSecondLine ie Government Operations (larger font below firstLine)
6
+ * @param {string} [props.agencyTitleSecondLine] ie Government Operations (larger font below firstLine)
7
7
  * @param {Address} props.address
8
8
  * @param {string} props.email
9
9
  * @param {import('react').ReactNode} props.logo
@@ -18,13 +18,7 @@ export function OnThisPage({ contentRef }) {
18
18
  ? (
19
19
  <>
20
20
  <h2 className="on-this-page__header">On this page</h2>
21
- <ul className="on-this-page__list">
22
- <li>
23
- {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
24
- <a href="#">Back to top</a>
25
- </li>
26
- </ul>
27
- <OnThisPageHeadersLevel headersLevel={headersTree} />
21
+ <OnThisPageHeadersLevel headersLevel={headersTree} backToTop={true}/>
28
22
  </>
29
23
  )
30
24
  : null
@@ -13,11 +13,13 @@ import { htmlDecode } from '../../util/htmlDecode';
13
13
  /**
14
14
  * @param {object} props
15
15
  * @param {HierarchyNode[]} props.headersLevel
16
+ * @param {boolean} [props.backToTop]
16
17
  * @returns {import('react').JSX.Element}
17
18
  */
18
- export function OnThisPageHeadersLevel({ headersLevel }) {
19
+ export function OnThisPageHeadersLevel({ headersLevel, backToTop = false }) {
19
20
  return (
20
21
  <ul className="on-this-page__list">
22
+ {backToTop ? <li className="back-to-top"><a href="#">Back to top</a></li> : ''}
21
23
  {
22
24
  headersLevel.map((header) => {
23
25
  let node = null;