@caspeco/casper-ui-library 7.6.0 → 7.7.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/README.md +3 -2
- package/dist/components/button/helper.d.ts +4 -1
- package/dist/components/button/helper.d.ts.map +1 -1
- package/dist/components/button/helper.js +18 -16
- package/dist/components/button/types.d.ts +5 -2
- package/dist/components/button/types.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.js +21 -21
- package/dist/components/date-picker/date-picker-date-cell.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-date-cell.js +36 -33
- package/dist/components/date-picker/date-picker-header.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-header.js +121 -90
- package/dist/components/icon-button/helper.d.ts +4 -1
- package/dist/components/icon-button/helper.d.ts.map +1 -1
- package/dist/components/icon-button/helper.js +13 -11
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/types.d.ts +2 -1
- package/dist/components/icon-button/types.d.ts.map +1 -1
- package/dist/components/toggle-button/types.d.ts +2 -1
- package/dist/components/toggle-button/types.d.ts.map +1 -1
- package/dist/node_modules/date-fns/constructNow.js +8 -0
- package/dist/node_modules/date-fns/isToday.js +13 -0
- package/dist/theme/theme-config/components/button-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/button-theme.js +46 -33
- package/dist/theme/theme-config/components/combobox-theme.d.ts +1 -1
- package/dist/theme/theme-config/components/drawer-theme.d.ts +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ export default defineConfig({
|
|
|
61
61
|
git checkout -b UTF-837-add-checkbox-component
|
|
62
62
|
```
|
|
63
63
|
3. Make your changes.
|
|
64
|
-
4. Bump the `version` field in `package.json` (following [Semantic versioning](https://semver.org/)) and run `npm install`.
|
|
64
|
+
4. Bump the `version` field in `package.json` (following [Semantic versioning](https://semver.org/)) and run `npm install`. The version reflects API changes only (e.g. removing a prop → MAJOR, adding a prop → MINOR, no public API changes → PATCH). UI changes are **NOT** API changes.
|
|
65
65
|
5. Open a [pull request](https://github.com/Caspeco/casper-ui-library/pulls) using the template and assign a reviewer.
|
|
66
|
-
6.
|
|
66
|
+
6. If the PR makes significant changes to the UI (e.g. changes the sizes for all buttons), clearly announce this in the [Mattermost channel](https://snack.azure.caspeco.com/default/channels/casper-ui-20---devs).
|
|
67
|
+
7. After approval, merge the PR. If you have a new version in package.json it will automatically publish your changes to npm. The documentation website is always rebuilt.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ButtonSize } from './types.js';
|
|
1
2
|
import { ThemeIconSizeVariable } from '../../theme/index.js';
|
|
2
3
|
import { ResponsiveValue } from '@chakra-ui/react';
|
|
3
4
|
export declare const iconSizeMap: {
|
|
5
|
+
xl: ThemeIconSizeVariable;
|
|
4
6
|
lg: ThemeIconSizeVariable;
|
|
5
7
|
md: ThemeIconSizeVariable;
|
|
6
8
|
sm: ThemeIconSizeVariable;
|
|
9
|
+
xs: ThemeIconSizeVariable;
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* Maps a ResponsiveValue of button sizes to corresponding icon sizes.
|
|
@@ -11,5 +14,5 @@ export declare const iconSizeMap: {
|
|
|
11
14
|
* @param size - The ResponsiveValue of the button size.
|
|
12
15
|
* @returns A ResponsiveValue of icon sizes.
|
|
13
16
|
*/
|
|
14
|
-
export declare function getIconSizeFromButtonSize(size: ResponsiveValue<
|
|
17
|
+
export declare function getIconSizeFromButtonSize(size: ResponsiveValue<ButtonSize>): ThemeIconSizeVariable | (ThemeIconSizeVariable | null)[] | Record<string, ThemeIconSizeVariable | undefined> | undefined;
|
|
15
18
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../lib/components/button/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../lib/components/button/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,4HA2B1E"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { ThemeIconSizeVariable as
|
|
1
|
+
import { ThemeIconSizeVariable as t } from "../../theme/theme-types.js";
|
|
2
2
|
const o = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
xl: t.Medium,
|
|
4
|
+
lg: t.Medium,
|
|
5
|
+
md: t.Medium,
|
|
6
|
+
sm: t.Small,
|
|
7
|
+
xs: t.Small
|
|
6
8
|
};
|
|
7
|
-
function
|
|
8
|
-
if (typeof
|
|
9
|
-
return o[
|
|
10
|
-
if (Array.isArray(
|
|
11
|
-
return
|
|
12
|
-
if (typeof
|
|
13
|
-
const
|
|
14
|
-
return Object.keys(
|
|
15
|
-
const i =
|
|
16
|
-
i && (
|
|
17
|
-
}),
|
|
9
|
+
function c(e) {
|
|
10
|
+
if (typeof e == "string")
|
|
11
|
+
return o[e];
|
|
12
|
+
if (Array.isArray(e))
|
|
13
|
+
return e.map((r) => r && o[r]);
|
|
14
|
+
if (typeof e == "object") {
|
|
15
|
+
const r = {};
|
|
16
|
+
return Object.keys(e).forEach((n) => {
|
|
17
|
+
const i = e[n];
|
|
18
|
+
i && (r[n] = o[i]);
|
|
19
|
+
}), r;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
c as getIconSizeFromButtonSize,
|
|
22
24
|
o as iconSizeMap
|
|
23
25
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Icons } from '../icon/index.js';
|
|
2
2
|
import { CustomChakraBoxProps, LayoutProps, MarginProps, PaddingProps } from '../../theme/index.js';
|
|
3
3
|
import { ButtonProps as ChakraButtonProps, LinkProps as ChakraLinkProps, ResponsiveValue } from '@chakra-ui/react';
|
|
4
|
+
export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
5
|
export type ButtonProps = CustomChakraBoxProps & LayoutProps & MarginProps & PaddingProps & Pick<ChakraLinkProps, "href" | "target" | "rel"> & Pick<ChakraButtonProps, "children" | "isDisabled" | "onClick" | "type" | "isLoading" | "loadingText"> & {
|
|
5
6
|
/**
|
|
6
7
|
* Appearance variant for Button.
|
|
@@ -8,8 +9,10 @@ export type ButtonProps = CustomChakraBoxProps & LayoutProps & MarginProps & Pad
|
|
|
8
9
|
* @note The 'card' variant is deprecated, use the component ToggleButton instead.
|
|
9
10
|
*/
|
|
10
11
|
variant?: ResponsiveValue<"primary" | "secondary" | "link" | "ghost" | "tertiary" | "segmentedControl" | "card" | "alert"> | undefined;
|
|
11
|
-
/**
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The size of the button, default: md
|
|
14
|
+
*/
|
|
15
|
+
size?: ResponsiveValue<ButtonSize> | undefined;
|
|
13
16
|
/**
|
|
14
17
|
* When set to true or false, will indicate to screen readers that this is a toggle button, with a selected state that can be true or false.
|
|
15
18
|
* Only compatible with the "card"-variant. Defaults to undefined (not a toggle button).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EACN,KAAK,WAAW,IAAI,iBAAiB,EACrC,KAAK,SAAS,IAAI,eAAe,EACjC,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAC7C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC,GAChD,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG;IACvG;;;;OAIG;IACH,OAAO,CAAC,EACL,eAAe,CACf,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAC9F,GACD,SAAS,CAAC;IAEb
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EACN,KAAK,WAAW,IAAI,iBAAiB,EACrC,KAAK,SAAS,IAAI,eAAe,EACjC,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAC7C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC,GAChD,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG;IACvG;;;;OAIG;IACH,OAAO,CAAC,EACL,eAAe,CACf,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAC9F,GACD,SAAS,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAE/C;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC;IAEjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC"}
|
|
@@ -5,16 +5,16 @@ import { DatePickerDateCell as X } from "./date-picker-date-cell.js";
|
|
|
5
5
|
import { DatePickerHeader as Lt } from "./date-picker-header.js";
|
|
6
6
|
import { DatePickerWeekCell as Pt } from "./date-picker-week-cell.js";
|
|
7
7
|
import { hasDotOnDate as p, isDateStrikeThrough as Ut, getWeekCellVariant as _t, getDateCellVariant as Z, firstLetterUpperCase as zt, hasDatePassed as At } from "./helper.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { lv as Ht } from "../../node_modules/date-fns/locale/lv.js";
|
|
9
|
+
import { lt as jt } from "../../node_modules/date-fns/locale/lt.js";
|
|
10
|
+
import { et as Kt } from "../../node_modules/date-fns/locale/et.js";
|
|
11
|
+
import { es as Yt } from "../../node_modules/date-fns/locale/es.js";
|
|
12
|
+
import { fi as qt } from "../../node_modules/date-fns/locale/fi.js";
|
|
13
|
+
import { nl as Jt } from "../../node_modules/date-fns/locale/nl.js";
|
|
14
|
+
import { endOfMonth as N } from "../../node_modules/date-fns/endOfMonth.js";
|
|
15
|
+
import { startOfWeek as Qt } from "../../node_modules/date-fns/startOfWeek.js";
|
|
16
|
+
import { nlBE as Xt } from "../../node_modules/date-fns/locale/nl-BE.js";
|
|
17
|
+
import { fr as R } from "../../node_modules/date-fns/locale/fr.js";
|
|
18
18
|
import { sv as Zt } from "../../node_modules/date-fns/locale/sv.js";
|
|
19
19
|
import { da as Nt } from "../../node_modules/date-fns/locale/da.js";
|
|
20
20
|
import { nb as Rt } from "../../node_modules/date-fns/locale/nb.js";
|
|
@@ -33,15 +33,15 @@ const ar = {
|
|
|
33
33
|
"nb-NO": { locale: Rt },
|
|
34
34
|
"da-DK": { locale: Nt },
|
|
35
35
|
"sv-SE": { locale: Zt },
|
|
36
|
-
"nl-NL": { locale:
|
|
37
|
-
"fi-FI": { locale:
|
|
38
|
-
"es-ES": { locale:
|
|
39
|
-
"et-EE": { locale:
|
|
40
|
-
"lt-LT": { locale:
|
|
41
|
-
"lv-LV": { locale:
|
|
42
|
-
"fr-FR": { locale:
|
|
43
|
-
"fr-BE": { locale:
|
|
44
|
-
"nl-BE": { locale:
|
|
36
|
+
"nl-NL": { locale: Jt },
|
|
37
|
+
"fi-FI": { locale: qt },
|
|
38
|
+
"es-ES": { locale: Yt },
|
|
39
|
+
"et-EE": { locale: Kt },
|
|
40
|
+
"lt-LT": { locale: jt },
|
|
41
|
+
"lv-LV": { locale: Ht },
|
|
42
|
+
"fr-FR": { locale: R },
|
|
43
|
+
"fr-BE": { locale: R },
|
|
44
|
+
"nl-BE": { locale: Xt }
|
|
45
45
|
};
|
|
46
46
|
function Gr({
|
|
47
47
|
selectedDate: l,
|
|
@@ -94,12 +94,12 @@ function Gr({
|
|
|
94
94
|
[S, $, E, e?.startDate, s]
|
|
95
95
|
);
|
|
96
96
|
function yt() {
|
|
97
|
-
const o =
|
|
97
|
+
const o = Qt(/* @__PURE__ */ new Date(), { locale: D });
|
|
98
98
|
return Array.from({ length: 7 }, (r, t) => tt(rt(o, t), "eee", { locale: D }));
|
|
99
99
|
}
|
|
100
100
|
const St = tt(F(n), "MMMM yyyy", {
|
|
101
101
|
locale: D
|
|
102
|
-
}), Ct =
|
|
102
|
+
}), Ct = N(n).getDate(), Mt = [a ? "v." : void 0, ...yt()], Ot = D.options?.weekStartsOn || 0, T = (F(n).getDay() - Ot + 7) % 7, kt = (7 - N(n).getDay()) % 7, gt = ["auto", "auto", "100%"], Bt = ["auto", "auto", "100%"], It = (o) => !mt && At(o) ? !0 : W ? W(o) : !1, vt = Array.from({ length: Ct + T + kt }, (o, r) => {
|
|
103
103
|
const t = rt(F(n), r - T), k = et(t, n), g = f(t, /* @__PURE__ */ new Date()), u = It(t) || ct, G = p(t, m?.yellowDotDates), L = p(t, m?.greenDotDates), P = p(t, m?.blueDotDates), U = p(t, m?.redDotDates), _ = p(t, m?.greyDotDates), z = Ut(t, nt) && !u;
|
|
104
104
|
let B = !1;
|
|
105
105
|
l && (B = f(t, l));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,4CAuGvB,CAAC"}
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { useStyleConfig as
|
|
3
|
-
import { formatDate as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as e, Fragment as W, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useStyleConfig as m, Button as O, Box as t, Stack as V } from "@chakra-ui/react";
|
|
3
|
+
import { formatDate as j } from "../../node_modules/date-fns/format.js";
|
|
4
|
+
import { isToday as x } from "../../node_modules/date-fns/isToday.js";
|
|
5
|
+
import { ThemeColorVariable as r, ThemeSpaceVariable as u } from "../../theme/theme-types.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
gridColumn: b,
|
|
8
|
+
gridRow: f,
|
|
9
|
+
gridIndex: g,
|
|
10
|
+
day: n,
|
|
11
|
+
handleDateChange: h,
|
|
11
12
|
variant: o,
|
|
12
13
|
isDisabled: d,
|
|
13
14
|
isStrikeThrough: s,
|
|
14
|
-
hasBlueDot:
|
|
15
|
+
hasBlueDot: C,
|
|
15
16
|
hasYellowDot: k,
|
|
16
|
-
hasGreenDot:
|
|
17
|
-
hasGreyDot:
|
|
18
|
-
hasRedDot:
|
|
17
|
+
hasGreenDot: D,
|
|
18
|
+
hasGreyDot: y,
|
|
19
|
+
hasRedDot: S,
|
|
19
20
|
selectWeek: a,
|
|
20
21
|
isHoliday: i
|
|
21
22
|
}) => {
|
|
22
|
-
const
|
|
23
|
+
const R = m("DateCell", { variant: o }), B = m("DateCellWeek", { variant: o }), c = (o === "selectedDay" || o === "startDateRange" || o === "endDateRange") && !a, l = {
|
|
23
24
|
borderRadius: "50%",
|
|
24
|
-
border:
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */ e(
|
|
25
|
+
border: c ? "solid 1.5px white" : "",
|
|
26
|
+
width: c ? "7.5px" : "6px",
|
|
27
|
+
height: c ? "7.5px" : "6px"
|
|
28
|
+
}, w = g % 7 === 6;
|
|
29
|
+
return /* @__PURE__ */ e(W, { children: /* @__PURE__ */ p(
|
|
29
30
|
O,
|
|
30
31
|
{
|
|
31
|
-
__css: a ?
|
|
32
|
+
__css: a ? B : R,
|
|
32
33
|
type: "button",
|
|
33
|
-
sx: a && o === "selectedDay" &&
|
|
34
|
+
sx: a && o === "selectedDay" && w ? {
|
|
34
35
|
borderTopRightRadius: "10px",
|
|
35
36
|
borderBottomRightRadius: "10px"
|
|
36
37
|
} : {},
|
|
37
38
|
variant: o,
|
|
38
39
|
isDisabled: d || s,
|
|
39
40
|
onClick: () => {
|
|
40
|
-
!d && !s &&
|
|
41
|
+
!d && !s && h(n);
|
|
41
42
|
},
|
|
42
|
-
gridColumn:
|
|
43
|
-
gridRow:
|
|
43
|
+
gridColumn: b,
|
|
44
|
+
gridRow: f,
|
|
44
45
|
display: "flex",
|
|
45
46
|
"data-testid": "date-picker-date-cell",
|
|
46
47
|
children: [
|
|
@@ -49,7 +50,9 @@ const L = ({
|
|
|
49
50
|
{
|
|
50
51
|
"data-testid": i ? "holiday" : void 0,
|
|
51
52
|
sx: { color: i ? r.Error : "inherit" },
|
|
52
|
-
|
|
53
|
+
fontWeight: x(n) ? "bold" : "normal",
|
|
54
|
+
textDecoration: x(n) ? "underline" : "none",
|
|
55
|
+
children: j(n, "d")
|
|
53
56
|
}
|
|
54
57
|
),
|
|
55
58
|
s && /* @__PURE__ */ e("span", {}),
|
|
@@ -57,11 +60,11 @@ const L = ({
|
|
|
57
60
|
V,
|
|
58
61
|
{
|
|
59
62
|
position: "absolute",
|
|
60
|
-
bottom:
|
|
63
|
+
bottom: u.XSmall,
|
|
61
64
|
direction: "row",
|
|
62
|
-
spacing:
|
|
65
|
+
spacing: u.XSmall,
|
|
63
66
|
children: [
|
|
64
|
-
|
|
67
|
+
C && /* @__PURE__ */ e(
|
|
65
68
|
t,
|
|
66
69
|
{
|
|
67
70
|
sx: {
|
|
@@ -70,7 +73,7 @@ const L = ({
|
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
),
|
|
73
|
-
|
|
76
|
+
D && /* @__PURE__ */ e(
|
|
74
77
|
t,
|
|
75
78
|
{
|
|
76
79
|
sx: {
|
|
@@ -88,7 +91,7 @@ const L = ({
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
),
|
|
91
|
-
|
|
94
|
+
y && /* @__PURE__ */ e(
|
|
92
95
|
t,
|
|
93
96
|
{
|
|
94
97
|
sx: {
|
|
@@ -97,7 +100,7 @@ const L = ({
|
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
),
|
|
100
|
-
|
|
103
|
+
S && /* @__PURE__ */ e(
|
|
101
104
|
t,
|
|
102
105
|
{
|
|
103
106
|
sx: {
|
|
@@ -114,5 +117,5 @@ const L = ({
|
|
|
114
117
|
) });
|
|
115
118
|
};
|
|
116
119
|
export {
|
|
117
|
-
|
|
120
|
+
N as DatePickerDateCell
|
|
118
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"AAKA,OAAO,EAeN,KAAK,MAAM,EACX,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,qBAAqB,GAAG;IAC5B,aAAa,EAAE,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wMAc9B,qBAAqB,4CAiJvB,CAAC"}
|
|
@@ -1,107 +1,138 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Flex as
|
|
3
|
-
import { firstLetterUpperCase as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { isBefore as
|
|
6
|
-
import { isSameMonth as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { sv as
|
|
17
|
-
import { da as
|
|
18
|
-
import { nb as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as p, Text as N } from "@chakra-ui/react";
|
|
3
|
+
import { firstLetterUpperCase as T } from "./helper.js";
|
|
4
|
+
import { startOfMonth as d } from "../../node_modules/date-fns/startOfMonth.js";
|
|
5
|
+
import { isBefore as Q } from "../../node_modules/date-fns/isBefore.js";
|
|
6
|
+
import { isSameMonth as X } from "../../node_modules/date-fns/isSameMonth.js";
|
|
7
|
+
import { startOfDay as Z } from "../../node_modules/date-fns/startOfDay.js";
|
|
8
|
+
import { Button as _ } from "../button/button.js";
|
|
9
|
+
import { IconButton as x } from "../icon-button/icon-button.js";
|
|
10
|
+
import { Icons as B } from "../icon/types.js";
|
|
11
|
+
import { getISOWeek as E } from "../../node_modules/date-fns/getISOWeek.js";
|
|
12
|
+
import { enGB as D } from "../../node_modules/date-fns/locale/en-GB.js";
|
|
13
|
+
import { enUS as k } from "../../node_modules/date-fns/locale/en-US.js";
|
|
14
|
+
import { nlBE as F } from "../../node_modules/date-fns/locale/nl-BE.js";
|
|
15
|
+
import { fr as P } from "../../node_modules/date-fns/locale/fr.js";
|
|
16
|
+
import { sv as V } from "../../node_modules/date-fns/locale/sv.js";
|
|
17
|
+
import { da as v } from "../../node_modules/date-fns/locale/da.js";
|
|
18
|
+
import { nb as j } from "../../node_modules/date-fns/locale/nb.js";
|
|
19
|
+
import { subMonths as R } from "../../node_modules/date-fns/subMonths.js";
|
|
20
|
+
import { subWeeks as rr } from "../../node_modules/date-fns/subWeeks.js";
|
|
21
|
+
import { subDays as l } from "../../node_modules/date-fns/subDays.js";
|
|
22
|
+
import { addMonths as tr } from "../../node_modules/date-fns/addMonths.js";
|
|
23
|
+
import { addWeeks as or } from "../../node_modules/date-fns/addWeeks.js";
|
|
24
|
+
import { addDays as b } from "../../node_modules/date-fns/addDays.js";
|
|
25
|
+
import { isSameYear as er } from "../../node_modules/date-fns/isSameYear.js";
|
|
26
|
+
import { isSameDay as ir } from "../../node_modules/date-fns/isSameDay.js";
|
|
27
|
+
import { ThemeSpaceVariable as H, ThemeFontSizeVariable as ar, ThemeFontVariable as mr } from "../../theme/theme-types.js";
|
|
28
|
+
import { formatDate as S } from "../../node_modules/date-fns/format.js";
|
|
29
|
+
const gr = ({
|
|
30
|
+
onMonthChange: h,
|
|
31
|
+
selectedMonth: a,
|
|
32
|
+
month: w,
|
|
28
33
|
selectWeek: m,
|
|
29
|
-
locale:
|
|
30
|
-
selectedDate:
|
|
31
|
-
onDateChange:
|
|
32
|
-
isExpanded:
|
|
33
|
-
disablePastMonths:
|
|
34
|
-
disableBackwardNavigation:
|
|
35
|
-
disableForwardNavigation:
|
|
36
|
-
dateRange:
|
|
37
|
-
onRangeChange:
|
|
34
|
+
locale: e,
|
|
35
|
+
selectedDate: t,
|
|
36
|
+
onDateChange: i,
|
|
37
|
+
isExpanded: n,
|
|
38
|
+
disablePastMonths: I,
|
|
39
|
+
disableBackwardNavigation: U,
|
|
40
|
+
disableForwardNavigation: $,
|
|
41
|
+
dateRange: o,
|
|
42
|
+
onRangeChange: f
|
|
38
43
|
}) => {
|
|
39
|
-
function
|
|
44
|
+
function g(r) {
|
|
40
45
|
switch (r) {
|
|
41
|
-
case
|
|
42
|
-
case F:
|
|
43
|
-
return "Week";
|
|
44
|
-
case Q:
|
|
46
|
+
case j:
|
|
45
47
|
return "Uke";
|
|
46
|
-
case
|
|
48
|
+
case v:
|
|
47
49
|
return "Uge";
|
|
48
|
-
case
|
|
49
|
-
default:
|
|
50
|
+
case V:
|
|
50
51
|
return "Vecka";
|
|
52
|
+
case P:
|
|
53
|
+
return "Semaine";
|
|
54
|
+
case F:
|
|
55
|
+
case k:
|
|
56
|
+
case D:
|
|
57
|
+
default:
|
|
58
|
+
return "Week";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function z(r) {
|
|
62
|
+
switch (r) {
|
|
63
|
+
case j:
|
|
64
|
+
case v:
|
|
65
|
+
case V:
|
|
66
|
+
return "I dag";
|
|
67
|
+
case P:
|
|
68
|
+
return "Aujourd'hui";
|
|
69
|
+
case F:
|
|
70
|
+
return "Vandaag";
|
|
71
|
+
case k:
|
|
72
|
+
case D:
|
|
73
|
+
default:
|
|
74
|
+
return "Today";
|
|
51
75
|
}
|
|
52
76
|
}
|
|
53
|
-
function
|
|
77
|
+
function L(r) {
|
|
54
78
|
return !!r?.startDate && !!r?.endDate;
|
|
55
79
|
}
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
return
|
|
80
|
+
const c = !m && L(o) && f;
|
|
81
|
+
function O(r) {
|
|
82
|
+
return er(r.startDate, r.endDate) ? e === D || e === k ? "MMM d" : "d MMM" : "PP";
|
|
59
83
|
}
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
84
|
+
const W = () => {
|
|
85
|
+
if (n)
|
|
86
|
+
return T(w);
|
|
63
87
|
if (m)
|
|
64
|
-
return `${
|
|
65
|
-
if (
|
|
66
|
-
const r =
|
|
67
|
-
return `${
|
|
88
|
+
return `${g(e)} ${E(t)}`;
|
|
89
|
+
if (c) {
|
|
90
|
+
const r = O(o), J = S(o.startDate, r, { locale: e }), K = S(o.endDate, r, { locale: e });
|
|
91
|
+
return `${J} - ${K}`.replace(/\./g, "");
|
|
68
92
|
}
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
startDate:
|
|
73
|
-
endDate:
|
|
74
|
-
}) :
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
startDate:
|
|
78
|
-
endDate:
|
|
79
|
-
}) :
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
return t ? S(t, "dd MMMM", { locale: e }) : T(w);
|
|
94
|
+
}, A = () => {
|
|
95
|
+
n ? h(R(d(a))) : m ? i(rr(t)) : c ? f({
|
|
96
|
+
startDate: l(o.startDate),
|
|
97
|
+
endDate: l(o.endDate)
|
|
98
|
+
}) : i(l(t));
|
|
99
|
+
}, C = () => {
|
|
100
|
+
n ? h(tr(d(a), 1)) : m ? i(or(t, 1)) : c ? f({
|
|
101
|
+
startDate: b(o.startDate, 1),
|
|
102
|
+
endDate: b(o.endDate, 1)
|
|
103
|
+
}) : i(b(t, 1));
|
|
104
|
+
}, y = d(/* @__PURE__ */ new Date()), G = U || I && (Q(a, y) || X(a, y)), M = Z(/* @__PURE__ */ new Date()), Y = !ir(t, M), q = () => {
|
|
105
|
+
i(M);
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ u(p, { justify: "space-between", align: "center", mb: H.Small, children: [
|
|
108
|
+
/* @__PURE__ */ s(N, { fontWeight: "500", fontFamily: mr.SubHeader, fontSize: ar.Large, children: W() }),
|
|
109
|
+
/* @__PURE__ */ u(p, { align: "center", gap: H.Small, children: [
|
|
110
|
+
Y && /* @__PURE__ */ s(_, { variant: "ghost", size: "sm", onClick: q, children: z(e) }),
|
|
111
|
+
/* @__PURE__ */ u(p, { align: "center", children: [
|
|
112
|
+
/* @__PURE__ */ s(
|
|
113
|
+
x,
|
|
114
|
+
{
|
|
115
|
+
icon: B.Back,
|
|
116
|
+
"aria-label": "Back",
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
onClick: A,
|
|
119
|
+
isDisabled: G
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ s(
|
|
123
|
+
x,
|
|
124
|
+
{
|
|
125
|
+
icon: B.Forward,
|
|
126
|
+
"aria-label": "Forward",
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
onClick: C,
|
|
129
|
+
isDisabled: $
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] })
|
|
133
|
+
] })
|
|
103
134
|
] });
|
|
104
135
|
};
|
|
105
136
|
export {
|
|
106
|
-
|
|
137
|
+
gr as DatePickerHeader
|
|
107
138
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ButtonSize } from '../button/types.js';
|
|
1
2
|
import { ThemeIconSizeVariable } from '../../theme/index.js';
|
|
2
3
|
import { ResponsiveValue } from '@chakra-ui/react';
|
|
3
4
|
export declare const iconSizeMap: {
|
|
5
|
+
xl: ThemeIconSizeVariable;
|
|
4
6
|
lg: ThemeIconSizeVariable;
|
|
5
7
|
md: ThemeIconSizeVariable;
|
|
6
8
|
sm: ThemeIconSizeVariable;
|
|
9
|
+
xs: ThemeIconSizeVariable;
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* Maps a ResponsiveValue of button sizes to corresponding icon sizes.
|
|
@@ -11,5 +14,5 @@ export declare const iconSizeMap: {
|
|
|
11
14
|
* @param size - The ResponsiveValue of the button size.
|
|
12
15
|
* @returns A ResponsiveValue of icon sizes.
|
|
13
16
|
*/
|
|
14
|
-
export declare function getIconSizeFromButtonSize(size: ResponsiveValue<
|
|
17
|
+
export declare function getIconSizeFromButtonSize(size: ResponsiveValue<ButtonSize>): ThemeIconSizeVariable | (ThemeIconSizeVariable | null)[] | Record<string, ThemeIconSizeVariable | undefined> | undefined;
|
|
15
18
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,4HA2B1E"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { ThemeIconSizeVariable as
|
|
1
|
+
import { ThemeIconSizeVariable as t } from "../../theme/theme-types.js";
|
|
2
2
|
const o = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
xl: t.Large,
|
|
4
|
+
lg: t.Medium,
|
|
5
|
+
md: t.Medium,
|
|
6
|
+
sm: t.Small,
|
|
7
|
+
xs: t.Small
|
|
6
8
|
};
|
|
7
|
-
function
|
|
9
|
+
function c(r) {
|
|
8
10
|
if (typeof r == "string")
|
|
9
11
|
return o[r];
|
|
10
12
|
if (Array.isArray(r))
|
|
11
|
-
return r.map((
|
|
13
|
+
return r.map((e) => e && o[e]);
|
|
12
14
|
if (typeof r == "object") {
|
|
13
|
-
const
|
|
15
|
+
const e = {};
|
|
14
16
|
return Object.keys(r).forEach((n) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}),
|
|
17
|
+
const a = r[n];
|
|
18
|
+
a && (e[n] = o[a]);
|
|
19
|
+
}), e;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
c as getIconSizeFromButtonSize,
|
|
22
24
|
o as iconSizeMap
|
|
23
25
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export declare const IconButton: import('react').ForwardRefExoticComponent<{
|
|
9
9
|
icon: import('../icon/index.js').Icons;
|
|
10
10
|
variant?: Exclude<import('../button/index.js').ButtonProps["variant"], "link" | "segmentedControl" | import('@chakra-ui/styled-system').ResponsiveArray<unknown> | Partial<Record<string, unknown>>>;
|
|
11
|
-
size?: import('@chakra-ui/styled-system').ResponsiveValue<
|
|
11
|
+
size?: import('@chakra-ui/styled-system').ResponsiveValue<import('../button/types.js').ButtonSize>;
|
|
12
12
|
} & {
|
|
13
13
|
"aria-label": string;
|
|
14
14
|
onKeyDown?: import('react').KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonSize } from '../button/types.js';
|
|
1
2
|
import { Icons } from '../icon/index.js';
|
|
2
3
|
import { CustomChakraBoxProps, MarginProps, PaddingProps } from '../../theme/index.js';
|
|
3
4
|
import { IconButtonProps as ChakraIconButtonProps, ResponsiveArray, ResponsiveValue } from '@chakra-ui/react';
|
|
@@ -15,7 +16,7 @@ type CustomProperties = {
|
|
|
15
16
|
/**
|
|
16
17
|
* The size of the button, defaults to md
|
|
17
18
|
*/
|
|
18
|
-
size?: ResponsiveValue<
|
|
19
|
+
size?: ResponsiveValue<ButtonSize>;
|
|
19
20
|
};
|
|
20
21
|
type ChakraIconButtonProperties = Pick<ChakraIconButtonProps, "aria-label" | "isDisabled" | "onClick" | "type" | "isLoading" | "onKeyDown">;
|
|
21
22
|
export type IconButtonProps = CustomProperties & ChakraIconButtonProperties & CustomStyleProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACX,eAAe,IAAI,qBAAqB,EACxC,eAAe,EACf,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE1E,KAAK,gBAAgB,GAAG;IACvB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAChB,WAAW,CAAC,SAAS,CAAC,EACtB,MAAM,GAAG,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CACzF,CAAC;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACX,eAAe,IAAI,qBAAqB,EACxC,eAAe,EACf,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE1E,KAAK,gBAAgB,GAAG;IACvB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAChB,WAAW,CAAC,SAAS,CAAC,EACtB,MAAM,GAAG,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CACzF,CAAC;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACrC,qBAAqB,EACrB,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAC5E,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonSize } from '../button/types.js';
|
|
1
2
|
import { CustomChakraBoxProps, LayoutProps, MarginProps, PaddingProps } from '../../theme/index.js';
|
|
2
3
|
import { ButtonProps as ChakraButtonProps, ResponsiveValue } from '@chakra-ui/react';
|
|
3
4
|
type CustomStyleProps = CustomChakraBoxProps & LayoutProps & MarginProps & PaddingProps;
|
|
@@ -5,7 +6,7 @@ type ToggleButtonPropsBase = {
|
|
|
5
6
|
/** Indicate whether button is pressed or not. Defaults to false. */
|
|
6
7
|
isPressed?: boolean;
|
|
7
8
|
/** The size of the button, default: md */
|
|
8
|
-
size?: ResponsiveValue<
|
|
9
|
+
size?: ResponsiveValue<ButtonSize> | undefined;
|
|
9
10
|
} & Pick<ChakraButtonProps, "children" | "isDisabled" | "onClick" | "type"> & CustomStyleProps;
|
|
10
11
|
type ToggleButtonPropsWithSubText = ToggleButtonPropsBase & {
|
|
11
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/toggle-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1F,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;AAExF,KAAK,qBAAqB,GAAG;IAC5B,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/toggle-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1F,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;AAExF,KAAK,qBAAqB,GAAG;IAC5B,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;CAC/C,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,GAC1E,gBAAgB,CAAC;AAElB,KAAK,4BAA4B,GAAG,qBAAqB,GAAG;IAC3D;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,+BAA+B,GAAG,qBAAqB,GAAG;IAC9D,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,MAAM,MAAM,iBAAiB,GAAG,4BAA4B,GAAG,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { constructFrom as r } from "./constructFrom.js";
|
|
2
|
+
import { constructNow as t } from "./constructNow.js";
|
|
3
|
+
import { isSameDay as m } from "./isSameDay.js";
|
|
4
|
+
function f(o, i) {
|
|
5
|
+
return m(
|
|
6
|
+
r(o, o),
|
|
7
|
+
t(o)
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as default,
|
|
12
|
+
f as isToday
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/button-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAA6C,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"button-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/button-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAA6C,MAAM,kBAAkB,CAAC;AAyO9G,eAAO,MAAM,YAAY,EAAE,0BA4CzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineStyleConfig as i } from "@chakra-ui/react";
|
|
2
|
-
import { isTouchScreenDevice as
|
|
3
|
-
import { ThemeColorToken as o, ThemeBorderToken as a, ThemeRadiusToken as d, ThemeFontToken as t, ThemeFontSizeToken as
|
|
4
|
-
const
|
|
2
|
+
import { isTouchScreenDevice as e } from "../../theme-helper.js";
|
|
3
|
+
import { ThemeColorToken as o, ThemeSpaceToken as l, ThemeBorderToken as a, ThemeRadiusToken as d, ThemeFontToken as t, ThemeFontSizeToken as r } from "../theme-tokens.js";
|
|
4
|
+
const g = {
|
|
5
5
|
fontFamily: t.SubHeader,
|
|
6
6
|
borderRadius: d.XLarge,
|
|
7
7
|
border: a.XSmall,
|
|
@@ -21,7 +21,7 @@ const l = {
|
|
|
21
21
|
background: o.Accent,
|
|
22
22
|
color: o.OnAccent,
|
|
23
23
|
_hover: {
|
|
24
|
-
background:
|
|
24
|
+
background: e() ? o.Accent : o.AccentHover,
|
|
25
25
|
_disabled: {
|
|
26
26
|
background: o.Accent,
|
|
27
27
|
color: o.OnAccent
|
|
@@ -35,8 +35,8 @@ const l = {
|
|
|
35
35
|
background: o.AccentContainer,
|
|
36
36
|
color: o.OnAccentContainer,
|
|
37
37
|
_hover: {
|
|
38
|
-
background:
|
|
39
|
-
color:
|
|
38
|
+
background: e() ? o.AccentContainer : o.AccentHover,
|
|
39
|
+
color: e() ? o.OnAccentContainer : o.OnAccent,
|
|
40
40
|
_disabled: {
|
|
41
41
|
background: o.AccentContainer,
|
|
42
42
|
color: o.OnAccentContainer
|
|
@@ -46,12 +46,12 @@ const l = {
|
|
|
46
46
|
background: o.AccentActive,
|
|
47
47
|
color: o.OnAccent
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, s = {
|
|
50
50
|
color: o.OnBackground,
|
|
51
51
|
fontWeight: "medium",
|
|
52
52
|
_hover: {
|
|
53
53
|
color: o.OnBackground,
|
|
54
|
-
bg:
|
|
54
|
+
bg: e() ? "none" : o.AccentHoverAlpha,
|
|
55
55
|
textDecoration: "none"
|
|
56
56
|
},
|
|
57
57
|
_active: {
|
|
@@ -62,7 +62,7 @@ const l = {
|
|
|
62
62
|
background: o.Error,
|
|
63
63
|
color: o.OnAccent,
|
|
64
64
|
_hover: {
|
|
65
|
-
background:
|
|
65
|
+
background: e() ? o.Error : o.ErrorHover,
|
|
66
66
|
_disabled: {
|
|
67
67
|
background: o.Error,
|
|
68
68
|
color: o.OnAccent
|
|
@@ -72,7 +72,7 @@ const l = {
|
|
|
72
72
|
background: o.ErrorActive,
|
|
73
73
|
color: o.OnAccent
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, h = {
|
|
76
76
|
color: o.OnBackground,
|
|
77
77
|
fontFamily: t.Body,
|
|
78
78
|
borderRadius: 0,
|
|
@@ -83,7 +83,7 @@ const l = {
|
|
|
83
83
|
width: "fit-content",
|
|
84
84
|
border: 0,
|
|
85
85
|
_hover: {
|
|
86
|
-
color:
|
|
86
|
+
color: e() ? o.OnBackground : o.AccentHover
|
|
87
87
|
},
|
|
88
88
|
_active: {
|
|
89
89
|
color: o.AccentActive,
|
|
@@ -148,24 +148,25 @@ const l = {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, n = '&[aria-pressed="true"]', c = '&[aria-pressed="false"]', p = {
|
|
152
152
|
// Base style
|
|
153
153
|
borderRadius: d.Small,
|
|
154
154
|
borderWidth: a.XSmall,
|
|
155
155
|
borderColor: o.OnSurfaceBorder,
|
|
156
|
+
paddingX: l.Small,
|
|
156
157
|
// Pressed state
|
|
157
|
-
[`${
|
|
158
|
+
[`${n}`]: {
|
|
158
159
|
background: o.Accent,
|
|
159
160
|
color: o.OnAccent
|
|
160
161
|
},
|
|
161
162
|
// Not pressed state
|
|
162
|
-
[`${
|
|
163
|
+
[`${c}`]: {
|
|
163
164
|
background: o.Surface,
|
|
164
165
|
color: o.OnSurface
|
|
165
166
|
},
|
|
166
167
|
// Hover styles
|
|
167
168
|
"@media(hover: hover)": {
|
|
168
|
-
[`${
|
|
169
|
+
[`${n}&:hover`]: {
|
|
169
170
|
background: o.AccentHover,
|
|
170
171
|
borderColor: o.AccentHover,
|
|
171
172
|
_disabled: {
|
|
@@ -173,7 +174,7 @@ const l = {
|
|
|
173
174
|
borderColor: o.Accent
|
|
174
175
|
}
|
|
175
176
|
},
|
|
176
|
-
[`${
|
|
177
|
+
[`${c}&:hover`]: {
|
|
177
178
|
background: o.AccentHoverAlpha,
|
|
178
179
|
color: o.OnSurface,
|
|
179
180
|
_disabled: {
|
|
@@ -183,57 +184,69 @@ const l = {
|
|
|
183
184
|
}
|
|
184
185
|
},
|
|
185
186
|
// Active styles
|
|
186
|
-
[`${
|
|
187
|
+
[`${n}:active`]: {
|
|
187
188
|
color: o.OnAccent,
|
|
188
189
|
background: o.AccentActive
|
|
189
190
|
},
|
|
190
|
-
[`${
|
|
191
|
+
[`${c}:active`]: {
|
|
191
192
|
color: o.OnSurface,
|
|
192
193
|
background: o.AccentActiveAlpha
|
|
193
194
|
},
|
|
194
195
|
// Define general disabled styles last to ensure they are not overridden
|
|
195
|
-
[`${
|
|
196
|
+
[`${n}:disabled`]: {
|
|
196
197
|
color: o.OnAccent,
|
|
197
198
|
background: o.Accent,
|
|
198
199
|
borderColor: o.Accent
|
|
199
200
|
},
|
|
200
|
-
[`${
|
|
201
|
+
[`${c}:disabled`]: {
|
|
201
202
|
color: o.OnSurface,
|
|
202
203
|
background: o.Surface
|
|
203
204
|
}
|
|
204
|
-
},
|
|
205
|
-
baseStyle:
|
|
205
|
+
}, S = i({
|
|
206
|
+
baseStyle: g,
|
|
206
207
|
sizes: {
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
xl: {
|
|
209
|
+
paddingX: "24px",
|
|
209
210
|
height: "56px",
|
|
210
211
|
minWidth: "56px",
|
|
211
|
-
fontSize:
|
|
212
|
+
fontSize: r.Large
|
|
213
|
+
},
|
|
214
|
+
lg: {
|
|
215
|
+
paddingX: "16px",
|
|
216
|
+
height: "48px",
|
|
217
|
+
minWidth: "48px",
|
|
218
|
+
fontSize: r.Medium
|
|
212
219
|
},
|
|
213
220
|
md: {
|
|
214
|
-
|
|
221
|
+
paddingX: "16px",
|
|
215
222
|
height: "40px",
|
|
216
223
|
minWidth: "40px",
|
|
217
|
-
fontSize:
|
|
224
|
+
fontSize: r.Medium
|
|
218
225
|
},
|
|
219
226
|
sm: {
|
|
220
|
-
|
|
227
|
+
paddingX: "8px",
|
|
228
|
+
height: "32px",
|
|
229
|
+
minWidth: "32px",
|
|
230
|
+
fontSize: r.Small
|
|
231
|
+
},
|
|
232
|
+
xs: {
|
|
233
|
+
paddingX: "8px",
|
|
221
234
|
height: "24px",
|
|
222
235
|
minWidth: "24px",
|
|
223
|
-
fontSize:
|
|
236
|
+
fontSize: r.Small
|
|
224
237
|
}
|
|
225
238
|
},
|
|
226
239
|
variants: {
|
|
227
240
|
primary: u,
|
|
228
241
|
secondary: b,
|
|
229
|
-
ghost:
|
|
230
|
-
link:
|
|
242
|
+
ghost: s,
|
|
243
|
+
link: h,
|
|
231
244
|
segmentedControl: v,
|
|
232
245
|
tertiary: k,
|
|
233
|
-
toggle:
|
|
246
|
+
toggle: p,
|
|
234
247
|
alert: A
|
|
235
248
|
}
|
|
236
249
|
});
|
|
237
250
|
export {
|
|
238
|
-
|
|
251
|
+
S as buttonConfig
|
|
239
252
|
};
|
|
@@ -51,7 +51,7 @@ export declare const comboboxConfig: {
|
|
|
51
51
|
};
|
|
52
52
|
} | undefined;
|
|
53
53
|
defaultProps?: {
|
|
54
|
-
size?: "md" | "sm" | "
|
|
54
|
+
size?: "md" | "sm" | "xl" | "lg" | "xs" | undefined;
|
|
55
55
|
variant?: "outline" | "ghost" | undefined;
|
|
56
56
|
colorScheme?: string | undefined;
|
|
57
57
|
} | undefined;
|
|
@@ -39,7 +39,7 @@ export declare const drawerConfig: {
|
|
|
39
39
|
}>;
|
|
40
40
|
} | undefined;
|
|
41
41
|
defaultProps?: {
|
|
42
|
-
size?: "md" | "sm" | "
|
|
42
|
+
size?: "md" | "sm" | "xl" | "lg" | "xs" | undefined;
|
|
43
43
|
variant?: string | number | undefined;
|
|
44
44
|
colorScheme?: string | undefined;
|
|
45
45
|
} | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
"@testing-library/react": "^16.3.0",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|
|
37
37
|
"@types/jest": "^30.0.0",
|
|
38
|
-
"@types/node": "^24.10.
|
|
38
|
+
"@types/node": "^24.10.1",
|
|
39
39
|
"@types/react": "^18.3.12",
|
|
40
40
|
"@types/react-dom": "^18.3.1",
|
|
41
|
-
"@vitejs/plugin-react-swc": "^4.2.
|
|
41
|
+
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
42
42
|
"eslint": "^9.39.1",
|
|
43
43
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
44
44
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
45
45
|
"globals": "^16.5.0",
|
|
46
|
-
"jsdom": "^27.
|
|
46
|
+
"jsdom": "^27.2.0",
|
|
47
47
|
"tsc-alias": "^1.8.16",
|
|
48
48
|
"typescript": "~5.9.3",
|
|
49
|
-
"typescript-eslint": "^8.46.
|
|
49
|
+
"typescript-eslint": "^8.46.4",
|
|
50
50
|
"vite": "^7.2.2",
|
|
51
51
|
"vite-plugin-dts": "^4.5.4",
|
|
52
52
|
"vite-tsconfig-paths": "^5.1.4",
|
|
53
|
-
"vitest": "^4.0.
|
|
53
|
+
"vitest": "^4.0.9"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@chakra-ui/react": "^2.8.2",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@chakra-ui/anatomy": "^2.3.4",
|
|
63
63
|
"@floating-ui/dom": "^1.7.4",
|
|
64
64
|
"@tanstack/react-table": "^8.21.3",
|
|
65
|
-
"csstype": "^3.
|
|
65
|
+
"csstype": "^3.2.2",
|
|
66
66
|
"date-fns": "^4.1.0"
|
|
67
67
|
}
|
|
68
68
|
}
|