@midas-ds/components 16.3.3 → 16.4.1

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 (70) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/Accordion.stories.d.ts +24 -0
  3. package/assets/DateField.css +1 -1
  4. package/assets/DateRangePicker.css +1 -1
  5. package/badge/Badge.stories.d.ts +17 -0
  6. package/breadcrumbs/Breadcrumbs.stories.d.ts +16 -0
  7. package/button/Button.stories.d.ts +25 -0
  8. package/button/ButtonGroup.stories.d.ts +15 -0
  9. package/calendar/Calendar.stories.d.ts +15 -0
  10. package/calendar/RangeCalendar.stories.d.ts +13 -0
  11. package/card/Card.stories.d.ts +12 -0
  12. package/checkbox/Checkbox.stories.d.ts +30 -0
  13. package/checkbox/CheckboxGroup.stories.d.ts +29 -0
  14. package/chunks/ClearButton-DavPe5uU.js +21 -0
  15. package/chunks/DateField-D9CEvqnd.js +91 -0
  16. package/chunks/DateRangePicker-DGfdhIjR.js +191 -0
  17. package/chunks/SearchField-Jqn3dKGs.js +127 -0
  18. package/clear-button/ClearButton.d.ts +3 -0
  19. package/clear-button/index.d.ts +1 -0
  20. package/clear-button/index.js +4 -0
  21. package/color-scheme-switch/ColorSchemeSwitch.stories.d.ts +6 -0
  22. package/combobox/ComboBox.stories.d.ts +44 -0
  23. package/date-field/DateField.d.ts +4 -0
  24. package/date-field/DateField.stories.d.ts +13 -0
  25. package/date-field/index.js +1 -1
  26. package/date-field/intl/translations.json.d.ts +11 -0
  27. package/date-picker/DatePicker.d.ts +4 -0
  28. package/date-picker/DatePicker.stories.d.ts +14 -0
  29. package/date-picker/DatePickerInputField.d.ts +1 -1
  30. package/date-picker/DateRangePicker.d.ts +4 -0
  31. package/date-picker/DateRangePicker.stories.d.ts +38 -0
  32. package/date-picker/index.js +1 -1
  33. package/date-picker/intl/translations.json.d.ts +11 -0
  34. package/date-picker/utils.d.ts +2 -0
  35. package/file-upload/DropZone.stories.d.ts +6 -0
  36. package/file-upload/FileUpload.stories.d.ts +11 -0
  37. package/grid/Grid.stories.d.ts +30 -0
  38. package/heading/Heading.stories.d.ts +30 -0
  39. package/index.js +3 -3
  40. package/info-banner/InfoBanner.stories.d.ts +16 -0
  41. package/label/Label.stories.d.ts +10 -0
  42. package/layout/Layout.stories.d.ts +9 -0
  43. package/legacy-select/LegacySelect.stories.d.ts +27 -0
  44. package/link/Link.stories.d.ts +14 -0
  45. package/link-button/LinkButton.stories.d.ts +12 -0
  46. package/logo/Logo.stories.d.ts +7 -0
  47. package/menu/Menu.stories.d.ts +34 -0
  48. package/modal/Dialog.stories.d.ts +15 -0
  49. package/package.json +1 -1
  50. package/popover/Popover.stories.d.ts +18 -0
  51. package/progress-bar/ProgressBar.stories.d.ts +15 -0
  52. package/radio/Radio.stories.d.ts +53 -0
  53. package/search-field/SearchField.stories.d.ts +22 -0
  54. package/search-field/index.js +1 -1
  55. package/select/Select.stories.d.ts +45 -0
  56. package/skeleton/Skeleton.Form.stories.d.ts +20 -0
  57. package/skeleton/Skeleton.stories.d.ts +10 -0
  58. package/spinner/Spinner.stories.d.ts +20 -0
  59. package/table/Table.stories.d.ts +31 -0
  60. package/tabs/Tabs.stories.d.ts +22 -0
  61. package/tag/Tag.stories.d.ts +8 -0
  62. package/text/Text.stories.d.ts +12 -0
  63. package/textfield/TextArea.stories.d.ts +367 -0
  64. package/textfield/TextField.stories.d.ts +34 -0
  65. package/toast/Toast.stories.d.ts +22 -0
  66. package/tooltip/Tooltip.stories.d.ts +26 -0
  67. package/utils/tests.d.ts +17 -0
  68. package/chunks/DateField-DPJrihTz.js +0 -46
  69. package/chunks/DateRangePicker-DzgK_p0d.js +0 -117
  70. package/chunks/SearchField-CxoPi6Ql.js +0 -135
