@midas-ds/components 16.4.2 → 16.5.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/accordion/Accordion.d.ts +6 -2
  3. package/accordion/Accordion.stories.d.ts +1 -1
  4. package/accordion/AccordionItem.d.ts +2 -3
  5. package/accordion/AccordionItem.stories.d.ts +22 -0
  6. package/accordion/index.d.ts +1 -1
  7. package/accordion/index.js +1 -1
  8. package/assets/DateField.css +1 -1
  9. package/assets/DateRangePicker.css +1 -1
  10. package/button/Button.d.ts +1 -1
  11. package/button/index.js +1 -1
  12. package/calendar/index.js +1 -1
  13. package/checkbox/index.js +1 -1
  14. package/chunks/{AccordionItem-Cu5L1c1h.js → AccordionItem-BvJQhuYO.js} +3 -3
  15. package/chunks/Button-BGu-SRi7.js +55 -0
  16. package/chunks/{CheckboxGroup-C6LIpj_R.js → CheckboxGroup-C5NpRdqR.js} +1 -1
  17. package/chunks/{ClearButton-DavPe5uU.js → ClearButton-Dtkd_M_7.js} +1 -1
  18. package/chunks/{ComboBox-BXcuyHPd.js → ComboBox-BrpJ6b7d.js} +1 -1
  19. package/chunks/DateField-CodiOrfY.js +91 -0
  20. package/chunks/DateRangePicker-DQB5TrfF.js +192 -0
  21. package/chunks/{Dialog-DprWZBKT.js → Dialog-DRpxD3Gh.js} +1 -1
  22. package/chunks/{InfoBanner-BOKZ4lBE.js → InfoBanner-DEwlyEud.js} +1 -1
  23. package/chunks/{Label-6SXmzRZE.js → Label-xWKvOuML.js} +1 -1
  24. package/chunks/{Layout-BUK3KFXi.js → Layout-BiPXXkKY.js} +1 -1
  25. package/chunks/{ProgressBar-67lCngwJ.js → ProgressBar-KQdaaME2.js} +1 -1
  26. package/chunks/{Radio-XQA8CylD.js → Radio-Clk616ep.js} +1 -1
  27. package/chunks/{RangeCalendar-Bt8q3FZi.js → RangeCalendar-pgiXYhpG.js} +1 -1
  28. package/chunks/{SearchField-Jqn3dKGs.js → SearchField-C493CTGJ.js} +2 -2
  29. package/chunks/{Select-CyYUhMOg.js → Select-CaSZY6w_.js} +2 -2
  30. package/chunks/{Select-BNCz_ox4.js → Select-D9db38XE.js} +2 -2
  31. package/chunks/{Tag-BKcduKRR.js → Tag-CZrQBEgv.js} +1 -1
  32. package/chunks/{TextArea-BM5wOL3b.js → TextArea-kEpt5DKm.js} +2 -2
  33. package/chunks/{Toast-C-EV39pd.js → Toast-BehM7JJP.js} +1 -1
  34. package/clear-button/index.js +1 -1
  35. package/combobox/ComboBox.stories.d.ts +2 -6
  36. package/combobox/index.js +1 -1
  37. package/date-field/index.js +1 -1
  38. package/date-picker/index.js +1 -1
  39. package/index.js +19 -19
  40. package/info-banner/index.js +1 -1
  41. package/label/index.js +1 -1
  42. package/layout/index.js +1 -1
  43. package/legacy-select/LegacySelect.stories.d.ts +1 -1
  44. package/legacy-select/index.js +1 -1
  45. package/modal/index.js +1 -1
  46. package/package.json +1 -1
  47. package/progress-bar/index.js +1 -1
  48. package/radio/index.js +1 -1
  49. package/search-field/index.js +1 -1
  50. package/select/Select.stories.d.ts +4 -3
  51. package/select/index.js +1 -1
  52. package/tag/index.js +1 -1
  53. package/textfield/index.js +1 -1
  54. package/toast/index.js +1 -1
  55. package/chunks/Button-BYrLbzir.js +0 -46
  56. package/chunks/DateField-D9CEvqnd.js +0 -91
  57. package/chunks/DateRangePicker-DGfdhIjR.js +0 -191
  58. package/combobox/utils.d.ts +0 -12
  59. package/legacy-select/utils.d.ts +0 -11
  60. package/utils/tests.d.ts +0 -17
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as i, Fragment as S } from "react/jsx-runtime";
2
2
  import { SelectStateContext as d, SelectValue as v, Button as h, TagList as V, Select as A } from "react-aria-components";
