@infonomic/uikit 1.0.1 → 1.1.0
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 +9 -10
- package/dist/components/avatar/avatar.d.ts +3 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +2 -2
- package/dist/components/notifications/alert.d.ts.map +1 -1
- package/dist/components/notifications/alert.js +36 -40
- package/dist/components/notifications/toast.d.ts +1 -1
- package/dist/components/notifications/toast.d.ts.map +1 -1
- package/dist/components/notifications/toast.js +2 -2
- package/dist/components/scroll-area/scroll-area_module.css +1 -1
- package/dist/icons/close-icon.d.ts.map +1 -1
- package/dist/icons/danger-icon.d.ts +1 -1
- package/dist/icons/danger-icon.d.ts.map +1 -1
- package/dist/icons/danger-icon.js +2 -5
- package/dist/icons/info-icon.d.ts +1 -1
- package/dist/icons/info-icon.d.ts.map +1 -1
- package/dist/icons/info-icon.js +2 -5
- package/dist/icons/primary-icon.d.ts +1 -1
- package/dist/icons/primary-icon.d.ts.map +1 -1
- package/dist/icons/primary-icon.js +1 -1
- package/dist/icons/success-icon.d.ts +1 -1
- package/dist/icons/success-icon.d.ts.map +1 -1
- package/dist/icons/success-icon.js +2 -5
- package/dist/icons/types/icon.d.ts +0 -1
- package/dist/icons/types/icon.d.ts.map +1 -1
- package/dist/icons/warning-icon.d.ts +1 -1
- package/dist/icons/warning-icon.d.ts.map +1 -1
- package/dist/icons/warning-icon.js +2 -5
- package/dist/widgets/datepicker/datepicker.js +23 -9
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -19,20 +19,19 @@ We built this with the following goals in mind:
|
|
|
19
19
|
|
|
20
20
|
## Getting Started
|
|
21
21
|
|
|
22
|
-
Install packages
|
|
22
|
+
Install packages
|
|
23
23
|
|
|
24
|
-
`
|
|
24
|
+
`npm install @infonomic/uikit`
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
or...
|
|
27
27
|
|
|
28
|
-
`pnpm
|
|
28
|
+
`pnpm add @infonomic/uikit`
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
And then in your application...
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
```ts
|
|
33
|
+
import { Button, Card, Container, Section } from '@infonomic/uikit/react
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
UI kit vars / colors have been registered with Tailwind in Next.js
|
|
37
|
+
At the moment docs are in the main repo and stories are available via Storybook.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,eAAO,MAAM,MAAM,GAAI,cAAc;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAG,KAAK,CAAC,GAAG,CAAC,OASrE,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Avatar } from "radix-ui";
|
|
4
4
|
import avatar_module from "./avatar.module.js";
|
|
5
5
|
const url = 'https://picsum.photos/150';
|
|
6
|
-
const avatar_Avatar = ()=>/*#__PURE__*/ jsxs(Avatar.Root, {
|
|
6
|
+
const avatar_Avatar = ({ initials })=>/*#__PURE__*/ jsxs(Avatar.Root, {
|
|
7
7
|
className: avatar_module["avatar-root"],
|
|
8
8
|
children: [
|
|
9
9
|
/*#__PURE__*/ jsx(Avatar.Image, {
|
|
@@ -16,7 +16,7 @@ const avatar_Avatar = ()=>/*#__PURE__*/ jsxs(Avatar.Root, {
|
|
|
16
16
|
delayMs: 600,
|
|
17
17
|
children: /*#__PURE__*/ jsx("span", {
|
|
18
18
|
className: avatar_module["avatar-text"],
|
|
19
|
-
children:
|
|
19
|
+
children: initials
|
|
20
20
|
})
|
|
21
21
|
})
|
|
22
22
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/alert.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAI/C,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAWD,eAAO,MAAM,KAAK,GAAkB,mEASjC,UAAU,GAAG;IACd,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAqEvB,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
3
|
import classnames from "classnames";
|
|
5
|
-
import {
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
6
5
|
import { CloseIcon } from "../../icons/close-icon.js";
|
|
7
6
|
import { DangerIcon } from "../../icons/danger-icon.js";
|
|
8
7
|
import { InfoIcon } from "../../icons/info-icon.js";
|
|
9
8
|
import { SuccessIcon } from "../../icons/success-icon.js";
|
|
10
9
|
import { WarningIcon } from "../../icons/warning-icon.js";
|
|
10
|
+
import { Button } from "../button/button.js";
|
|
11
11
|
import alert_module from "./alert.module.js";
|
|
12
12
|
const alertIcons = {
|
|
13
13
|
primary: WarningIcon,
|
|
@@ -35,48 +35,44 @@ const alert_Alert = function({ ref, intent = 'success', icon = true, close = tru
|
|
|
35
35
|
[alert_module.fade]: fade
|
|
36
36
|
}),
|
|
37
37
|
...rest,
|
|
38
|
-
children: null != title ? /*#__PURE__*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
icon
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/*#__PURE__*/ jsx("
|
|
50
|
-
|
|
51
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
52
|
-
children: title
|
|
53
|
-
})
|
|
54
|
-
}),
|
|
55
|
-
true === close && /*#__PURE__*/ jsx(Button, {
|
|
56
|
-
intent: intent,
|
|
57
|
-
variant: "filled",
|
|
58
|
-
"aria-label": "Close",
|
|
59
|
-
className: classnames(alert_module.close),
|
|
60
|
-
type: "button",
|
|
61
|
-
onClick: handleOnClose,
|
|
62
|
-
...rest,
|
|
63
|
-
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
64
|
-
height: "12px",
|
|
65
|
-
width: "12px"
|
|
66
|
-
})
|
|
38
|
+
children: null != title ? /*#__PURE__*/ jsxs("div", {
|
|
39
|
+
className: alert_module["alert-with-title"],
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ jsxs("div", {
|
|
42
|
+
className: classnames(alert_module.header),
|
|
43
|
+
children: [
|
|
44
|
+
icon && /*#__PURE__*/ jsx(Icon, {
|
|
45
|
+
className: alert_module.icon
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx("div", {
|
|
48
|
+
className: classnames(alert_module.title),
|
|
49
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
50
|
+
children: title
|
|
67
51
|
})
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
}),
|
|
53
|
+
true === close && /*#__PURE__*/ jsx(Button, {
|
|
54
|
+
intent: intent,
|
|
55
|
+
variant: "filled",
|
|
56
|
+
"aria-label": "Close",
|
|
57
|
+
className: classnames(alert_module.close),
|
|
58
|
+
type: "button",
|
|
59
|
+
onClick: handleOnClose,
|
|
60
|
+
...rest,
|
|
61
|
+
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
62
|
+
height: "12px",
|
|
63
|
+
width: "12px"
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ jsx("div", {
|
|
69
|
+
className: classnames(alert_module.content),
|
|
70
|
+
children: children
|
|
71
|
+
})
|
|
72
|
+
]
|
|
76
73
|
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
77
74
|
children: [
|
|
78
75
|
icon && /*#__PURE__*/ jsx(Icon, {
|
|
79
|
-
useSprite: true,
|
|
80
76
|
className: alert_module.icon
|
|
81
77
|
}),
|
|
82
78
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Toast as ToastPrimitive } from 'radix-ui';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import type { IconType, Intent, OnOpenChange, Position } from './@types/toast.js';
|
|
4
4
|
export interface ToastProps extends React.InputHTMLAttributes<HTMLLIElement> {
|
|
5
5
|
intent?: Intent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/toast.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/toast.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAUjF,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,mBAAmB,CAAC,aAAa,CAAC;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,aAAa,6CAA0B,CAAA;AACpD,eAAO,MAAM,aAAa,4GAA0B,CAAA;AAIpD,eAAO,MAAM,KAAK,GAAkB,kGAYjC,UAAU,GAAG;IACd,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;CACrC,sBAqEA,CAAA"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFocusTrap, useMergedRef } from "@mantine/hooks";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import react from "react";
|
|
6
5
|
import { Toast as external_radix_ui_Toast } from "radix-ui";
|
|
6
|
+
import react from "react";
|
|
7
|
+
import { CloseIcon } from "../../icons/close-icon.js";
|
|
7
8
|
import { DangerIcon } from "../../icons/danger-icon.js";
|
|
8
9
|
import { InfoIcon } from "../../icons/info-icon.js";
|
|
9
10
|
import { SuccessIcon } from "../../icons/success-icon.js";
|
|
10
11
|
import { WarningIcon } from "../../icons/warning-icon.js";
|
|
11
12
|
import { Button } from "../button/button.js";
|
|
12
13
|
import toast_module from "./toast.module.js";
|
|
13
|
-
import { CloseIcon } from "../../icons/close-icon.js";
|
|
14
14
|
const toastIcons = {
|
|
15
15
|
success: SuccessIcon,
|
|
16
16
|
info: InfoIcon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-icon.d.ts","sourceRoot":"","sources":["../../src/icons/close-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"close-icon.d.ts","sourceRoot":"","sources":["../../src/icons/close-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,eAAO,MAAM,SAAS;2CAA0C,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO;;CAoB5F,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconProps } from './types/icon.js';
|
|
3
|
-
export declare const DangerIcon: ({ className, svgClassName,
|
|
3
|
+
export declare const DangerIcon: ({ className, svgClassName, ...rest }: IconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=danger-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"danger-icon.d.ts","sourceRoot":"","sources":["../../src/icons/danger-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"danger-icon.d.ts","sourceRoot":"","sources":["../../src/icons/danger-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,eAAO,MAAM,UAAU,GAAI,sCAAsC,SAAS,KAAG,KAAK,CAAC,GAAG,CAAC,OAUtF,CAAA"}
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { IconElement } from "./icon-element.js";
|
|
4
4
|
import icons_module from "./icons.module.js";
|
|
5
|
-
const
|
|
6
|
-
const DangerIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
5
|
+
const DangerIcon = ({ className, svgClassName, ...rest })=>{
|
|
7
6
|
const applied = classnames(icons_module["fill-danger"], svgClassName);
|
|
8
7
|
return /*#__PURE__*/ jsx(IconElement, {
|
|
9
8
|
className: classnames('danger-icon', className),
|
|
@@ -13,9 +12,7 @@ const DangerIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
|
13
12
|
focusable: "false",
|
|
14
13
|
"aria-hidden": "true",
|
|
15
14
|
viewBox: "0 0 24 24",
|
|
16
|
-
children:
|
|
17
|
-
href: `/sprite.svg#${spriteID}`
|
|
18
|
-
}) : /*#__PURE__*/ jsx("path", {
|
|
15
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
19
16
|
d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
20
17
|
})
|
|
21
18
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconProps } from './types/icon.js';
|
|
3
|
-
export declare const InfoIcon: ({ className, svgClassName,
|
|
3
|
+
export declare const InfoIcon: ({ className, svgClassName, ...rest }: IconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=info-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-icon.d.ts","sourceRoot":"","sources":["../../src/icons/info-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"info-icon.d.ts","sourceRoot":"","sources":["../../src/icons/info-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,eAAO,MAAM,QAAQ,GAAI,sCAAsC,SAAS,KAAG,KAAK,CAAC,GAAG,CAAC,OAUpF,CAAA"}
|
package/dist/icons/info-icon.js
CHANGED
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { IconElement } from "./icon-element.js";
|
|
4
4
|
import icons_module from "./icons.module.js";
|
|
5
|
-
const
|
|
6
|
-
const InfoIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
5
|
+
const InfoIcon = ({ className, svgClassName, ...rest })=>{
|
|
7
6
|
const applied = classnames(icons_module["fill-info"], svgClassName);
|
|
8
7
|
return /*#__PURE__*/ jsx(IconElement, {
|
|
9
8
|
className: classnames('info-icon', className),
|
|
@@ -13,9 +12,7 @@ const InfoIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
|
13
12
|
focusable: "false",
|
|
14
13
|
"aria-hidden": "true",
|
|
15
14
|
viewBox: "0 0 24 24",
|
|
16
|
-
children:
|
|
17
|
-
href: `/sprite.svg#${spriteID}`
|
|
18
|
-
}) : /*#__PURE__*/ jsx("path", {
|
|
15
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
19
16
|
d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
20
17
|
})
|
|
21
18
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconProps } from './types/icon.js';
|
|
3
|
-
export declare const PrimaryIcon: ({ className, svgClassName,
|
|
3
|
+
export declare const PrimaryIcon: ({ className, svgClassName, ...rest }: IconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=primary-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primary-icon.d.ts","sourceRoot":"","sources":["../../src/icons/primary-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"primary-icon.d.ts","sourceRoot":"","sources":["../../src/icons/primary-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAMhD,eAAO,MAAM,WAAW,GAAI,sCAAsC,SAAS,KAAG,KAAK,CAAC,GAAG,CAAC,OAUvF,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { IconElement } from "./icon-element.js";
|
|
4
4
|
import icons_module from "./icons.module.js";
|
|
5
|
-
const PrimaryIcon = ({ className, svgClassName,
|
|
5
|
+
const PrimaryIcon = ({ className, svgClassName, ...rest })=>{
|
|
6
6
|
const applied = classnames(icons_module["fill-primary"], svgClassName);
|
|
7
7
|
return /*#__PURE__*/ jsx(IconElement, {
|
|
8
8
|
className: classnames('primary-icon', className),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconProps } from './types/icon.js';
|
|
3
|
-
export declare const SuccessIcon: ({ className, svgClassName,
|
|
3
|
+
export declare const SuccessIcon: ({ className, svgClassName, ...rest }: IconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=success-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"success-icon.d.ts","sourceRoot":"","sources":["../../src/icons/success-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"success-icon.d.ts","sourceRoot":"","sources":["../../src/icons/success-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,eAAO,MAAM,WAAW,GAAI,sCAAsC,SAAS,KAAG,KAAK,CAAC,GAAG,CAAC,OAUvF,CAAA"}
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { IconElement } from "./icon-element.js";
|
|
4
4
|
import icons_module from "./icons.module.js";
|
|
5
|
-
const
|
|
6
|
-
const SuccessIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
5
|
+
const SuccessIcon = ({ className, svgClassName, ...rest })=>{
|
|
7
6
|
const applied = classnames(icons_module["fill-success"], svgClassName);
|
|
8
7
|
return /*#__PURE__*/ jsx(IconElement, {
|
|
9
8
|
className: classnames('success-icon', className),
|
|
@@ -13,9 +12,7 @@ const SuccessIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
|
13
12
|
focusable: "false",
|
|
14
13
|
"aria-hidden": "true",
|
|
15
14
|
viewBox: "0 0 24 24",
|
|
16
|
-
children:
|
|
17
|
-
href: `/sprite.svg#${spriteID}`
|
|
18
|
-
}) : /*#__PURE__*/ jsx("path", {
|
|
15
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
19
16
|
d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"
|
|
20
17
|
})
|
|
21
18
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/icons/types/icon.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/icons/types/icon.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconProps } from './types/icon.js';
|
|
3
|
-
export declare const WarningIcon: ({ className, svgClassName,
|
|
3
|
+
export declare const WarningIcon: ({ className, svgClassName, ...rest }: IconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=warning-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning-icon.d.ts","sourceRoot":"","sources":["../../src/icons/warning-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warning-icon.d.ts","sourceRoot":"","sources":["../../src/icons/warning-icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,eAAO,MAAM,WAAW,GAAI,sCAAsC,SAAS,KAAG,KAAK,CAAC,GAAG,CAAC,OAUvF,CAAA"}
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { IconElement } from "./icon-element.js";
|
|
4
4
|
import icons_module from "./icons.module.js";
|
|
5
|
-
const
|
|
6
|
-
const WarningIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
5
|
+
const WarningIcon = ({ className, svgClassName, ...rest })=>{
|
|
7
6
|
const applied = classnames(icons_module["fill-warning"], svgClassName);
|
|
8
7
|
return /*#__PURE__*/ jsx(IconElement, {
|
|
9
8
|
className: classnames('warning-icon', className),
|
|
@@ -13,9 +12,7 @@ const WarningIcon = ({ className, svgClassName, useSprite, ...rest })=>{
|
|
|
13
12
|
focusable: "false",
|
|
14
13
|
"aria-hidden": "true",
|
|
15
14
|
viewBox: "0 0 24 24",
|
|
16
|
-
children:
|
|
17
|
-
href: `/sprite.svg#${spriteID}`
|
|
18
|
-
}) : /*#__PURE__*/ jsx("path", {
|
|
15
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
19
16
|
d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
|
|
20
17
|
})
|
|
21
18
|
})
|
|
@@ -3,26 +3,32 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import { format } from "date-fns";
|
|
5
5
|
import { Popover } from "radix-ui";
|
|
6
|
-
import { useRef, useState } from "react";
|
|
7
|
-
import { Button
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { Button } from "../../components/button/button.js";
|
|
8
|
+
import { IconButton } from "../../components/button/icon-button.js";
|
|
8
9
|
import { Calendar } from "../../components/calendar/calendar.js";
|
|
9
10
|
import { Input, InputAdornment } from "../../components/input/index.js";
|
|
10
11
|
import { ScrollArea } from "../../components/scroll-area/scroll-area.js";
|
|
11
12
|
import { CalendarIcon } from "../../icons/calendar-icon.js";
|
|
12
13
|
import { CloseIcon } from "../../icons/close-icon.js";
|
|
13
14
|
import datepicker_module from "./datepicker.module.js";
|
|
14
|
-
function DatePicker({ id, name, initialValue, mode = 'datetime', yearsInFuture = 1, yearsInPast = 10, variant, intent, inputSize, inputClassName, inputWrapperClassName, containerClassName, onClear = ()=>{}, onDateChange = ()=>{}, validatorFn, helpText, errorText, placeHolderText = '
|
|
15
|
+
function DatePicker({ id, name, label, required, initialValue, mode = 'datetime', yearsInFuture = 1, yearsInPast = 10, variant, intent, inputSize, inputClassName, inputWrapperClassName, containerClassName, onClear = ()=>{}, onDateChange = ()=>{}, validatorFn, helpText, errorText, placeHolderText = '', ariaLabelForSearch = 'date', ariaLabelForClear = 'clear', ...rest }) {
|
|
15
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
17
|
const [time, setTime] = useState('08:00');
|
|
17
|
-
const [date, setDate] = useState(
|
|
18
|
+
const [date, setDate] = useState(()=>{
|
|
19
|
+
if (initialValue) return initialValue;
|
|
20
|
+
if (null == initialValue && true === required) return new Date();
|
|
21
|
+
return null;
|
|
22
|
+
});
|
|
18
23
|
const [month, setMonth] = useState(date);
|
|
19
24
|
const calendarRef = useRef(null);
|
|
20
25
|
const inputRef = useRef(null);
|
|
26
|
+
const hasInitialized = useRef(false);
|
|
21
27
|
const handleClear = ()=>{
|
|
22
|
-
setDate(void 0);
|
|
23
28
|
if ((null == inputRef ? void 0 : inputRef.current) != null) inputRef.current.value = '';
|
|
29
|
+
setDate(null);
|
|
30
|
+
onDateChange(null);
|
|
24
31
|
onClear();
|
|
25
|
-
onDateChange(void 0);
|
|
26
32
|
};
|
|
27
33
|
const handleOnDateChange = (value)=>{
|
|
28
34
|
if (null != onDateChange && 'function' == typeof onDateChange) onDateChange(value);
|
|
@@ -33,6 +39,12 @@ function DatePicker({ id, name, initialValue, mode = 'datetime', yearsInFuture =
|
|
|
33
39
|
setIsOpen(true);
|
|
34
40
|
}
|
|
35
41
|
};
|
|
42
|
+
useEffect(()=>{
|
|
43
|
+
if (null == initialValue && null != date && true === required && false === hasInitialized.current) {
|
|
44
|
+
hasInitialized.current = true;
|
|
45
|
+
onDateChange(date);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
36
48
|
return /*#__PURE__*/ jsxs("div", {
|
|
37
49
|
className: classnames(datepicker_module.container, containerClassName),
|
|
38
50
|
children: [
|
|
@@ -44,7 +56,9 @@ function DatePicker({ id, name, initialValue, mode = 'datetime', yearsInFuture =
|
|
|
44
56
|
},
|
|
45
57
|
children: /*#__PURE__*/ jsx(Input, {
|
|
46
58
|
id: id,
|
|
59
|
+
label: label,
|
|
47
60
|
readOnly: true,
|
|
61
|
+
required: required,
|
|
48
62
|
name: name,
|
|
49
63
|
variant: variant,
|
|
50
64
|
intent: intent,
|
|
@@ -58,7 +72,7 @@ function DatePicker({ id, name, initialValue, mode = 'datetime', yearsInFuture =
|
|
|
58
72
|
e.stopPropagation();
|
|
59
73
|
setIsOpen(true);
|
|
60
74
|
},
|
|
61
|
-
value: date ? `${format(date, 'PP HH:mm')}` : '
|
|
75
|
+
value: date ? `${format(date, 'PP HH:mm')}` : '',
|
|
62
76
|
placeHolder: placeHolderText,
|
|
63
77
|
helpText: helpText,
|
|
64
78
|
disabled: false,
|
|
@@ -130,8 +144,8 @@ function DatePicker({ id, name, initialValue, mode = 'datetime', yearsInFuture =
|
|
|
130
144
|
mode: "single",
|
|
131
145
|
required: true,
|
|
132
146
|
captionLayout: "dropdown",
|
|
133
|
-
selected: date,
|
|
134
|
-
month: month,
|
|
147
|
+
selected: date ?? void 0,
|
|
148
|
+
month: month ?? void 0,
|
|
135
149
|
onMonthChange: setMonth,
|
|
136
150
|
onSelect: (selectedDate)=>{
|
|
137
151
|
if (selectedDate) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "@infonomic/uikit",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.0
|
|
5
|
+
"version": "1.1.0",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
|
|
7
8
|
"keywords": [
|
|
8
9
|
"uikit",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"module": "./dist/react.js",
|
|
23
24
|
"main": "./dist/react.js",
|
|
24
25
|
"files": [
|
|
25
|
-
"dist
|
|
26
|
+
"dist",
|
|
26
27
|
"src/astro.js"
|
|
27
28
|
],
|
|
28
29
|
"exports": {
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"./react": {
|
|
31
32
|
"types": "./dist/react.d.ts",
|
|
32
33
|
"import": "./dist/react.js",
|
|
34
|
+
"main": "./dist/react.js",
|
|
33
35
|
"default": "./dist/react.js"
|
|
34
36
|
},
|
|
35
37
|
"./styles.css": {
|
|
@@ -86,7 +88,11 @@
|
|
|
86
88
|
"vitest": "^3.2.4"
|
|
87
89
|
},
|
|
88
90
|
"publishConfig": {
|
|
89
|
-
"access": "public"
|
|
91
|
+
"access": "public",
|
|
92
|
+
"files": [
|
|
93
|
+
"dist/",
|
|
94
|
+
"src/astro.js"
|
|
95
|
+
]
|
|
90
96
|
},
|
|
91
97
|
"scripts": {
|
|
92
98
|
"dev": "run-p dev:*",
|