@tcn/ui 0.9.0 → 0.11.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/bar.css +1 -0
- package/dist/body.css +1 -1
- package/dist/body.module-BbFZ7KNP.js +5 -0
- package/dist/body.module-BbFZ7KNP.js.map +1 -0
- package/dist/divider.css +1 -1
- package/dist/footer.css +1 -1
- package/dist/form/field/h_field/h_field.d.ts.map +1 -1
- package/dist/form/field/h_field/h_field.js +33 -35
- package/dist/form/field/h_field/h_field.js.map +1 -1
- package/dist/form/field/v_field/v_field.d.ts.map +1 -1
- package/dist/form/field/v_field/v_field.js +34 -36
- package/dist/form/field/v_field/v_field.js.map +1 -1
- package/dist/frame.css +1 -1
- package/dist/inputs/color_input/color_input.d.ts.map +1 -1
- package/dist/inputs/color_input/color_input.js +47 -46
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.d.ts.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +61 -58
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/index.d.ts +1 -0
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/index.js +34 -31
- package/dist/inputs/index.js.map +1 -1
- package/dist/inputs/input/input.js +9 -9
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/input_group/input_group.d.ts +5 -0
- package/dist/inputs/input_group/input_group.d.ts.map +1 -0
- package/dist/inputs/input_group/input_group.js +20 -0
- package/dist/inputs/input_group/input_group.js.map +1 -0
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts +2 -2
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/countries_phone_information.js +5 -353
- package/dist/inputs/phone_number_input/countries_phone_information.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.d.ts +24 -0
- package/dist/inputs/phone_number_input/phone_number_context.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_context.js +23 -0
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts +19 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js +77 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input.d.ts +16 -14
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +104 -274
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts +6 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +95 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts +12 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.js +111 -0
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -0
- package/dist/inputs/select/select.d.ts.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.d.ts +4 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +120 -111
- package/dist/inputs/suggestions/suggestion_list.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.d.ts.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +39 -39
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/layouts/bar/bar.d.ts +5 -0
- package/dist/layouts/bar/bar.d.ts.map +1 -0
- package/dist/layouts/bar/bar.js +20 -0
- package/dist/layouts/bar/bar.js.map +1 -0
- package/dist/layouts/body/body.d.ts +2 -2
- package/dist/layouts/body/body.d.ts.map +1 -1
- package/dist/layouts/body/body.js +12 -12
- package/dist/layouts/body/body.js.map +1 -1
- package/dist/layouts/body/h_body.d.ts.map +1 -1
- package/dist/layouts/body/h_body.js +18 -12
- package/dist/layouts/body/h_body.js.map +1 -1
- package/dist/layouts/body/v_body.d.ts.map +1 -1
- package/dist/layouts/body/v_body.js +16 -10
- package/dist/layouts/body/v_body.js.map +1 -1
- package/dist/layouts/footer/footer.d.ts +2 -3
- package/dist/layouts/footer/footer.d.ts.map +1 -1
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/footer/footer.js.map +1 -1
- package/dist/layouts/header/header.d.ts +2 -2
- package/dist/layouts/header/header.d.ts.map +1 -1
- package/dist/layouts/header/header.js +13 -21
- package/dist/layouts/header/header.js.map +1 -1
- package/dist/layouts/index.d.ts +0 -1
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +17 -19
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/rail/rail.js +41 -41
- package/dist/layouts/rail/rail.js.map +1 -1
- package/dist/layouts/rail/side/side.d.ts.map +1 -1
- package/dist/layouts/rail/side/side.js +1 -1
- package/dist/layouts/rail/side/side.js.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
- package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
- package/dist/layouts/scaffold/scaffold.js +32 -32
- package/dist/layouts/scaffold/scaffold.js.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
- package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.js +17 -19
- package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts +8 -4
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +87 -23
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.d.ts.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +52 -50
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/panel.css +1 -0
- package/dist/phone_number_input.css +1 -1
- package/dist/rail.css +1 -1
- package/dist/scaffold.css +1 -1
- package/dist/side.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js +12 -10
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +4 -4
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js +26 -26
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -2
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +6 -5
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -2
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js +10 -9
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +2 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +32 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -2
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js +6 -5
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -2
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +6 -6
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -2
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js +6 -5
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/suggestion_list.css +1 -1
- package/dist/surfaces/index.d.ts +1 -2
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +18 -20
- package/dist/surfaces/index.js.map +1 -1
- package/dist/surfaces/panel/panel.d.ts +5 -0
- package/dist/surfaces/panel/panel.d.ts.map +1 -0
- package/dist/surfaces/panel/panel.js +19 -0
- package/dist/surfaces/panel/panel.js.map +1 -0
- package/dist/surfaces/pop_confirm/pop_confirm.js +2 -3
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -10
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/stylesheets/reset.css +1 -1
- package/dist/themes/stylesheets/reset.js +8 -1
- package/dist/themes/stylesheets/reset.js.map +1 -1
- package/dist/themes/theme.d.ts +2 -1
- package/dist/themes/theme.d.ts.map +1 -1
- package/dist/themes/theme.js +16 -9
- package/dist/themes/theme.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +210 -18
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/typography/body_text/body_text.d.ts.map +1 -1
- package/dist/typography/body_text/body_text.js +12 -10
- package/dist/typography/body_text/body_text.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 +22 -19
- package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
- package/package.json +4 -2
- package/src/form/field/h_field/h_field.tsx +0 -4
- package/src/form/field/v_field/v_field.stories.tsx +8 -0
- package/src/form/field/v_field/v_field.tsx +1 -4
- package/src/form/field_set/field_set.stories.tsx +2 -1
- package/src/inputs/__docs__/inputs.mdx +81 -0
- package/src/inputs/__docs__/inputs.stories.tsx +268 -0
- package/src/inputs/color_input/color_input.tsx +17 -17
- package/src/inputs/combo_box/combo_box.tsx +17 -13
- package/src/inputs/index.ts +2 -0
- package/src/inputs/input/input.tsx +1 -1
- package/src/inputs/input_group/input_group.tsx +26 -0
- package/src/inputs/phone_number_input/countries_phone_information.ts +6 -353
- package/src/inputs/phone_number_input/phone_number_context.tsx +32 -0
- package/src/inputs/phone_number_input/phone_number_country_select_adapter.tsx +126 -0
- package/src/inputs/phone_number_input/phone_number_input.module.css +5 -63
- package/src/inputs/phone_number_input/phone_number_input.stories.tsx +180 -150
- package/src/inputs/phone_number_input/phone_number_input.tsx +133 -400
- package/src/inputs/phone_number_input/phone_number_input_adapter.tsx +123 -0
- package/src/inputs/phone_number_input/sip_input.tsx +147 -0
- package/src/inputs/select/select.tsx +13 -14
- package/src/inputs/suggestions/suggestion_list.module.css +1 -0
- package/src/inputs/suggestions/suggestion_list.stories.tsx +12 -8
- package/src/inputs/suggestions/suggestion_list.tsx +24 -3
- package/src/inputs/textarea/textarea.tsx +1 -1
- package/src/inputs/unit_input/unit_input.tsx +17 -17
- package/src/layouts/__stories__/composed.stories.tsx +0 -55
- package/src/layouts/__stories__/rail.stories.tsx +78 -0
- package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
- package/src/layouts/__stories__/utils/content.tsx +27 -0
- package/src/layouts/__stories__/utils/layout_theme.css +88 -0
- package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
- package/src/layouts/__stories__/utils.tsx +6 -6
- package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
- package/src/layouts/bar/bar.tsx +23 -0
- package/src/layouts/body/body.module.css +9 -4
- package/src/layouts/body/body.tsx +7 -6
- package/src/layouts/body/h_body.module.css +1 -2
- package/src/layouts/body/h_body.tsx +9 -4
- package/src/layouts/body/v_body.tsx +9 -4
- package/src/layouts/divider/divider.module.css +1 -1
- package/src/layouts/footer/footer.module.css +0 -3
- package/src/layouts/footer/footer.tsx +5 -6
- package/src/layouts/header/header.tsx +6 -15
- package/src/layouts/index.ts +0 -1
- package/src/layouts/rail/rail.module.css +9 -5
- package/src/layouts/rail/rail.tsx +1 -1
- package/src/layouts/rail/side/side.module.css +0 -1
- package/src/layouts/rail/side/side.tsx +1 -2
- package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
- package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
- package/src/layouts/scaffold/scaffold.module.css +10 -7
- package/src/layouts/scaffold/scaffold.tsx +1 -1
- package/src/layouts/utility_bar/utility_bar.tsx +6 -9
- package/src/overlay/frame/frame.module.css +2 -4
- package/src/overlay/frame/frame.stories.tsx +13 -10
- package/src/overlay/frame/frame.tsx +124 -16
- package/src/overlay/popper/base/dismissal_decorator.tsx +1 -1
- package/src/overlay/popper/legacy/popper.tsx +5 -1
- package/src/stacks/box/bottom_resize_handle.tsx +12 -5
- package/src/stacks/box/box.tsx +18 -14
- package/src/stacks/box/end_resize_handle.tsx +11 -6
- package/src/stacks/box/left_resize_handle.tsx +9 -3
- package/src/stacks/box/resize_handlers.ts +27 -13
- package/src/stacks/box/right_resize_handle.tsx +9 -3
- package/src/stacks/box/start_resize_handle.tsx +9 -4
- package/src/stacks/box/top_resize_handle.tsx +10 -4
- package/src/stacks/collapsible_box.stories.tsx +11 -11
- package/src/stacks/h_collapsible_box.tsx +5 -5
- package/src/stacks/v_collapsible_box.tsx +4 -4
- package/src/surfaces/index.ts +1 -2
- package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
- package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
- package/src/surfaces/panel/panel.module.css +1 -6
- package/src/surfaces/panel/panel.tsx +22 -0
- package/src/surfaces/window/window.tsx +14 -4
- package/src/themes/stories/controls_fieldset.tsx +1 -1
- package/src/themes/stylesheets/reset.css +8 -1
- package/src/themes/theme.tsx +6 -2
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
- package/src/themes/themes/ergo/ergo_theme.css +210 -18
- package/src/typography/body_text/body_text.tsx +2 -0
- package/src/utils/dnd/__stories__/draggable.stories.tsx +14 -8
- package/src/utils/dnd/hooks/use_drag_container.ts +13 -3
- package/dist/h_body.css +0 -1
- package/dist/h_panel.css +0 -1
- package/dist/header.css +0 -1
- package/dist/layouts/rail/main/main.d.ts +0 -6
- package/dist/layouts/rail/main/main.d.ts.map +0 -1
- package/dist/layouts/rail/main/main.js +0 -21
- package/dist/layouts/rail/main/main.js.map +0 -1
- package/dist/main.css +0 -1
- package/dist/surfaces/panel/h_panel.d.ts +0 -9
- package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/h_panel.js +0 -60
- package/dist/surfaces/panel/h_panel.js.map +0 -1
- package/dist/surfaces/panel/v_panel.d.ts +0 -5
- package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/v_panel.js +0 -19
- package/dist/surfaces/panel/v_panel.js.map +0 -1
- package/dist/utility_bar.css +0 -1
- package/dist/v_body.css +0 -1
- package/src/inputs/phone_number_input/__tests__/utils.test.ts +0 -52
- package/src/layouts/header/header.module.css +0 -8
- package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
- package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
- package/src/layouts/rail/main/main.module.css +0 -7
- package/src/layouts/rail/main/main.tsx +0 -26
- package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
- package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
- package/src/surfaces/panel/h_panel.tsx +0 -65
- package/src/surfaces/panel/v_panel.tsx +0 -20
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Box } from '../../../stacks/index.js';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import type { BoxProps } from '../../../stacks/index.js';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
|
|
6
|
+
export interface SBLayoutContentProps extends BoxProps {}
|
|
7
|
+
|
|
8
|
+
export const SBLayoutContent: React.FC<PropsWithChildren<SBLayoutContentProps>> = ({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
minHeight = '200px',
|
|
12
|
+
minWidth = '200px',
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<Box
|
|
17
|
+
minHeight={minHeight}
|
|
18
|
+
minWidth={minWidth}
|
|
19
|
+
className={clsx('sb-layout-content', className)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
↔ {minWidth}
|
|
23
|
+
<br />↕ {minHeight}
|
|
24
|
+
{children}
|
|
25
|
+
</Box>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* A way to visualize layout components - since they are not themed until being used in a surface */
|
|
2
|
+
.sb-layout-theme {
|
|
3
|
+
/* Forest (5) - Greens & teals */
|
|
4
|
+
--pastel-forest-bg: #e8f5e9;
|
|
5
|
+
--pastel-forest-1: #a5d6a7;
|
|
6
|
+
--pastel-forest-2: #81c784;
|
|
7
|
+
--pastel-forest-3: #66bb6a;
|
|
8
|
+
--pastel-forest-4: #4caf50;
|
|
9
|
+
|
|
10
|
+
/* Sunset (5) - Warm peaches, corals & yellows */
|
|
11
|
+
--pastel-sunset-bg: #fff7e3;
|
|
12
|
+
--pastel-sunset-1: #f5c6a0;
|
|
13
|
+
--pastel-sunset-2: #eba985;
|
|
14
|
+
--pastel-sunset-3: #e08f6a;
|
|
15
|
+
--pastel-sunset-4: #d47550;
|
|
16
|
+
|
|
17
|
+
/* Berry (5) - Purples, lavenders & pinks */
|
|
18
|
+
--pastel-berry-bg: #f5eafa;
|
|
19
|
+
--pastel-berry-1: #e8d5f2;
|
|
20
|
+
--pastel-berry-2: #d4b8e8;
|
|
21
|
+
--pastel-berry-3: #c9a7e0;
|
|
22
|
+
--pastel-berry-4: #b78ed4;
|
|
23
|
+
|
|
24
|
+
--bg: var(--pastel-sunset-bg);
|
|
25
|
+
--bg-1: var(--pastel-sunset-1);
|
|
26
|
+
--bg-2: var(--pastel-sunset-2);
|
|
27
|
+
--bg-3: var(--pastel-sunset-3);
|
|
28
|
+
--bg-4: var(--pastel-sunset-4);
|
|
29
|
+
--bg-5: rgba(0, 0, 0, 0.25);
|
|
30
|
+
|
|
31
|
+
:where(.tcn-scaffold) {
|
|
32
|
+
background: var(--bg);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where(.tcn-bar) {
|
|
36
|
+
min-height: 32px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:where(.tcn-header) {
|
|
40
|
+
background: var(--bg-1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:where(.tcn-utility-bar) {
|
|
44
|
+
background: var(--bg-2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:where(.tcn-footer) {
|
|
48
|
+
background: var(--bg-3);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:where(.tcn-body) {
|
|
52
|
+
background: var(--bg-4);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.tcn-rail) {
|
|
56
|
+
background: var(--bg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where(.tcn-utility-strip) {
|
|
60
|
+
background: var(--bg-1);
|
|
61
|
+
min-width: 32px;
|
|
62
|
+
padding: 8px;
|
|
63
|
+
|
|
64
|
+
:where(.tcn-title) {
|
|
65
|
+
writing-mode: vertical-rl;
|
|
66
|
+
text-orientation: mixed;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:where(.tcn-side) {
|
|
71
|
+
background: var(--bg-2);
|
|
72
|
+
min-width: 32px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where(.tcn-main) {
|
|
76
|
+
background: var(--bg-4);
|
|
77
|
+
gap: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where(.sb-layout-content) {
|
|
81
|
+
background: var(--bg-5);
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
/* flex-grow: 1; */
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Box } from '../../../stacks/index.js';
|
|
2
|
+
|
|
3
|
+
import './layout_theme.css';
|
|
4
|
+
|
|
5
|
+
export const LayoutStoryDecorator = ({ children }: { children: React.ReactNode }) => {
|
|
6
|
+
return (
|
|
7
|
+
<Box className="sb-layout-theme" height="100vh" width="100vw" minHeight="400px">
|
|
8
|
+
{children}
|
|
9
|
+
</Box>
|
|
10
|
+
);
|
|
11
|
+
};
|
|
@@ -3,13 +3,13 @@ import clsx from 'clsx';
|
|
|
3
3
|
|
|
4
4
|
import { Scaffold, type ScaffoldProps } from '../scaffold/scaffold.js';
|
|
5
5
|
import { Header } from '../header/header.js';
|
|
6
|
-
import { Body } from '../body/body.js';
|
|
7
6
|
import { Footer } from '../footer/footer.js';
|
|
8
7
|
import { UtilityBar } from '../utility_bar/utility_bar.js';
|
|
9
8
|
|
|
10
9
|
import { Rail, type RailProps } from '../rail/rail.js';
|
|
11
10
|
import { Side } from '../rail/side/side.js';
|
|
12
|
-
import {
|
|
11
|
+
import { VBody } from '../body/v_body.js';
|
|
12
|
+
import { HBody } from '../body/h_body.js';
|
|
13
13
|
import { Box, Spacer } from '../../stacks/index.js';
|
|
14
14
|
import { UtilityStrip } from '../rail/utility_strip/utility_strip.js';
|
|
15
15
|
import { SearchIcon } from '@tcn/icons/search_icon.js';
|
|
@@ -101,10 +101,10 @@ export const SBNestedRail: React.FC<PropsWithChildren<SBNestedRailProps>> = ({
|
|
|
101
101
|
</UtilityStrip>
|
|
102
102
|
)}
|
|
103
103
|
{main && (
|
|
104
|
-
<
|
|
105
|
-
{mainLabel && <>
|
|
104
|
+
<HBody className={clsx(styles.main, styles.secondary)} width="200px">
|
|
105
|
+
{mainLabel && <>Body</>}
|
|
106
106
|
{children}
|
|
107
|
-
</
|
|
107
|
+
</HBody>
|
|
108
108
|
)}
|
|
109
109
|
{!main && children}
|
|
110
110
|
{side && (
|
|
@@ -163,7 +163,7 @@ export const SBNestedScaffold: React.FC<PropsWithChildren<SBNestedScaffoldProps>
|
|
|
163
163
|
</UtilityBar>
|
|
164
164
|
)}
|
|
165
165
|
{body && (
|
|
166
|
-
<
|
|
166
|
+
<VBody className={clsx(styles.body, styles.secondary)}>Body {children}</VBody>
|
|
167
167
|
)}
|
|
168
168
|
{!body && children}
|
|
169
169
|
{footer && (
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { HStack, type HStackProps } from '../../stacks/h_stack.js';
|
|
4
|
+
|
|
5
|
+
import styles from './bar.module.css';
|
|
6
|
+
|
|
7
|
+
export type BarProps = HStackProps;
|
|
8
|
+
|
|
9
|
+
export const Bar = React.forwardRef<HTMLElement, BarProps>(function Bar(
|
|
10
|
+
{ children, className, ...props }: BarProps,
|
|
11
|
+
ref
|
|
12
|
+
) {
|
|
13
|
+
return (
|
|
14
|
+
<HStack
|
|
15
|
+
ref={ref}
|
|
16
|
+
as="header"
|
|
17
|
+
className={clsx(className, styles['bar'], 'tcn-bar')}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</HStack>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
@layer tcn-system {
|
|
2
2
|
.body {
|
|
3
3
|
min-height: 0;
|
|
4
|
+
min-width: 0;
|
|
4
5
|
flex-grow: 1;
|
|
5
|
-
|
|
6
|
-
height: 100%;
|
|
6
|
+
flex-shrink: unset;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
.h-body {
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.v-body {
|
|
14
|
+
overflow-y: auto;
|
|
10
15
|
}
|
|
11
16
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { VStack, type VStackProps } from '../../stacks/v_stack.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import styles from './body.module.css';
|
|
4
|
+
import { Box, type BoxProps } from '../../stacks/box/box.js';
|
|
5
5
|
|
|
6
|
-
export interface BodyProps extends Omit<
|
|
6
|
+
export interface BodyProps extends Omit<BoxProps, 'as'> {}
|
|
7
7
|
|
|
8
|
+
// Under construction: although this component behaves correctly, a content/child component that manages scrolling is needed.
|
|
9
|
+
// For now HBody and VBody are recommended.
|
|
8
10
|
export const Body = React.forwardRef<HTMLElement, BodyProps>(function Body(
|
|
9
|
-
{ children, className,
|
|
11
|
+
{ children, className, ...props }: BodyProps,
|
|
10
12
|
ref
|
|
11
13
|
) {
|
|
12
14
|
return (
|
|
13
|
-
<
|
|
15
|
+
<Box
|
|
14
16
|
ref={ref}
|
|
15
17
|
as="div"
|
|
16
|
-
overflowY={overflowY}
|
|
17
18
|
className={clsx(styles['body'], className, 'tcn-body')}
|
|
18
19
|
{...props}
|
|
19
20
|
>
|
|
20
21
|
{children}
|
|
21
|
-
</
|
|
22
|
+
</Box>
|
|
22
23
|
);
|
|
23
24
|
});
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { HStack, type HStackProps } from '../../stacks/h_stack.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
|
-
import styles from './
|
|
4
|
+
import styles from './body.module.css';
|
|
5
5
|
|
|
6
6
|
export interface HBodyProps extends Omit<HStackProps, 'as'> {}
|
|
7
7
|
|
|
8
8
|
export const HBody = React.forwardRef<HTMLElement, HBodyProps>(function HBody(
|
|
9
|
-
{ children, className,
|
|
9
|
+
{ children, className, ...props }: HBodyProps,
|
|
10
10
|
ref
|
|
11
11
|
) {
|
|
12
12
|
return (
|
|
13
13
|
<HStack
|
|
14
14
|
ref={ref}
|
|
15
15
|
as="div"
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
className={clsx(
|
|
17
|
+
styles['body'],
|
|
18
|
+
styles['h-body'],
|
|
19
|
+
className,
|
|
20
|
+
'tcn-h-body',
|
|
21
|
+
'tcn-body'
|
|
22
|
+
)}
|
|
18
23
|
{...props}
|
|
19
24
|
>
|
|
20
25
|
{children}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { VStack, type VStackProps } from '../../stacks/v_stack.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
|
-
import styles from './
|
|
4
|
+
import styles from './body.module.css';
|
|
5
5
|
|
|
6
6
|
export interface VBodyProps extends Omit<VStackProps, 'as'> {}
|
|
7
7
|
|
|
8
8
|
export const VBody = React.forwardRef<HTMLElement, VBodyProps>(function VBody(
|
|
9
|
-
{ children, className,
|
|
9
|
+
{ children, className, ...props }: VBodyProps,
|
|
10
10
|
ref
|
|
11
11
|
) {
|
|
12
12
|
return (
|
|
13
13
|
<VStack
|
|
14
14
|
ref={ref}
|
|
15
15
|
as="div"
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
className={clsx(
|
|
17
|
+
styles['body'],
|
|
18
|
+
styles['v-body'],
|
|
19
|
+
className,
|
|
20
|
+
'tcn-body',
|
|
21
|
+
'tcn-v-body'
|
|
22
|
+
)}
|
|
18
23
|
{...props}
|
|
19
24
|
>
|
|
20
25
|
{children}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { HStack, type HStackProps } from '../../stacks/h_stack.js';
|
|
4
3
|
import type { Hierarchy, Size } from '../../utils/index.js';
|
|
5
|
-
import
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
import styles from './footer.module.css';
|
|
7
|
+
export interface FooterProps extends Omit<BarProps, 'as'> {
|
|
8
8
|
hierarchy?: Hierarchy;
|
|
9
9
|
size?: Size;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer(
|
|
@@ -15,7 +14,7 @@ export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer
|
|
|
15
14
|
ref
|
|
16
15
|
) {
|
|
17
16
|
return (
|
|
18
|
-
<
|
|
17
|
+
<Bar
|
|
19
18
|
ref={ref}
|
|
20
19
|
as="footer"
|
|
21
20
|
className={clsx(styles.footer, className, 'tcn-footer')}
|
|
@@ -24,6 +23,6 @@ export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer
|
|
|
24
23
|
{...props}
|
|
25
24
|
>
|
|
26
25
|
{children}
|
|
27
|
-
</
|
|
26
|
+
</Bar>
|
|
28
27
|
);
|
|
29
28
|
});
|
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { HStack, type HStackProps } from '../../stacks/h_stack.js';
|
|
4
3
|
import type { Hierarchy, Size } from '../../utils/index.js';
|
|
5
|
-
import
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
|
-
export interface HeaderProps extends Omit<
|
|
6
|
+
export interface HeaderProps extends Omit<BarProps, 'as'> {
|
|
8
7
|
hierarchy?: Hierarchy;
|
|
9
8
|
size?: Size;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export const Header = React.forwardRef<HTMLElement, HeaderProps>(function Header(
|
|
13
|
-
{
|
|
14
|
-
hierarchy = 'secondary',
|
|
15
|
-
height = 'auto',
|
|
16
|
-
children,
|
|
17
|
-
className,
|
|
18
|
-
size = 'md',
|
|
19
|
-
...props
|
|
20
|
-
}: HeaderProps,
|
|
12
|
+
{ hierarchy = 'secondary', size = 'md', children, className, ...props }: HeaderProps,
|
|
21
13
|
ref
|
|
22
14
|
) {
|
|
23
15
|
return (
|
|
24
|
-
<
|
|
16
|
+
<Bar
|
|
25
17
|
ref={ref}
|
|
26
18
|
as="header"
|
|
27
|
-
className={clsx(
|
|
19
|
+
className={clsx(className, 'tcn-header')}
|
|
28
20
|
data-hierarchy={hierarchy}
|
|
29
21
|
data-size={size}
|
|
30
|
-
height={height}
|
|
31
22
|
{...props}
|
|
32
23
|
>
|
|
33
24
|
{children}
|
|
34
|
-
</
|
|
25
|
+
</Bar>
|
|
35
26
|
);
|
|
36
27
|
});
|
package/src/layouts/index.ts
CHANGED
|
@@ -21,7 +21,6 @@ export { Breakpoint, type BreakpointProps } from './responsive/breakpoint.js';
|
|
|
21
21
|
export { TTable, THead, TBody, TFoot, TR, TH, TD } from './table/table.js';
|
|
22
22
|
|
|
23
23
|
export { Rail, type RailProps } from './rail/rail.js';
|
|
24
|
-
export { Main, type MainProps } from './rail/main/main.js';
|
|
25
24
|
export { Side, type SideProps } from './rail/side/side.js';
|
|
26
25
|
export {
|
|
27
26
|
UtilityStrip,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
@layer tcn-system {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
overflow: auto;
|
|
6
|
-
:where(.tcn-body) {
|
|
2
|
+
.rail {
|
|
3
|
+
:where(.rail-stack) {
|
|
4
|
+
width: 100%;
|
|
7
5
|
height: 100%;
|
|
6
|
+
overflow: auto;
|
|
7
|
+
> :global(.tcn-body) {
|
|
8
|
+
height: 100%;
|
|
9
|
+
width: auto;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
}
|
|
8
12
|
}
|
|
9
13
|
}
|
|
10
14
|
}
|
|
@@ -40,7 +40,7 @@ export const Rail = React.forwardRef<HTMLElement, RailProps>(function Rail(
|
|
|
40
40
|
maxHeight={maxHeight}
|
|
41
41
|
data-h-alignment={hAlign}
|
|
42
42
|
data-v-alignment={vAlign}
|
|
43
|
-
className={clsx(className, 'tcn-rail')}
|
|
43
|
+
className={clsx(className, styles['rail'], 'tcn-rail')}
|
|
44
44
|
{...props}
|
|
45
45
|
>
|
|
46
46
|
<HStack
|
|
@@ -4,7 +4,6 @@ import { VStack, type VStackProps } from '../../../stacks/v_stack.js';
|
|
|
4
4
|
|
|
5
5
|
import styles from './side.module.css';
|
|
6
6
|
|
|
7
|
-
// UtilityBar
|
|
8
7
|
export interface SideProps extends Omit<VStackProps, 'as'> {}
|
|
9
8
|
|
|
10
9
|
export const Side = React.forwardRef<HTMLElement, SideProps>(function UtilityStrip(
|
|
@@ -14,9 +13,9 @@ export const Side = React.forwardRef<HTMLElement, SideProps>(function UtilityStr
|
|
|
14
13
|
return (
|
|
15
14
|
<VStack
|
|
16
15
|
ref={ref}
|
|
16
|
+
width={width}
|
|
17
17
|
className={clsx(styles['side'], 'tcn-side', className)}
|
|
18
18
|
as="section"
|
|
19
|
-
width={width}
|
|
20
19
|
{...props}
|
|
21
20
|
>
|
|
22
21
|
{children}
|
|
@@ -5,7 +5,6 @@ import { VStack, type VStackProps } from '../../../stacks/v_stack.js';
|
|
|
5
5
|
|
|
6
6
|
import styles from './utility_strip.module.css';
|
|
7
7
|
|
|
8
|
-
// UtilityBar
|
|
9
8
|
export interface UtilityStripProps extends Omit<VStackProps, 'as'> {
|
|
10
9
|
hierarchy?: Hierarchy;
|
|
11
10
|
size?: Size;
|
|
@@ -18,6 +17,8 @@ export const UtilityStrip = React.forwardRef<HTMLElement, UtilityStripProps>(
|
|
|
18
17
|
className,
|
|
19
18
|
width = 'auto',
|
|
20
19
|
hierarchy = 'secondary',
|
|
20
|
+
vAlign = 'start',
|
|
21
|
+
hAlign = 'center',
|
|
21
22
|
size = 'md',
|
|
22
23
|
...props
|
|
23
24
|
}: UtilityStripProps,
|
|
@@ -27,6 +28,8 @@ export const UtilityStrip = React.forwardRef<HTMLElement, UtilityStripProps>(
|
|
|
27
28
|
<VStack
|
|
28
29
|
ref={ref}
|
|
29
30
|
as="header"
|
|
31
|
+
vAlign={vAlign}
|
|
32
|
+
hAlign={hAlign}
|
|
30
33
|
className={clsx(styles['utility-strip'], 'tcn-utility-strip', className)}
|
|
31
34
|
data-hierarchy={hierarchy}
|
|
32
35
|
data-size={size}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
@layer tcn-system {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
.scaffold {
|
|
3
|
+
:where(.scaffold-stack) {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
overflow: auto;
|
|
7
|
+
> :global(.tcn-body) {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: auto;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
}
|
|
@@ -38,7 +38,7 @@ export const Scaffold = React.forwardRef<HTMLElement, ScaffoldProps>(function Sc
|
|
|
38
38
|
maxHeight={maxHeight}
|
|
39
39
|
data-h-alignment={hAlign}
|
|
40
40
|
data-v-alignment={vAlign}
|
|
41
|
-
className={clsx(className, 'tcn-scaffold')}
|
|
41
|
+
className={clsx(className, styles['scaffold'], 'tcn-scaffold')}
|
|
42
42
|
{...props}
|
|
43
43
|
>
|
|
44
44
|
<VStack
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { HStack, type HStackProps } from '../../stacks/h_stack.js';
|
|
4
3
|
import type { Hierarchy, Size } from '../../utils/index.js';
|
|
5
|
-
import
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
6
|
// UtilityBar
|
|
8
|
-
export interface UtilityBarProps extends Omit<
|
|
7
|
+
export interface UtilityBarProps extends Omit<BarProps, 'as'> {
|
|
9
8
|
hierarchy?: Hierarchy;
|
|
10
9
|
size?: Size;
|
|
11
10
|
}
|
|
@@ -14,26 +13,24 @@ export const UtilityBar = React.forwardRef<HTMLElement, UtilityBarProps>(
|
|
|
14
13
|
function UtilityBar(
|
|
15
14
|
{
|
|
16
15
|
hierarchy = 'secondary',
|
|
17
|
-
|
|
16
|
+
size = 'md',
|
|
18
17
|
children,
|
|
19
18
|
className,
|
|
20
|
-
size = 'md',
|
|
21
19
|
...props
|
|
22
20
|
}: UtilityBarProps,
|
|
23
21
|
ref
|
|
24
22
|
) {
|
|
25
23
|
return (
|
|
26
|
-
<
|
|
24
|
+
<Bar
|
|
27
25
|
ref={ref}
|
|
28
26
|
as="header"
|
|
29
|
-
className={clsx(
|
|
27
|
+
className={clsx(className, 'tcn-utility-bar')}
|
|
30
28
|
data-hierarchy={hierarchy}
|
|
31
29
|
data-size={size}
|
|
32
|
-
height={height}
|
|
33
30
|
{...props}
|
|
34
31
|
>
|
|
35
32
|
{children}
|
|
36
|
-
</
|
|
33
|
+
</Bar>
|
|
37
34
|
);
|
|
38
35
|
}
|
|
39
36
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Header, Scaffold } from '../../layouts/index.js';
|
|
1
2
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
2
|
-
import { Frame, type FrameOwnProps } from './frame.js';
|
|
3
|
-
import { DragHandle } from '../../utils/dnd/handle.js';
|
|
4
|
-
import { Title } from '../../typography/title/title.js';
|
|
5
3
|
import { BodyText } from '../../typography/index.js';
|
|
6
|
-
import {
|
|
4
|
+
import { Title } from '../../typography/title/title.js';
|
|
5
|
+
import { DragHandle } from '../../utils/dnd/handle.js';
|
|
6
|
+
import { Frame, type FrameOwnProps } from './frame.js';
|
|
7
7
|
import styles from './frame_stories.module.css';
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Overlays/Floating/Frame',
|
|
@@ -14,6 +14,7 @@ export default {
|
|
|
14
14
|
isOpen: true,
|
|
15
15
|
draggable: true,
|
|
16
16
|
veil: false,
|
|
17
|
+
resizable: true,
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -26,14 +27,16 @@ export const FrameStory = (args: Omit<FrameOwnProps, 'children'>) => {
|
|
|
26
27
|
className={styles['sb-frame-container']}
|
|
27
28
|
{...args}
|
|
28
29
|
>
|
|
29
|
-
<
|
|
30
|
-
<Title> This is a frame</Title>
|
|
31
|
-
</Header>
|
|
32
|
-
<DragHandle>
|
|
30
|
+
<Scaffold>
|
|
33
31
|
<Header className={styles['sb-frame-header']}>
|
|
34
|
-
<
|
|
32
|
+
<Title> This is a frame</Title>
|
|
35
33
|
</Header>
|
|
36
|
-
|
|
34
|
+
<DragHandle>
|
|
35
|
+
<Header className={styles['sb-frame-header']}>
|
|
36
|
+
<BodyText> You can drag here.</BodyText>
|
|
37
|
+
</Header>
|
|
38
|
+
</DragHandle>
|
|
39
|
+
</Scaffold>
|
|
37
40
|
</Frame>
|
|
38
41
|
</ZStack>
|
|
39
42
|
);
|