@tcn/ui 0.12.5 → 0.12.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/inputs/color_input/color_input.js +18 -18
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/control/control.d.ts +10 -0
- package/dist/inputs/control/control.d.ts.map +1 -0
- package/dist/inputs/control/control.js +17 -0
- package/dist/inputs/control/control.js.map +1 -0
- package/dist/inputs/control_set/control_set.d.ts +5 -0
- package/dist/inputs/control_set/control_set.d.ts.map +1 -0
- package/dist/inputs/control_set/control_set.js +20 -0
- package/dist/inputs/{input_group/input_group.js.map → control_set/control_set.js.map} +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +20 -20
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/index.d.ts +2 -1
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/index.js +27 -24
- package/dist/inputs/index.js.map +1 -1
- package/dist/inputs/input/input.js +6 -6
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js +15 -15
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +24 -24
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +21 -21
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -1
- package/dist/inputs/phone_number_input/sip_input.js +14 -14
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -1
- package/dist/inputs/select/select.js +6 -6
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/textarea/textarea.js +8 -8
- package/dist/inputs/textarea/textarea.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +20 -20
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts +2 -2
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +67 -59
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/slide/slide.d.ts +9 -0
- package/dist/overlay/slide/slide.d.ts.map +1 -0
- package/dist/overlay/slide/slide.js +29 -0
- package/dist/overlay/slide/slide.js.map +1 -0
- package/dist/slide.css +1 -0
- package/dist/surfaces/drawers/drawer.d.ts +5 -0
- package/dist/surfaces/drawers/drawer.d.ts.map +1 -0
- package/dist/surfaces/drawers/drawer.js +23 -0
- package/dist/surfaces/drawers/drawer.js.map +1 -0
- package/dist/surfaces/index.d.ts +1 -4
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +20 -26
- package/dist/surfaces/index.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +1 -1
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/window/window.d.ts +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/themes/stylesheets/reset.css +1 -1
- package/dist/themes/stylesheets/reset.js +2 -2
- package/dist/themes/stylesheets/reset.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +70 -6
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
- package/package.json +2 -2
- package/src/inputs/color_input/color_input.tsx +3 -3
- package/src/inputs/control/control.stories.tsx +158 -0
- package/src/inputs/control/control.tsx +32 -0
- package/src/inputs/control/control_stories.module.css +7 -0
- package/src/inputs/control_set/control_set.stories.tsx +46 -0
- package/src/inputs/{input_group/input_group.tsx → control_set/control_set.tsx} +5 -5
- package/src/inputs/date_picker/date_picker_input.stories.tsx +1 -1
- package/src/inputs/date_picker/date_picker_input.tsx +1 -1
- package/src/inputs/index.ts +2 -1
- package/src/inputs/input/input.tsx +1 -1
- package/src/inputs/phone_number_input/phone_number_country_select_adapter.tsx +1 -1
- package/src/inputs/phone_number_input/phone_number_input.tsx +1 -1
- package/src/inputs/phone_number_input/phone_number_input_adapter.tsx +2 -2
- package/src/inputs/phone_number_input/sip_input.tsx +4 -4
- package/src/inputs/select/select.tsx +1 -1
- package/src/inputs/textarea/textarea.stories.tsx +1 -1
- package/src/inputs/textarea/textarea.tsx +1 -1
- package/src/inputs/unit_input/unit_input.tsx +3 -3
- package/src/overlay/frame/frame.tsx +13 -16
- package/src/overlay/slide/slide.module.css +30 -0
- package/src/overlay/slide/slide.stories.tsx +58 -0
- package/src/overlay/slide/slide.tsx +51 -0
- package/src/surfaces/drawers/drawer.stories.tsx +130 -0
- package/src/surfaces/drawers/drawer.tsx +26 -0
- package/src/surfaces/index.ts +1 -4
- package/src/themes/stylesheets/reset.css +2 -2
- package/src/themes/themes/ergo/ergo_theme.css +70 -6
- package/src/utils/dnd/hooks/use_drag_container.ts +0 -7
- package/dist/drawer_bottom.css +0 -1
- package/dist/drawer_end.css +0 -1
- package/dist/drawer_start.css +0 -1
- package/dist/drawer_top.css +0 -1
- package/dist/inputs/input_group/input_group.d.ts +0 -5
- package/dist/inputs/input_group/input_group.d.ts.map +0 -1
- package/dist/inputs/input_group/input_group.js +0 -20
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.d.ts +0 -7
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.d.ts.map +0 -1
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js +0 -22
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js.map +0 -1
- package/dist/surfaces/drawers/drawer_end/drawer_end.d.ts +0 -7
- package/dist/surfaces/drawers/drawer_end/drawer_end.d.ts.map +0 -1
- package/dist/surfaces/drawers/drawer_end/drawer_end.js +0 -20
- package/dist/surfaces/drawers/drawer_end/drawer_end.js.map +0 -1
- package/dist/surfaces/drawers/drawer_start/drawer_start.d.ts +0 -7
- package/dist/surfaces/drawers/drawer_start/drawer_start.d.ts.map +0 -1
- package/dist/surfaces/drawers/drawer_start/drawer_start.js +0 -22
- package/dist/surfaces/drawers/drawer_start/drawer_start.js.map +0 -1
- package/dist/surfaces/drawers/drawer_top/drawer_top.d.ts +0 -7
- package/dist/surfaces/drawers/drawer_top/drawer_top.d.ts.map +0 -1
- package/dist/surfaces/drawers/drawer_top/drawer_top.js +0 -20
- package/dist/surfaces/drawers/drawer_top/drawer_top.js.map +0 -1
- package/src/surfaces/drawers/__stories__/drawers.stories.tsx +0 -26
- package/src/surfaces/drawers/drawer_bottom/drawer_bottom.module.css +0 -5
- package/src/surfaces/drawers/drawer_bottom/drawer_bottom.tsx +0 -23
- package/src/surfaces/drawers/drawer_end/drawer_end.module.css +0 -5
- package/src/surfaces/drawers/drawer_end/drawer_end.tsx +0 -24
- package/src/surfaces/drawers/drawer_start/drawer_start.module.css +0 -5
- package/src/surfaces/drawers/drawer_start/drawer_start.tsx +0 -23
- package/src/surfaces/drawers/drawer_top/drawer_top.module.css +0 -5
- package/src/surfaces/drawers/drawer_top/drawer_top.tsx +0 -24
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
1
|
+
import { jsxs as n, Fragment as C, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Box as m } from "../../stacks/box/box.js";
|
|
3
3
|
import { HStack as $ } from "../../stacks/h_stack.js";
|
|
4
|
-
import { Spacer as
|
|
4
|
+
import { Spacer as s } from "../../stacks/spacer.js";
|
|
5
5
|
import { clsx as h } from "clsx";
|
|
6
|
-
import { useState as
|
|
6
|
+
import { useState as I, useRef as A, useLayoutEffect as N } from "react";
|
|
7
7
|
import "../../actions/button/base_button/base_button.js";
|
|
8
8
|
import "../../actions/button/button_group/button_group.js";
|
|
9
9
|
import "../../actions/button/slim_button/slim_button.js";
|
|
@@ -12,21 +12,21 @@ import "../../actions/toggle/toggle.js";
|
|
|
12
12
|
import { ColorPicker as _ } from "./color_picker.js";
|
|
13
13
|
import { Input as B } from "../input/input.js";
|
|
14
14
|
import { Popper as F } from "../../overlay/popper/legacy/popper.js";
|
|
15
|
-
import {
|
|
15
|
+
import { ControlSet as j } from "../control_set/control_set.js";
|
|
16
16
|
import '../../color_input.css';const z = "_checker-board_2cc94a9", K = "_color-input-select_abe3066", f = { "checker-board": z, "color-input-select": K };
|
|
17
17
|
function v({
|
|
18
18
|
value: c = "#000",
|
|
19
19
|
onChange: i,
|
|
20
20
|
onError: O,
|
|
21
|
-
disabled:
|
|
21
|
+
disabled: p,
|
|
22
22
|
width: x = "100%",
|
|
23
23
|
maxWidth: g,
|
|
24
24
|
minWidth: b,
|
|
25
25
|
hierarchy: k = "secondary",
|
|
26
26
|
...E
|
|
27
27
|
}) {
|
|
28
|
-
const [e, a] =
|
|
29
|
-
function
|
|
28
|
+
const [e, a] = I(null), y = e != null, d = A(null);
|
|
29
|
+
function S(t) {
|
|
30
30
|
a(t.currentTarget);
|
|
31
31
|
}
|
|
32
32
|
function u() {
|
|
@@ -37,15 +37,15 @@ function v({
|
|
|
37
37
|
e != null && d.current && d.current.focus();
|
|
38
38
|
});
|
|
39
39
|
}, [e]);
|
|
40
|
-
function
|
|
40
|
+
function w(t) {
|
|
41
41
|
t.key === "Escape" && u();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function R(t) {
|
|
44
44
|
const r = t.rgb;
|
|
45
45
|
let l = t.hex;
|
|
46
46
|
r.a != null ? l = `rgba(${r.r},${r.g},${r.b},${r.a})` : l = `rgb(${r.r},${r.g},${r.b})`, i && i(l);
|
|
47
47
|
}
|
|
48
|
-
return /* @__PURE__ */ n(
|
|
48
|
+
return /* @__PURE__ */ n(C, { children: [
|
|
49
49
|
/* @__PURE__ */ n(
|
|
50
50
|
j,
|
|
51
51
|
{
|
|
@@ -60,7 +60,7 @@ function v({
|
|
|
60
60
|
B,
|
|
61
61
|
{
|
|
62
62
|
width: "flex",
|
|
63
|
-
disabled:
|
|
63
|
+
disabled: p,
|
|
64
64
|
value: c,
|
|
65
65
|
style: {
|
|
66
66
|
borderEndEndRadius: 0,
|
|
@@ -75,9 +75,9 @@ function v({
|
|
|
75
75
|
/* @__PURE__ */ n(
|
|
76
76
|
P,
|
|
77
77
|
{
|
|
78
|
-
disabled:
|
|
78
|
+
disabled: p,
|
|
79
79
|
hierarchy: k,
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: S,
|
|
81
81
|
width: "70px",
|
|
82
82
|
maxWidth: "70px",
|
|
83
83
|
className: h(
|
|
@@ -92,7 +92,7 @@ function v({
|
|
|
92
92
|
},
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ n($, { height: "14px", gap: "4px", hAlign: "start", children: [
|
|
95
|
-
/* @__PURE__ */ o(
|
|
95
|
+
/* @__PURE__ */ o(s, { width: "4px" }),
|
|
96
96
|
/* @__PURE__ */ o(
|
|
97
97
|
m,
|
|
98
98
|
{
|
|
@@ -109,9 +109,9 @@ function v({
|
|
|
109
109
|
)
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
/* @__PURE__ */ o(
|
|
112
|
+
/* @__PURE__ */ o(s, {})
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */ o(
|
|
114
|
+
/* @__PURE__ */ o(s, { width: "4px" })
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
)
|
|
@@ -131,8 +131,8 @@ function v({
|
|
|
131
131
|
_,
|
|
132
132
|
{
|
|
133
133
|
color: c,
|
|
134
|
-
onKeyDown:
|
|
135
|
-
onColorChange:
|
|
134
|
+
onKeyDown: w,
|
|
135
|
+
onColorChange: R
|
|
136
136
|
}
|
|
137
137
|
)
|
|
138
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_input.js","sources":["../../../src/inputs/color_input/color_input.tsx"],"sourcesContent":["import { Box } from '../../stacks/box/box.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { HTMLAttributes } from 'react';\nimport { ColorState } from 'react-color';\nimport { Button } from '../../actions/index.js';\nimport { ColorPicker } from './color_picker.js';\nimport { Input } from '../input/input.js';\nimport styles from './color_input.module.css';\n\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport {
|
|
1
|
+
{"version":3,"file":"color_input.js","sources":["../../../src/inputs/color_input/color_input.tsx"],"sourcesContent":["import { Box } from '../../stacks/box/box.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { HTMLAttributes } from 'react';\nimport { ColorState } from 'react-color';\nimport { Button } from '../../actions/index.js';\nimport { ColorPicker } from './color_picker.js';\nimport { Input } from '../input/input.js';\nimport styles from './color_input.module.css';\n\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { ControlSet } from '../control_set/control_set.js';\n\nexport interface ColorInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: string;\n disabled?: boolean;\n onChange?: (color: string) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n hierarchy?: 'primary' | 'secondary' | 'tertiary';\n}\n\nexport function ColorInput({\n value = '#000',\n onChange,\n onError,\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n hierarchy = 'secondary',\n ...props\n}: ColorInputProps) {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function updateColor(value: ColorState) {\n const rgb = value.rgb;\n let color = value.hex;\n\n if (rgb.a != null) {\n color = `rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a})`;\n } else {\n color = `rgb(${rgb.r},${rgb.g},${rgb.b})`;\n }\n\n onChange && onChange(color);\n }\n\n return (\n <>\n <ControlSet\n height=\"auto\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n className=\"tcn-color-input-wrapper\"\n {...props}\n >\n <Input\n width=\"flex\"\n disabled={disabled}\n value={value}\n style={{\n borderEndEndRadius: 0,\n borderStartEndRadius: 0,\n textAlign: 'start',\n paddingInlineEnd: '8px',\n }}\n className=\"tcn-color-input\"\n onChange={onChange}\n />\n\n <Button\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openPicker}\n width=\"70px\"\n maxWidth=\"70px\"\n className={clsx(\n styles['color-input-select'],\n 'tcn-color-input-select',\n 'tcn-select'\n )}\n style={{\n borderStartStartRadius: 0,\n borderEndStartRadius: 0,\n paddingInlineEnd: 0,\n }}\n >\n <HStack height=\"14px\" gap=\"4px\" hAlign=\"start\">\n <Spacer width=\"4px\" />\n <Box\n width=\"flex\"\n height=\"30px\"\n className={clsx(styles['checker-board'], 'tcn-checker-board')}\n style={{ borderRadius: '2px', overflow: 'hidden' }}\n >\n <Box\n height=\"100%\"\n style={{ backgroundColor: value, borderRadius: '2px' }}\n ></Box>\n </Box>\n <Spacer />\n </HStack>\n <Spacer width=\"4px\" />\n </Button>\n </ControlSet>\n <Popper\n anchorElement={anchorElement}\n onClose={closePicker}\n open={isOpen}\n restoreFocus\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n >\n <ColorPicker\n color={value}\n onKeyDown={processKeyInput}\n onColorChange={updateColor}\n />\n </Popper>\n </>\n );\n}\n"],"names":["ColorInput","value","onChange","onError","disabled","width","maxWidth","minWidth","hierarchy","props","anchorElement","setAnchorElement","useState","isOpen","pickerRef","useRef","openPicker","e","closePicker","useLayoutEffect","processKeyInput","event","updateColor","rgb","color","jsxs","Fragment","ControlSet","jsx","Input","Button","clsx","styles","HStack","Spacer","Box","Popper","ColorPicker"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VStackProps } from '../../stacks/v_stack.js';
|
|
3
|
+
import { HStackProps } from '../../stacks/h_stack.js';
|
|
4
|
+
export interface ControlProps extends VStackProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const Control: React.ForwardRefExoticComponent<ControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface ControlRowProps extends HStackProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const ControlRow: React.ForwardRefExoticComponent<ControlRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/inputs/control/control.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,YAAa,SAAQ,WAAW;CAAG;AAEpD,eAAO,MAAM,OAAO,qFASlB,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,WAAW;CAAG;AAEvD,eAAO,MAAM,UAAU,wFAWtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as m } from "clsx";
|
|
3
|
+
import a from "react";
|
|
4
|
+
import { VStack as e } from "../../stacks/v_stack.js";
|
|
5
|
+
import { HStack as i } from "../../stacks/h_stack.js";
|
|
6
|
+
const R = a.forwardRef(function({ as: o = "div", className: r, children: t, ...n }, c) {
|
|
7
|
+
return /* @__PURE__ */ f(e, { ref: c, as: o, className: m(r, "tcn-control"), ...n, children: t });
|
|
8
|
+
}), C = a.forwardRef(
|
|
9
|
+
function({ as: o = "div", className: r, children: t, ...n }, c) {
|
|
10
|
+
return /* @__PURE__ */ f(i, { ref: c, as: o, className: m(r, "tcn-control-row"), ...n, children: t });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
R as Control,
|
|
15
|
+
C as ControlRow
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sources":["../../../src/inputs/control/control.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { VStack, type VStackProps } from '../../stacks/v_stack.js';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\n\nexport interface ControlProps extends VStackProps {}\n\nexport const Control = React.forwardRef<HTMLDivElement, ControlProps>(function Control(\n { as = 'div', className, children, ...props }: ControlProps,\n ref: React.Ref<HTMLDivElement>\n) {\n return (\n <VStack ref={ref} as={as} className={clsx(className, 'tcn-control')} {...props}>\n {children}\n </VStack>\n );\n});\n\nexport interface ControlRowProps extends HStackProps {}\n\nexport const ControlRow = React.forwardRef<HTMLDivElement, ControlRowProps>(\n function ControlRow(\n { as = 'div', className, children, ...props }: ControlRowProps,\n ref: React.Ref<HTMLDivElement>\n ) {\n return (\n <HStack ref={ref} as={as} className={clsx(className, 'tcn-control-row')} {...props}>\n {children}\n </HStack>\n );\n }\n);\n"],"names":["Control","React","as","className","children","props","ref","jsx","VStack","clsx","ControlRow","HStack"],"mappings":";;;;;AAOO,MAAMA,IAAUC,EAAM,WAAyC,SACpE,EAAE,IAAAC,IAAK,OAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GACtCC,GACA;AACA,SACE,gBAAAC,EAACC,GAAA,EAAO,KAAAF,GAAU,IAAAJ,GAAQ,WAAWO,EAAKN,GAAW,aAAa,GAAI,GAAGE,GACtE,UAAAD,EAAA,CACH;AAEJ,CAAC,GAIYM,IAAaT,EAAM;AAAA,EAC9B,SACE,EAAE,IAAAC,IAAK,OAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GACtCC,GACA;AACA,WACE,gBAAAC,EAACI,GAAA,EAAO,KAAAL,GAAU,IAAAJ,GAAQ,WAAWO,EAAKN,GAAW,iBAAiB,GAAI,GAAGE,GAC1E,UAAAD,EAAA,CACH;AAAA,EAEJ;AACF;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HStackProps } from '../../stacks/h_stack.js';
|
|
3
|
+
export type ControlSetProps = HStackProps;
|
|
4
|
+
export declare const ControlSet: React.ForwardRefExoticComponent<ControlSetProps & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
//# sourceMappingURL=control_set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control_set.d.ts","sourceRoot":"","sources":["../../../src/inputs/control_set/control_set.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C,eAAO,MAAM,UAAU,qFAmBtB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { clsx as r } from "clsx";
|
|
4
|
+
import { HStack as p } from "../../stacks/h_stack.js";
|
|
5
|
+
const C = t.forwardRef(
|
|
6
|
+
function({ children: e, as: n = "div", className: m, ...s }, a) {
|
|
7
|
+
const c = t.Children.map(
|
|
8
|
+
e,
|
|
9
|
+
(o) => t.isValidElement(o) ? t.cloneElement(o, {
|
|
10
|
+
...o.props,
|
|
11
|
+
className: r(o.props.className, "tcn-control-set-item")
|
|
12
|
+
}) : o
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ l(p, { ref: a, as: n, className: r(m, "tcn-control-set"), ...s, children: c });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
C as ControlSet
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=control_set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"control_set.js","sources":["../../../src/inputs/control_set/control_set.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\n\nexport type ControlSetProps = HStackProps;\n\nexport const ControlSet = React.forwardRef<HTMLElement, ControlSetProps>(\n function InputGroup(\n { children, as = 'div', className, ...props }: ControlSetProps,\n ref\n ) {\n const clonedChildren = React.Children.map(children, child =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n ...child.props,\n className: clsx(child.props.className, 'tcn-control-set-item'),\n })\n : child\n );\n return (\n <HStack ref={ref} as={as} className={clsx(className, 'tcn-control-set')} {...props}>\n {clonedChildren}\n </HStack>\n );\n }\n);\n"],"names":["ControlSet","React","children","as","className","props","ref","clonedChildren","child","clsx","jsx","HStack"],"mappings":";;;;AAMO,MAAMA,IAAaC,EAAM;AAAA,EAC9B,SACE,EAAE,UAAAC,GAAU,IAAAC,IAAK,OAAO,WAAAC,GAAW,GAAGC,EAAA,GACtCC,GACA;AACA,UAAMC,IAAiBN,EAAM,SAAS;AAAA,MAAIC;AAAA,MAAU,OAClDD,EAAM,eAAeO,CAAK,IACtBP,EAAM,aAAaO,GAAO;AAAA,QACxB,GAAGA,EAAM;AAAA,QACT,WAAWC,EAAKD,EAAM,MAAM,WAAW,sBAAsB;AAAA,MAAA,CAC9D,IACDA;AAAA,IAAA;AAEN,WACE,gBAAAE,EAACC,GAAA,EAAO,KAAAL,GAAU,IAAAH,GAAQ,WAAWM,EAAKL,GAAW,iBAAiB,GAAI,GAAGC,GAC1E,UAAAE,EAAA,CACH;AAAA,EAEJ;AACF;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, Fragment as q, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import B, { useState as L, useRef as M, useCallback as V, useMemo as W, useLayoutEffect as Z } from "react";
|
|
3
3
|
import { ZStack as G } from "../../stacks/z_stack.js";
|
|
4
4
|
import { Popper as H } from "../../overlay/popper/legacy/popper.js";
|
|
5
|
-
import { clsx as
|
|
5
|
+
import { clsx as m } from "clsx";
|
|
6
6
|
import "../../actions/button/base_button/base_button.js";
|
|
7
7
|
import "../../actions/button/button_group/button_group.js";
|
|
8
8
|
import "../../actions/button/slim_button/slim_button.js";
|
|
@@ -26,7 +26,7 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
26
26
|
width: y = "100%",
|
|
27
27
|
maxWidth: D,
|
|
28
28
|
minWidth: Y,
|
|
29
|
-
showTime:
|
|
29
|
+
showTime: n = !1,
|
|
30
30
|
timeIntervalInMinutes: x = 15,
|
|
31
31
|
hierarchy: A = "secondary",
|
|
32
32
|
disabledDates: E,
|
|
@@ -36,14 +36,14 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
36
36
|
onTimeSelected: w,
|
|
37
37
|
..._
|
|
38
38
|
}, b) => {
|
|
39
|
-
const [
|
|
39
|
+
const [o, a] = L(null), v = o != null, i = M(null), p = V((t) => t.closest(".tcn-suggestion-list") != null, []), C = W(() => {
|
|
40
40
|
const t = {
|
|
41
41
|
year: "numeric",
|
|
42
42
|
month: "short",
|
|
43
43
|
day: "numeric"
|
|
44
44
|
};
|
|
45
|
-
return
|
|
46
|
-
}, [s,
|
|
45
|
+
return n && (t.hour = "numeric", t.minute = "2-digit", t.hour12 = !0), new Intl.DateTimeFormat(s, t);
|
|
46
|
+
}, [s, n]), F = c != null ? C.format(c) : R;
|
|
47
47
|
function P(t) {
|
|
48
48
|
a(t.currentTarget);
|
|
49
49
|
}
|
|
@@ -52,9 +52,9 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
52
52
|
}
|
|
53
53
|
Z(() => {
|
|
54
54
|
requestAnimationFrame(() => {
|
|
55
|
-
|
|
55
|
+
o != null && i.current && i.current.focus();
|
|
56
56
|
});
|
|
57
|
-
}, [
|
|
57
|
+
}, [o]);
|
|
58
58
|
function O(t) {
|
|
59
59
|
t.key === "Escape" && e();
|
|
60
60
|
}
|
|
@@ -63,17 +63,17 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
63
63
|
t?.focus();
|
|
64
64
|
}
|
|
65
65
|
function N(t) {
|
|
66
|
-
d?.(t), !
|
|
66
|
+
d?.(t), !n && e();
|
|
67
67
|
}
|
|
68
68
|
function j(t, z, K) {
|
|
69
69
|
w?.(t, z, K), e();
|
|
70
70
|
}
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ u(q, { children: [
|
|
72
|
+
/* @__PURE__ */ r(
|
|
73
73
|
J,
|
|
74
74
|
{
|
|
75
75
|
ref: b,
|
|
76
|
-
className:
|
|
76
|
+
className: m(f.button, "tcn-entry", "tcn-date-picker-input"),
|
|
77
77
|
hAlign: "start",
|
|
78
78
|
disabled: l,
|
|
79
79
|
hierarchy: A,
|
|
@@ -81,13 +81,13 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
81
81
|
width: y,
|
|
82
82
|
maxWidth: D,
|
|
83
83
|
..._,
|
|
84
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ r("span", { className: "ellipsis", children: F })
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ r(
|
|
88
88
|
H,
|
|
89
89
|
{
|
|
90
|
-
anchorElement:
|
|
90
|
+
anchorElement: o,
|
|
91
91
|
disableClickAway: !0,
|
|
92
92
|
veil: !0,
|
|
93
93
|
onVeilClick: e,
|
|
@@ -100,14 +100,14 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
100
100
|
isClickAwayException: p,
|
|
101
101
|
isScrollAwayException: p,
|
|
102
102
|
restoreFocus: !0,
|
|
103
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ u(
|
|
104
104
|
G,
|
|
105
105
|
{
|
|
106
106
|
padding: "8px",
|
|
107
|
-
className:
|
|
107
|
+
className: m(f.popover, "tcn-date-picker-popover"),
|
|
108
108
|
onKeyDown: O,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ r(
|
|
111
111
|
Q,
|
|
112
112
|
{
|
|
113
113
|
ref: i,
|
|
@@ -115,7 +115,7 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
115
115
|
onChange: N,
|
|
116
116
|
min: k,
|
|
117
117
|
max: g,
|
|
118
|
-
showTime:
|
|
118
|
+
showTime: n,
|
|
119
119
|
onError: h,
|
|
120
120
|
disabled: l,
|
|
121
121
|
disabledDates: E,
|
|
@@ -125,7 +125,7 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
125
125
|
timeIntervalInMinutes: x
|
|
126
126
|
}
|
|
127
127
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ r(T, { onRedirect: I })
|
|
129
129
|
]
|
|
130
130
|
}
|
|
131
131
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_picker_input.js","sources":["../../../src/inputs/date_picker/date_picker_input.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Hierarchy } from '../../utils/index.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { clsx } from 'clsx';\nimport { HTMLAttributes } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { DatePicker } from './date_picker.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { FocusRedirect } from '../../utils/index.js';\nimport styles from './date_picker_input.module.css';\n\nexport interface DatePickerInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: Date | null;\n disabled?: boolean;\n onChange?: (date: Date | null) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n showTime?: boolean;\n timeIntervalInMinutes?: number;\n disabledDates?: Date[] | undefined;\n countryCode?: string;\n renderActions?: (datePickerPresenter: DatePickerPresenter) => React.ReactNode;\n min?: Date;\n max?: Date;\n hierarchy?: Hierarchy;\n selectDateMessage?: string;\n onTimeSelected?: (hour: number, minutes: number, seconds: number) => void;\n}\n\nexport const DatePickerInput = React.forwardRef<HTMLButtonElement, DatePickerInputProps>(\n (\n {\n value = new Date(),\n onChange,\n onError,\n min = new Date('01/01/1924'),\n max = new Date('01/01/2124'),\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n showTime = false,\n timeIntervalInMinutes = 15,\n hierarchy = 'secondary',\n disabledDates,\n selectDateMessage = 'Select Date',\n countryCode,\n renderActions,\n onTimeSelected,\n ...props\n }: DatePickerInputProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n const isException = useCallback((target: HTMLElement) => {\n return target.closest('.tcn-suggestion-list') != null;\n }, []);\n\n const formatter = useMemo(() => {\n const formatOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n if (showTime) {\n formatOptions.hour = 'numeric';\n formatOptions.minute = '2-digit';\n formatOptions.hour12 = true;\n }\n\n return new Intl.DateTimeFormat(countryCode, formatOptions);\n }, [countryCode, showTime]);\n\n const formattedDate = value != null ? formatter.format(value) : selectDateMessage;\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function handleRedirect() {\n const picker = pickerRef.current;\n\n if (picker != null) {\n picker.focus();\n }\n }\n\n function dateSelected(date: Date | null) {\n onChange?.(date);\n !showTime && closePicker();\n }\n\n function timeSelected(hour: number, minutes: number, seconds: number) {\n onTimeSelected?.(hour, minutes, seconds);\n closePicker();\n }\n\n return (\n <>\n <Button\n ref={ref}\n className={clsx(styles.button, 'tcn-
|
|
1
|
+
{"version":3,"file":"date_picker_input.js","sources":["../../../src/inputs/date_picker/date_picker_input.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Hierarchy } from '../../utils/index.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { clsx } from 'clsx';\nimport { HTMLAttributes } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { DatePicker } from './date_picker.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { FocusRedirect } from '../../utils/index.js';\nimport styles from './date_picker_input.module.css';\n\nexport interface DatePickerInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: Date | null;\n disabled?: boolean;\n onChange?: (date: Date | null) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n showTime?: boolean;\n timeIntervalInMinutes?: number;\n disabledDates?: Date[] | undefined;\n countryCode?: string;\n renderActions?: (datePickerPresenter: DatePickerPresenter) => React.ReactNode;\n min?: Date;\n max?: Date;\n hierarchy?: Hierarchy;\n selectDateMessage?: string;\n onTimeSelected?: (hour: number, minutes: number, seconds: number) => void;\n}\n\nexport const DatePickerInput = React.forwardRef<HTMLButtonElement, DatePickerInputProps>(\n (\n {\n value = new Date(),\n onChange,\n onError,\n min = new Date('01/01/1924'),\n max = new Date('01/01/2124'),\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n showTime = false,\n timeIntervalInMinutes = 15,\n hierarchy = 'secondary',\n disabledDates,\n selectDateMessage = 'Select Date',\n countryCode,\n renderActions,\n onTimeSelected,\n ...props\n }: DatePickerInputProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n const isException = useCallback((target: HTMLElement) => {\n return target.closest('.tcn-suggestion-list') != null;\n }, []);\n\n const formatter = useMemo(() => {\n const formatOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n if (showTime) {\n formatOptions.hour = 'numeric';\n formatOptions.minute = '2-digit';\n formatOptions.hour12 = true;\n }\n\n return new Intl.DateTimeFormat(countryCode, formatOptions);\n }, [countryCode, showTime]);\n\n const formattedDate = value != null ? formatter.format(value) : selectDateMessage;\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function handleRedirect() {\n const picker = pickerRef.current;\n\n if (picker != null) {\n picker.focus();\n }\n }\n\n function dateSelected(date: Date | null) {\n onChange?.(date);\n !showTime && closePicker();\n }\n\n function timeSelected(hour: number, minutes: number, seconds: number) {\n onTimeSelected?.(hour, minutes, seconds);\n closePicker();\n }\n\n return (\n <>\n <Button\n ref={ref}\n className={clsx(styles.button, 'tcn-entry', 'tcn-date-picker-input')}\n hAlign=\"start\"\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openPicker}\n width={width}\n maxWidth={maxWidth}\n {...props}\n >\n <span className=\"ellipsis\">{formattedDate}</span>\n </Button>\n <Popper\n anchorElement={anchorElement}\n disableClickAway\n veil\n onVeilClick={closePicker}\n onClose={closePicker}\n verticalAnchor=\"bottom\"\n horizontalAnchor=\"start\"\n verticalOrigin=\"top\"\n horizontalOrigin=\"start\"\n open={isOpen}\n isClickAwayException={isException}\n isScrollAwayException={isException}\n restoreFocus\n >\n <ZStack\n padding=\"8px\"\n className={clsx(styles.popover, 'tcn-date-picker-popover')}\n onKeyDown={processKeyInput}\n >\n <DatePicker\n ref={pickerRef}\n value={value}\n onChange={dateSelected}\n min={min}\n max={max}\n showTime={showTime}\n onError={onError}\n disabled={disabled}\n disabledDates={disabledDates}\n countryCode={countryCode}\n renderActions={renderActions}\n onTimeSelected={timeSelected}\n timeIntervalInMinutes={timeIntervalInMinutes}\n />\n <FocusRedirect onRedirect={handleRedirect} />\n </ZStack>\n </Popper>\n </>\n );\n }\n);\n"],"names":["DatePickerInput","React","value","onChange","onError","min","max","disabled","width","maxWidth","minWidth","showTime","timeIntervalInMinutes","hierarchy","disabledDates","selectDateMessage","countryCode","renderActions","onTimeSelected","props","ref","anchorElement","setAnchorElement","useState","isOpen","pickerRef","useRef","isException","useCallback","target","formatter","useMemo","formatOptions","formattedDate","openPicker","e","closePicker","useLayoutEffect","processKeyInput","event","handleRedirect","picker","dateSelected","date","timeSelected","hour","minutes","seconds","jsxs","Fragment","jsx","Button","clsx","styles","Popper","ZStack","DatePicker","FocusRedirect"],"mappings":"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"}
|
package/dist/inputs/index.d.ts
CHANGED
|
@@ -39,7 +39,8 @@ export * from './suggestions/suggestion_list.js';
|
|
|
39
39
|
export * from './switch/switch.js';
|
|
40
40
|
export * from './textarea/textarea.js';
|
|
41
41
|
export * from './unit_input/unit_input.js';
|
|
42
|
-
export * from './
|
|
42
|
+
export * from './control_set/control_set.js';
|
|
43
|
+
export * from './control/control.js';
|
|
43
44
|
export { SelectGroup, type SelectGroupProps, } from '../inputs/select_group/select_group.js';
|
|
44
45
|
export { SingleSelectGroup, type SingleSelectGroupProps, } from '../inputs/select_group/single_select_group.js';
|
|
45
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAEhD,cAAc,sCAAsC,CAAC;AAErD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,qDAAqD,CAAC;AACpE,cAAc,4CAA4C,CAAC;AAE3D,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAEhD,cAAc,sCAAsC,CAAC;AAErD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,qDAAqD,CAAC;AACpE,cAAc,4CAA4C,CAAC;AAE3D,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,+CAA+C,CAAC"}
|
package/dist/inputs/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Checkbox as
|
|
1
|
+
import { Checkbox as e } from "./checkbox/checkbox.js";
|
|
2
2
|
import { ColorInput as p } from "./color_input/color_input.js";
|
|
3
3
|
import { ColorPicker as x } from "./color_input/color_picker.js";
|
|
4
4
|
import { ComboBox as f } from "./combo_box/combo_box.js";
|
|
5
5
|
import { DatePicker as n } from "./date_picker/date_picker.js";
|
|
6
|
-
import { DatePickerDay as
|
|
6
|
+
import { DatePickerDay as l } from "./date_picker/date_picker_day.js";
|
|
7
7
|
import { DatePickerBody as s } from "./date_picker/date_picker_body.js";
|
|
8
8
|
import { DatePickerDate as k } from "./date_picker/date_picker_date.js";
|
|
9
9
|
import { DatePickerInput as P } from "./date_picker/date_picker_input.js";
|
|
10
10
|
import { DatePickerHeader as D } from "./date_picker/date_picker_header.js";
|
|
11
|
-
import { DatePickerPresenter as
|
|
11
|
+
import { DatePickerPresenter as g } from "./date_picker/date_picker_presenter.js";
|
|
12
12
|
import { Input as b } from "./input/input.js";
|
|
13
13
|
import { AlphaCharacter as A } from "./mask_input/alpha_character.js";
|
|
14
14
|
import { AlphaNumericCharacter as B } from "./mask_input/alpha_numeric_character.js";
|
|
15
|
-
import { Character as
|
|
15
|
+
import { Character as O } from "./mask_input/character.js";
|
|
16
16
|
import { ConstantCharacter as V } from "./mask_input/constant_character.js";
|
|
17
|
-
import { KeyCaptureInput as
|
|
18
|
-
import { LanguageCharacter as
|
|
17
|
+
import { KeyCaptureInput as G } from "./mask_input/key_capture_input.js";
|
|
18
|
+
import { LanguageCharacter as v } from "./mask_input/language_character.js";
|
|
19
19
|
import { Mask as K } from "./mask_input/mask.js";
|
|
20
20
|
import { MaskInput as U } from "./mask_input/mask_input.js";
|
|
21
21
|
import { MaskPresenter as q } from "./mask_input/mask_presenter.js";
|
|
@@ -25,41 +25,44 @@ import { MultiComboBox as W } from "./multi_combo_box/multi_combo_box.js";
|
|
|
25
25
|
import { Multiselect as Y } from "./multiselect/multiselect.js";
|
|
26
26
|
import { MultiselectInlineValues as _ } from "./multiselect/multiselect_inline_values.js";
|
|
27
27
|
import { MultiselectValues as rr } from "./multiselect/multiselect_values.js";
|
|
28
|
-
import { makeAvailableOptions as
|
|
28
|
+
import { makeAvailableOptions as er, makeValuesAsOptions as tr } from "./options/utils.js";
|
|
29
29
|
import { Option as mr } from "./options/option.js";
|
|
30
30
|
import { countriesPhoneInformation as ar, defaultCountries as fr } from "./phone_number_input/countries_phone_information.js";
|
|
31
31
|
import { PhoneNumberInput as nr } from "./phone_number_input/phone_number_input.js";
|
|
32
|
-
import { Radio as
|
|
32
|
+
import { Radio as lr } from "./radio/radio.js";
|
|
33
33
|
import { Select as sr } from "./select/select.js";
|
|
34
34
|
import { Slider as kr } from "./slider/slider.js";
|
|
35
35
|
import { SuggestionItem as Pr } from "./suggestions/suggestion_item.js";
|
|
36
36
|
import { SuggestionList as Dr } from "./suggestions/suggestion_list.js";
|
|
37
|
-
import { Switch as
|
|
37
|
+
import { Switch as gr } from "./switch/switch.js";
|
|
38
38
|
import { Textarea as br } from "./textarea/textarea.js";
|
|
39
39
|
import { UnitInput as Ar } from "./unit_input/unit_input.js";
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
40
|
+
import { ControlSet as Br } from "./control_set/control_set.js";
|
|
41
|
+
import { Control as Or, ControlRow as Rr } from "./control/control.js";
|
|
42
|
+
import { SelectGroup as wr } from "./select_group/select_group.js";
|
|
43
|
+
import { SingleSelectGroup as Lr } from "./select_group/single_select_group.js";
|
|
43
44
|
export {
|
|
44
45
|
A as AlphaCharacter,
|
|
45
46
|
B as AlphaNumericCharacter,
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
O as Character,
|
|
48
|
+
e as Checkbox,
|
|
48
49
|
p as ColorInput,
|
|
49
50
|
x as ColorPicker,
|
|
50
51
|
f as ComboBox,
|
|
51
52
|
V as ConstantCharacter,
|
|
53
|
+
Or as Control,
|
|
54
|
+
Rr as ControlRow,
|
|
55
|
+
Br as ControlSet,
|
|
52
56
|
n as DatePicker,
|
|
53
57
|
s as DatePickerBody,
|
|
54
58
|
k as DatePickerDate,
|
|
55
|
-
|
|
59
|
+
l as DatePickerDay,
|
|
56
60
|
D as DatePickerHeader,
|
|
57
61
|
P as DatePickerInput,
|
|
58
|
-
|
|
62
|
+
g as DatePickerPresenter,
|
|
59
63
|
b as Input,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
w as LanguageCharacter,
|
|
64
|
+
G as KeyCaptureInput,
|
|
65
|
+
v as LanguageCharacter,
|
|
63
66
|
K as Mask,
|
|
64
67
|
U as MaskInput,
|
|
65
68
|
q as MaskPresenter,
|
|
@@ -70,20 +73,20 @@ export {
|
|
|
70
73
|
E as NumericCharacter,
|
|
71
74
|
mr as Option,
|
|
72
75
|
nr as PhoneNumberInput,
|
|
73
|
-
|
|
76
|
+
lr as Radio,
|
|
74
77
|
J as RegexCharacter,
|
|
75
78
|
sr as Select,
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
wr as SelectGroup,
|
|
80
|
+
Lr as SingleSelectGroup,
|
|
78
81
|
kr as Slider,
|
|
79
82
|
Pr as SuggestionItem,
|
|
80
83
|
Dr as SuggestionList,
|
|
81
|
-
|
|
84
|
+
gr as Switch,
|
|
82
85
|
br as Textarea,
|
|
83
86
|
Ar as UnitInput,
|
|
84
87
|
ar as countriesPhoneInformation,
|
|
85
88
|
fr as defaultCountries,
|
|
86
|
-
|
|
89
|
+
er as makeAvailableOptions,
|
|
87
90
|
tr as makeValuesAsOptions
|
|
88
91
|
};
|
|
89
92
|
//# sourceMappingURL=index.js.map
|
package/dist/inputs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as c } from "clsx";
|
|
3
|
-
import
|
|
4
|
-
import '../../input.css';const
|
|
5
|
-
return /* @__PURE__ */
|
|
3
|
+
import f from "react";
|
|
4
|
+
import '../../input.css';const o = "_input_a16553f", m = { input: o }, y = f.forwardRef(function({ type: n = "text", style: i, className: s, width: r, height: l, onChange: a, ...t }, u) {
|
|
5
|
+
return /* @__PURE__ */ d(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
|
-
className: c(m.input, s, "tcn-input", "tcn-
|
|
8
|
+
className: c(m.input, s, "tcn-input", "tcn-entry"),
|
|
9
9
|
type: n,
|
|
10
|
-
ref:
|
|
10
|
+
ref: u,
|
|
11
11
|
"data-is-disabled": t.disabled || !1,
|
|
12
12
|
"aria-disabled": t.disabled || !1,
|
|
13
13
|
onChange: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../../src/inputs/input/input.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { InputHTMLAttributes } from 'react';\nimport styles from './input.module.css';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n type?: React.HTMLInputTypeAttribute;\n width?: string;\n height?: string;\n value?: string;\n disabled?: boolean;\n min?: string;\n max?: string;\n placeholder?: string;\n onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Input = React.forwardRef(function Input(\n { type = 'text', style, className, width, height, onChange, ...props }: InputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n return (\n <input\n className={clsx(styles.input, className, 'tcn-input', 'tcn-
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../src/inputs/input/input.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { InputHTMLAttributes } from 'react';\nimport styles from './input.module.css';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n type?: React.HTMLInputTypeAttribute;\n width?: string;\n height?: string;\n value?: string;\n disabled?: boolean;\n min?: string;\n max?: string;\n placeholder?: string;\n onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Input = React.forwardRef(function Input(\n { type = 'text', style, className, width, height, onChange, ...props }: InputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n return (\n <input\n className={clsx(styles.input, className, 'tcn-input', 'tcn-entry')}\n type={type}\n ref={ref}\n data-is-disabled={props.disabled || false}\n aria-disabled={props.disabled || false}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n style={{ width, height, ...style }}\n />\n );\n});\n"],"names":["Input","React","type","style","className","width","height","onChange","props","ref","jsx","clsx","styles"],"mappings":";;;8CAkBaA,IAAQC,EAAM,WAAW,SACpC,EAAE,MAAAC,IAAO,QAAQ,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAC/DC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,OAAOR,GAAW,aAAa,WAAW;AAAA,MACjE,MAAAF;AAAA,MACA,KAAAO;AAAA,MACA,oBAAkBD,EAAM,YAAY;AAAA,MACpC,iBAAeA,EAAM,YAAY;AAAA,MACjC,UAAU,CAAA,MAAK;AACb,QAAAD,KAAYA,EAAS,EAAE,cAAc,OAAO,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGC;AAAA,MACJ,OAAO,EAAE,OAAAH,GAAO,QAAAC,GAAQ,GAAGH,EAAA;AAAA,IAAM;AAAA,EAAA;AAGvC,CAAC;"}
|