@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.
- package/CHANGELOG.md +16 -0
- package/accordion/Accordion.stories.d.ts +24 -0
- package/assets/DateField.css +1 -1
- package/assets/DateRangePicker.css +1 -1
- package/badge/Badge.stories.d.ts +17 -0
- package/breadcrumbs/Breadcrumbs.stories.d.ts +16 -0
- package/button/Button.stories.d.ts +25 -0
- package/button/ButtonGroup.stories.d.ts +15 -0
- package/calendar/Calendar.stories.d.ts +15 -0
- package/calendar/RangeCalendar.stories.d.ts +13 -0
- package/card/Card.stories.d.ts +12 -0
- package/checkbox/Checkbox.stories.d.ts +30 -0
- package/checkbox/CheckboxGroup.stories.d.ts +29 -0
- package/chunks/ClearButton-DavPe5uU.js +21 -0
- package/chunks/DateField-D9CEvqnd.js +91 -0
- package/chunks/DateRangePicker-DGfdhIjR.js +191 -0
- package/chunks/SearchField-Jqn3dKGs.js +127 -0
- package/clear-button/ClearButton.d.ts +3 -0
- package/clear-button/index.d.ts +1 -0
- package/clear-button/index.js +4 -0
- package/color-scheme-switch/ColorSchemeSwitch.stories.d.ts +6 -0
- package/combobox/ComboBox.stories.d.ts +44 -0
- package/date-field/DateField.d.ts +4 -0
- package/date-field/DateField.stories.d.ts +13 -0
- package/date-field/index.js +1 -1
- package/date-field/intl/translations.json.d.ts +11 -0
- package/date-picker/DatePicker.d.ts +4 -0
- package/date-picker/DatePicker.stories.d.ts +14 -0
- package/date-picker/DatePickerInputField.d.ts +1 -1
- package/date-picker/DateRangePicker.d.ts +4 -0
- package/date-picker/DateRangePicker.stories.d.ts +38 -0
- package/date-picker/index.js +1 -1
- package/date-picker/intl/translations.json.d.ts +11 -0
- package/date-picker/utils.d.ts +2 -0
- package/file-upload/DropZone.stories.d.ts +6 -0
- package/file-upload/FileUpload.stories.d.ts +11 -0
- package/grid/Grid.stories.d.ts +30 -0
- package/heading/Heading.stories.d.ts +30 -0
- package/index.js +3 -3
- package/info-banner/InfoBanner.stories.d.ts +16 -0
- package/label/Label.stories.d.ts +10 -0
- package/layout/Layout.stories.d.ts +9 -0
- package/legacy-select/LegacySelect.stories.d.ts +27 -0
- package/link/Link.stories.d.ts +14 -0
- package/link-button/LinkButton.stories.d.ts +12 -0
- package/logo/Logo.stories.d.ts +7 -0
- package/menu/Menu.stories.d.ts +34 -0
- package/modal/Dialog.stories.d.ts +15 -0
- package/package.json +1 -1
- package/popover/Popover.stories.d.ts +18 -0
- package/progress-bar/ProgressBar.stories.d.ts +15 -0
- package/radio/Radio.stories.d.ts +53 -0
- package/search-field/SearchField.stories.d.ts +22 -0
- package/search-field/index.js +1 -1
- package/select/Select.stories.d.ts +45 -0
- package/skeleton/Skeleton.Form.stories.d.ts +20 -0
- package/skeleton/Skeleton.stories.d.ts +10 -0
- package/spinner/Spinner.stories.d.ts +20 -0
- package/table/Table.stories.d.ts +31 -0
- package/tabs/Tabs.stories.d.ts +22 -0
- package/tag/Tag.stories.d.ts +8 -0
- package/text/Text.stories.d.ts +12 -0
- package/textfield/TextArea.stories.d.ts +367 -0
- package/textfield/TextField.stories.d.ts +34 -0
- package/toast/Toast.stories.d.ts +22 -0
- package/tooltip/Tooltip.stories.d.ts +26 -0
- package/utils/tests.d.ts +17 -0
- package/chunks/DateField-DPJrihTz.js +0 -46
- package/chunks/DateRangePicker-DzgK_p0d.js +0 -117
- package/chunks/SearchField-CxoPi6Ql.js +0 -135
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 16.4.1 (2026-01-16)
|
|
2
|
+
|
|
3
|
+
### ๐งช Tests updated
|
|
4
|
+
|
|
5
|
+
- **textfield:** rename file ([8287e354be](https://github.com/migrationsverket/midas/commit/8287e354be))
|
|
6
|
+
- replace jest with vitest ([6d8ca7deb3](https://github.com/migrationsverket/midas/commit/6d8ca7deb3))
|
|
7
|
+
- move new tests into component folder ([306aaaa4f5](https://github.com/migrationsverket/midas/commit/306aaaa4f5))
|
|
8
|
+
- **Table:** skip a11y tests for slow virtualized table ([a6055b5c91](https://github.com/migrationsverket/midas/commit/a6055b5c91))
|
|
9
|
+
- move tests and stories to component folders ([967763f723](https://github.com/migrationsverket/midas/commit/967763f723))
|
|
10
|
+
|
|
11
|
+
## 16.4.0 (2026-01-15)
|
|
12
|
+
|
|
13
|
+
### ๐ Features
|
|
14
|
+
|
|
15
|
+
- **components, date-field, date-picker, search-field:** add clear button ([#995](https://github.com/migrationsverket/midas/pull/995))
|
|
16
|
+
|
|
1
17
|
## 16.3.3 (2026-01-14)
|
|
2
18
|
|
|
3
19
|
### ๐งฑ Updated Dependencies
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { Accordion } from '.';
|
|
4
|
+
type Story = StoryObj<typeof Accordion>;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
component: React.FC<import('./Accordion').MidasAccordion>;
|
|
7
|
+
subcomponents: {
|
|
8
|
+
AccordionItem: React.ComponentType<unknown>;
|
|
9
|
+
};
|
|
10
|
+
title: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
args: {
|
|
13
|
+
size: "large";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const Default: Story;
|
|
18
|
+
export declare const Contained: Story;
|
|
19
|
+
export declare const AllowsMultipleExpanded: Story;
|
|
20
|
+
export declare const DefaultExpandedKeys: Story;
|
|
21
|
+
export declare const CustomTriggerElements: Story;
|
|
22
|
+
export declare const DynamicContent: Story;
|
|
23
|
+
export declare const DS1060: Story;
|
|
24
|
+
export declare const AccordionHasBackground: Story;
|
package/assets/DateField.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._dateField_3cnhf_1{font-family:var(--midas-typography-font-family);display:flex;flex-direction:column;align-items:flex-start}._dateField_3cnhf_1[data-readonly] ._inputField_3cnhf_7{background-color:transparent;border-bottom-color:var(--midas-border-color-subtle)}._dateField_3cnhf_1[data-disabled] ._inputField_3cnhf_7{color:var(--midas-text-disabled);cursor:not-allowed;border-bottom-color:var(--midas-border-color-disabled);background-color:var(--midas-field-disabled)}._dateField_3cnhf_1[data-invalid] ._inputField_3cnhf_7{box-shadow:inset 0 0 0 3px var(--midas-support-border-warning);border-color:transparent}._inputField_3cnhf_7{box-sizing:border-box;width:100%;min-height:var(--midas-size-150);display:flex;justify-content:flex-start;align-items:center;background-color:var(--midas-field-01-base);border:1px solid transparent;border-bottom-color:var(--midas-border-color-primary);padding:0 1rem;position:relative}._inputField_3cnhf_7._medium_3cnhf_38{min-height:var(--midas-size-130)}._dateField_3cnhf_1:not([data-disabled],[data-readonly]) ._inputField_3cnhf_7 :hover{background-color:var(--midas-field-01-hover)}._clearButton_3cnhf_47{display:flex;align-items:center;justify-content:center;position:absolute;padding:.5rem;border:none;right:.25rem;top:50%;transform:translateY(-50%);background-color:transparent}._clearButton_3cnhf_47._medium_3cnhf_38{padding:.375rem}@media(forced-colors:active){._inputField_3cnhf_7{border:1px solid var(--midas-border-color-primary)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._datePicker_10uve_1{font-family:var(--midas-typography-font-family);display:flex;flex-direction:column;align-items:flex-start}._inputField_10uve_8{box-sizing:border-box;width:100%;height:var(--midas-size-150);align-items:center;background-color:var(--midas-field-01-base);border-bottom:1px solid var(--midas-border-color-primary);padding-left:1rem;display:flex;justify-content:flex-start;gap:1rem}@media(forced-colors:active){._inputField_10uve_8{border:1px solid var(--midas-border-color-primary)}}._inputField_10uve_8._medium_10uve_24{height:var(--midas-size-130)}._inputField_10uve_8[data-disabled]{cursor:not-allowed;border-color:var(--midas-border-color-disabled)}._inputField_10uve_8:focus-visible,._inputField_10uve_8[data-focus-visible]{outline:none}._inputField_10uve_8[data-focus-visible]{box-shadow:var(--midas-state-focus)}._inputField_10uve_8[data-invalid]{border:none;box-shadow:inset 0 0 0 3px var(--midas-support-border-warning)}@media(forced-colors:active){._inputField_10uve_8[data-invalid]{border:1px solid var(--midas-border-color-primary)}}._inputField_10uve_8._readOnly_10uve_51{background-color:transparent;border-color:var(--midas-border-color-subtle)}._inputField_10uve_8 ._buttonGroup_10uve_56{display:flex;margin-left:auto;gap:0}._inputField_10uve_8 ._clearButton_10uve_62{display:flex;align-items:center;justify-content:center;border:none;padding:.5rem;color:var(--midas-icon-primary);background-color:transparent;cursor:pointer}._inputField_10uve_8 ._clearButton_10uve_62._medium_10uve_24{padding:.375rem}._inputField_10uve_8 ._clearButton_10uve_62[data-disabled]{cursor:not-allowed;color:var(--midas-icon-disabled)}._inputField_10uve_8 ._clearButton_10uve_62[data-hovered]:not([data-disabled]){background-color:var(--midas-field-01-hover)}._inputField_10uve_8 ._clearButton_10uve_62:focus-visible,._inputField_10uve_8 ._clearButton_10uve_62[data-focus-visible]{outline:none;box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._inputField_10uve_8 ._clearButton_10uve_62:focus-visible,._inputField_10uve_8 ._clearButton_10uve_62[data-focus-visible]{outline:3px solid highlight;outline-offset:2px}}._inputField_10uve_8 ._calendarButton_10uve_97{display:flex;align-items:center;justify-content:center;border:none;padding:.5rem .75rem;color:var(--midas-icon-primary);background-color:transparent;cursor:pointer}._inputField_10uve_8 ._calendarButton_10uve_97._medium_10uve_24{padding:.375rem .625rem}._inputField_10uve_8 ._calendarButton_10uve_97[data-disabled]{cursor:not-allowed;color:var(--midas-icon-disabled)}._inputField_10uve_8 ._calendarButton_10uve_97._readOnly_10uve_51{color:var(--midas-icon-read-only)}._inputField_10uve_8 ._calendarButton_10uve_97[data-hovered]:not([data-disabled]){background-color:var(--midas-field-01-hover)}._inputField_10uve_8 ._calendarButton_10uve_97:focus-visible,._inputField_10uve_8 ._calendarButton_10uve_97[data-focus-visible]{outline:none;box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._inputField_10uve_8 ._calendarButton_10uve_97:focus-visible,._inputField_10uve_8 ._calendarButton_10uve_97[data-focus-visible]{outline:3px solid highlight;outline-offset:2px}}._dialog_10uve_137{box-shadow:0 3px 5px #0003}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Badge } from './Badge';
|
|
3
|
+
type Story = StoryObj<typeof Badge>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: import('react').FC<import('react').HTMLAttributes<HTMLSpanElement>>;
|
|
6
|
+
title: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
args: {};
|
|
12
|
+
render: (args: import('react').HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
export declare const NoLabel: Story;
|
|
16
|
+
export declare const WithLabel: Story;
|
|
17
|
+
export declare const LongLabel: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Breadcrumbs } from './Breadcrumbs';
|
|
3
|
+
type Story = StoryObj<typeof Breadcrumbs>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: <T extends import('./Breadcrumbs').BreadcrumbItem>({ items, className, ...rest }: import('./Breadcrumbs').BreadcrumbsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
title: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
args: {
|
|
9
|
+
items: {
|
|
10
|
+
title: string;
|
|
11
|
+
href: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const TertiaryWithIcon: Story;
|
|
9
|
+
export declare const PrimaryDisabled: Story;
|
|
10
|
+
export declare const SecondaryDisabled: Story;
|
|
11
|
+
export declare const PrimaryFullwidth: {
|
|
12
|
+
args: {
|
|
13
|
+
children: string;
|
|
14
|
+
fullwidth: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const Icon: {
|
|
18
|
+
args: {
|
|
19
|
+
children: undefined;
|
|
20
|
+
icon: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
21
|
+
variant: string;
|
|
22
|
+
'aria-label': string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const Danger: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ButtonGroup } from './ButtonGroup';
|
|
3
|
+
type Story = StoryObj<typeof ButtonGroup>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: import('react').FC<import('react').HTMLAttributes<HTMLDivElement>>;
|
|
6
|
+
title: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
args: {};
|
|
12
|
+
argTypes: {};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Calendar } from './Calendar';
|
|
3
|
+
type Story = StoryObj<typeof Calendar>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: import('react').FC<import('./Calendar').CalendarProps>;
|
|
6
|
+
render: (args: import('./Calendar').CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
title: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Primary: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
export declare const ReadOnly: Story;
|
|
14
|
+
export declare const Invalid: Story;
|
|
15
|
+
export declare const UnavailableWeekends: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { RangeCalendar } from './RangeCalendar';
|
|
3
|
+
type Story = StoryObj<typeof RangeCalendar>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: import('react').FC<import('./RangeCalendar').RangeCalendarProps>;
|
|
6
|
+
title: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
export declare const Primary: Story;
|
|
11
|
+
export declare const SelectedDates: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
export declare const ReadOnly: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Card } from './Card';
|
|
3
|
+
declare const meta: Meta<typeof Card>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Card>;
|
|
6
|
+
export declare const Example: Story;
|
|
7
|
+
export declare const Horizontal: Story;
|
|
8
|
+
export declare const WithActions: Story;
|
|
9
|
+
export declare const WithPrimaryAction: Story;
|
|
10
|
+
export declare const WithLink: Story;
|
|
11
|
+
export declare const WithImage: Story;
|
|
12
|
+
export declare const WithContainedImage: Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Checkbox } from './Checkbox';
|
|
3
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('react-aria').AriaCheckboxProps & import('react-aria-components').SlotProps & {
|
|
6
|
+
className?: string;
|
|
7
|
+
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
8
|
+
title: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: string;
|
|
12
|
+
};
|
|
13
|
+
args: {
|
|
14
|
+
isDisabled: false;
|
|
15
|
+
isIndeterminate: false;
|
|
16
|
+
isInvalid: false;
|
|
17
|
+
isReadOnly: false;
|
|
18
|
+
isRequired: false;
|
|
19
|
+
value: string;
|
|
20
|
+
children: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
export declare const Primary: Story;
|
|
25
|
+
export declare const Disabled: Story;
|
|
26
|
+
export declare const ReadOnly: Story;
|
|
27
|
+
export declare const Invalid: Story;
|
|
28
|
+
export declare const Indeterminate: Story;
|
|
29
|
+
export declare const Selected: Story;
|
|
30
|
+
export declare const Required: Story;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { CheckboxGroup } from './CheckboxGroup';
|
|
3
|
+
type Story = StoryObj<typeof CheckboxGroup>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof CheckboxGroup;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
args: {
|
|
11
|
+
isInvalid: false;
|
|
12
|
+
isDisabled: false;
|
|
13
|
+
isRequired: false;
|
|
14
|
+
isReadOnly: false;
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
errorMessage: string;
|
|
18
|
+
errorPosition: "top";
|
|
19
|
+
children: import("react/jsx-runtime").JSX.Element[];
|
|
20
|
+
};
|
|
21
|
+
tags: string[];
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
export declare const Primary: Story;
|
|
25
|
+
export declare const ShowSelectAll: Story;
|
|
26
|
+
export declare const SelectAllInteraction: Story;
|
|
27
|
+
export declare const Disabled: Story;
|
|
28
|
+
export declare const ReadOnly: Story;
|
|
29
|
+
export declare const Invalid: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { B as o } from "./Button-BYrLbzir.js";
|
|
3
|
+
import { X as i } from "./x-BXShoIAM.js";
|
|
4
|
+
const m = (t) => /* @__PURE__ */ r(
|
|
5
|
+
o,
|
|
6
|
+
{
|
|
7
|
+
variant: "icon",
|
|
8
|
+
slot: null,
|
|
9
|
+
...t,
|
|
10
|
+
children: /* @__PURE__ */ r(
|
|
11
|
+
i,
|
|
12
|
+
{
|
|
13
|
+
size: 20,
|
|
14
|
+
"aria-hidden": !0
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
m as C
|
|
21
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
};
|