@tcn/ui 0.8.0 → 0.9.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/dist/{Color-6BZIO3FS-CWWwv-fq.js → Color-6BZIO3FS-C9xkPWgz.js} +2 -2
- package/dist/{Color-6BZIO3FS-CWWwv-fq.js.map → Color-6BZIO3FS-C9xkPWgz.js.map} +1 -1
- package/dist/{WithTooltip-65CFNBJE-DvcUZizH.js → WithTooltip-65CFNBJE-DEnh547F.js} +2 -2
- package/dist/{WithTooltip-65CFNBJE-DvcUZizH.js.map → WithTooltip-65CFNBJE-DEnh547F.js.map} +1 -1
- package/dist/actions/__docs__/components/showcase.js +1 -1
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +8 -6
- package/dist/actions/index.js.map +1 -1
- package/dist/body.css +1 -0
- package/dist/feedback/progress/progress_bar.js +13 -13
- package/dist/form/field/common/field_description.js +7 -8
- package/dist/form/field/common/field_description.js.map +1 -1
- package/dist/form/field/common/field_error.js +6 -6
- package/dist/form/field/common/field_label.js +7 -8
- package/dist/form/field/common/field_label.js.map +1 -1
- package/dist/form/field_set/field_set.js +7 -7
- package/dist/formatter-EIJCOSYU-DWmgEY3b.js +6 -0
- package/dist/{formatter-EIJCOSYU-D6nmx63h.js.map → formatter-EIJCOSYU-DWmgEY3b.js.map} +1 -1
- package/dist/inputs/color_input/color_input.js +10 -9
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_date.js +6 -6
- package/dist/inputs/date_picker/date_picker_day.js +6 -6
- package/dist/inputs/date_picker/date_picker_header.js +7 -6
- package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +3 -2
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_time_selector.js +8 -7
- package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +6 -5
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +8 -7
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_inline_values.js +8 -7
- package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +3 -2
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +44 -43
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/select/select.js +3 -2
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +9 -8
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/layouts/body/body.d.ts +6 -0
- package/dist/layouts/body/body.d.ts.map +1 -0
- package/dist/layouts/body/body.js +21 -0
- package/dist/layouts/body/body.js.map +1 -0
- package/dist/layouts/index.d.ts +7 -0
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +42 -22
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/rail/main/main.d.ts +6 -0
- package/dist/layouts/rail/main/main.d.ts.map +1 -0
- package/dist/layouts/rail/main/main.js +21 -0
- package/dist/layouts/rail/main/main.js.map +1 -0
- package/dist/layouts/rail/rail.d.ts +9 -0
- package/dist/layouts/rail/rail.d.ts.map +1 -0
- package/dist/layouts/rail/rail.js +55 -0
- package/dist/layouts/rail/rail.js.map +1 -0
- package/dist/layouts/rail/side/side.d.ts +6 -0
- package/dist/layouts/rail/side/side.d.ts.map +1 -0
- package/dist/layouts/rail/side/side.js +21 -0
- package/dist/layouts/rail/side/side.js.map +1 -0
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts +9 -0
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -0
- package/dist/layouts/rail/utility_strip/utility_strip.js +32 -0
- package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -0
- package/dist/layouts/responsive/breakpoint.d.ts +11 -0
- package/dist/layouts/responsive/breakpoint.d.ts.map +1 -0
- package/dist/layouts/responsive/breakpoint.js +15 -0
- package/dist/layouts/responsive/breakpoint.js.map +1 -0
- package/dist/layouts/responsive/responsive.d.ts +7 -0
- package/dist/layouts/responsive/responsive.d.ts.map +1 -0
- package/dist/layouts/responsive/responsive.js +11 -0
- package/dist/layouts/responsive/responsive.js.map +1 -0
- package/dist/layouts/responsive/responsive_container.d.ts +7 -0
- package/dist/layouts/responsive/responsive_container.d.ts.map +1 -0
- package/dist/layouts/responsive/responsive_container.js +30 -0
- package/dist/layouts/responsive/responsive_container.js.map +1 -0
- package/dist/layouts/responsive/responsive_viewport.d.ts +7 -0
- package/dist/layouts/responsive/responsive_viewport.d.ts.map +1 -0
- package/dist/layouts/responsive/responsive_viewport.js +12 -0
- package/dist/layouts/responsive/responsive_viewport.js.map +1 -0
- package/dist/layouts/scaffold/scaffold.js +31 -31
- package/dist/layouts/scaffold/scaffold.js.map +1 -1
- package/dist/layouts/table/table.d.ts +27 -0
- package/dist/layouts/table/table.d.ts.map +1 -0
- package/dist/layouts/table/table.js +70 -0
- package/dist/layouts/table/table.js.map +1 -0
- package/dist/main.css +1 -0
- package/dist/rail.css +1 -0
- package/dist/scaffold.css +1 -1
- package/dist/{showcase-DK557szS.js → showcase-y9D3_Y8T.js} +3413 -3396
- package/dist/showcase-y9D3_Y8T.js.map +1 -0
- package/dist/side.css +1 -0
- package/dist/stacks/box/box.d.ts +2 -2
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/story_components/style_box.d.ts +1 -1
- package/dist/stacks/story_components/style_box.d.ts.map +1 -1
- package/dist/surfaces/alert/alert.js +3 -2
- package/dist/surfaces/alert/alert.js.map +1 -1
- package/dist/surfaces/confirm/confirm.js +5 -5
- package/dist/surfaces/pop_confirm/pop_confirm.js +14 -2
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/{syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js → syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js} +2 -2
- package/dist/{syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js.map → syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js.map} +1 -1
- package/dist/table.css +1 -0
- package/dist/table.module-BtSxOntS.js +5 -0
- package/dist/table.module-BtSxOntS.js.map +1 -0
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +174 -43
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/typography/body_text/body_text.d.ts +2 -1
- package/dist/typography/body_text/body_text.d.ts.map +1 -1
- package/dist/typography/body_text/body_text.js +24 -23
- package/dist/typography/body_text/body_text.js.map +1 -1
- package/dist/typography/callout/callout.d.ts +2 -1
- package/dist/typography/callout/callout.d.ts.map +1 -1
- package/dist/typography/callout/callout.js +28 -27
- package/dist/typography/callout/callout.js.map +1 -1
- package/dist/typography/caption/caption.d.ts +2 -1
- package/dist/typography/caption/caption.d.ts.map +1 -1
- package/dist/typography/caption/caption.js +18 -17
- package/dist/typography/caption/caption.js.map +1 -1
- package/dist/typography/footnote/footnote.d.ts +2 -1
- package/dist/typography/footnote/footnote.d.ts.map +1 -1
- package/dist/typography/footnote/footnote.js +25 -24
- package/dist/typography/footnote/footnote.js.map +1 -1
- package/dist/typography/headline/headline.d.ts +2 -1
- package/dist/typography/headline/headline.d.ts.map +1 -1
- package/dist/typography/headline/headline.js +36 -33
- package/dist/typography/headline/headline.js.map +1 -1
- package/dist/typography/subheadline/subheadline.d.ts +2 -1
- package/dist/typography/subheadline/subheadline.d.ts.map +1 -1
- package/dist/typography/subheadline/subheadline.js +35 -32
- package/dist/typography/subheadline/subheadline.js.map +1 -1
- package/dist/utility_strip.css +1 -0
- package/dist/utils/dnd/context.d.ts.map +1 -1
- package/dist/utils/dnd/context.js +9 -7
- package/dist/utils/dnd/context.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 +29 -15
- package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
- package/dist/utils/dnd/types.d.ts +3 -4
- package/dist/utils/dnd/types.d.ts.map +1 -1
- package/dist/utils/hooks/use_media_query.d.ts +5 -8
- package/dist/utils/hooks/use_media_query.d.ts.map +1 -1
- package/dist/utils/hooks/use_media_query.js +10 -11
- package/dist/utils/hooks/use_media_query.js.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +19 -21
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/index.ts +1 -0
- package/src/layouts/__stories__/composed.stories.tsx +113 -0
- package/src/layouts/__stories__/composed_stories.module.css +142 -0
- package/src/layouts/__stories__/utils.tsx +174 -0
- package/src/layouts/body/body.module.css +11 -0
- package/src/layouts/body/body.tsx +23 -0
- package/src/layouts/index.ts +12 -0
- package/src/layouts/rail/__stories__/rail.stories.tsx +64 -0
- package/src/layouts/rail/__stories__/rail_stories.module.css +25 -0
- package/src/layouts/rail/main/main.module.css +7 -0
- package/src/layouts/rail/main/main.tsx +26 -0
- package/src/layouts/rail/rail.module.css +10 -0
- package/src/layouts/rail/rail.tsx +62 -0
- package/src/layouts/rail/side/side.module.css +8 -0
- package/src/layouts/rail/side/side.tsx +25 -0
- package/src/layouts/rail/utility_strip/utility_strip.module.css +6 -0
- package/src/layouts/rail/utility_strip/utility_strip.tsx +40 -0
- package/src/layouts/responsive/breakpoint.tsx +29 -0
- package/src/layouts/responsive/responsive.stories.tsx +37 -0
- package/src/layouts/responsive/responsive.tsx +18 -0
- package/src/layouts/responsive/responsive_container.tsx +51 -0
- package/src/layouts/responsive/responsive_viewport.tsx +17 -0
- package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +53 -0
- package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +31 -0
- package/src/layouts/scaffold/scaffold.module.css +4 -0
- package/src/layouts/table/__stories__/mock_data.ts +420 -0
- package/src/layouts/table/__stories__/table.stories.tsx +326 -0
- package/src/layouts/table/__stories__/table_stories.module.css +30 -0
- package/src/layouts/table/table.module.css +37 -0
- package/src/layouts/table/table.tsx +132 -0
- package/src/stacks/box/box.tsx +1 -1
- package/src/surfaces/modal/__stories__/modal.stories.tsx +5 -5
- package/src/surfaces/panel/__stories__/panel.stories.tsx +114 -1
- package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +4 -2
- package/src/themes/themes/ergo/ergo_theme.css +173 -42
- package/src/typography/body_text/body_text.tsx +21 -17
- package/src/typography/callout/callout.tsx +20 -16
- package/src/typography/caption/caption.tsx +20 -16
- package/src/typography/footnote/footnote.tsx +20 -16
- package/src/typography/headline/headline.tsx +60 -54
- package/src/typography/subheadline/subheadline.tsx +60 -54
- package/src/utils/dnd/__stories__/draggable.stories.tsx +34 -0
- package/src/utils/dnd/context.ts +1 -0
- package/src/utils/dnd/hooks/use_drag_container.ts +18 -1
- package/src/utils/dnd/types.ts +4 -1
- package/src/utils/hooks/use_media_query.ts +16 -27
- package/src/utils/index.ts +1 -3
- package/dist/body_text.module-h4XQE2pC.js +0 -5
- package/dist/body_text.module-h4XQE2pC.js.map +0 -1
- package/dist/callout.module-D8ECmxpO.js +0 -5
- package/dist/callout.module-D8ECmxpO.js.map +0 -1
- package/dist/caption.module-DDq0H4xZ.js +0 -5
- package/dist/caption.module-DDq0H4xZ.js.map +0 -1
- package/dist/footnote.module-DEyFuqOr.js +0 -5
- package/dist/footnote.module-DEyFuqOr.js.map +0 -1
- package/dist/formatter-EIJCOSYU-D6nmx63h.js +0 -6
- package/dist/headline.module-BiwHBtGf.js +0 -5
- package/dist/headline.module-BiwHBtGf.js.map +0 -1
- package/dist/showcase-DK557szS.js.map +0 -1
- package/dist/subheadline.module-C-v7zMkQ.js +0 -5
- package/dist/subheadline.module-C-v7zMkQ.js.map +0 -1
- package/dist/utils/responsive/responsive_renderer.d.ts +0 -21
- package/dist/utils/responsive/responsive_renderer.d.ts.map +0 -1
- package/dist/utils/responsive/responsive_renderer.js +0 -12
- package/dist/utils/responsive/responsive_renderer.js.map +0 -1
- package/src/utils/responsive/responsive_renderer.stories.tsx +0 -77
- package/src/utils/responsive/responsive_renderer.tsx +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { i as f, j as h } from "../../../showcase-
|
|
2
|
+
import { i as f, j as h } from "../../../showcase-y9D3_Y8T.js";
|
|
3
3
|
import "../../../stacks/box/box.js";
|
|
4
4
|
import "../../../stacks/h_collapsible_box.js";
|
|
5
5
|
import "../../../stacks/h_stack.js";
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { SlimButton } from './button/slim_button/slim_button.js';
|
|
|
4
4
|
export { Button, type ButtonProps } from './button/button/button.js';
|
|
5
5
|
export { SelectGroup, type SelectGroupProps, } from './button/select_group/select_group.js';
|
|
6
6
|
export { SingleSelectGroup, type SingleSelectGroupProps, } from './button/select_group/single_select_group.js';
|
|
7
|
+
export { Toggle, type ToggleProps } from './toggle/toggle.js';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,8CAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/actions/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { BaseButton as
|
|
1
|
+
import { BaseButton as t } from "./button/base_button/base_button.js";
|
|
2
2
|
import { ButtonGroup as p } from "./button/button_group/button_group.js";
|
|
3
|
-
import { SlimButton as
|
|
3
|
+
import { SlimButton as f } from "./button/slim_button/slim_button.js";
|
|
4
4
|
import { Button as x } from "./button/button/button.js";
|
|
5
|
-
import { SelectGroup as
|
|
5
|
+
import { SelectGroup as n } from "./button/select_group/select_group.js";
|
|
6
6
|
import { SingleSelectGroup as S } from "./button/select_group/single_select_group.js";
|
|
7
|
+
import { Toggle as G } from "./toggle/toggle.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
t as BaseButton,
|
|
9
10
|
x as Button,
|
|
10
11
|
p as ButtonGroup,
|
|
11
|
-
|
|
12
|
+
n as SelectGroup,
|
|
12
13
|
S as SingleSelectGroup,
|
|
13
|
-
|
|
14
|
+
f as SlimButton,
|
|
15
|
+
G as Toggle
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/body.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer tcn-system{._body_42a1eac{min-height:0;flex-grow:1;width:100%;height:100%}:where(._tcn-main_5114d87){height:auto}}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
3
|
import { BodyText as t } from "../../typography/body_text/body_text.js";
|
|
4
|
-
import
|
|
5
|
-
import "../../
|
|
6
|
-
import "../../
|
|
7
|
-
import "../../
|
|
8
|
-
import "../../
|
|
9
|
-
import "../../subheadline.module-C-v7zMkQ.js";
|
|
4
|
+
import "../../typography/callout/callout.js";
|
|
5
|
+
import "../../typography/caption/caption.js";
|
|
6
|
+
import "../../typography/footnote/footnote.js";
|
|
7
|
+
import "../../typography/headline/headline.js";
|
|
8
|
+
import "../../typography/subheadline/subheadline.js";
|
|
10
9
|
import "../../typography/title/title.js";
|
|
11
|
-
import { HStack as
|
|
10
|
+
import { HStack as l } from "../../stacks/h_stack.js";
|
|
12
11
|
import { Spacer as a } from "../../stacks/spacer.js";
|
|
13
|
-
import { VStack as
|
|
14
|
-
import { ZStack as
|
|
12
|
+
import { VStack as d } from "../../stacks/v_stack.js";
|
|
13
|
+
import { ZStack as b } from "../../stacks/z_stack.js";
|
|
14
|
+
import f from "clsx";
|
|
15
15
|
import '../../progress_bar.css';const h = "_progress-bar-container_014b4d9", _ = "_progress-bar-background_9176cc0", x = "_progress-bar_057c33d", k = "_progress-bar-fill_00854f0", u = "_moveStripes_d219e85", s = { "progress-bar-container": h, "progress-bar-background": _, "progress-bar": x, "progress-bar-fill": k, moveStripes: u }, T = m.forwardRef(function({ message: i, value: p, ...c }, n) {
|
|
16
16
|
const o = `${(p * 100).toFixed(0)}%`, g = { "--progress-percentage": o };
|
|
17
17
|
return /* @__PURE__ */ e(
|
|
18
|
-
|
|
18
|
+
d,
|
|
19
19
|
{
|
|
20
20
|
ref: n,
|
|
21
|
-
className:
|
|
21
|
+
className: f(s["progress-bar-container"], "tcn-progress-bar"),
|
|
22
22
|
...c,
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */ e(
|
|
24
|
+
/* @__PURE__ */ e(l, { height: "auto", vAlign: "end", children: [
|
|
25
25
|
/* @__PURE__ */ r(t, { children: i }),
|
|
26
26
|
/* @__PURE__ */ r(a, {}),
|
|
27
27
|
/* @__PURE__ */ r(a, { width: "8px" }),
|
|
28
28
|
/* @__PURE__ */ r(t, { size: "sm", style: { flexShrink: 0 }, children: o })
|
|
29
29
|
] }),
|
|
30
|
-
/* @__PURE__ */ e(
|
|
30
|
+
/* @__PURE__ */ e(b, { height: "8px", hAlign: "start", children: [
|
|
31
31
|
/* @__PURE__ */ r("div", { className: s["progress-bar-background"] }),
|
|
32
32
|
/* @__PURE__ */ r(
|
|
33
33
|
"div",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText as i } from "../../../typography/body_text/body_text.js";
|
|
3
|
-
import "
|
|
4
|
-
import "../../../
|
|
5
|
-
import "../../../
|
|
6
|
-
import "../../../
|
|
7
|
-
import "../../../
|
|
8
|
-
import "../../../subheadline.module-C-v7zMkQ.js";
|
|
3
|
+
import "../../../typography/callout/callout.js";
|
|
4
|
+
import "../../../typography/caption/caption.js";
|
|
5
|
+
import "../../../typography/footnote/footnote.js";
|
|
6
|
+
import "../../../typography/headline/headline.js";
|
|
7
|
+
import "../../../typography/subheadline/subheadline.js";
|
|
9
8
|
import "../../../typography/title/title.js";
|
|
10
|
-
const
|
|
9
|
+
const c = ({ children: r, id: t }) => r ? typeof r == "string" ? /* @__PURE__ */ o(
|
|
11
10
|
i,
|
|
12
11
|
{
|
|
13
12
|
breakWords: !0,
|
|
@@ -20,6 +19,6 @@ const x = ({ children: r, id: t }) => r ? typeof r == "string" ? /* @__PURE__ */
|
|
|
20
19
|
}
|
|
21
20
|
) : r : null;
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
c as FieldDescription
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=field_description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field_description.js","sources":["../../../../src/form/field/common/field_description.tsx"],"sourcesContent":["import React from 'react';\nimport { BodyText } from '../../../typography/index.js';\n\nexport interface FieldDescriptionOwnProps {\n children?: React.ReactNode | string;\n id?: string;\n}\n\nexport const FieldDescription = ({ children, id }: FieldDescriptionOwnProps) => {\n if (!children) return null;\n if (typeof children === 'string') {\n return (\n <BodyText\n breakWords\n hierarchy=\"secondary\"\n emphasis=\"normal\"\n size=\"sm\"\n className=\"tcn-field-row-description-text\"\n id={id}\n >\n {children}\n </BodyText>\n );\n }\n return children;\n};\n"],"names":["FieldDescription","children","id","jsx","BodyText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field_description.js","sources":["../../../../src/form/field/common/field_description.tsx"],"sourcesContent":["import React from 'react';\nimport { BodyText } from '../../../typography/index.js';\n\nexport interface FieldDescriptionOwnProps {\n children?: React.ReactNode | string;\n id?: string;\n}\n\nexport const FieldDescription = ({ children, id }: FieldDescriptionOwnProps) => {\n if (!children) return null;\n if (typeof children === 'string') {\n return (\n <BodyText\n breakWords\n hierarchy=\"secondary\"\n emphasis=\"normal\"\n size=\"sm\"\n className=\"tcn-field-row-description-text\"\n id={id}\n >\n {children}\n </BodyText>\n );\n }\n return children;\n};\n"],"names":["FieldDescription","children","id","jsx","BodyText"],"mappings":";;;;;;;;AAQO,MAAMA,IAAmB,CAAC,EAAE,UAAAC,GAAU,IAAAC,QACtCD,IACD,OAAOA,KAAa,WAEpB,gBAAAE;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,YAAU;AAAA,IACV,WAAU;AAAA,IACV,UAAS;AAAA,IACT,MAAK;AAAA,IACL,WAAU;AAAA,IACV,IAAAF;AAAA,IAEC,UAAAD;AAAA,EAAA;AAAA,IAIAA,IAfe;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText as p } from "../../../typography/body_text/body_text.js";
|
|
3
|
-
import "
|
|
4
|
-
import "../../../
|
|
5
|
-
import "../../../
|
|
6
|
-
import "../../../
|
|
7
|
-
import "../../../
|
|
8
|
-
import "../../../subheadline.module-C-v7zMkQ.js";
|
|
3
|
+
import "../../../typography/callout/callout.js";
|
|
4
|
+
import "../../../typography/caption/caption.js";
|
|
5
|
+
import "../../../typography/footnote/footnote.js";
|
|
6
|
+
import "../../../typography/headline/headline.js";
|
|
7
|
+
import "../../../typography/subheadline/subheadline.js";
|
|
9
8
|
import "../../../typography/title/title.js";
|
|
10
9
|
import { theme as i } from "../../../themes/theme_variables.js";
|
|
11
10
|
import "react";
|
|
@@ -16,6 +15,7 @@ import "../../../stacks/spacer.js";
|
|
|
16
15
|
import "../../../stacks/v_collapsible_box.js";
|
|
17
16
|
import "../../../stacks/v_stack.js";
|
|
18
17
|
import "../../../stacks/z_stack.js";
|
|
18
|
+
import "clsx";
|
|
19
19
|
import '../../../themes/stylesheets/reset.css';/* empty css */
|
|
20
20
|
import "../../../theme_provider.module-ChZQ5Xsk.js";
|
|
21
21
|
import "../../../themes/stylesheets/reset.js";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsxs as o, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText as t } from "../../../typography/body_text/body_text.js";
|
|
3
|
-
import "
|
|
4
|
-
import "../../../
|
|
5
|
-
import "../../../
|
|
6
|
-
import "../../../
|
|
7
|
-
import "../../../
|
|
8
|
-
import "../../../subheadline.module-C-v7zMkQ.js";
|
|
3
|
+
import "../../../typography/callout/callout.js";
|
|
4
|
+
import "../../../typography/caption/caption.js";
|
|
5
|
+
import "../../../typography/footnote/footnote.js";
|
|
6
|
+
import "../../../typography/headline/headline.js";
|
|
7
|
+
import "../../../typography/subheadline/subheadline.js";
|
|
9
8
|
import "../../../typography/title/title.js";
|
|
10
|
-
const
|
|
9
|
+
const u = ({ children: r, id: e, required: i }) => r ? typeof r == "string" ? /* @__PURE__ */ o(
|
|
11
10
|
t,
|
|
12
11
|
{
|
|
13
12
|
breakWords: !0,
|
|
@@ -33,6 +32,6 @@ const x = ({ children: r, id: e, required: i }) => r ? typeof r == "string" ? /*
|
|
|
33
32
|
}
|
|
34
33
|
) : r : null;
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
u as FieldLabel
|
|
37
36
|
};
|
|
38
37
|
//# sourceMappingURL=field_label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field_label.js","sources":["../../../../src/form/field/common/field_label.tsx"],"sourcesContent":["import React from 'react';\nimport { BodyText } from '../../../typography/index.js';\n\nexport interface FieldLabelOwnProps {\n children?: React.ReactNode | string;\n id?: string;\n required?: boolean;\n}\n\nexport const FieldLabel = ({ children, id, required }: FieldLabelOwnProps) => {\n if (!children) return null;\n if (typeof children === 'string') {\n return (\n <BodyText\n breakWords\n color=\"inherit\"\n size=\"lg\"\n id={id}\n style={{\n justifyContent: 'center',\n alignItems: 'center',\n display: 'flex',\n }}\n >\n {children}\n {required && (\n <BodyText\n size=\"lg\"\n style={{ color: 'red', paddingInline: 'calc(var(--scalar, 1)*4px)' }}\n >\n *\n </BodyText>\n )}\n </BodyText>\n );\n }\n return children;\n};\n"],"names":["FieldLabel","children","id","required","jsxs","BodyText","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field_label.js","sources":["../../../../src/form/field/common/field_label.tsx"],"sourcesContent":["import React from 'react';\nimport { BodyText } from '../../../typography/index.js';\n\nexport interface FieldLabelOwnProps {\n children?: React.ReactNode | string;\n id?: string;\n required?: boolean;\n}\n\nexport const FieldLabel = ({ children, id, required }: FieldLabelOwnProps) => {\n if (!children) return null;\n if (typeof children === 'string') {\n return (\n <BodyText\n breakWords\n color=\"inherit\"\n size=\"lg\"\n id={id}\n style={{\n justifyContent: 'center',\n alignItems: 'center',\n display: 'flex',\n }}\n >\n {children}\n {required && (\n <BodyText\n size=\"lg\"\n style={{ color: 'red', paddingInline: 'calc(var(--scalar, 1)*4px)' }}\n >\n *\n </BodyText>\n )}\n </BodyText>\n );\n }\n return children;\n};\n"],"names":["FieldLabel","children","id","required","jsxs","BodyText","jsx"],"mappings":";;;;;;;;AASO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,IAAAC,GAAI,UAAAC,QACpCF,IACD,OAAOA,KAAa,WAEpB,gBAAAG;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,YAAU;AAAA,IACV,OAAM;AAAA,IACN,MAAK;AAAA,IACL,IAAAH;AAAA,IACA,OAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,SAAS;AAAA,IAAA;AAAA,IAGV,UAAA;AAAA,MAAAD;AAAA,MACAE,KACC,gBAAAG;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAO,EAAE,OAAO,OAAO,eAAe,6BAAA;AAAA,UACvC,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAAA;AAAA,IAKDJ,IA1Be;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import "../../
|
|
4
|
-
import "../../
|
|
5
|
-
import "../../
|
|
6
|
-
import "../../
|
|
7
|
-
import "../../
|
|
8
|
-
import "../../subheadline.module-C-v7zMkQ.js";
|
|
2
|
+
import "../../typography/body_text/body_text.js";
|
|
3
|
+
import "../../typography/callout/callout.js";
|
|
4
|
+
import "../../typography/caption/caption.js";
|
|
5
|
+
import "../../typography/footnote/footnote.js";
|
|
6
|
+
import "../../typography/headline/headline.js";
|
|
7
|
+
import "../../typography/subheadline/subheadline.js";
|
|
9
8
|
import { Title as h } from "../../typography/title/title.js";
|
|
10
9
|
import { HStack as b } from "../../stacks/h_stack.js";
|
|
11
10
|
import { Spacer as c } from "../../stacks/spacer.js";
|
|
12
11
|
import { VStack as f } from "../../stacks/v_stack.js";
|
|
12
|
+
import { clsx as i } from "clsx";
|
|
13
13
|
import y, { useMemo as S } from "react";
|
|
14
14
|
import '../../field_set.css';const u = "_field-set_8e981d9", x = "_field-set-body_4cd3139", m = { "field-set": u, "field-set-body": x };
|
|
15
15
|
let _ = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter-EIJCOSYU-
|
|
1
|
+
{"version":3,"file":"formatter-EIJCOSYU-DWmgEY3b.js","sources":["../../../node_modules/.pnpm/storybook@10.2.8_@testing-library+dom@10.4.1_prettier@2.8.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/storybook/dist/_browser-chunks/formatter-EIJCOSYU.js"],"sourcesContent":["import {\n require_memoizerific\n} from \"./chunk-ZCFV7BZB.js\";\nimport {\n dedent\n} from \"./chunk-3LY4VQVK.js\";\nimport {\n __toESM\n} from \"./chunk-A242L54C.js\";\n\n// src/components/components/syntaxhighlighter/formatter.ts\nvar import_memoizerific = __toESM(require_memoizerific(), 1);\nvar formatter = (0, import_memoizerific.default)(2)(async (type, source) => type === !1 ? source : dedent(source));\nexport {\n formatter\n};\n"],"names":["import_memoizerific","__toESM","require_memoizerific","formatter","type","source","dedent"],"mappings":";AAWA,IAAIA,IAAsBC,EAAQC,EAAoB,GAAI,CAAC,GACvDC,QAAgBH,EAAoB,SAAS,CAAC,EAAE,OAAOI,GAAMC,MAAWD,MAAS,KAAKC,IAASC,EAAOD,CAAM,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as C, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { Box as m } from "../../stacks/box/box.js";
|
|
3
3
|
import { HStack as h } from "../../stacks/h_stack.js";
|
|
4
|
-
import { Spacer as
|
|
4
|
+
import { Spacer as p } from "../../stacks/spacer.js";
|
|
5
5
|
import { ZStack as I } from "../../stacks/z_stack.js";
|
|
6
6
|
import { clsx as f } from "clsx";
|
|
7
7
|
import { useState as A, useRef as N, useLayoutEffect as P } from "react";
|
|
@@ -11,15 +11,16 @@ import "../../actions/button/slim_button/slim_button.js";
|
|
|
11
11
|
import { Button as _ } from "../../actions/button/button/button.js";
|
|
12
12
|
import "../../actions/button/select_group/select_group.js";
|
|
13
13
|
import "../../actions/button/select_group/single_select_group.js";
|
|
14
|
+
import "../../actions/toggle/toggle.js";
|
|
14
15
|
import { ColorPicker as B } from "./color_picker.js";
|
|
15
16
|
import { Input as F } from "../input/input.js";
|
|
16
17
|
import { Popper as j } from "../../overlay/popper/legacy/popper.js";
|
|
17
18
|
import '../../color_input.css';const z = "_checker-board_2cc94a9", K = "_color-input-select_abe3066", x = { "checker-board": z, "color-input-select": K };
|
|
18
|
-
function
|
|
19
|
+
function or({
|
|
19
20
|
value: c = "#000",
|
|
20
21
|
onChange: i,
|
|
21
22
|
onError: O,
|
|
22
|
-
disabled:
|
|
23
|
+
disabled: s,
|
|
23
24
|
width: g = "100%",
|
|
24
25
|
maxWidth: b,
|
|
25
26
|
minWidth: k,
|
|
@@ -60,7 +61,7 @@ function rr({
|
|
|
60
61
|
/* @__PURE__ */ r(I, { width: "flex", children: /* @__PURE__ */ r(
|
|
61
62
|
F,
|
|
62
63
|
{
|
|
63
|
-
disabled:
|
|
64
|
+
disabled: s,
|
|
64
65
|
value: c,
|
|
65
66
|
style: {
|
|
66
67
|
borderEndEndRadius: 0,
|
|
@@ -75,7 +76,7 @@ function rr({
|
|
|
75
76
|
/* @__PURE__ */ n(
|
|
76
77
|
_,
|
|
77
78
|
{
|
|
78
|
-
disabled:
|
|
79
|
+
disabled: s,
|
|
79
80
|
hierarchy: E,
|
|
80
81
|
onClick: w,
|
|
81
82
|
width: "70px",
|
|
@@ -92,7 +93,7 @@ function rr({
|
|
|
92
93
|
},
|
|
93
94
|
children: [
|
|
94
95
|
/* @__PURE__ */ n(h, { height: "14px", gap: "4px", hAlign: "start", children: [
|
|
95
|
-
/* @__PURE__ */ r(
|
|
96
|
+
/* @__PURE__ */ r(p, { width: "4px" }),
|
|
96
97
|
/* @__PURE__ */ r(
|
|
97
98
|
m,
|
|
98
99
|
{
|
|
@@ -109,9 +110,9 @@ function rr({
|
|
|
109
110
|
)
|
|
110
111
|
}
|
|
111
112
|
),
|
|
112
|
-
/* @__PURE__ */ r(
|
|
113
|
+
/* @__PURE__ */ r(p, {})
|
|
113
114
|
] }),
|
|
114
|
-
/* @__PURE__ */ r(
|
|
115
|
+
/* @__PURE__ */ r(p, { width: "4px" })
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
)
|
|
@@ -140,6 +141,6 @@ function rr({
|
|
|
140
141
|
] });
|
|
141
142
|
}
|
|
142
143
|
export {
|
|
143
|
-
|
|
144
|
+
or as ColorInput
|
|
144
145
|
};
|
|
145
146
|
//# sourceMappingURL=color_input.js.map
|
|
@@ -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 { ZStack } from '../../stacks/z_stack.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';\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 <HStack\n height=\"auto\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n className=\"tcn-color-input-wrapper\"\n {...props}\n >\n <ZStack width=\"flex\">\n <Input\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 </ZStack>\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 </HStack>\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","HStack","jsx","ZStack","Input","Button","clsx","styles","Spacer","Box","Popper","ColorPicker"],"mappings":"
|
|
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 { ZStack } from '../../stacks/z_stack.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';\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 <HStack\n height=\"auto\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n className=\"tcn-color-input-wrapper\"\n {...props}\n >\n <ZStack width=\"flex\">\n <Input\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 </ZStack>\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 </HStack>\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","HStack","jsx","ZStack","Input","Button","clsx","styles","Spacer","Box","Popper","ColorPicker"],"mappings":";;;;;;;;;;;;;;;;;;AA2BO,SAASA,GAAW;AAAA,EACzB,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAoB;AAClB,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAmC,IAAI,GAC3EC,IAASH,KAAiB,MAC1BI,IAAYC,EAA8B,IAAI;AAEpD,WAASC,EAAWC,GAAwC;AAC1D,IAAAN,EAAiBM,EAAE,aAAa;AAAA,EAClC;AAEA,WAASC,IAAc;AACrB,IAAAP,EAAiB,IAAI;AAAA,EACvB;AAEA,EAAAQ,EAAgB,MAAM;A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} from "react/jsx-runtime";
|
|
2
2
|
import { useSignalValue as u } from "@tcn/state";
|
|
3
3
|
import { BodyText as b } from "../../typography/body_text/body_text.js";
|
|
4
|
-
import
|
|
5
|
-
import "../../
|
|
6
|
-
import "../../
|
|
7
|
-
import "../../
|
|
8
|
-
import "../../
|
|
9
|
-
import "../../subheadline.module-C-v7zMkQ.js";
|
|
4
|
+
import "../../typography/callout/callout.js";
|
|
5
|
+
import "../../typography/caption/caption.js";
|
|
6
|
+
import "../../typography/footnote/footnote.js";
|
|
7
|
+
import "../../typography/headline/headline.js";
|
|
8
|
+
import "../../typography/subheadline/subheadline.js";
|
|
10
9
|
import "../../typography/title/title.js";
|
|
11
10
|
import { ZStack as M } from "../../stacks/z_stack.js";
|
|
11
|
+
import { clsx as f } from "clsx";
|
|
12
12
|
import '../../date_picker_date.css';const B = "_date-picker-date_38d540e", _ = "_date-picker-today_af9d1ab", k = { "date-picker-date": B, "date-picker-today": _ };
|
|
13
13
|
function C({ presenter: i, date: t }) {
|
|
14
14
|
const {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import "../../
|
|
4
|
-
import "../../
|
|
5
|
-
import "../../
|
|
6
|
-
import "../../footnote.module-DEyFuqOr.js";
|
|
2
|
+
import "../../typography/body_text/body_text.js";
|
|
3
|
+
import "../../typography/callout/callout.js";
|
|
4
|
+
import "../../typography/caption/caption.js";
|
|
5
|
+
import "../../typography/footnote/footnote.js";
|
|
7
6
|
import { Headline as c } from "../../typography/headline/headline.js";
|
|
8
|
-
import "../../subheadline.
|
|
7
|
+
import "../../typography/subheadline/subheadline.js";
|
|
9
8
|
import "../../typography/title/title.js";
|
|
10
9
|
import { ZStack as p } from "../../stacks/z_stack.js";
|
|
11
10
|
import { useMemo as s } from "react";
|
|
11
|
+
import r from "clsx";
|
|
12
12
|
import '../../date_picker_day.css';const d = "_date-picker-day_2945845", i = { "date-picker-day": d };
|
|
13
13
|
function u({ dayOfTheWeek: o, countryCode: t }) {
|
|
14
14
|
const e = /* @__PURE__ */ new Date();
|
|
@@ -9,7 +9,8 @@ import { SlimButton as m } from "../../actions/button/slim_button/slim_button.js
|
|
|
9
9
|
import "../../actions/button/button/button.js";
|
|
10
10
|
import "../../actions/button/select_group/select_group.js";
|
|
11
11
|
import "../../actions/button/select_group/single_select_group.js";
|
|
12
|
-
import
|
|
12
|
+
import "../../actions/toggle/toggle.js";
|
|
13
|
+
import { getMonthsOfYear as p } from "../../utils/calendar/get_months_of_year.js";
|
|
13
14
|
import { Select as k } from "../select/select.js";
|
|
14
15
|
import { ChevronLeftIcon as S } from "@tcn/icons/chevron_left_icon.js";
|
|
15
16
|
import { ChevronRightIcon as x } from "@tcn/icons/chevron_right_icon.js";
|
|
@@ -18,15 +19,15 @@ import { clsx as O } from "clsx";
|
|
|
18
19
|
import { DatePickerYearInput as B } from "./date_picker_year_input.js";
|
|
19
20
|
import '../../date_picker_header.css';const N = "_date-picker-header_696681a", R = { "date-picker-header": N };
|
|
20
21
|
function V(t) {
|
|
21
|
-
const o =
|
|
22
|
+
const o = p(t, "short"), e = p(t, "long");
|
|
22
23
|
return o.map((n, r) => /* @__PURE__ */ i(y, { value: String(r), label: n, keywords: [n], children: e[r] }, r));
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function K({ presenter: t, countryCode: o }) {
|
|
25
26
|
const e = g(t.stateBroadcast), n = M(null);
|
|
26
27
|
function r(a) {
|
|
27
28
|
t.setVisibleMonth(Number(a));
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function u() {
|
|
30
31
|
return t.setVisibleMonth(t.stateBroadcast.get().visibleMonth - 1);
|
|
31
32
|
}
|
|
32
33
|
function d() {
|
|
@@ -48,7 +49,7 @@ function J({ presenter: t, countryCode: o }) {
|
|
|
48
49
|
{
|
|
49
50
|
disabled: !e.canNavigateToPreviousMonth,
|
|
50
51
|
hierarchy: "tertiary",
|
|
51
|
-
onClick:
|
|
52
|
+
onClick: u,
|
|
52
53
|
children: /* @__PURE__ */ i(S, { flipOnRtl: !0, size: "md" })
|
|
53
54
|
}
|
|
54
55
|
),
|
|
@@ -82,6 +83,6 @@ function J({ presenter: t, countryCode: o }) {
|
|
|
82
83
|
);
|
|
83
84
|
}
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
K as DatePickerHeader
|
|
86
87
|
};
|
|
87
88
|
//# sourceMappingURL=date_picker_header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_picker_header.js","sources":["../../../src/inputs/date_picker/date_picker_header.tsx"],"sourcesContent":["import { useSignalValue, useSignalValueEffect } from '@tcn/state';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport React, { useMemo, useRef } from 'react';\nimport { SlimButton } from '../../actions/index.js';\nimport { getMonthsOfYear } from '../../utils/calendar/get_months_of_year.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { Select } from '../select/select.js';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { Option, OptionProps } from '../options/option.js';\nimport { DatePickerState } from './date_picker_presenter.js';\nimport styles from './date_picker_header.module.css';\nimport { clsx } from 'clsx';\nimport { DatePickerYearInput } from './date_picker_year_input.js';\n\nfunction makeMonthsOptions(countryCode: string): React.ReactElement<OptionProps>[] {\n const shortMonths = getMonthsOfYear(countryCode, 'short');\n const longMonths = getMonthsOfYear(countryCode, 'long');\n\n return shortMonths.map((m, index) => {\n return (\n <Option key={index} value={String(index)} label={m} keywords={[m]}>\n {longMonths[index]}\n </Option>\n );\n });\n}\n\nexport interface DatePickerHeaderProps {\n presenter: DatePickerPresenter;\n countryCode: string;\n}\n\nexport function DatePickerHeader({ presenter, countryCode }: DatePickerHeaderProps) {\n const state = useSignalValue(presenter.stateBroadcast);\n const yearInputRef = useRef<HTMLInputElement>(null);\n\n function selectMonth(value: string) {\n presenter.setVisibleMonth(Number(value));\n }\n\n function previous() {\n return presenter.setVisibleMonth(presenter.stateBroadcast.get().visibleMonth - 1);\n }\n\n function next() {\n return presenter.setVisibleMonth(presenter.stateBroadcast.get().visibleMonth + 1);\n }\n\n const monthsOptions = useMemo(() => {\n return makeMonthsOptions(countryCode);\n }, [countryCode]);\n\n useSignalValueEffect((state: DatePickerState) => {\n const input = yearInputRef.current;\n if (input && input.value !== String(state.visibleYear)) {\n input.value = String(state.visibleYear);\n }\n }, presenter.stateBroadcast);\n\n return (\n <HStack\n className={clsx(styles['date-picker-header'], 'tcn-date-picker-header')}\n minWidth=\"35px\"\n width=\"100%\"\n >\n <SlimButton\n disabled={!state.canNavigateToPreviousMonth}\n hierarchy=\"tertiary\"\n onClick={previous}\n >\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </SlimButton>\n <Spacer />\n <HStack hAlign=\"center\" gap=\"4px\" width=\"auto\">\n <Select\n hierarchy=\"tertiary\"\n width=\"auto\"\n maxWidth=\"150px\"\n value={String(state.visibleMonth)}\n onChange={selectMonth}\n >\n {monthsOptions}\n </Select>\n <DatePickerYearInput presenter={presenter} />\n </HStack>\n <Spacer />\n <SlimButton\n disabled={!state.canNavigateToNextMonth}\n hierarchy=\"tertiary\"\n onClick={next}\n >\n <ChevronRightIcon flipOnRtl size=\"md\" />\n </SlimButton>\n </HStack>\n );\n}\n"],"names":["makeMonthsOptions","countryCode","shortMonths","getMonthsOfYear","longMonths","m","index","jsx","Option","DatePickerHeader","presenter","state","useSignalValue","yearInputRef","useRef","selectMonth","value","previous","next","monthsOptions","useMemo","useSignalValueEffect","input","jsxs","HStack","clsx","styles","SlimButton","ChevronLeftIcon","Spacer","Select","DatePickerYearInput","ChevronRightIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"date_picker_header.js","sources":["../../../src/inputs/date_picker/date_picker_header.tsx"],"sourcesContent":["import { useSignalValue, useSignalValueEffect } from '@tcn/state';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport React, { useMemo, useRef } from 'react';\nimport { SlimButton } from '../../actions/index.js';\nimport { getMonthsOfYear } from '../../utils/calendar/get_months_of_year.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { Select } from '../select/select.js';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { Option, OptionProps } from '../options/option.js';\nimport { DatePickerState } from './date_picker_presenter.js';\nimport styles from './date_picker_header.module.css';\nimport { clsx } from 'clsx';\nimport { DatePickerYearInput } from './date_picker_year_input.js';\n\nfunction makeMonthsOptions(countryCode: string): React.ReactElement<OptionProps>[] {\n const shortMonths = getMonthsOfYear(countryCode, 'short');\n const longMonths = getMonthsOfYear(countryCode, 'long');\n\n return shortMonths.map((m, index) => {\n return (\n <Option key={index} value={String(index)} label={m} keywords={[m]}>\n {longMonths[index]}\n </Option>\n );\n });\n}\n\nexport interface DatePickerHeaderProps {\n presenter: DatePickerPresenter;\n countryCode: string;\n}\n\nexport function DatePickerHeader({ presenter, countryCode }: DatePickerHeaderProps) {\n const state = useSignalValue(presenter.stateBroadcast);\n const yearInputRef = useRef<HTMLInputElement>(null);\n\n function selectMonth(value: string) {\n presenter.setVisibleMonth(Number(value));\n }\n\n function previous() {\n return presenter.setVisibleMonth(presenter.stateBroadcast.get().visibleMonth - 1);\n }\n\n function next() {\n return presenter.setVisibleMonth(presenter.stateBroadcast.get().visibleMonth + 1);\n }\n\n const monthsOptions = useMemo(() => {\n return makeMonthsOptions(countryCode);\n }, [countryCode]);\n\n useSignalValueEffect((state: DatePickerState) => {\n const input = yearInputRef.current;\n if (input && input.value !== String(state.visibleYear)) {\n input.value = String(state.visibleYear);\n }\n }, presenter.stateBroadcast);\n\n return (\n <HStack\n className={clsx(styles['date-picker-header'], 'tcn-date-picker-header')}\n minWidth=\"35px\"\n width=\"100%\"\n >\n <SlimButton\n disabled={!state.canNavigateToPreviousMonth}\n hierarchy=\"tertiary\"\n onClick={previous}\n >\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </SlimButton>\n <Spacer />\n <HStack hAlign=\"center\" gap=\"4px\" width=\"auto\">\n <Select\n hierarchy=\"tertiary\"\n width=\"auto\"\n maxWidth=\"150px\"\n value={String(state.visibleMonth)}\n onChange={selectMonth}\n >\n {monthsOptions}\n </Select>\n <DatePickerYearInput presenter={presenter} />\n </HStack>\n <Spacer />\n <SlimButton\n disabled={!state.canNavigateToNextMonth}\n hierarchy=\"tertiary\"\n onClick={next}\n >\n <ChevronRightIcon flipOnRtl size=\"md\" />\n </SlimButton>\n </HStack>\n );\n}\n"],"names":["makeMonthsOptions","countryCode","shortMonths","getMonthsOfYear","longMonths","m","index","jsx","Option","DatePickerHeader","presenter","state","useSignalValue","yearInputRef","useRef","selectMonth","value","previous","next","monthsOptions","useMemo","useSignalValueEffect","input","jsxs","HStack","clsx","styles","SlimButton","ChevronLeftIcon","Spacer","Select","DatePickerYearInput","ChevronRightIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,SAASA,EAAkBC,GAAwD;AACjF,QAAMC,IAAcC,EAAgBF,GAAa,OAAO,GAClDG,IAAaD,EAAgBF,GAAa,MAAM;AAEtD,SAAOC,EAAY,IAAI,CAACG,GAAGC,MAEvB,gBAAAC,EAACC,GAAA,EAAmB,OAAO,OAAOF,CAAK,GAAG,OAAOD,GAAG,UAAU,CAACA,CAAC,GAC7D,UAAAD,EAAWE,CAAK,KADNA,CAEb,CAEH;AACH;AAOO,SAASG,EAAiB,EAAE,WAAAC,GAAW,aAAAT,KAAsC;AAClF,QAAMU,IAAQC,EAAeF,EAAU,cAAc,GAC/CG,IAAeC,EAAyB,IAAI;AAElD,WAASC,EAAYC,GAAe;AAClC,IAAAN,EAAU,gBAAgB,OAAOM,CAAK,CAAC;AAAA,EACzC;AAEA,WAASC,IAAW;AAClB,WAAOP,EAAU,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AAChB,EAAM;AAAA,YACjB,WAAU;AAAA,YACV,SAASO;AAAA,YAET,UAAA,gBAAAX,EAACyB,GAAA,EAAiB,WAAS,IAAC,MAAK,KAAA,CAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACxC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -9,6 +9,7 @@ import "../../actions/button/slim_button/slim_button.js";
|
|
|
9
9
|
import { Button as J } from "../../actions/button/button/button.js";
|
|
10
10
|
import "../../actions/button/select_group/select_group.js";
|
|
11
11
|
import "../../actions/button/select_group/single_select_group.js";
|
|
12
|
+
import "../../actions/toggle/toggle.js";
|
|
12
13
|
import { DatePicker as Q } from "./date_picker.js";
|
|
13
14
|
import "../../utils/click_away_listener.js";
|
|
14
15
|
import { FocusRedirect as T } from "../../utils/focus_redirect.js";
|
|
@@ -16,7 +17,7 @@ import "../../utils/scroll_away_listener.js";
|
|
|
16
17
|
import "../../utils/hooks/use_resize_observer.js";
|
|
17
18
|
import "../../utils/dnd/context.js";
|
|
18
19
|
import "../../draggable.module-BgelQsuJ.js";
|
|
19
|
-
import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_708f951", f = { button: U, popover: X },
|
|
20
|
+
import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_708f951", f = { button: U, popover: X }, yt = B.forwardRef(
|
|
20
21
|
({
|
|
21
22
|
value: c = /* @__PURE__ */ new Date(),
|
|
22
23
|
onChange: d,
|
|
@@ -136,6 +137,6 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
136
137
|
}
|
|
137
138
|
);
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
yt as DatePickerInput
|
|
140
141
|
};
|
|
141
142
|
//# sourceMappingURL=date_picker_input.js.map
|
|
@@ -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-select')}\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":"
|
|
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-select')}\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":";;;;;;;;;;;;;;;;;;;oFAiCaA,KAAkBC,EAAM;AAAA,EACnC,CACE;AAAA,IACE,OAAAC,wBAAY,KAAA;AAAA,IACZ,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC,IAAM,oBAAI,KAAK,YAAY;AAAA,IAC3B,KAAAC,IAAM,oBAAI,KAAK,YAAY;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;AAAA,oBACA,UAAAK;AAAA,oBACA,SAAAP;AAAA,oBACA,UAAAG;AAAA,oBACA,eAAAO;AAAA,oBACA,aAAAE;AAAA,oBACA,eAAAC;AAAA,oBACA,gBAAgB2B;AAAA,oBAChB,uBAAAhC;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEF,gBAAAsC,EAACO,GAAA,EAAc,YAAYjB,EAAA,CAAgB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;"}
|
|
@@ -8,16 +8,17 @@ import "../../actions/button/slim_button/slim_button.js";
|
|
|
8
8
|
import { Button as O } from "../../actions/button/button/button.js";
|
|
9
9
|
import "../../actions/button/select_group/select_group.js";
|
|
10
10
|
import "../../actions/button/select_group/single_select_group.js";
|
|
11
|
+
import "../../actions/toggle/toggle.js";
|
|
11
12
|
import { BodyText as $ } from "../../typography/body_text/body_text.js";
|
|
12
|
-
import "../../callout.
|
|
13
|
-
import "../../caption.
|
|
14
|
-
import "../../footnote.
|
|
15
|
-
import "../../headline.
|
|
16
|
-
import "../../subheadline.
|
|
13
|
+
import "../../typography/callout/callout.js";
|
|
14
|
+
import "../../typography/caption/caption.js";
|
|
15
|
+
import "../../typography/footnote/footnote.js";
|
|
16
|
+
import "../../typography/headline/headline.js";
|
|
17
|
+
import "../../typography/subheadline/subheadline.js";
|
|
17
18
|
import "../../typography/title/title.js";
|
|
18
19
|
import { ClockIcon as j } from "@tcn/icons/clock_icon.js";
|
|
19
20
|
import '../../date_picker_time_selector.css';const z = "_time-box_f3145be", P = "_time-box-title_6cc801b", Z = "_time-box-title-container_22add52", v = "_selected-time_33e3aa3", m = { "time-box": z, "time-box-title": P, "time-box-title-container": Z, "selected-time": v };
|
|
20
|
-
function
|
|
21
|
+
function nt({
|
|
21
22
|
origin: e,
|
|
22
23
|
intervalInMinutes: f,
|
|
23
24
|
max: b,
|
|
@@ -85,6 +86,6 @@ function it({
|
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
88
|
export {
|
|
88
|
-
|
|
89
|
+
nt as DatePickerTimeSelector
|
|
89
90
|
};
|
|
90
91
|
//# sourceMappingURL=date_picker_time_selector.js.map
|