@strapi/design-system 1.6.4 → 1.6.6
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/Accordion/Accordion.cjs +1 -1
- package/dist/Accordion/Accordion.js +1 -1
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +48 -51
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +17 -16
- package/dist/BaseRadio/BaseRadio.cjs +1 -1
- package/dist/BaseRadio/BaseRadio.js +1 -1
- package/dist/Box/Box.cjs +3 -3
- package/dist/Box/Box.js +26 -26
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +1 -1
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +16 -4
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +13 -13
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +13 -13
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +62 -63
- package/dist/DatePicker/DatePicker.cjs +8 -1
- package/dist/DatePicker/DatePicker.js +71 -98
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +125 -57
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +43 -26
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +31 -15
- package/dist/DatePicker/components.cjs +8 -6
- package/dist/DatePicker/components.js +15 -13
- package/dist/DatePicker/utils/getDayOfWeek.js +8 -8
- package/dist/DatePicker/utils/getMonths.cjs +1 -1
- package/dist/DatePicker/utils/getMonths.js +3 -3
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +1 -1
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -104
- package/dist/Dialog/Dialog.cjs +4 -4
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Dialog/DialogFooter.cjs +3 -3
- package/dist/Dialog/DialogFooter.js +2 -2
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +31 -27
- package/dist/Field/FieldAction.cjs +2 -8
- package/dist/Field/FieldAction.js +27 -16
- package/dist/Field/FieldContext.cjs +1 -1
- package/dist/Field/FieldContext.js +2 -2
- package/dist/Field/FieldError.cjs +1 -1
- package/dist/Field/FieldError.js +14 -4
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +17 -7
- package/dist/Field/FieldInput.cjs +14 -16
- package/dist/Field/FieldInput.js +104 -72
- package/dist/Field/FieldLabel.cjs +6 -3
- package/dist/Field/FieldLabel.js +43 -25
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +34 -38
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +32 -30
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +29 -27
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +3 -3
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +33 -13
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +20 -10
- package/dist/ModalLayout/ModalLayout.cjs +1 -1
- package/dist/ModalLayout/ModalLayout.js +1 -1
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +32 -32
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +1 -1
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +64 -67
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +39 -37
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +14 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +13 -8
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +20 -13
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +7 -6
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +66 -65
- package/dist/Select/SelectButton.cjs +3 -3
- package/dist/Select/SelectButton.js +17 -15
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +10 -8
- package/dist/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +2 -2
- package/dist/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/SubNav/SubNavLinkSection.js +1 -1
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +7 -7
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +17 -7
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +1 -1
- package/dist/Tag/Tag.cjs +8 -8
- package/dist/Tag/Tag.js +52 -49
- package/dist/TextButton/TextButton.cjs +6 -12
- package/dist/TextButton/TextButton.js +32 -46
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +48 -47
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +12 -13
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +13 -12
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +48 -100
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +2 -2
- package/dist/ToggleCheckbox/ToggleCheckbox.js +1 -0
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +28 -29
- package/dist/Tooltip/Tooltip.cjs +1 -1
- package/dist/Tooltip/Tooltip.js +1 -1
- package/dist/helpers/deprecations.cjs +1 -1
- package/dist/helpers/deprecations.js +7 -7
- package/dist/helpers/useElementOnScreen.cjs +1 -1
- package/dist/helpers/useElementOnScreen.js +4 -13
- package/dist/helpers/useId.cjs +1 -1
- package/dist/helpers/useId.js +4 -11
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +4 -21
- package/dist/helpers/useLockScroll.cjs +1 -1
- package/dist/helpers/useLockScroll.js +4 -7
- package/dist/helpers/usePrevious.cjs +1 -1
- package/dist/helpers/usePrevious.js +4 -8
- package/dist/helpers/useResizeObserver.cjs +1 -1
- package/dist/helpers/useResizeObserver.js +4 -14
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useIntersection.js +3 -3
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +33 -13
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +20 -10
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/v2/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +2 -2
- package/dist/v2/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/v2/SubNav/SubNavLinkSection.js +1 -1
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +10 -10
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +17 -7
- package/package.json +5 -3
- package/dist/DateTimePicker/DateTimePickerProps.cjs +0 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +0 -40
- package/dist/DateTimePicker/__tests__/parseDate.test.cjs +0 -1
- package/dist/DateTimePicker/__tests__/parseDate.test.js +0 -8
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -7
- package/dist/Select/SingleSelect.cjs +0 -82
- package/dist/Select/SingleSelect.js +0 -285
|
@@ -1,74 +1,142 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { DatePickerPopover as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useEffect as O } from "react";
|
|
3
|
+
import { DatePickerPopover as W } from "./components.js";
|
|
4
4
|
import { DatePickerTd as H } from "./DatePickerTd.js";
|
|
5
|
-
import { DatePickerTh as
|
|
5
|
+
import { DatePickerTh as t } from "./DatePickerTh.js";
|
|
6
6
|
import { getDayOfWeek as I } from "./utils/getDayOfWeek.js";
|
|
7
7
|
import { getMonths as V } from "./utils/getMonths.js";
|
|
8
|
-
import { generateWeeks as
|
|
8
|
+
import { generateWeeks as q } from "./utils/generateWeeks.js";
|
|
9
9
|
import { getYears as z } from "./utils/getYears.js";
|
|
10
10
|
import { formatDate as A } from "./utils/formatDate.js";
|
|
11
11
|
import { Box as p } from "../Box/Box.js";
|
|
12
12
|
import { Flex as G } from "../Flex/Flex.js";
|
|
13
13
|
import { FocusTrap as J } from "../FocusTrap/FocusTrap.js";
|
|
14
|
-
import {
|
|
15
|
-
import "../RawTable/
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
14
|
+
import { getDefaultLocale as K } from "../helpers/getDefaultLocale.js";
|
|
15
|
+
import { RawTable as N } from "../RawTable/RawTable.js";
|
|
16
|
+
import "../RawTable/RawTableContext.js";
|
|
17
|
+
import { RawThead as Q } from "../RawTable/RawThead.js";
|
|
18
|
+
import { RawTbody as U } from "../RawTable/RawTbody.js";
|
|
19
|
+
import { RawTr as u } from "../RawTable/RawTr.js";
|
|
20
|
+
import { SimpleMenu as g, MenuItem as D } from "../SimpleMenu/SimpleMenu.js";
|
|
21
|
+
import { VisuallyHidden as X } from "../VisuallyHidden/VisuallyHidden.js";
|
|
22
|
+
const Ce = ({
|
|
23
|
+
onEscape: i,
|
|
24
|
+
popoverSource: c,
|
|
25
|
+
...d
|
|
26
|
+
}) => e(W, {
|
|
27
|
+
source: c,
|
|
28
|
+
role: "dialog",
|
|
29
|
+
"aria-modal": "true",
|
|
30
|
+
spacing: 4,
|
|
31
|
+
children: e(J, {
|
|
32
|
+
onEscape: i,
|
|
33
|
+
children: e(Z, {
|
|
34
|
+
...d
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}), Z = ({
|
|
22
38
|
selectedDate: i,
|
|
23
|
-
initialDate:
|
|
24
|
-
|
|
25
|
-
onChange:
|
|
26
|
-
label: k,
|
|
39
|
+
initialDate: c = new Date(),
|
|
40
|
+
locale: d,
|
|
41
|
+
onChange: s,
|
|
27
42
|
minDate: w,
|
|
28
|
-
maxDate:
|
|
29
|
-
onEscape: y
|
|
43
|
+
maxDate: k
|
|
30
44
|
}) => {
|
|
31
|
-
const [
|
|
32
|
-
|
|
45
|
+
const [a, m] = E(c), [f, C, M] = q(a, i), {
|
|
46
|
+
sun: x,
|
|
47
|
+
mon: R,
|
|
48
|
+
tue: T,
|
|
49
|
+
wed: P,
|
|
50
|
+
thu: F,
|
|
51
|
+
fri: S,
|
|
52
|
+
sat: Y
|
|
53
|
+
} = I(), h = V(), b = z(w, k), y = d || K();
|
|
54
|
+
O(() => {
|
|
33
55
|
i && m(i);
|
|
34
56
|
}, [i]);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
const
|
|
40
|
-
|
|
57
|
+
const v = (r) => {
|
|
58
|
+
const o = new Date(a);
|
|
59
|
+
o.setMonth(h.indexOf(r)), m(o);
|
|
60
|
+
}, L = (r) => {
|
|
61
|
+
const o = new Date(a);
|
|
62
|
+
o.setFullYear(r), m(o);
|
|
63
|
+
}, $ = (r) => () => {
|
|
64
|
+
s && s(r);
|
|
41
65
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
return l(p, {
|
|
67
|
+
padding: 4,
|
|
68
|
+
children: [e(p, {
|
|
69
|
+
paddingBottom: 4,
|
|
70
|
+
paddingLeft: 2,
|
|
71
|
+
paddingRight: 2,
|
|
72
|
+
children: l(G, {
|
|
73
|
+
children: [e(g, {
|
|
74
|
+
label: h[a.getMonth()],
|
|
75
|
+
children: h.map((r) => e(D, {
|
|
76
|
+
onClick: () => v(r),
|
|
77
|
+
children: r
|
|
78
|
+
}, r))
|
|
79
|
+
}), e(p, {
|
|
80
|
+
paddingLeft: 2,
|
|
81
|
+
children: e(g, {
|
|
82
|
+
label: a.getFullYear(),
|
|
83
|
+
children: b.map((r) => e(D, {
|
|
84
|
+
onClick: () => L(r),
|
|
85
|
+
children: r
|
|
86
|
+
}, r))
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
}), l(N, {
|
|
91
|
+
colCount: 7,
|
|
92
|
+
rowCount: f.length + 1,
|
|
93
|
+
initialCol: M,
|
|
94
|
+
initialRow: C,
|
|
95
|
+
role: "grid",
|
|
96
|
+
children: [e(Q, {
|
|
97
|
+
children: l(u, {
|
|
98
|
+
"aria-rowindex": 1,
|
|
99
|
+
children: [e(t, {
|
|
100
|
+
children: x
|
|
101
|
+
}), e(t, {
|
|
102
|
+
children: R
|
|
103
|
+
}), e(t, {
|
|
104
|
+
children: T
|
|
105
|
+
}), e(t, {
|
|
106
|
+
children: P
|
|
107
|
+
}), e(t, {
|
|
108
|
+
children: F
|
|
109
|
+
}), e(t, {
|
|
110
|
+
children: S
|
|
111
|
+
}), e(t, {
|
|
112
|
+
children: Y
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
}), e(U, {
|
|
116
|
+
children: f.map((r, o) => e(u, {
|
|
117
|
+
children: r.map(({
|
|
118
|
+
date: n,
|
|
119
|
+
outsideMonth: j,
|
|
120
|
+
isSelected: B
|
|
121
|
+
}) => l(H, {
|
|
122
|
+
outsideMonth: j,
|
|
123
|
+
onSelectDay: $(n),
|
|
124
|
+
isSelected: B,
|
|
125
|
+
children: [e("span", {
|
|
126
|
+
"aria-hidden": !0,
|
|
127
|
+
children: n.getDate()
|
|
128
|
+
}), e(X, {
|
|
129
|
+
children: e("span", {
|
|
130
|
+
children: A(n, y)
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
}, `${n.getFullYear()}-${n.getMonth() + 1}-${n.getDate()}`))
|
|
134
|
+
}, o))
|
|
135
|
+
})]
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
71
138
|
};
|
|
72
139
|
export {
|
|
73
|
-
|
|
140
|
+
Ce as DatePickerCalendar,
|
|
141
|
+
Z as DatePickerCalendarContent
|
|
74
142
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),s=require("styled-components");require("react");require("../RawTable/RawTableContext.cjs");const u=require("../RawTable/RawCell.cjs");require("../Box/Box.cjs");const l=require("../Typography/Typography.cjs"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=c(s),p=d.default.button`
|
|
2
2
|
border: none;
|
|
3
|
-
background: ${({theme:e
|
|
3
|
+
background: ${({theme:e,$isSelected:r})=>r?e.colors.primary100:e.colors.neutral0};
|
|
4
4
|
height: ${32/16}rem;
|
|
5
5
|
text-align: center;
|
|
6
6
|
width: ${32/16}rem;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
background: ${({theme:e})=>e.colors.primary100};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
&:hover > ${
|
|
16
|
+
&:hover > ${l.Typography} {
|
|
17
17
|
color: ${({theme:e})=>e.colors.primary600};
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,y=({children:e,outsideMonth:r=!1,onSelectDay:n,isSelected:t=!1,...i})=>{let o="neutral900";return t?o="primary600":r&&(o="neutral600"),a.jsx(u.RawTd,{...i,children:a.jsx(p,{tabIndex:-1,onClick:n,$isSelected:t,type:"button",children:a.jsx(l.Typography,{variant:"pi",textColor:o,fontWeight:t?"bold":void 0,children:e})})})};exports.DatePickerTd=y;
|
|
@@ -1,44 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "../RawTable/
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "styled-components";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../RawTable/RawTableContext.js";
|
|
5
5
|
import { RawTd as c } from "../RawTable/RawCell.js";
|
|
6
|
-
import "../
|
|
7
|
-
import "../RawTable/RawTbody.js";
|
|
8
|
-
import "../RawTable/RawTr.js";
|
|
6
|
+
import "../Box/Box.js";
|
|
9
7
|
import { Typography as n } from "../Typography/Typography.js";
|
|
10
|
-
const
|
|
8
|
+
const d = p.button`
|
|
11
9
|
border: none;
|
|
12
|
-
background: ${({
|
|
10
|
+
background: ${({
|
|
11
|
+
theme: r,
|
|
12
|
+
$isSelected: o
|
|
13
|
+
}) => o ? r.colors.primary100 : r.colors.neutral0};
|
|
13
14
|
height: ${32 / 16}rem;
|
|
14
15
|
text-align: center;
|
|
15
16
|
width: ${32 / 16}rem;
|
|
16
|
-
border-radius: ${({
|
|
17
|
+
border-radius: ${({
|
|
18
|
+
theme: r
|
|
19
|
+
}) => r.borderRadius};
|
|
17
20
|
|
|
18
21
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
19
22
|
outline-offset: -2px;
|
|
20
23
|
|
|
21
24
|
&:hover {
|
|
22
|
-
background: ${({
|
|
25
|
+
background: ${({
|
|
26
|
+
theme: r
|
|
27
|
+
}) => r.colors.primary100};
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
&:hover > ${n} {
|
|
26
|
-
color: ${({
|
|
31
|
+
color: ${({
|
|
32
|
+
theme: r
|
|
33
|
+
}) => r.colors.primary600};
|
|
27
34
|
}
|
|
28
|
-
`,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
`, y = ({
|
|
36
|
+
children: r,
|
|
37
|
+
outsideMonth: o = !1,
|
|
38
|
+
onSelectDay: l,
|
|
39
|
+
isSelected: e = !1,
|
|
40
|
+
...a
|
|
41
|
+
}) => {
|
|
42
|
+
let t = "neutral900";
|
|
43
|
+
return e ? t = "primary600" : o && (t = "neutral600"), i(c, {
|
|
44
|
+
...a,
|
|
45
|
+
children: i(d, {
|
|
46
|
+
tabIndex: -1,
|
|
47
|
+
onClick: l,
|
|
48
|
+
$isSelected: e,
|
|
49
|
+
type: "button",
|
|
50
|
+
children: i(n, {
|
|
51
|
+
variant: "pi",
|
|
52
|
+
textColor: t,
|
|
53
|
+
fontWeight: e ? "bold" : void 0,
|
|
54
|
+
children: r
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
41
58
|
};
|
|
42
59
|
export {
|
|
43
|
-
|
|
60
|
+
y as DatePickerTd
|
|
44
61
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("styled-components"),o=require("../Flex/Flex.cjs");require("react");require("../RawTable/RawTableContext.cjs");const s=require("../RawTable/RawCell.cjs");require("../Box/Box.cjs");const l=require("../Typography/Typography.cjs"),n=require("../VisuallyHidden/VisuallyHidden.cjs"),u=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=u(a),c=r.default(s.RawTh)`
|
|
2
2
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
3
3
|
outline-offset: -2px;
|
|
4
4
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
5
5
|
text-transform: capitalize;
|
|
6
|
-
`,
|
|
6
|
+
`,d=r.default(o.Flex)`
|
|
7
7
|
height: ${24/16}rem;
|
|
8
8
|
width: ${32/16}rem;
|
|
9
|
-
`,
|
|
9
|
+
`,h=({children:e,...i})=>t.jsx(c,{...i,children:t.jsxs(d,{justifyContent:"center",children:[t.jsx(l.Typography,{variant:"pi",fontWeight:"bold",color:"neutral800","aria-hidden":!0,children:e.substr(0,2)}),t.jsx(n.VisuallyHidden,{children:t.jsx("span",{children:e})})]})});exports.DatePickerTh=h;
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import
|
|
3
|
-
import r from "styled-components";
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import t from "styled-components";
|
|
4
3
|
import { Flex as n } from "../Flex/Flex.js";
|
|
5
|
-
import "
|
|
4
|
+
import "react";
|
|
5
|
+
import "../RawTable/RawTableContext.js";
|
|
6
6
|
import { RawTh as a } from "../RawTable/RawCell.js";
|
|
7
|
-
import "../
|
|
8
|
-
import "../RawTable/RawTbody.js";
|
|
9
|
-
import "../RawTable/RawTr.js";
|
|
7
|
+
import "../Box/Box.js";
|
|
10
8
|
import { Typography as m } from "../Typography/Typography.js";
|
|
11
9
|
import { VisuallyHidden as p } from "../VisuallyHidden/VisuallyHidden.js";
|
|
12
|
-
const
|
|
10
|
+
const s = t(a)`
|
|
13
11
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
14
12
|
outline-offset: -2px;
|
|
15
|
-
border-radius: ${({
|
|
13
|
+
border-radius: ${({
|
|
14
|
+
theme: r
|
|
15
|
+
}) => r.borderRadius};
|
|
16
16
|
text-transform: capitalize;
|
|
17
|
-
`,
|
|
17
|
+
`, l = t(n)`
|
|
18
18
|
height: ${24 / 16}rem;
|
|
19
19
|
width: ${32 / 16}rem;
|
|
20
|
-
`,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
20
|
+
`, y = ({
|
|
21
|
+
children: r,
|
|
22
|
+
...o
|
|
23
|
+
}) => e(s, {
|
|
24
|
+
...o,
|
|
25
|
+
children: i(l, {
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
children: [e(m, {
|
|
28
|
+
variant: "pi",
|
|
29
|
+
fontWeight: "bold",
|
|
30
|
+
color: "neutral800",
|
|
31
|
+
"aria-hidden": !0,
|
|
32
|
+
children: r.substr(0, 2)
|
|
33
|
+
}), e(p, {
|
|
34
|
+
children: e("span", {
|
|
35
|
+
children: r
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
24
40
|
export {
|
|
25
|
-
|
|
41
|
+
y as DatePickerTh
|
|
26
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("styled-components"),n=require("../Box/Box.cjs"),a=require("../Field/FieldInput.cjs"),i=require("../Popover/Popover.cjs"),s=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=s(r),d=o.default(i.Popover)`
|
|
2
2
|
max-height: ${3*6}rem;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
`,l=o.default.button`
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
fill: ${({theme:e})=>e.colors.neutral500};
|
|
12
12
|
}
|
|
13
13
|
`,c=o.default.div`
|
|
14
|
-
${({bold:e,theme:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
${({bold:e,theme:t})=>e?r.css`
|
|
15
|
+
& ${a.InputWrapper} {
|
|
16
|
+
border: 1px solid ${t.colors.primary600};
|
|
17
|
+
}
|
|
18
|
+
`:""}
|
|
19
|
+
`,u=o.default(n.Box)`
|
|
18
20
|
background: transparent;
|
|
19
21
|
border: none;
|
|
20
22
|
position: relative;
|
|
@@ -28,4 +30,4 @@
|
|
|
28
30
|
svg path {
|
|
29
31
|
fill: ${({theme:e})=>e.colors.neutral600};
|
|
30
32
|
}
|
|
31
|
-
`;exports.DatePickerButton=l;exports.DatePickerPopover=
|
|
33
|
+
`;exports.DatePickerButton=l;exports.DatePickerPopover=d;exports.DatePickerWrapper=c;exports.IconBox=u;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import o from "styled-components";
|
|
2
|
-
import { Box as
|
|
1
|
+
import o, { css as t } from "styled-components";
|
|
2
|
+
import { Box as n } from "../Box/Box.js";
|
|
3
3
|
import { InputWrapper as i } from "../Field/FieldInput.js";
|
|
4
4
|
import { Popover as a } from "../Popover/Popover.js";
|
|
5
|
-
const
|
|
5
|
+
const c = o(a)`
|
|
6
6
|
max-height: ${3 * 6}rem;
|
|
7
7
|
overflow: hidden;
|
|
8
|
-
`,
|
|
8
|
+
`, m = o.button`
|
|
9
9
|
border: none;
|
|
10
10
|
background: transparent;
|
|
11
11
|
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
@@ -14,11 +14,13 @@ const l = o(a)`
|
|
|
14
14
|
& svg path {
|
|
15
15
|
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
18
|
-
${({ bold: r, theme: e }) => r ?
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
`, u = o.div`
|
|
18
|
+
${({ bold: r, theme: e }) => r ? t`
|
|
19
|
+
& ${i} {
|
|
20
|
+
border: 1px solid ${e.colors.primary600};
|
|
21
|
+
}
|
|
22
|
+
` : ""}
|
|
23
|
+
`, $ = o(n)`
|
|
22
24
|
background: transparent;
|
|
23
25
|
border: none;
|
|
24
26
|
position: relative;
|
|
@@ -34,8 +36,8 @@ const l = o(a)`
|
|
|
34
36
|
}
|
|
35
37
|
`;
|
|
36
38
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
m as DatePickerButton,
|
|
40
|
+
c as DatePickerPopover,
|
|
41
|
+
u as DatePickerWrapper,
|
|
42
|
+
$ as IconBox
|
|
41
43
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const D = () => {
|
|
2
|
-
const
|
|
2
|
+
const e = new Intl.DateTimeFormat(void 0, { weekday: "long" }).format, t = new Date(1970, 0, 1), n = new Date(1970, 0, 2), o = new Date(1970, 0, 3), a = new Date(1970, 0, 4), s = new Date(1970, 0, 5), w = new Date(1970, 0, 6), c = new Date(1970, 0, 7);
|
|
3
3
|
return {
|
|
4
|
-
sun:
|
|
5
|
-
mon:
|
|
6
|
-
tue:
|
|
7
|
-
wed:
|
|
8
|
-
thu: t
|
|
9
|
-
fri:
|
|
10
|
-
sat:
|
|
4
|
+
sun: e(a),
|
|
5
|
+
mon: e(s),
|
|
6
|
+
tue: e(w),
|
|
7
|
+
wed: e(c),
|
|
8
|
+
thu: e(t),
|
|
9
|
+
fri: e(n),
|
|
10
|
+
sat: e(o)
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=()=>{const e=new Intl.DateTimeFormat(void 0,{month:"long"}).format;return Array(12).fill(null).map((o,t)=>e(new Date(1970,t,1)))};exports.getMonths=n;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = () => {
|
|
2
2
|
const t = new Intl.DateTimeFormat(void 0, { month: "long" }).format;
|
|
3
|
-
return Array(12).fill(null).map((
|
|
3
|
+
return Array(12).fill(null).map((e, n) => t(new Date(1970, n, 1)));
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
o as getMonths
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=200,u=15,c=(s,a)=>{const t=new Date().getFullYear(),n=s?.getFullYear()??
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=200,u=15,c=(s,a)=>{const t=new Date().getFullYear(),n=s?.getFullYear()??t-l,o=a?.getFullYear()??t+u,r=[];for(let e=n;e<=o;e++)r.push(e);return r};exports.getYears=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const E = (n, s) => {
|
|
2
|
-
const t = new Date().getFullYear(), a = n?.getFullYear() ??
|
|
2
|
+
const t = new Date().getFullYear(), a = n?.getFullYear() ?? t - 200, A = s?.getFullYear() ?? t + 15, r = [];
|
|
3
3
|
for (let e = a; e <= A; e++)
|
|
4
4
|
r.push(e);
|
|
5
5
|
return r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),$=require("../DatePicker/DatePicker.cjs"),w=require("../Field/Field.cjs"),L=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const v=require("../Field/FieldHint.cjs"),E=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const g=require("../Flex/Flex.cjs"),N=require("../hooks/useControllableState.cjs"),V=require("../hooks/useId.cjs"),_=require("../TimePicker/TimePicker.cjs"),z=({ariaLabel:l,clearLabel:s="clear",disabled:p=!1,error:c,hint:d,id:h,label:u,labelAction:x,onChange:f,onClear:m,name:q,required:F=!1,selectButtonTitle:b="select",size:D="M",step:k=1,value:T,...C})=>{const P=A(T),[t,a]=N.useControllableState({prop:P,onChange:f}),r=t?`${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`:void 0,I=e=>{if(r){const[n,j]=r.split(":");e.setHours(parseInt(n,10)),e.setMinutes(parseInt(j,10))}a(e)},S=e=>{const n=t?new Date(t):new Date,[j,y]=e.split(":");n.setHours(parseInt(j,10)),n.setMinutes(parseInt(y,10)),a(n)},H=()=>{a(void 0),m&&m()},M=()=>{let e=t?new Date(t):new Date;e.setHours(0),e.setMinutes(0),a(e)},o=V.useId(h);return i.jsx(w.Field,{name:q,role:"group",id:o,"aria-labelledby":o,hint:d,error:c,required:F,children:i.jsxs(g.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[i.jsx(L.FieldLabel,{action:x,children:u}),i.jsxs(g.Flex,{gap:2,children:[i.jsx($.DatePicker,{ariaLabel:u||l,selectedDate:t,selectedDateLabel:e=>`Date picker, current is ${e}`,onChange:I,error:typeof c=="string",hint:typeof d=="string",required:F,size:D,onClear:H,clearLabel:`${s} date`,disabled:p,id:o,...C}),i.jsx(_.TimePicker,{size:D,"aria-label":u||l,error:typeof c=="string",hint:typeof d=="string",value:r,onChange:S,onClear:r!==void 0&&r!=="0:0:0"?M:void 0,clearLabel:`${s} time`,required:F,selectButtonTitle:b,disabled:p,step:k,id:o})]}),i.jsx(v.FieldHint,{}),i.jsx(E.FieldError,{})]})})},A=l=>{const s=Date.parse(l);if(!Number.isNaN(s))return new Date(s)};exports.DateTimePicker=z;
|