@strapi/design-system 1.6.5 → 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/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +17 -16
- 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 +124 -57
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +42 -24
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +29 -12
- 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/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +3 -3
- package/dist/Field/FieldLabel.cjs +5 -2
- package/dist/Field/FieldLabel.js +27 -27
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +32 -30
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +4 -1
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +57 -55
- package/dist/Select/SelectButton.cjs +3 -3
- package/dist/Select/SelectButton.js +17 -15
- 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 +47 -46
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +48 -100
- package/package.json +4 -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
|
@@ -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 l=require("react/jsx-runtime"),c=require("react"),i=require("styled-components"),d=require("../Flex/Flex.cjs"),p=require("../themes/utils.cjs"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},f=t(c),b=t(i),s=b.default(d.Flex)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${({theme:e})=>e.spaces[3]};
|
|
4
4
|
width: ${({theme:e})=>e.spaces[3]};
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
pointer-events: none;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
${
|
|
17
|
-
`,r=
|
|
16
|
+
${p.buttonFocusStyle}
|
|
17
|
+
`,r=f.default.forwardRef(({disabled:e,children:a,background:o="neutral0",...u},n)=>l.jsx(s,{ref:n,"aria-disabled":e,as:"button",type:"button",disabled:e,padding:2,hasRadius:!0,background:o,borderColor:"neutral200",cursor:"pointer",...u,children:a}));r.displayName="BaseButton";exports.BaseButton=r;exports.BaseButtonWrapper=s;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { buttonFocusStyle as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import i from "styled-components";
|
|
4
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
5
|
+
import { buttonFocusStyle as p } from "../themes/utils.js";
|
|
6
|
+
const d = i(u)`
|
|
7
7
|
svg {
|
|
8
8
|
height: ${({
|
|
9
9
|
theme: t
|
|
@@ -24,27 +24,28 @@ const p = n(i)`
|
|
|
24
24
|
pointer-events: none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
${
|
|
28
|
-
`,
|
|
27
|
+
${p}
|
|
28
|
+
`, l = n.forwardRef(({
|
|
29
29
|
disabled: t,
|
|
30
30
|
children: r,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
background: e = "neutral0",
|
|
32
|
+
...o
|
|
33
|
+
}, a) => s(d, {
|
|
34
|
+
ref: a,
|
|
34
35
|
"aria-disabled": t,
|
|
35
36
|
as: "button",
|
|
36
37
|
type: "button",
|
|
37
38
|
disabled: t,
|
|
38
39
|
padding: 2,
|
|
39
40
|
hasRadius: !0,
|
|
40
|
-
background:
|
|
41
|
+
background: e,
|
|
41
42
|
borderColor: "neutral200",
|
|
42
43
|
cursor: "pointer",
|
|
43
|
-
...
|
|
44
|
+
...o,
|
|
44
45
|
children: r
|
|
45
46
|
}));
|
|
46
|
-
|
|
47
|
+
l.displayName = "BaseButton";
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
l as BaseButton,
|
|
50
|
+
d as BaseButtonWrapper
|
|
50
51
|
};
|
|
@@ -1 +1,8 @@
|
|
|
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"),p=require("react"),f=require("@strapi/icons"),b=require("styled-components"),k=require("./components.cjs"),P=require("./DatePickerCalendar.cjs"),R=require("./utils/formatDate.cjs");require("../Field/Field.cjs");require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");require("../Field/FieldContext.cjs");require("../Typography/Typography.cjs");const T=require("../Field/FieldAction.cjs"),v=require("../helpers/getDefaultLocale.cjs"),A=require("../TextInput/TextInput.cjs"),I=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},L=I(b),S=({ariaLabel:e,onClear:i,clearLabel:j="Clear",initialDate:D,locale:h,maxDate:m,minDate:q,onChange:l,selectedDate:a,disabled:n=!1,...x})=>{const[o,c]=p.useState(!1),r=p.useRef(null),u=h||v.getDefaultLocale(),d=a?R.formatDate(a,u):"",g=()=>{n||c(s=>!s)},y=()=>{n||i&&(i(),r.current.inputWrapperRef.current.focus())},F=s=>{l&&l(s),c(!1)},C=()=>{c(!1)};return t.jsxs(k.DatePickerWrapper,{bold:o,children:[t.jsx(A.TextInput,{ref:r,onClick:g,onChange:()=>{},value:d,startAction:t.jsx(f.Calendar,{"aria-hidden":!0}),endAction:i&&d?t.jsx(T.FieldAction,{label:j,onClick:y,"aria-disabled":n||void 0,children:t.jsx(_,{})}):void 0,"aria-autocomplete":"none","aria-label":e,disabled:n,type:"text",...x}),r.current&&r.current.inputWrapperRef&&o&&t.jsx(P.DatePickerCalendar,{selectedDate:a,initialDate:D,onChange:F,onEscape:C,locale:u,popoverSource:r.current.inputWrapperRef,minDate:q,maxDate:m})]})},_=L.default(f.Cross)`
|
|
2
|
+
height: ${11/16}rem;
|
|
3
|
+
width: ${11/16}rem;
|
|
4
|
+
|
|
5
|
+
path {
|
|
6
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
7
|
+
}
|
|
8
|
+
`;exports.DatePicker=S;
|
|
@@ -1,110 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsxs as R, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as W } from "react";
|
|
3
|
+
import { Cross as v, Calendar as A } from "@strapi/icons";
|
|
4
|
+
import P from "styled-components";
|
|
5
|
+
import { DatePickerWrapper as S } from "./components.js";
|
|
6
|
+
import { DatePickerCalendar as $ } from "./DatePickerCalendar.js";
|
|
7
|
+
import { formatDate as j } from "./utils/formatDate.js";
|
|
8
|
+
import "../Field/Field.js";
|
|
9
|
+
import "../Field/FieldLabel.js";
|
|
10
|
+
import "../Field/FieldInput.js";
|
|
11
|
+
import "../Field/FieldContext.js";
|
|
12
|
+
import "../Typography/Typography.js";
|
|
13
|
+
import { FieldAction as E } from "../Field/FieldAction.js";
|
|
7
14
|
import { getDefaultLocale as V } from "../helpers/getDefaultLocale.js";
|
|
8
|
-
import { TextInput as
|
|
9
|
-
|
|
10
|
-
const v = ({
|
|
15
|
+
import { TextInput as w } from "../TextInput/TextInput.js";
|
|
16
|
+
const X = ({
|
|
11
17
|
ariaLabel: o,
|
|
12
|
-
|
|
18
|
+
onClear: i,
|
|
19
|
+
clearLabel: s = "Clear",
|
|
20
|
+
initialDate: u,
|
|
21
|
+
locale: d,
|
|
22
|
+
maxDate: h,
|
|
23
|
+
minDate: C,
|
|
24
|
+
onChange: p,
|
|
13
25
|
selectedDate: a,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
locale: h,
|
|
17
|
-
selectedDateLabel: k,
|
|
18
|
-
onClear: s,
|
|
19
|
-
clearLabel: E,
|
|
20
|
-
disabled: r,
|
|
21
|
-
id: R,
|
|
22
|
-
minDate: P,
|
|
23
|
-
maxDate: O,
|
|
24
|
-
...x
|
|
26
|
+
disabled: t = !1,
|
|
27
|
+
...D
|
|
25
28
|
}) => {
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
29
|
+
const [c, n] = y(!1), e = W(null), m = d || V(), f = a ? j(a, m) : "", g = () => {
|
|
30
|
+
t || n((l) => !l);
|
|
31
|
+
}, x = () => {
|
|
32
|
+
t || i && (i(), e.current.inputWrapperRef.current.focus());
|
|
33
|
+
}, b = (l) => {
|
|
34
|
+
p && p(l), n(!1);
|
|
35
|
+
}, k = () => {
|
|
36
|
+
n(!1);
|
|
34
37
|
};
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
ref:
|
|
39
|
-
onClick:
|
|
38
|
+
return R(S, {
|
|
39
|
+
bold: c,
|
|
40
|
+
children: [r(w, {
|
|
41
|
+
ref: e,
|
|
42
|
+
onClick: g,
|
|
40
43
|
onChange: () => {
|
|
41
44
|
},
|
|
42
|
-
value:
|
|
43
|
-
startAction:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */ t.createElement(T, { "aria-hidden": !0 })
|
|
53
|
-
),
|
|
54
|
-
endAction: s && m ? /* @__PURE__ */ t.createElement(I, { as: "button", onClick: y, "aria-label": E, "aria-disabled": r }, /* @__PURE__ */ t.createElement(W, null)) : void 0,
|
|
45
|
+
value: f,
|
|
46
|
+
startAction: r(A, {
|
|
47
|
+
"aria-hidden": !0
|
|
48
|
+
}),
|
|
49
|
+
endAction: i && f ? r(E, {
|
|
50
|
+
label: s,
|
|
51
|
+
onClick: x,
|
|
52
|
+
"aria-disabled": t || void 0,
|
|
53
|
+
children: r(F, {})
|
|
54
|
+
}) : void 0,
|
|
55
55
|
"aria-autocomplete": "none",
|
|
56
|
-
label: i,
|
|
57
56
|
"aria-label": o,
|
|
58
|
-
disabled:
|
|
59
|
-
|
|
60
|
-
...
|
|
61
|
-
}
|
|
62
|
-
), n.current && n.current.inputWrapperRef && f && /* @__PURE__ */ t.createElement(
|
|
63
|
-
S,
|
|
64
|
-
{
|
|
57
|
+
disabled: t,
|
|
58
|
+
type: "text",
|
|
59
|
+
...D
|
|
60
|
+
}), e.current && e.current.inputWrapperRef && c && r($, {
|
|
65
61
|
selectedDate: a,
|
|
66
|
-
initialDate:
|
|
67
|
-
onChange:
|
|
68
|
-
onEscape:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
minDate:
|
|
72
|
-
maxDate:
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
maxDate: void 0,
|
|
86
|
-
onClear: void 0,
|
|
87
|
-
placeholder: void 0,
|
|
88
|
-
selectedDate: void 0,
|
|
89
|
-
size: "M"
|
|
90
|
-
};
|
|
91
|
-
v.propTypes = {
|
|
92
|
-
ariaLabel: e.string,
|
|
93
|
-
clearLabel: e.string,
|
|
94
|
-
disabled: e.bool,
|
|
95
|
-
id: e.string,
|
|
96
|
-
initialDate: e.instanceOf(Date),
|
|
97
|
-
label: e.string,
|
|
98
|
-
locale: e.string,
|
|
99
|
-
maxDate: e.instanceOf(Date),
|
|
100
|
-
minDate: e.instanceOf(Date),
|
|
101
|
-
onChange: e.func.isRequired,
|
|
102
|
-
onClear: e.func,
|
|
103
|
-
placeholder: e.string,
|
|
104
|
-
selectedDate: e.instanceOf(Date),
|
|
105
|
-
selectedDateLabel: e.func.isRequired,
|
|
106
|
-
size: e.oneOf(Object.keys(j.input))
|
|
107
|
-
};
|
|
62
|
+
initialDate: u,
|
|
63
|
+
onChange: b,
|
|
64
|
+
onEscape: k,
|
|
65
|
+
locale: m,
|
|
66
|
+
popoverSource: e.current.inputWrapperRef,
|
|
67
|
+
minDate: C,
|
|
68
|
+
maxDate: h
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}, F = P(v)`
|
|
72
|
+
height: ${11 / 16}rem;
|
|
73
|
+
width: ${11 / 16}rem;
|
|
74
|
+
|
|
75
|
+
path {
|
|
76
|
+
fill: ${({
|
|
77
|
+
theme: o
|
|
78
|
+
}) => o.colors.neutral600};
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
108
81
|
export {
|
|
109
|
-
|
|
82
|
+
X as DatePicker
|
|
110
83
|
};
|
|
@@ -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 e=require("react/jsx-runtime"),T=require("react"),L=require("./components.cjs"),O=require("./DatePickerTd.cjs"),a=require("./DatePickerTh.cjs"),H=require("./utils/getDayOfWeek.cjs"),V=require("./utils/getMonths.cjs"),$=require("./utils/generateWeeks.cjs"),E=require("./utils/getYears.cjs"),I=require("./utils/formatDate.cjs"),h=require("../Box/Box.cjs"),_=require("../Flex/Flex.cjs"),z=require("../FocusTrap/FocusTrap.cjs"),A=require("../helpers/getDefaultLocale.cjs"),G=require("../RawTable/RawTable.cjs");require("../RawTable/RawTableContext.cjs");const J=require("../RawTable/RawThead.cjs"),K=require("../RawTable/RawTbody.cjs"),g=require("../RawTable/RawTr.cjs"),i=require("../SimpleMenu/SimpleMenu.cjs"),N=require("../VisuallyHidden/VisuallyHidden.cjs"),Q=({onEscape:s,popoverSource:l,...o})=>e.jsx(L.DatePickerPopover,{source:l,role:"dialog","aria-modal":"true",spacing:4,children:e.jsx(z.FocusTrap,{onEscape:s,children:e.jsx(D,{...o})})}),D=({selectedDate:s,initialDate:l=new Date,locale:o,onChange:j,minDate:p,maxDate:w})=>{const[c,d]=T.useState(l),[x,k,R]=$.generateWeeks(c,s),{sun:m,mon:q,tue:P,wed:f,thu:M,fri:b,sat:C}=H.getDayOfWeek(),u=V.getMonths(),y=E.getYears(p,w),F=o||A.getDefaultLocale();T.useEffect(()=>{s&&d(s)},[s]);const S=t=>{const r=new Date(c);r.setMonth(u.indexOf(t)),d(r)},B=t=>{const r=new Date(c);r.setFullYear(t),d(r)},Y=t=>()=>{j&&j(t)};return e.jsxs(h.Box,{padding:4,children:[e.jsx(h.Box,{paddingBottom:4,paddingLeft:2,paddingRight:2,children:e.jsxs(_.Flex,{children:[e.jsx(i.SimpleMenu,{label:u[c.getMonth()],children:u.map(t=>e.jsx(i.MenuItem,{onClick:()=>S(t),children:t},t))}),e.jsx(h.Box,{paddingLeft:2,children:e.jsx(i.SimpleMenu,{label:c.getFullYear(),children:y.map(t=>e.jsx(i.MenuItem,{onClick:()=>B(t),children:t},t))})})]})}),e.jsxs(G.RawTable,{colCount:7,rowCount:x.length+1,initialCol:R,initialRow:k,role:"grid",children:[e.jsx(J.RawThead,{children:e.jsxs(g.RawTr,{"aria-rowindex":1,children:[e.jsx(a.DatePickerTh,{children:m}),e.jsx(a.DatePickerTh,{children:q}),e.jsx(a.DatePickerTh,{children:P}),e.jsx(a.DatePickerTh,{children:f}),e.jsx(a.DatePickerTh,{children:M}),e.jsx(a.DatePickerTh,{children:b}),e.jsx(a.DatePickerTh,{children:C})]})}),e.jsx(K.RawTbody,{children:x.map((t,r)=>e.jsx(g.RawTr,{children:t.map(({date:n,outsideMonth:W,isSelected:v})=>e.jsxs(O.DatePickerTd,{outsideMonth:W,onSelectDay:Y(n),isSelected:v,children:[e.jsx("span",{"aria-hidden":!0,children:n.getDate()}),e.jsx(N.VisuallyHidden,{children:e.jsx("span",{children:I.formatDate(n,F)})})]},`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`))},r))})]})]})};exports.DatePickerCalendar=Q;exports.DatePickerCalendarContent=D;
|
|
@@ -1,75 +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 "
|
|
14
|
+
import { getDefaultLocale as K } from "../helpers/getDefaultLocale.js";
|
|
15
|
+
import { RawTable as N } from "../RawTable/RawTable.js";
|
|
16
16
|
import "../RawTable/RawTableContext.js";
|
|
17
|
-
import { RawThead as
|
|
18
|
-
import { RawTbody as
|
|
19
|
-
import { RawTr as
|
|
20
|
-
import { SimpleMenu as
|
|
21
|
-
import { VisuallyHidden as
|
|
22
|
-
const
|
|
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 = ({
|
|
23
38
|
selectedDate: i,
|
|
24
|
-
initialDate:
|
|
25
|
-
|
|
26
|
-
onChange:
|
|
27
|
-
label: k,
|
|
39
|
+
initialDate: c = new Date(),
|
|
40
|
+
locale: d,
|
|
41
|
+
onChange: s,
|
|
28
42
|
minDate: w,
|
|
29
|
-
maxDate:
|
|
30
|
-
onEscape: y
|
|
43
|
+
maxDate: k
|
|
31
44
|
}) => {
|
|
32
|
-
const [
|
|
33
|
-
|
|
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(() => {
|
|
34
55
|
i && m(i);
|
|
35
56
|
}, [i]);
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
const
|
|
41
|
-
|
|
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);
|
|
42
65
|
};
|
|
43
|
-
return
|
|
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
|
-
|
|
71
|
-
|
|
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
|
+
});
|
|
72
138
|
};
|
|
73
139
|
export {
|
|
74
|
-
|
|
140
|
+
Ce as DatePickerCalendar,
|
|
141
|
+
Z as DatePickerCalendarContent
|
|
75
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,43 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "react/jsx-runtime";
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "styled-components";
|
|
3
|
+
import "react";
|
|
5
4
|
import "../RawTable/RawTableContext.js";
|
|
6
|
-
import { RawTd as
|
|
5
|
+
import { RawTd as c } from "../RawTable/RawCell.js";
|
|
7
6
|
import "../Box/Box.js";
|
|
8
7
|
import { Typography as n } from "../Typography/Typography.js";
|
|
9
|
-
const
|
|
8
|
+
const d = p.button`
|
|
10
9
|
border: none;
|
|
11
|
-
background: ${({
|
|
10
|
+
background: ${({
|
|
11
|
+
theme: r,
|
|
12
|
+
$isSelected: o
|
|
13
|
+
}) => o ? r.colors.primary100 : r.colors.neutral0};
|
|
12
14
|
height: ${32 / 16}rem;
|
|
13
15
|
text-align: center;
|
|
14
16
|
width: ${32 / 16}rem;
|
|
15
|
-
border-radius: ${({
|
|
17
|
+
border-radius: ${({
|
|
18
|
+
theme: r
|
|
19
|
+
}) => r.borderRadius};
|
|
16
20
|
|
|
17
21
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
18
22
|
outline-offset: -2px;
|
|
19
23
|
|
|
20
24
|
&:hover {
|
|
21
|
-
background: ${({
|
|
25
|
+
background: ${({
|
|
26
|
+
theme: r
|
|
27
|
+
}) => r.colors.primary100};
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
&:hover > ${n} {
|
|
25
|
-
color: ${({
|
|
31
|
+
color: ${({
|
|
32
|
+
theme: r
|
|
33
|
+
}) => r.colors.primary600};
|
|
26
34
|
}
|
|
27
|
-
`,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
});
|
|
40
58
|
};
|
|
41
59
|
export {
|
|
42
|
-
|
|
60
|
+
y as DatePickerTd
|
|
43
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;
|