@@ -0,0 +1,34 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { TextField } from './TextField';
3
+ type Story = StoryObj<typeof TextField>;
4
+ declare const _default: {
5
+ title: string;
6
+ component: import('react').ForwardRefExoticComponent<import('./TextFieldBase').TextFieldBaseProps & import('../utils/types').Complement<import('./TextFieldBase').TextFieldBaseProps, import('./Input').InputProps> & import('react').RefAttributes<HTMLInputElement>>;
7
+ argTypes: {
8
+ type: {
9
+ options: string[];
10
+ control: {
11
+ type: "select";
12
+ };
13
+ };
14
+ };
15
+ args: {
16
+ label: string;
17
+ description: string;
18
+ errorPosition: "top";
19
+ size: "large";
20
+ };
21
+ };
22
+ export default _default;
23
+ export declare const Primary: Story;
24
+ export declare const Password: Story;
25
+ export declare const Invalid: Story;
26
+ export declare const Required: Story;
27
+ export declare const CustomValidation: Story;
28
+ export declare const Number: Story;
29
+ export declare const Disabled: Story;
30
+ export declare const ReadOnly: Story;
31
+ export declare const ShowCounter: Story;
32
+ export declare const MaxLengthAndShowCounter: Story;
33
+ export declare const DS1243: Story;
34
+ export declare const WithHelpPopover: Story;
@@ -0,0 +1,22 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { MidasToast } from './Toast';
3
+ type Story = StoryObj<MidasToast>;
4
+ declare const _default: {
5
+ title: string;
6
+ tags: string[];
7
+ argTypes: {
8
+ type: {
9
+ control: "select";
10
+ description: string;
11
+ options: string[];
12
+ table: {
13
+ defaultValue: {
14
+ summary: string;
15
+ };
16
+ };
17
+ };
18
+ };
19
+ };
20
+ export default _default;
21
+ export declare const Global: Story;
22
+ export declare const Local: Story;
@@ -0,0 +1,26 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { MidasTooltipProps, Tooltip } from './Tooltip';
3
+ type Story = StoryObj<typeof Tooltip>;
4
+ declare const _default: {
5
+ component: typeof Tooltip;
6
+ subcomponents: {
7
+ TooltipTrigger: React.ComponentType<unknown>;
8
+ };
9
+ title: string;
10
+ tags: string[];
11
+ parameters: {
12
+ layout: string;
13
+ a11y: {
14
+ test: string;
15
+ };
16
+ };
17
+ args: {
18
+ children: string;
19
+ };
20
+ render: (args: MidasTooltipProps) => import("react/jsx-runtime").JSX.Element;
21
+ };
22
+ export default _default;
23
+ export declare const Primary: Story;
24
+ export declare const Open: Story;
25
+ export declare const Placement: Story;
26
+ export declare const PlacementStartRTL: Story;
@@ -0,0 +1,17 @@
1
+ export declare const options: {
2
+ name: string;
3
+ id: string;
4
+ }[];
5
+ export declare const mockedNow: import('@internationalized/date').CalendarDate;
6
+ export declare function generateMockOptions(count: number): {
7
+ id: number;
8
+ name: string;
9
+ }[];
10
+ export declare const optionsWithSections: {
11
+ name: string;
12
+ id: number;
13
+ children: {
14
+ name: string;
15
+ id: number;
16
+ }[];
17
+ }[];
@@ -1,46 +0,0 @@
1
- import { jsxs as F, jsx as e } from "react/jsx-runtime";
2
- import { DateField as u } from "react-aria-components";
3
- import { c as m } from "./clsx-AexbMWKp.js";
4
- import { a as _, D as f } from "./DateInputDivider-CkTB5q5k.js";
5
- import { F as s } from "./FieldError-Bra5aRT3.js";
6
- import { a as h, L as D } from "./Label-6SXmzRZE.js";
7
- import { T as b } from "./Text-TWzJxnto.js";
8
- import '../assets/DateField.css';const x = "_dateField_y3sba_1", y = "_inputField_y3sba_7", L = "_medium_y3sba_37", i = {
9
- dateField: x,
10
- inputField: y,
11
- medium: L
12
- }, S = ({
13
- className: r,
14
- description: t,
15
- errorMessage: d,
16
- errorPosition: a = "top",
17
- label: l,
18
- size: o = "large",
19
- popover: n,
20
- ...p
21
- }) => /* @__PURE__ */ F(
22
- u,
23
- {
24
- ...p,
25
- className: m(i.dateField, r),
26
- children: [
27
- /* @__PURE__ */ e(h, { popover: n, children: l && /* @__PURE__ */ e(D, { children: l }) }),
28
- t && /* @__PURE__ */ e(b, { slot: "description", children: t }),
29
- a === "top" && /* @__PURE__ */ e(s, { children: d }),
30
- /* @__PURE__ */ e(
31
- "div",
32
- {
33
- className: m(i.inputField, {
34
- [i.medium]: o === "medium"
35
- }),
36
- "data-testid": "date-field_input-field",
37
- children: /* @__PURE__ */ e(_, { children: (c) => /* @__PURE__ */ e(f, { segment: c }) })
38
- }
39
- ),
40
- a === "bottom" && /* @__PURE__ */ e(s, { children: d })
41
- ]
42
- }
43
- );
44
- export {
45
- S as D
46
- };
@@ -1,117 +0,0 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { Group as P, Button as b, Popover as f, Dialog as v, DatePicker as x, DateRangePicker as F } from "react-aria-components";
3
- import { a as m } from "./clsx-AexbMWKp.js";
4
- import { C as M, R as N } from "./RangeCalendar-Bt8q3FZi.js";
5
- import { a as p, D as k, b as B } from "./DateInputDivider-CkTB5q5k.js";
6
- import { F as h } from "./FieldError-Bra5aRT3.js";
7
- import { a as u, L as y } from "./Label-6SXmzRZE.js";
8
- import { T as _ } from "./Text-TWzJxnto.js";
9
- import { c as C } from "./createLucideIcon-D4r5Phnh.js";
10
- import '../assets/DateRangePicker.css';const I = [
11
- ["path", { d: "M8 2v4", key: "1cmpym" }],
12
- ["path", { d: "M16 2v4", key: "4m81vk" }],
13
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
14
- ["path", { d: "M3 10h18", key: "8toen8" }],
15
- ["path", { d: "M8 14h.01", key: "6423bh" }],
16
- ["path", { d: "M12 14h.01", key: "1etili" }],
17
- ["path", { d: "M16 14h.01", key: "1gbofw" }],
18
- ["path", { d: "M8 18h.01", key: "lrp35t" }],
19
- ["path", { d: "M12 18h.01", key: "mhygvu" }],
20
- ["path", { d: "M16 18h.01", key: "kzsmim" }]
21
- ], L = C("calendar-days", I), O = "_datePicker_175bg_1", R = "_inputField_175bg_8", j = "_medium_175bg_24", w = "_readOnly_175bg_42", T = "_calendarButton_175bg_60", $ = "_dialog_175bg_108", a = {
22
- datePicker: O,
23
- inputField: R,
24
- medium: j,
25
- readOnly: w,
26
- calendarButton: T,
27
- dialog: $
28
- }, g = ({
29
- children: i,
30
- isDisabled: r,
31
- isInvalid: n,
32
- isReadOnly: t,
33
- size: d = "large"
34
- }) => /* @__PURE__ */ l(
35
- P,
36
- {
37
- className: m(a.inputField, {
38
- [a.medium]: d === "medium",
39
- [a.readOnly]: t
40
- }),
41
- children: [
42
- i,
43
- /* @__PURE__ */ e(
44
- b,
45
- {
46
- className: m(a.calendarButton, {
47
- [a.medium]: d === "medium",
48
- [a.readOnly]: t
49
- }),
50
- "data-invalid": n || void 0,
51
- isDisabled: r,
52
- children: /* @__PURE__ */ e(
53
- L,
54
- {
55
- "aria-hidden": !0,
56
- size: 20
57
- }
58
- )
59
- }
60
- )
61
- ]
62
- }
63
- ), D = ({
64
- children: i
65
- }) => /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(v, { className: a.dialog, children: i }) }), K = ({
66
- className: i,
67
- description: r,
68
- errorMessage: n,
69
- errorPosition: t = "top",
70
- label: d,
71
- popover: s,
72
- ...c
73
- }) => /* @__PURE__ */ l(
74
- x,
75
- {
76
- className: m(a.datePicker, i),
77
- ...c,
78
- children: [
79
- /* @__PURE__ */ e(u, { popover: s, children: d && /* @__PURE__ */ e(y, { children: d }) }),
80
- r && /* @__PURE__ */ e(_, { slot: "description", children: r }),
81
- t === "top" && /* @__PURE__ */ e(h, { children: n }),
82
- /* @__PURE__ */ e(g, { ...c, children: /* @__PURE__ */ e(p, { children: (o) => /* @__PURE__ */ e(k, { segment: o }) }) }),
83
- t === "bottom" && /* @__PURE__ */ e(h, { children: n }),
84
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(M, {}) })
85
- ]
86
- }
87
- ), Q = ({
88
- className: i,
89
- description: r,
90
- errorMessage: n,
91
- errorPosition: t = "top",
92
- label: d,
93
- popover: s,
94
- ...c
95
- }) => /* @__PURE__ */ l(
96
- F,
97
- {
98
- className: m(a.datePicker, i),
99
- ...c,
100
- children: [
101
- /* @__PURE__ */ e(u, { popover: s, children: d && /* @__PURE__ */ e(y, { children: d }) }),
102
- r && /* @__PURE__ */ e(_, { slot: "description", children: r }),
103
- t === "top" && /* @__PURE__ */ e(h, { children: n }),
104
- /* @__PURE__ */ l(g, { ...c, children: [
105
- /* @__PURE__ */ e(p, { slot: "start", children: (o) => /* @__PURE__ */ e(k, { segment: o }) }),
106
- /* @__PURE__ */ e(B, {}),
107
- /* @__PURE__ */ e(p, { slot: "end", children: (o) => /* @__PURE__ */ e(k, { segment: o }) })
108
- ] }),
109
- t === "bottom" && /* @__PURE__ */ e(h, { children: n }),
110
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(N, {}) })
111
- ]
112
- }
113
- );
114
- export {
115
- K as D,
116
- Q as a
117
- };
@@ -1,135 +0,0 @@
1
- import { jsxs as u, jsx as n } from "react/jsx-runtime";
2
- import { s as N } from "./TextField.module-DZslrEPC.js";
3
- import { B as _ } from "./Button-BYrLbzir.js";
4
- import { c as l } from "./clsx-AexbMWKp.js";
5
- import * as x from "react";
6
- import { useSearchFieldState as j } from "react-stately";
7
- import { useSearchField as C } from "react-aria";
8
- import { F as f } from "./FieldError-Bra5aRT3.js";
9
- import { c as p } from "./createLucideIcon-D4r5Phnh.js";
10
- import { X as B } from "./x-BXShoIAM.js";
11
- import { u as D } from "./useLocalizedStringFormatter-BHvsRxDk.js";
12
- import '../assets/SearchField.css';const E = [
13
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
14
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
15
- ], k = p("search", E), P = "_container_basio_1", T = "_inner_basio_10", w = "_inputContainer_basio_15", I = "_medium_basio_21", K = "_icon_basio_26", L = "_clear_basio_39", M = "_input_basio_15", a = {
16
- container: P,
17
- inner: T,
18
- inputContainer: w,
19
- medium: I,
20
- icon: K,
21
- clear: L,
22
- input: M
23
- }, R = { search: "Search" }, V = { search: "Sök" }, O = {
24
- en: R,
25
- sv: V
26
- };
27
- function X(r) {
28
- return !!r?.length;
29
- }
30
- const Z = ({
31
- errorPosition: r = "top",
32
- size: t = "large",
33
- ...e
34
- }) => {
35
- const { value: i, setValue: d } = j(e), v = D(O), m = x.useRef(null), { inputProps: o, isInvalid: s, validationErrors: h, clearButtonProps: S } = C(
36
- {
37
- ...e,
38
- label: e.placeholder,
39
- validationBehavior: "native"
40
- },
41
- { value: i, setValue: d },
42
- m
43
- ), g = ({ target: c }) => d(c.value), y = () => d(""), b = () => {
44
- if (e.validate && X(e.validate(i)) || s || !i) {
45
- m.current?.focus();
46
- return;
47
- }
48
- e.onSubmit && e.onSubmit(i);
49
- }, F = ({ key: c }) => {
50
- c === "Enter" && b();
51
- };
52
- return /* @__PURE__ */ u(
53
- "div",
54
- {
55
- className: l(a.container, e.className),
56
- "data-disabled": o.disabled,
57
- children: [
58
- r === "top" && /* @__PURE__ */ n(f, { isInvalid: s, children: e.errorMessage ?? h.join(" ") }),
59
- /* @__PURE__ */ u("div", { className: a.inner, children: [
60
- /* @__PURE__ */ u(
61
- "div",
62
- {
63
- className: l(a.inputContainer, {
64
- [a.medium]: t === "medium"
65
- }),
66
- children: [
67
- /* @__PURE__ */ n(
68
- k,
69
- {
70
- size: 20,
71
- className: a.icon
72
- }
73
- ),
74
- /* @__PURE__ */ n(
75
- "input",
76
- {
77
- ...o,
78
- ...o.disabled && { "data-disabled": !0 },
79
- className: l(
80
- N.input,
81
- a.input,
82
- o.className,
83
- { [a.medium]: t === "medium" }
84
- ),
85
- ref: m,
86
- onChange: g,
87
- value: i,
88
- "aria-invalid": s,
89
- onKeyDown: F,
90
- "aria-label": e.placeholder,
91
- "aria-labelledby": ""
92
- }
93
- ),
94
- i.length > 0 && /* @__PURE__ */ n(
95
- _,
96
- {
97
- variant: "icon",
98
- size: t,
99
- className: l(a.clear, {
100
- [a.medium]: t === "medium"
101
- }),
102
- onPress: y,
103
- ...S,
104
- children: /* @__PURE__ */ n(
105
- B,
106
- {
107
- size: 20,
108
- "aria-hidden": !0
109
- }
110
- )
111
- }
112
- )
113
- ]
114
- }
115
- ),
116
- /* @__PURE__ */ n(
117
- _,
118
- {
119
- size: t,
120
- isDisabled: e.isDisabled,
121
- excludeFromTabOrder: !0,
122
- onPress: b,
123
- type: "button",
124
- children: e.buttonText ? e.buttonText : v.format("search")
125
- }
126
- )
127
- ] }),
128
- r === "bottom" && /* @__PURE__ */ n(f, { isInvalid: s, children: e.errorMessage ?? h.join(" ") })
129
- ]
130
- }
131
- );
132
- };
133
- export {
134
- Z as S
135
- };