3
3
  import { FocusScope as C } from "@react-aria/focus";
4
- import { a as N, L as b } from "./Label-6SXmzRZE.js";
4
+ import { a as N, L as b } from "./Label-xWKvOuML.js";
5
5
  import { a as y, c as T } from "./clsx-AexbMWKp.js";
6
6
  import { T as B } from "./Text-TWzJxnto.js";
7
7
  import { F as g } from "./FieldError-Bra5aRT3.js";
@@ -12,7 +12,7 @@ import { useFocusManager as F } from "react-aria";
12
12
  import { X as L } from "./x-BXShoIAM.js";
13
13
  import { L as I } from "./ListBox-D5BBeZWL.js";
14
14
  import { P as G } from "./Popover-BcEtFiU1.js";
15
- import { a as j, T as k } from "./Tag-BKcduKRR.js";
15
+ import { a as j, T as k } from "./Tag-CZrQBEgv.js";
16
16
  import { C as R } from "./chevron-down-DgT-uSF9.js";
17
17
  import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, w = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, u = {
18
18
  en: $,
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import { Tag as c, TagGroup as _, TagList as e } from "react-aria-components";
3
- import { B as g } from "./Button-BYrLbzir.js";
3
+ import { B as g } from "./Button-BGu-SRi7.js";
4
4
  import { c as u } from "./clsx-AexbMWKp.js";
5
5
  import { X as l } from "./x-BXShoIAM.js";
6
6
  import '../assets/Tag.css';const T = "_button_1nm6n_1", p = "_success_1nm6n_16", f = "_warning_1nm6n_17", d = "_info_1nm6n_18", x = "_important_1nm6n_19", b = "_tag_1nm6n_31", w = "_tagText_1nm6n_83", L = "_dismissable_1nm6n_88", N = "_tagList_1nm6n_92", s = {
@@ -4,11 +4,11 @@ import { useContextProps as p, TextFieldContext as b, TextField as g, InputConte
4
4
  import { a as A, c as h } from "./clsx-AexbMWKp.js";
5
5
  import { s as d } from "./TextField.module-DZslrEPC.js";
6
6
  import { T as w } from "./Text-TWzJxnto.js";
7
- import { B } from "./Button-BYrLbzir.js";
7
+ import { B } from "./Button-BGu-SRi7.js";
8
8
  import { u as L } from "./useLocalizedStringFormatter-BHvsRxDk.js";
9
9
  import { F as u } from "./FieldError-Bra5aRT3.js";
10
10
  import { C as E } from "./CharacterCounter-R6vh7AE5.js";
11
- import { a as S, L as $ } from "./Label-6SXmzRZE.js";
11
+ import { a as S, L as $ } from "./Label-xWKvOuML.js";
12
12
  const x = l(
13
13
  (e, a) => {
14
14
  [e] = p(e, a, b);
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as c, Fragment as f } from "react/jsx-runtime";
2
- import { B as p } from "./Button-BYrLbzir.js";
2
+ import { B as p } from "./Button-BGu-SRi7.js";
3
3
  import { useToastRegion as g, useToast as h } from "react-aria";
4
4
  import { ToastQueue as v, useToastQueue as R, useToastState as y } from "react-stately";
5
5
  import l from "react";
@@ -1,4 +1,4 @@
1
- import { C as t } from "../chunks/ClearButton-DavPe5uU.js";
1
+ import { C as t } from "../chunks/ClearButton-Dtkd_M_7.js";
2
2
  export {
3
3
  t as ClearButton
4
4
  };
@@ -1,13 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
- import { optionsWithSections } from '../utils/tests';
2
+ import { options, optionsWithSections } from '../../../../tools/test-utils/src/index.ts';
3
3
  import { ComboBox } from './ComboBox';
4
4
  type Item = (typeof options)[0];
5
5
  type Section = (typeof optionsWithSections)[0];
6
6
  type Story<T extends object = Item> = StoryObj<typeof ComboBox<T>>;
7
- declare const options: {
8
- id: number;
9
- name: string;
10
- }[];
11
7
  declare const _default: {
12
8
  component: typeof ComboBox;
13
9
  title: string;
@@ -26,7 +22,7 @@ declare const _default: {
26
22
  };
27
23
  };
28
24
  render: (args: import('./ComboBox').ComboBoxProps<{
29
- id: number;
25
+ id: import('react-aria').Key;
30
26
  name: string;
31
27
  }>) => import("react/jsx-runtime").JSX.Element;
32
28
  };
package/combobox/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as a, a as b, b as x } from "../chunks/ComboBox-BXcuyHPd.js";
1
+ import { C as a, a as b, b as x } from "../chunks/ComboBox-BrpJ6b7d.js";
2
2
  export {
3
3
  a as ComboBox,
4
4
  b as ComboBoxItem,
@@ -1,4 +1,4 @@
1
- import { D as t } from "../chunks/DateField-D9CEvqnd.js";
1
+ import { D as t } from "../chunks/DateField-CodiOrfY.js";
2
2
  import { a as r, b as o, D as p } from "../chunks/DateInputDivider-CkTB5q5k.js";
3
3
  export {
4
4
  t as DateField,
@@ -1,4 +1,4 @@
1
- import { D as r, a as t } from "../chunks/DateRangePicker-DGfdhIjR.js";
1
+ import { D as r, a as t } from "../chunks/DateRangePicker-DQB5TrfF.js";
2
2
  export {
3
3
  r as DatePicker,
4
4
  t as DateRangePicker
package/index.js CHANGED
@@ -1,44 +1,44 @@
1
- import { a as r, A as e } from "./chunks/AccordionItem-Cu5L1c1h.js";
1
+ import { A as r, a as e } from "./chunks/AccordionItem-BvJQhuYO.js";
2
2
  import { B as s, a as p } from "./chunks/BadgeContainer-CKVsfTlF.js";
3
3
  import { B as m } from "./chunks/Breadcrumbs-By2bMbQd.js";
4
- import { B as f } from "./chunks/Button-BYrLbzir.js";
4
+ import { B as f } from "./chunks/Button-BGu-SRi7.js";
5
5
  import { B as d } from "./chunks/ButtonGroup-Dr6HOBo2.js";
6
- import { C as l, R as u } from "./chunks/RangeCalendar-Bt8q3FZi.js";
6
+ import { C as l, R as u } from "./chunks/RangeCalendar-pgiXYhpG.js";
7
7
  import { C as g, d as b, c, a as B, e as L, f as S, b as D } from "./chunks/Card-ia98VoKL.js";
8
8
  import { C as G } from "./chunks/CharacterCounter-R6vh7AE5.js";
9
9
  import { C as R } from "./chunks/Checkbox-BTAfwDxU.js";
10
- import { C as F } from "./chunks/CheckboxGroup-C6LIpj_R.js";
10
+ import { C as F } from "./chunks/CheckboxGroup-C5NpRdqR.js";
11
11
  import { C as v } from "./chunks/ColorSchemeSwitch-CaqrCGTA.js";
12
- import { C as h, a as H, b as y } from "./chunks/ComboBox-BXcuyHPd.js";
13
- import { D as N } from "./chunks/DateField-D9CEvqnd.js";
12
+ import { C as h, a as H, b as y } from "./chunks/ComboBox-BrpJ6b7d.js";
13
+ import { D as N } from "./chunks/DateField-CodiOrfY.js";
14
14
  import { a as E, b as Q, D as Z } from "./chunks/DateInputDivider-CkTB5q5k.js";
15
- import { D as q, a as J } from "./chunks/DateRangePicker-DGfdhIjR.js";
15
+ import { D as q, a as J } from "./chunks/DateRangePicker-DQB5TrfF.js";
16
16
  import { F as O } from "./chunks/FieldError-Bra5aRT3.js";
17
17
  import { D as V, F as W } from "./chunks/FileUpload-h1PxqQmb.js";
18
18
  import { G as Y } from "./chunks/Grid-B-WgMwON.js";
19
19
  import { G as $ } from "./chunks/GridItem-5t1Z14sM.js";
20
20
  import { H as ao } from "./chunks/Heading-D8tNNJkt.js";
21
- import { I as eo } from "./chunks/InfoBanner-BOKZ4lBE.js";
22
- import { L as so } from "./chunks/Label-6SXmzRZE.js";
23
- import { H as xo, L as mo, N as io, S as fo, a as no } from "./chunks/Layout-BUK3KFXi.js";
21
+ import { I as eo } from "./chunks/InfoBanner-DEwlyEud.js";
22
+ import { L as so } from "./chunks/Label-xWKvOuML.js";
23
+ import { H as xo, L as mo, N as io, S as fo, a as no } from "./chunks/Layout-BiPXXkKY.js";
24
24
  import { L as lo } from "./chunks/Link-yTNUNv3C.js";
25
25
  import { L as Co } from "./chunks/LinkButton-3nAekUJ4.js";
26
26
  import { L as bo } from "./chunks/Logo-CsWcKqIg.js";
27
- import { M as Bo } from "./chunks/Dialog-DprWZBKT.js";
27
+ import { M as Bo } from "./chunks/Dialog-DRpxD3Gh.js";
28
28
  import { P as So } from "./chunks/Popover-BcEtFiU1.js";
29
- import { P as Io } from "./chunks/ProgressBar-67lCngwJ.js";
30
- import { R as Po, a as Ro } from "./chunks/Radio-XQA8CylD.js";
31
- import { S as Fo } from "./chunks/SearchField-Jqn3dKGs.js";
32
- import { S as vo } from "./chunks/Select-BNCz_ox4.js";
33
- import { S as ho } from "./chunks/Select-CyYUhMOg.js";
29
+ import { P as Io } from "./chunks/ProgressBar-KQdaaME2.js";
30
+ import { R as Po, a as Ro } from "./chunks/Radio-Clk616ep.js";
31
+ import { S as Fo } from "./chunks/SearchField-C493CTGJ.js";
32
+ import { S as vo } from "./chunks/Select-D9db38XE.js";
33
+ import { S as ho } from "./chunks/Select-CaSZY6w_.js";
34
34
  import { S as yo } from "./chunks/Skeleton-DqIHQLQl.js";
35
35
  import { S as No } from "./chunks/Spinner-tvJ7rPiT.js";
36
36
  import { b as Eo, C as Qo, R as Zo, T as jo, c as qo, a as Jo } from "./chunks/Table-BgsgXhC_.js";
37
37
  import { a as Oo, c as Uo, b as Vo, T as Wo } from "./chunks/TabList-D2XV5ixe.js";
38
- import { T as Yo, a as _o } from "./chunks/Tag-BKcduKRR.js";
38
+ import { T as Yo, a as _o } from "./chunks/Tag-CZrQBEgv.js";
39
39
  import { T as oa } from "./chunks/Text-TWzJxnto.js";
40
- import { I as ra, b as ea, a as ta, T as sa } from "./chunks/TextArea-BM5wOL3b.js";
41
- import { G as xa, b as ma, T as ia, a as fa, t as na } from "./chunks/Toast-C-EV39pd.js";
40
+ import { I as ra, b as ea, a as ta, T as sa } from "./chunks/TextArea-kEpt5DKm.js";
41
+ import { G as xa, b as ma, T as ia, a as fa, t as na } from "./chunks/Toast-BehM7JJP.js";
42
42
  import { T as Ta, a as la } from "./chunks/ToggleButtonGroup-CXKTrLbb.js";
43
43
  import { T as Ca, a as ga } from "./chunks/Tooltip-m032jGgF.js";
44
44
  import { L as ca } from "./chunks/ListBox-D5BBeZWL.js";
@@ -1,4 +1,4 @@
1
- import { I as r } from "../chunks/InfoBanner-BOKZ4lBE.js";
1
+ import { I as r } from "../chunks/InfoBanner-DEwlyEud.js";
2
2
  export {
3
3
  r as InfoBanner
4
4
  };
package/label/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { L as o } from "../chunks/Label-6SXmzRZE.js";
1
+ import { L as o } from "../chunks/Label-xWKvOuML.js";
2
2
  export {
3
3
  o as Label
4
4
  };
package/layout/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as e, L as s, N as b, S as d, a as i } from "../chunks/Layout-BUK3KFXi.js";
1
+ import { H as e, L as s, N as b, S as d, a as i } from "../chunks/Layout-BiPXXkKY.js";
2
2
  export {
3
3
  e as Header,
4
4
  s as Layout,
@@ -13,8 +13,8 @@ declare const _default: {
13
13
  isSelectableAll: false;
14
14
  label: string;
15
15
  options: {
16
+ id: import('react-aria').Key;
16
17
  name: string;
17
- id: string;
18
18
  }[];
19
19
  placeholder: string;
20
20
  selectionMode: "single";
@@ -1,4 +1,4 @@
1
- import { S as c } from "../chunks/Select-CyYUhMOg.js";
1
+ import { S as c } from "../chunks/Select-CaSZY6w_.js";
2
2
  export {
3
3
  c as LegacySelect
4
4
  };
package/modal/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M as a } from "../chunks/Dialog-DprWZBKT.js";
1
+ import { M as a } from "../chunks/Dialog-DRpxD3Gh.js";
2
2
  import { DialogTrigger as g } from "react-aria-components";
3
3
  export {
4
4
  g as DialogTrigger,
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "16.4.2",
17
+ "version": "16.5.0",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1,4 +1,4 @@
1
- import { P as s } from "../chunks/ProgressBar-67lCngwJ.js";
1
+ import { P as s } from "../chunks/ProgressBar-KQdaaME2.js";
2
2
  export {
3
3
  s as ProgressBar
4
4
  };
package/radio/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as r, a as R } from "../chunks/Radio-XQA8CylD.js";
1
+ import { R as r, a as R } from "../chunks/Radio-Clk616ep.js";
2
2
  export {
3
3
  r as Radio,
4
4
  R as RadioGroup
@@ -1,4 +1,4 @@
1
- import { S as a } from "../chunks/SearchField-Jqn3dKGs.js";
1
+ import { S as a } from "../chunks/SearchField-C493CTGJ.js";
2
2
  export {
3
3
  a as SearchField
4
4
  };
@@ -1,5 +1,6 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
- import { options, optionsWithSections } from '../utils/tests';
2
+ import { options, optionsWithSections } from '../../../../tools/test-utils/src/index.ts';
3
+ import { Key } from 'react-aria-components';
3
4
  import { Select, SelectionMode } from './Select';
4
5
  type Story<T extends object = Item, M extends SelectionMode = 'single'> = StoryObj<typeof Select<T, M>>;
5
6
  type Item = (typeof options)[0];
@@ -10,16 +11,16 @@ declare const _default: {
10
11
  tags: string[];
11
12
  args: {
12
13
  children: (item: {
14
+ id: Key;
13
15
  name: string;
14
- id: string;
15
16
  }) => import("react/jsx-runtime").JSX.Element;
16
17
  description: string;
17
18
  isDisabled: false;
18
19
  isSelectableAll: false;
19
20
  label: string;
20
21
  items: {
22
+ id: Key;
21
23
  name: string;
22
- id: string;
23
24
  }[];
24
25
  placeholder: string;
25
26
  selectionMode: "single";
package/select/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "../chunks/Select-BNCz_ox4.js";
1
+ import { S as r } from "../chunks/Select-D9db38XE.js";
2
2
  export {
3
3
  r as Select
4
4
  };
package/tag/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as r, a as T } from "../chunks/Tag-BKcduKRR.js";
1
+ import { T as r, a as T } from "../chunks/Tag-CZrQBEgv.js";
2
2
  export {
3
3
  r as Tag,
4
4
  T as TagGroup
@@ -1,4 +1,4 @@
1
- import { I as s, b as t, a as x, T } from "../chunks/TextArea-BM5wOL3b.js";
1
+ import { I as s, b as t, a as x, T } from "../chunks/TextArea-kEpt5DKm.js";
2
2
  export {
3
3
  s as Input,
4
4
  t as TextArea,
package/toast/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G as s, b as t, T as e, a as r, t as T } from "../chunks/Toast-C-EV39pd.js";
1
+ import { G as s, b as t, T as e, a as r, t as T } from "../chunks/Toast-BehM7JJP.js";
2
2
  import { useToastState as u } from "react-stately";
3
3
  export {
4
4
  s as GlobalToastRegion,
@@ -1,46 +0,0 @@
1
- import { jsx as e, jsxs as c, Fragment as l } from "react/jsx-runtime";
2
- import { B as r } from "./Button.module-Cm0H98vy.js";
3
- import { Button as u } from "react-aria-components";
4
- import { c as p } from "./clsx-AexbMWKp.js";
5
- import { S as g } from "./Spinner-tvJ7rPiT.js";
6
- const S = ({
7
- variant: i = "primary",
8
- fullwidth: o,
9
- className: m,
10
- iconPlacement: s,
11
- size: d = "large",
12
- icon: n,
13
- iconSize: a,
14
- ...t
15
- }) => /* @__PURE__ */ e(
16
- u,
17
- {
18
- className: p(
19
- r.button,
20
- i === "primary" && r.primary,
21
- i === "secondary" && r.secondary,
22
- i === "tertiary" && r.tertiary,
23
- i === "danger" && r.danger,
24
- i === "icon" && r.iconBtn,
25
- o && r.fullwidth,
26
- d === "medium" && r.medium,
27
- s === "right" && r.iconRight,
28
- m
29
- ),
30
- ...t,
31
- children: /* @__PURE__ */ c(l, { children: [
32
- n && !t.isPending && /* @__PURE__ */ e(
33
- n,
34
- {
35
- "aria-hidden": !0,
36
- size: a ?? 20
37
- }
38
- ),
39
- t.isPending && /* @__PURE__ */ e(g, { small: !0 }),
40
- t.children
41
- ] })
42
- }
43
- );
44
- export {
45
- S as B
46
- };
@@ -1,91 +0,0 @@
1
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
- import * as _ from "react";
3
- import { DateField as D, DateFieldStateContext as x } from "react-aria-components";
4
- import { c as d } from "./clsx-AexbMWKp.js";
5
- import { a as g, D as B } from "./DateInputDivider-CkTB5q5k.js";
6
- import { F as f } from "./FieldError-Bra5aRT3.js";
7
- import { a as C, L as b } from "./Label-6SXmzRZE.js";
8
- import { T as L } from "./Text-TWzJxnto.js";
9
- import { C as S } from "./ClearButton-DavPe5uU.js";
10
- import { FocusScope as v, useFocusManager as N } from "@react-aria/focus";
11
- import { u as V } from "./useLocalizedStringFormatter-BHvsRxDk.js";
12
- import '../assets/DateField.css';const j = { clear: "Clear date" }, T = { clear: "Rensa datum" }, E = {
13
- en: j,
14
- sv: T
15
- }, I = "_dateField_3cnhf_1", M = "_inputField_3cnhf_7", P = "_medium_3cnhf_38", R = "_clearButton_3cnhf_47", s = {
16
- dateField: I,
17
- inputField: M,
18
- medium: P,
19
- clearButton: R
20
- }, W = ({
21
- isClearable: i,
22
- size: t,
23
- isDisabled: o,
24
- isReadOnly: r
25
- }) => {
26
- const l = V(E), a = _.useContext(x), n = N(), c = () => {
27
- a?.setValue(null), n?.focusFirst();
28
- };
29
- return i && a?.value != null && !r ? /* @__PURE__ */ e(
30
- S,
31
- {
32
- onPress: c,
33
- size: t,
34
- isDisabled: o,
35
- "aria-label": l.format("clear"),
36
- className: d(s.clearButton, {
37
- [s.medium]: t === "medium"
38
- })
39
- }
40
- ) : null;
41
- }, Q = ({
42
- className: i,
43
- description: t,
44
- errorMessage: o,
45
- errorPosition: r = "top",
46
- label: l,
47
- size: a = "large",
48
- popover: n,
49
- isClearable: c = !1,
50
- isReadOnly: m,
51
- isDisabled: u,
52
- ...F
53
- }) => /* @__PURE__ */ p(
54
- D,
55
- {
56
- ...F,
57
- isReadOnly: m,
58
- isDisabled: u,
59
- className: d(s.dateField, i),
60
- children: [
61
- /* @__PURE__ */ e(C, { popover: n, children: l && /* @__PURE__ */ e(b, { children: l }) }),
62
- t && /* @__PURE__ */ e(L, { slot: "description", children: t }),
63
- r === "top" && /* @__PURE__ */ e(f, { children: o }),
64
- /* @__PURE__ */ e(
65
- "div",
66
- {
67
- className: d(s.inputField, {
68
- [s.medium]: a === "medium"
69
- }),
70
- "data-testid": "date-field_input-field",
71
- children: /* @__PURE__ */ p(v, { children: [
72
- /* @__PURE__ */ e(g, { children: (h) => /* @__PURE__ */ e(B, { segment: h }) }),
73
- /* @__PURE__ */ e(
74
- W,
75
- {
76
- isClearable: c,
77
- size: a,
78
- isDisabled: u,
79
- isReadOnly: m
80
- }
81
- )
82
- ] })
83
- }
84
- ),
85
- r === "bottom" && /* @__PURE__ */ e(f, { children: o })
86
- ]
87
- }
88
- );
89
- export {
90
- Q as D
91
- };
@@ -1,191 +0,0 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import { Group as B, Button as F, DatePickerStateContext as b, DateRangePickerStateContext as M, Popover as S, Dialog as N, DatePicker as R, DateRangePicker as G } from "react-aria-components";
3
- import { a as k } from "./clsx-AexbMWKp.js";
4
- import { C as L, R as I } from "./RangeCalendar-Bt8q3FZi.js";
5
- import { a as v, D as P, b as V } from "./DateInputDivider-CkTB5q5k.js";
6
- import { F as _ } from "./FieldError-Bra5aRT3.js";
7
- import { a as g, L as y } from "./Label-6SXmzRZE.js";
8
- import { T as D } from "./Text-TWzJxnto.js";
9
- import * as f from "react";
10
- import { C as j } from "./ClearButton-DavPe5uU.js";
11
- import { FocusScope as w, useFocusManager as O } from "@react-aria/focus";
12
- import { c as T } from "./createLucideIcon-D4r5Phnh.js";
13
- import { u as $ } from "./useLocalizedStringFormatter-BHvsRxDk.js";
14
- import '../assets/DateRangePicker.css';const E = [
15
- ["path", { d: "M8 2v4", key: "1cmpym" }],
16
- ["path", { d: "M16 2v4", key: "4m81vk" }],
17
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
18
- ["path", { d: "M3 10h18", key: "8toen8" }],
19
- ["path", { d: "M8 14h.01", key: "6423bh" }],
20
- ["path", { d: "M12 14h.01", key: "1etili" }],
21
- ["path", { d: "M16 14h.01", key: "1gbofw" }],
22
- ["path", { d: "M8 18h.01", key: "lrp35t" }],
23
- ["path", { d: "M12 18h.01", key: "mhygvu" }],
24
- ["path", { d: "M16 18h.01", key: "kzsmim" }]
25
- ], W = T("calendar-days", E), q = { clear: "Clear date" }, z = { clear: "Rensa datum" }, A = {
26
- en: q,
27
- sv: z
28
- }, H = "_datePicker_10uve_1", J = "_inputField_10uve_8", K = "_medium_10uve_24", Q = "_readOnly_10uve_51", U = "_buttonGroup_10uve_56", X = "_clearButton_10uve_62", Y = "_calendarButton_10uve_97", Z = "_dialog_10uve_137", r = {
29
- datePicker: H,
30
- inputField: J,
31
- medium: K,
32
- readOnly: Q,
33
- buttonGroup: U,
34
- clearButton: X,
35
- calendarButton: Y,
36
- dialog: Z
37
- }, ee = (t) => !!t && !!t.value && Object.prototype.hasOwnProperty.call(t.value, "start"), te = ({
38
- isClearable: t,
39
- isDisabled: c,
40
- isReadOnly: i,
41
- size: a
42
- }) => {
43
- const n = f.useContext(b), l = f.useContext(M), m = $(A), s = O(), o = l ?? n, h = ee(o) ? !!o.value.start && o.value.end : !!o?.value;
44
- return t && h && !i ? /* @__PURE__ */ e(
45
- j,
46
- {
47
- onPress: () => {
48
- o?.setValue(null), s?.focusFirst();
49
- },
50
- size: a,
51
- isDisabled: c,
52
- "aria-label": m.format("clear"),
53
- className: k(r.clearButton, {
54
- [r.medium]: a === "medium"
55
- })
56
- }
57
- ) : null;
58
- }, C = ({
59
- children: t,
60
- isDisabled: c,
61
- isInvalid: i,
62
- isReadOnly: a,
63
- size: n = "large",
64
- isClearable: l = !1
65
- }) => /* @__PURE__ */ e(
66
- B,
67
- {
68
- className: k(r.inputField, {
69
- [r.medium]: n === "medium",
70
- [r.readOnly]: a
71
- }),
72
- children: /* @__PURE__ */ p(w, { children: [
73
- t,
74
- /* @__PURE__ */ p("div", { className: r.buttonGroup, children: [
75
- /* @__PURE__ */ e(
76
- te,
77
- {
78
- isClearable: l,
79
- isDisabled: c,
80
- isReadOnly: a,
81
- size: n
82
- }
83
- ),
84
- /* @__PURE__ */ e(
85
- F,
86
- {
87
- className: k(r.calendarButton, {
88
- [r.medium]: n === "medium",
89
- [r.readOnly]: a
90
- }),
91
- "data-invalid": i || void 0,
92
- isDisabled: c,
93
- children: /* @__PURE__ */ e(
94
- W,
95
- {
96
- "aria-hidden": !0,
97
- size: 20
98
- }
99
- )
100
- }
101
- )
102
- ] })
103
- ] })
104
- }
105
- ), x = ({
106
- children: t
107
- }) => /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(N, { className: r.dialog, children: t }) }), pe = ({
108
- className: t,
109
- description: c,
110
- errorMessage: i,
111
- errorPosition: a = "top",
112
- label: n,
113
- popover: l,
114
- isClearable: m = !1,
115
- isReadOnly: s,
116
- isDisabled: o,
117
- size: h,
118
- ...d
119
- }) => /* @__PURE__ */ p(
120
- R,
121
- {
122
- className: k(r.datePicker, t),
123
- isReadOnly: s,
124
- isDisabled: o,
125
- ...d,
126
- children: [
127
- /* @__PURE__ */ e(g, { popover: l, children: n && /* @__PURE__ */ e(y, { children: n }) }),
128
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
129
- a === "top" && /* @__PURE__ */ e(_, { children: i }),
130
- /* @__PURE__ */ e(
131
- C,
132
- {
133
- isClearable: m,
134
- isReadOnly: s,
135
- isDisabled: o,
136
- size: h,
137
- ...d,
138
- children: /* @__PURE__ */ e(v, { children: (u) => /* @__PURE__ */ e(P, { segment: u }) })
139
- }
140
- ),
141
- a === "bottom" && /* @__PURE__ */ e(_, { children: i }),
142
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(L, {}) })
143
- ]
144
- }
145
- ), ke = ({
146
- className: t,
147
- description: c,
148
- errorMessage: i,
149
- errorPosition: a = "top",
150
- label: n,
151
- popover: l,
152
- isClearable: m = !1,
153
- isReadOnly: s,
154
- isDisabled: o,
155
- size: h,
156
- ...d
157
- }) => /* @__PURE__ */ p(
158
- G,
159
- {
160
- className: k(r.datePicker, t),
161
- isReadOnly: s,
162
- isDisabled: o,
163
- ...d,
164
- children: [
165
- /* @__PURE__ */ e(g, { popover: l, children: n && /* @__PURE__ */ e(y, { children: n }) }),
166
- c && /* @__PURE__ */ e(D, { slot: "description", children: c }),
167
- a === "top" && /* @__PURE__ */ e(_, { children: i }),
168
- /* @__PURE__ */ p(
169
- C,
170
- {
171
- isClearable: m,
172
- isReadOnly: s,
173
- isDisabled: o,
174
- size: h,
175
- ...d,
176
- children: [
177
- /* @__PURE__ */ e(v, { slot: "start", children: (u) => /* @__PURE__ */ e(P, { segment: u }) }),
178
- /* @__PURE__ */ e(V, {}),
179
- /* @__PURE__ */ e(v, { slot: "end", children: (u) => /* @__PURE__ */ e(P, { segment: u }) })
180
- ]
181
- }
182
- ),
183
- a === "bottom" && /* @__PURE__ */ e(_, { children: i }),
184
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(I, {}) })
185
- ]
186
- }
187
- );
188
- export {
189
- pe as D,
190
- ke as a
191
- };
@@ -1,12 +0,0 @@
1
- export declare function generateMockOptions(count: number): {
2
- id: number;
3
- name: string;
4
- }[];
5
- export declare const optionsWithSections: {
6
- name: string;
7
- id: number;
8
- children: {
9
- name: string;
10
- id: number;
11
- }[];
12
- }[];
@@ -1,11 +0,0 @@
1
- export declare const options: {
2
- name: string;
3
- id: string;
4
- }[];
5
- export declare const optionsWithSections: {
6
- name: string;
7
- children: {
8
- name: string;
9
- id: string;
10
- }[];
11
- }[];