@tcn/ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.d.ts.map +1 -1
- package/dist/feedback/index.js +6 -4
- package/dist/feedback/index.js.map +1 -1
- package/dist/feedback/progress/progress.d.ts +7 -0
- package/dist/feedback/progress/progress.d.ts.map +1 -0
- package/dist/feedback/progress/progress.js +38 -0
- package/dist/feedback/progress/progress.js.map +1 -0
- package/dist/feedback/progress/progress_bar.d.ts +0 -1
- package/dist/feedback/progress/progress_bar.d.ts.map +1 -1
- package/dist/feedback/progress/progress_bar.js +6 -46
- package/dist/feedback/progress/progress_bar.js.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +4 -3
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +145 -127
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +65 -65
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/progress_bar-CPP0Jyv-.js +38 -0
- package/dist/progress_bar-CPP0Jyv-.js.map +1 -0
- package/dist/progress_bar.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -8
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- 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/box/end_resize_handle.d.ts +2 -8
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -8
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +3 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +36 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -8
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -8
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -8
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +18 -0
- package/dist/stacks/box/types.d.ts.map +1 -0
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/index.d.ts +1 -0
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +3 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +10 -8
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.js +18 -12
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -1
- package/dist/surfaces/tooltip/tooltip.js +22 -20
- package/dist/surfaces/tooltip/tooltip.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +3 -4
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -18
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +3 -1
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/package.json +1 -1
- package/src/feedback/index.ts +1 -0
- package/src/feedback/progress/progress.module.css +5 -0
- package/src/feedback/progress/progress.stories.tsx +48 -0
- package/src/feedback/progress/progress.tsx +39 -0
- package/src/feedback/progress/progress_bar.module.css +4 -28
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.tsx +14 -26
- package/src/inputs/select/select.stories.tsx +23 -2
- package/src/inputs/suggestions/suggestion_list.tsx +58 -39
- package/src/overlay/frame/frame.tsx +10 -12
- package/src/stacks/box/bottom_resize_handle.tsx +2 -13
- package/src/stacks/box/box.tsx +4 -2
- package/src/stacks/box/end_resize_handle.tsx +3 -13
- package/src/stacks/box/left_resize_handle.tsx +3 -13
- package/src/stacks/box/resize_handlers.ts +22 -18
- package/src/stacks/box/right_resize_handle.tsx +2 -13
- package/src/stacks/box/start_resize_handle.tsx +3 -13
- package/src/stacks/box/top_resize_handle.tsx +3 -12
- package/src/stacks/box/types.ts +44 -0
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/index.ts +1 -0
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/surfaces/modal/modal.tsx +6 -4
- package/src/surfaces/pop_confirm/pop_confirm.tsx +8 -2
- package/src/surfaces/tooltip/tooltip.tsx +2 -1
- package/src/surfaces/window/window.stories.tsx +9 -1
- package/src/surfaces/window/window.tsx +6 -4
- package/src/themes/themes/ergo/ergo_theme.css +3 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HandleProps } from './handle_props.js';
|
|
2
|
+
|
|
3
|
+
export type WidthResizeOrigin = 'left' | 'right';
|
|
4
|
+
export type HeightResizeOrigin = 'top' | 'bottom';
|
|
5
|
+
|
|
6
|
+
export type OnWidthResize = (
|
|
7
|
+
// Newly calculated width
|
|
8
|
+
width: number,
|
|
9
|
+
// Origin of the resize - left or right of the box
|
|
10
|
+
origin: WidthResizeOrigin,
|
|
11
|
+
// Total delta of the resize (the sum of all deltas before end event)
|
|
12
|
+
totalDelta: number,
|
|
13
|
+
// Current delta of the resize (the delta of the current event)
|
|
14
|
+
currentDelta: number,
|
|
15
|
+
// Whether the resize is at the limit of the box, this includes min-content, max-content, and min-width/height
|
|
16
|
+
atLimit: boolean
|
|
17
|
+
) => void;
|
|
18
|
+
|
|
19
|
+
export type OnHeightResize = (
|
|
20
|
+
// Newly calculated height
|
|
21
|
+
height: number,
|
|
22
|
+
// Origin of the resize - top or bottom of the box
|
|
23
|
+
origin: HeightResizeOrigin,
|
|
24
|
+
// Total delta of the resize (the sum of all deltas before end event)
|
|
25
|
+
totalDelta: number,
|
|
26
|
+
// Current delta of the resize (the delta of the current event)
|
|
27
|
+
currentDelta: number,
|
|
28
|
+
// Whether the resize is at the limit of the box, this includes min-content, max-content, and min-width/height
|
|
29
|
+
atLimit: boolean
|
|
30
|
+
) => void;
|
|
31
|
+
|
|
32
|
+
export interface HorizontalResizeHandleProps {
|
|
33
|
+
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
34
|
+
handleProps?: HandleProps;
|
|
35
|
+
onWidthResize?: OnWidthResize;
|
|
36
|
+
onWidthResizeEnd?: (width: number, origin: WidthResizeOrigin) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface VerticalResizeHandleProps {
|
|
40
|
+
targetRef: React.MutableRefObject<HTMLElement | null>;
|
|
41
|
+
handleProps?: HandleProps;
|
|
42
|
+
onHeightResize?: OnHeightResize;
|
|
43
|
+
onHeightResizeEnd?: (height: number, origin: HeightResizeOrigin) => void;
|
|
44
|
+
}
|
|
@@ -32,9 +32,9 @@ export const HCollapsibleBox = React.forwardRef(function CollapsibleBox(
|
|
|
32
32
|
data-is-collapsed={!open}
|
|
33
33
|
data-collapse-orientation="horizontal"
|
|
34
34
|
data-is-resizing={resizing}
|
|
35
|
-
onWidthResize={(
|
|
35
|
+
onWidthResize={(...args) => {
|
|
36
36
|
setIsResizing(true);
|
|
37
|
-
props.onWidthResize?.(
|
|
37
|
+
props.onWidthResize?.(...args);
|
|
38
38
|
}}
|
|
39
39
|
onWidthResizeEnd={(width, origin) => {
|
|
40
40
|
setIsResizing(false);
|
package/src/stacks/index.ts
CHANGED
|
@@ -32,9 +32,9 @@ export const VCollapsibleBox = React.forwardRef(function CollapsibleBox(
|
|
|
32
32
|
data-is-collapsed={!open}
|
|
33
33
|
data-collapse-orientation="vertical"
|
|
34
34
|
data-is-resizing={resizing}
|
|
35
|
-
onHeightResize={(
|
|
35
|
+
onHeightResize={(...args) => {
|
|
36
36
|
setIsResizing(true);
|
|
37
|
-
props.onHeightResize?.(
|
|
37
|
+
props.onHeightResize?.(...args);
|
|
38
38
|
}}
|
|
39
39
|
onHeightResizeEnd={(height, origin) => {
|
|
40
40
|
setIsResizing(false);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Frame, type
|
|
4
|
-
import { Scaffold
|
|
3
|
+
import { Frame, type FrameProps } from '../../overlay/frame/frame.js';
|
|
4
|
+
import { Scaffold } from '../../layouts/scaffold/scaffold.js';
|
|
5
5
|
|
|
6
6
|
// Styles
|
|
7
7
|
import styles from './modal.module.css';
|
|
8
8
|
|
|
9
|
-
export type ModalProps =
|
|
9
|
+
export type ModalProps = FrameProps;
|
|
10
10
|
|
|
11
11
|
export const Modal = React.forwardRef<HTMLElement, ModalProps>(function Modal(
|
|
12
12
|
{ children, className, isOpen, draggable = false, veil = true, ...props }: ModalProps,
|
|
@@ -14,12 +14,14 @@ export const Modal = React.forwardRef<HTMLElement, ModalProps>(function Modal(
|
|
|
14
14
|
) {
|
|
15
15
|
return (
|
|
16
16
|
<Frame
|
|
17
|
+
ref={ref}
|
|
17
18
|
isOpen={isOpen}
|
|
18
19
|
draggable={draggable}
|
|
19
20
|
veil={veil}
|
|
20
21
|
className={clsx(styles['modal'], 'tcn-surface', 'tcn-modal', className)}
|
|
22
|
+
{...props}
|
|
21
23
|
>
|
|
22
|
-
<Scaffold
|
|
24
|
+
<Scaffold className={'tcn-modal-scaffold'} width="100%" height="100%">
|
|
23
25
|
{children}
|
|
24
26
|
</Scaffold>
|
|
25
27
|
</Frame>
|
|
@@ -11,13 +11,19 @@ export type PopConfirmProps = ElementPopperProps;
|
|
|
11
11
|
|
|
12
12
|
export const PopConfirm = React.forwardRef<HTMLDivElement, PopConfirmProps>(
|
|
13
13
|
function PopConfirm(
|
|
14
|
-
{
|
|
14
|
+
{
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
precision = 'low',
|
|
18
|
+
dismissals = [PopperDismissal.CLICK_AWAY],
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
15
21
|
ref
|
|
16
22
|
) {
|
|
17
23
|
return (
|
|
18
24
|
<ElementPopper
|
|
19
25
|
ref={ref}
|
|
20
|
-
precision=
|
|
26
|
+
precision={precision}
|
|
21
27
|
className={clsx(className, 'tcn-pop-confirm')}
|
|
22
28
|
dismissals={dismissals}
|
|
23
29
|
{...props}
|
|
@@ -22,6 +22,7 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function T
|
|
|
22
22
|
verticalOrigin = 'bottom',
|
|
23
23
|
horizontalAnchor = 'center',
|
|
24
24
|
horizontalOrigin = 'center',
|
|
25
|
+
precision = 'low', // TODO: Fix caret styles and set to high
|
|
25
26
|
label,
|
|
26
27
|
...props
|
|
27
28
|
},
|
|
@@ -49,7 +50,7 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function T
|
|
|
49
50
|
verticalOrigin={verticalOrigin}
|
|
50
51
|
horizontalAnchor={horizontalAnchor}
|
|
51
52
|
horizontalOrigin={horizontalOrigin}
|
|
52
|
-
precision=
|
|
53
|
+
precision={precision}
|
|
53
54
|
className={clsx(className, styles.tooltip, 'tcn-surface', 'tcn-tooltip')}
|
|
54
55
|
{...props}
|
|
55
56
|
>
|
|
@@ -25,7 +25,15 @@ export const WindowStory = () => {
|
|
|
25
25
|
return (
|
|
26
26
|
<ZStack height="100%" width="100%" minHeight="600px">
|
|
27
27
|
<Button onClick={toggle}>{isOpen ? 'Close' : 'Open'}</Button>
|
|
28
|
-
<Window
|
|
28
|
+
<Window
|
|
29
|
+
isOpen={isOpen}
|
|
30
|
+
width="400px"
|
|
31
|
+
height="500px"
|
|
32
|
+
minWidth="min-content"
|
|
33
|
+
minHeight="300px"
|
|
34
|
+
maxWidth="600px"
|
|
35
|
+
maxHeight="600px"
|
|
36
|
+
>
|
|
29
37
|
<DragHandle>
|
|
30
38
|
<Header>
|
|
31
39
|
<Title>Window Title</Title>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Frame, type FrameProps } from '../../overlay/frame/frame.js';
|
|
4
|
+
import { Scaffold } from '../../layouts/scaffold/scaffold.js';
|
|
5
5
|
|
|
6
6
|
// Styles
|
|
7
7
|
import styles from './window.module.css';
|
|
8
8
|
|
|
9
|
-
export type WindowProps =
|
|
9
|
+
export type WindowProps = FrameProps;
|
|
10
10
|
|
|
11
11
|
export const Window = React.forwardRef<HTMLElement, WindowProps>(function Window(
|
|
12
12
|
{
|
|
@@ -30,8 +30,10 @@ export const Window = React.forwardRef<HTMLElement, WindowProps>(function Window
|
|
|
30
30
|
className={clsx(styles['window'], 'tcn-surface', 'tcn-window', className)}
|
|
31
31
|
width={width}
|
|
32
32
|
height={height}
|
|
33
|
+
ref={ref}
|
|
34
|
+
{...props}
|
|
33
35
|
>
|
|
34
|
-
<Scaffold
|
|
36
|
+
<Scaffold width="100%" height="100%" className={'tcn-window-scaffold'}>
|
|
35
37
|
{children}
|
|
36
38
|
</Scaffold>
|
|
37
39
|
</Frame>
|
|
@@ -686,6 +686,7 @@
|
|
|
686
686
|
/* MODAL: */
|
|
687
687
|
.tcn-modal {
|
|
688
688
|
--divide-header: 0;
|
|
689
|
+
box-shadow: 0px 4px 34px 0px #00000096;
|
|
689
690
|
|
|
690
691
|
:where(.tcn-scaffold) {
|
|
691
692
|
border-radius: var(--shape-radius-medium);
|
|
@@ -710,10 +711,11 @@
|
|
|
710
711
|
|
|
711
712
|
/* WINDOW: */
|
|
712
713
|
.tcn-window {
|
|
714
|
+
box-shadow: 0px 4px 34px 0px #00000096;
|
|
715
|
+
|
|
713
716
|
--divide-header: 0;
|
|
714
717
|
|
|
715
718
|
:where(.tcn-scaffold) {
|
|
716
|
-
box-shadow: 0px 4px 34px 0px #00000096;
|
|
717
719
|
border-radius: var(--shape-radius-medium);
|
|
718
720
|
background-color: var(--background-color-primary);
|
|
719
721
|
overflow: hidden;
|