@orcestr/ui 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.d.ts +5 -4
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +5 -2
- package/dist/components/AppShell/AppShell.d.ts +2 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.js +9 -6
- package/dist/components/AppSidebar/AppSidebar.d.ts +36 -0
- package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -0
- package/dist/components/AppSidebar/AppSidebar.js +53 -0
- package/dist/components/Badge/Badge.d.ts +8 -6
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +4 -4
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts +22 -0
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -0
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +50 -0
- package/dist/components/Box/Box.d.ts +2 -0
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +15 -2
- package/dist/components/Button/Button.d.ts +7 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +23 -3
- package/dist/components/Card/Card.d.ts +26 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.js +25 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -2
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +13 -4
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +10 -9
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +5 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +9 -1
- package/dist/components/Dialog/Dialog.d.ts +69 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +48 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/EntityPicker/EntityPicker.d.ts +2 -1
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
- package/dist/components/EntityPicker/EntityPicker.js +2 -2
- package/dist/components/Flex/Flex.d.ts +5 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +16 -3
- package/dist/components/Grid/Grid.d.ts +9 -2
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.js +22 -1
- package/dist/components/IconButton/IconButton.d.ts +19 -7
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +40 -5
- package/dist/components/IconTextButton/IconTextButton.d.ts +20 -0
- package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -0
- package/dist/components/IconTextButton/IconTextButton.js +24 -0
- package/dist/components/InlineEdit/InlineEdit.d.ts +63 -0
- package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -0
- package/dist/components/InlineEdit/InlineEdit.js +98 -0
- package/dist/components/LinkButton/LinkButton.d.ts +25 -0
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/components/LinkButton/LinkButton.js +12 -0
- package/dist/components/Modal/Modal.d.ts +29 -6
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +37 -13
- package/dist/components/Overlay/OverlayProvider.d.ts +1 -0
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/components/Overlay/OverlayProvider.js +18 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +2 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +3 -3
- package/dist/components/Popover/Popover.d.ts +37 -3
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +56 -9
- package/dist/components/ScrollArea/ScrollArea.d.ts +4 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +30 -4
- package/dist/components/Section/Section.d.ts +2 -0
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +28 -2
- package/dist/components/Select/Select.d.ts +36 -4
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +70 -3
- package/dist/components/Separator/Separator.d.ts +3 -1
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Separator/Separator.js +4 -2
- package/dist/components/SpecialModal/SpecialModal.d.ts +43 -0
- package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -0
- package/dist/components/SpecialModal/SpecialModal.js +34 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/State/State.d.ts +8 -1
- package/dist/components/State/State.d.ts.map +1 -1
- package/dist/components/State/State.js +2 -2
- package/dist/components/Switch/Switch.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/Table/Table.d.ts +64 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +38 -0
- package/dist/components/Tabs/Tabs.d.ts +33 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +189 -4
- package/dist/components/Text/Text.d.ts +13 -3
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +16 -3
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +19 -8
- package/dist/components/Tooltip/Tooltip.d.ts +11 -3
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +58 -9
- package/dist/example/CodePreview.d.ts.map +1 -1
- package/dist/example/CodePreview.js +3 -3
- package/dist/example/ExampleActionsSection.d.ts.map +1 -1
- package/dist/example/ExampleActionsSection.js +3 -3
- package/dist/example/ExampleApplicationSection.d.ts +7 -0
- package/dist/example/ExampleApplicationSection.d.ts.map +1 -0
- package/dist/example/ExampleApplicationSection.js +68 -0
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
- package/dist/example/ExampleBasicsSections.js +5 -9
- package/dist/example/ExampleDataSection.d.ts.map +1 -1
- package/dist/example/ExampleDataSection.js +31 -30
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
- package/dist/example/ExampleFieldsSection.js +51 -3
- package/dist/example/ExampleFoundationsSection.js +1 -1
- package/dist/example/ExampleOverlays.d.ts.map +1 -1
- package/dist/example/ExampleOverlays.js +7 -2
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
- package/dist/example/ExampleOverlaysSection.js +5 -2
- package/dist/example/ExampleSelectionSection.d.ts +3 -1
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
- package/dist/example/ExampleSelectionSection.js +10 -3
- package/dist/example/ExampleStateSection.d.ts +3 -0
- package/dist/example/ExampleStateSection.d.ts.map +1 -1
- package/dist/example/ExampleStateSection.js +58 -3
- package/dist/example/ExampleThemePlayground.d.ts +83 -53
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
- package/dist/example/ExampleThemePlayground.js +119 -56
- package/dist/example/UiExamplePage.d.ts.map +1 -1
- package/dist/example/UiExamplePage.js +39 -10
- package/dist/example/codeSamples.d.ts +7 -0
- package/dist/example/codeSamples.d.ts.map +1 -1
- package/dist/example/codeSamples.js +429 -60
- package/dist/example/exampleData.d.ts.map +1 -1
- package/dist/example/exampleData.js +16 -2
- package/dist/example/styles.css +245 -74
- package/dist/hooks/useFloatingPosition.js +1 -1
- package/dist/hooks/usePresence.d.ts.map +1 -1
- package/dist/hooks/usePresence.js +9 -7
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/styles/orcestr-ui.css +2544 -671
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +90 -36
- package/dist/theme/defaultTheme.d.ts.map +1 -1
- package/dist/theme/defaultTheme.js +322 -194
- package/dist/theme/systemProps.d.ts +48 -28
- package/dist/theme/systemProps.d.ts.map +1 -1
- package/dist/theme/systemProps.js +103 -1
- package/dist/theme/themeTypes.d.ts +21 -17
- package/dist/theme/themeTypes.d.ts.map +1 -1
- package/dist/utils/slot.d.ts +11 -0
- package/dist/utils/slot.d.ts.map +1 -0
- package/dist/utils/slot.js +18 -0
- package/package.json +1 -1
- package/dist/components/Workflow/Workflow.d.ts +0 -82
- package/dist/components/Workflow/Workflow.d.ts.map +0 -1
- package/dist/components/Workflow/Workflow.js +0 -73
|
@@ -1,46 +1,65 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
2
|
+
export type SemanticTone = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
export type ColorTone = 'blue' | 'sky' | 'cyan' | 'teal' | 'indigo' | 'violet' | 'purple' | 'iris' | 'green' | 'jade' | 'mint' | 'grass' | 'lime' | 'yellow' | 'amber' | 'orange' | 'brown' | 'red' | 'ruby' | 'crimson' | 'pink' | 'tomato';
|
|
4
|
+
export type Tone = SemanticTone | ColorTone;
|
|
5
|
+
export type ToneInput = Tone | 'muted' | 'gray' | 'mauve' | 'slate' | 'sage' | 'olive' | 'sand' | 'blue' | 'sky' | 'cyan' | 'teal' | 'indigo' | 'violet' | 'purple' | 'iris' | 'green' | 'jade' | 'mint' | 'grass' | 'lime' | 'yellow' | 'amber' | 'orange' | 'brown' | 'red' | 'ruby' | 'crimson' | 'pink' | 'tomato' | (string & {});
|
|
6
|
+
export type UiSize = 1 | 2 | 3 | 4 | '1' | '2' | '3' | '4';
|
|
4
7
|
export type RadiusScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
5
|
-
export type AlignShort = 's' | 'c' | 'e' | 'st' | 'b';
|
|
6
|
-
export type JustifyShort = 's' | 'c' | 'e' | 'sb' | 'sa' | 'se';
|
|
8
|
+
export type AlignShort = 's' | 'c' | 'e' | 'st' | 'b' | 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
9
|
+
export type JustifyShort = 's' | 'c' | 'e' | 'sb' | 'sa' | 'se' | 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
10
|
+
export type ResponsiveValue<T> = T | {
|
|
11
|
+
initial?: T;
|
|
12
|
+
sm?: T;
|
|
13
|
+
md?: T;
|
|
14
|
+
lg?: T;
|
|
15
|
+
xl?: T;
|
|
16
|
+
};
|
|
7
17
|
export type SystemProps = {
|
|
8
|
-
m?: number | string
|
|
9
|
-
mt?: number | string
|
|
10
|
-
mr?: number | string
|
|
11
|
-
mb?: number | string
|
|
12
|
-
ml?: number | string
|
|
13
|
-
mx?: number | string
|
|
14
|
-
my?: number | string
|
|
15
|
-
p?: number | string
|
|
16
|
-
pt?: number | string
|
|
17
|
-
pr?: number | string
|
|
18
|
-
pb?: number | string
|
|
19
|
-
pl?: number | string
|
|
20
|
-
px?: number | string
|
|
21
|
-
py?: number | string
|
|
22
|
-
g?: number | string
|
|
23
|
-
w?: number | string
|
|
24
|
-
minW?: number | string
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
m?: ResponsiveValue<number | string>;
|
|
19
|
+
mt?: ResponsiveValue<number | string>;
|
|
20
|
+
mr?: ResponsiveValue<number | string>;
|
|
21
|
+
mb?: ResponsiveValue<number | string>;
|
|
22
|
+
ml?: ResponsiveValue<number | string>;
|
|
23
|
+
mx?: ResponsiveValue<number | string>;
|
|
24
|
+
my?: ResponsiveValue<number | string>;
|
|
25
|
+
p?: ResponsiveValue<number | string>;
|
|
26
|
+
pt?: ResponsiveValue<number | string>;
|
|
27
|
+
pr?: ResponsiveValue<number | string>;
|
|
28
|
+
pb?: ResponsiveValue<number | string>;
|
|
29
|
+
pl?: ResponsiveValue<number | string>;
|
|
30
|
+
px?: ResponsiveValue<number | string>;
|
|
31
|
+
py?: ResponsiveValue<number | string>;
|
|
32
|
+
g?: ResponsiveValue<number | string>;
|
|
33
|
+
w?: ResponsiveValue<number | string>;
|
|
34
|
+
minW?: ResponsiveValue<number | string>;
|
|
35
|
+
minWidth?: ResponsiveValue<number | string>;
|
|
36
|
+
maxW?: ResponsiveValue<number | string>;
|
|
37
|
+
maxWidth?: ResponsiveValue<number | string>;
|
|
38
|
+
size?: ResponsiveValue<number | string>;
|
|
39
|
+
h?: ResponsiveValue<number | string>;
|
|
40
|
+
minH?: ResponsiveValue<number | string>;
|
|
41
|
+
minHeight?: ResponsiveValue<number | string>;
|
|
42
|
+
maxH?: ResponsiveValue<number | string>;
|
|
43
|
+
maxHeight?: ResponsiveValue<number | string>;
|
|
30
44
|
display?: CSSProperties['display'];
|
|
31
45
|
position?: CSSProperties['position'];
|
|
32
46
|
overflow?: CSSProperties['overflow'];
|
|
33
47
|
flex?: CSSProperties['flex'];
|
|
48
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
49
|
+
flexShrink?: CSSProperties['flexShrink'];
|
|
50
|
+
flexBasis?: CSSProperties['flexBasis'];
|
|
51
|
+
alignSelf?: CSSProperties['alignSelf'];
|
|
34
52
|
a?: AlignShort;
|
|
35
53
|
j?: JustifyShort;
|
|
36
54
|
row?: boolean;
|
|
37
55
|
col?: boolean;
|
|
56
|
+
direction?: CSSProperties['flexDirection'];
|
|
38
57
|
wrap?: boolean;
|
|
39
58
|
nowrap?: boolean;
|
|
40
59
|
inline?: boolean;
|
|
41
|
-
fs?: number | string
|
|
60
|
+
fs?: ResponsiveValue<number | string>;
|
|
42
61
|
fw?: CSSProperties['fontWeight'];
|
|
43
|
-
lh?: number | string
|
|
62
|
+
lh?: ResponsiveValue<number | string>;
|
|
44
63
|
ta?: CSSProperties['textAlign'];
|
|
45
64
|
color?: CSSProperties['color'];
|
|
46
65
|
r?: RadiusScale | `${RadiusScale}` | string;
|
|
@@ -50,4 +69,5 @@ export declare function splitSystemProps<P extends Record<string, unknown>>(prop
|
|
|
50
69
|
systemStyle: CSSProperties;
|
|
51
70
|
restProps: Omit<P, keyof SystemProps>;
|
|
52
71
|
};
|
|
72
|
+
export declare function normalizeTone(value: ToneInput | undefined, fallback?: Tone): Tone;
|
|
53
73
|
//# sourceMappingURL=systemProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemProps.d.ts","sourceRoot":"","sources":["../../src/theme/systemProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"systemProps.d.ts","sourceRoot":"","sources":["../../src/theme/systemProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,CAAC;AACb,MAAM,MAAM,SAAS,GACf,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
22
|
'size',
|
|
21
23
|
'h',
|
|
22
24
|
'minH',
|
|
25
|
+
'minHeight',
|
|
23
26
|
'maxH',
|
|
27
|
+
'maxHeight',
|
|
24
28
|
'display',
|
|
25
29
|
'position',
|
|
26
30
|
'overflow',
|
|
27
31
|
'flex',
|
|
32
|
+
'flexGrow',
|
|
33
|
+
'flexShrink',
|
|
34
|
+
'flexBasis',
|
|
35
|
+
'alignSelf',
|
|
28
36
|
'a',
|
|
29
37
|
'j',
|
|
30
38
|
'row',
|
|
31
39
|
'col',
|
|
40
|
+
'direction',
|
|
32
41
|
'wrap',
|
|
33
42
|
'nowrap',
|
|
34
43
|
'inline',
|
|
@@ -40,13 +49,30 @@ const systemKeys = new Set([
|
|
|
40
49
|
'r',
|
|
41
50
|
'truncate',
|
|
42
51
|
]);
|
|
43
|
-
const spacing = [
|
|
52
|
+
const spacing = [
|
|
53
|
+
'0',
|
|
54
|
+
'4px',
|
|
55
|
+
'8px',
|
|
56
|
+
'12px',
|
|
57
|
+
'16px',
|
|
58
|
+
'24px',
|
|
59
|
+
'32px',
|
|
60
|
+
'40px',
|
|
61
|
+
'48px',
|
|
62
|
+
'64px',
|
|
63
|
+
];
|
|
44
64
|
const radiusScale = ['0', '2px', '4px', '6px', '8px', '10px', '12px', '999px'];
|
|
45
65
|
function sizeValue(value) {
|
|
46
66
|
if (value === undefined)
|
|
47
67
|
return undefined;
|
|
68
|
+
if (typeof value === 'object') {
|
|
69
|
+
return sizeValue(value.initial ?? value.md ?? value.lg ?? value.sm ?? value.xl);
|
|
70
|
+
}
|
|
48
71
|
if (typeof value === 'number')
|
|
49
72
|
return spacing[value] ?? `${value}px`;
|
|
73
|
+
const normalized = value.trim();
|
|
74
|
+
if (/^[0-9]$/.test(normalized))
|
|
75
|
+
return spacing[Number(normalized)];
|
|
50
76
|
return value;
|
|
51
77
|
}
|
|
52
78
|
function radiusValue(value) {
|
|
@@ -61,30 +87,41 @@ function radiusValue(value) {
|
|
|
61
87
|
}
|
|
62
88
|
function alignValue(value) {
|
|
63
89
|
switch (value) {
|
|
90
|
+
case 'start':
|
|
64
91
|
case 's':
|
|
65
92
|
return 'flex-start';
|
|
93
|
+
case 'center':
|
|
66
94
|
case 'c':
|
|
67
95
|
return 'center';
|
|
96
|
+
case 'end':
|
|
68
97
|
case 'e':
|
|
69
98
|
return 'flex-end';
|
|
99
|
+
case 'stretch':
|
|
70
100
|
case 'st':
|
|
71
101
|
return 'stretch';
|
|
102
|
+
case 'baseline':
|
|
72
103
|
case 'b':
|
|
73
104
|
return 'baseline';
|
|
74
105
|
}
|
|
75
106
|
}
|
|
76
107
|
function justifyValue(value) {
|
|
77
108
|
switch (value) {
|
|
109
|
+
case 'start':
|
|
78
110
|
case 's':
|
|
79
111
|
return 'flex-start';
|
|
112
|
+
case 'center':
|
|
80
113
|
case 'c':
|
|
81
114
|
return 'center';
|
|
115
|
+
case 'end':
|
|
82
116
|
case 'e':
|
|
83
117
|
return 'flex-end';
|
|
118
|
+
case 'between':
|
|
84
119
|
case 'sb':
|
|
85
120
|
return 'space-between';
|
|
121
|
+
case 'around':
|
|
86
122
|
case 'sa':
|
|
87
123
|
return 'space-around';
|
|
124
|
+
case 'evenly':
|
|
88
125
|
case 'se':
|
|
89
126
|
return 'space-evenly';
|
|
90
127
|
}
|
|
@@ -149,9 +186,11 @@ export function splitSystemProps(props) {
|
|
|
149
186
|
systemStyle.width = sizeValue(value);
|
|
150
187
|
break;
|
|
151
188
|
case 'minW':
|
|
189
|
+
case 'minWidth':
|
|
152
190
|
systemStyle.minWidth = sizeValue(value);
|
|
153
191
|
break;
|
|
154
192
|
case 'maxW':
|
|
193
|
+
case 'maxWidth':
|
|
155
194
|
systemStyle.maxWidth = sizeValue(value);
|
|
156
195
|
break;
|
|
157
196
|
case 'size': {
|
|
@@ -164,9 +203,11 @@ export function splitSystemProps(props) {
|
|
|
164
203
|
systemStyle.height = sizeValue(value);
|
|
165
204
|
break;
|
|
166
205
|
case 'minH':
|
|
206
|
+
case 'minHeight':
|
|
167
207
|
systemStyle.minHeight = sizeValue(value);
|
|
168
208
|
break;
|
|
169
209
|
case 'maxH':
|
|
210
|
+
case 'maxHeight':
|
|
170
211
|
systemStyle.maxHeight = sizeValue(value);
|
|
171
212
|
break;
|
|
172
213
|
case 'display':
|
|
@@ -181,6 +222,18 @@ export function splitSystemProps(props) {
|
|
|
181
222
|
case 'flex':
|
|
182
223
|
systemStyle.flex = value;
|
|
183
224
|
break;
|
|
225
|
+
case 'flexGrow':
|
|
226
|
+
systemStyle.flexGrow = value;
|
|
227
|
+
break;
|
|
228
|
+
case 'flexShrink':
|
|
229
|
+
systemStyle.flexShrink = value;
|
|
230
|
+
break;
|
|
231
|
+
case 'flexBasis':
|
|
232
|
+
systemStyle.flexBasis = value;
|
|
233
|
+
break;
|
|
234
|
+
case 'alignSelf':
|
|
235
|
+
systemStyle.alignSelf = value;
|
|
236
|
+
break;
|
|
184
237
|
case 'a':
|
|
185
238
|
systemStyle.alignItems = alignValue(value);
|
|
186
239
|
break;
|
|
@@ -195,6 +248,9 @@ export function splitSystemProps(props) {
|
|
|
195
248
|
if (value)
|
|
196
249
|
systemStyle.flexDirection = 'column';
|
|
197
250
|
break;
|
|
251
|
+
case 'direction':
|
|
252
|
+
systemStyle.flexDirection = value;
|
|
253
|
+
break;
|
|
198
254
|
case 'wrap':
|
|
199
255
|
if (value)
|
|
200
256
|
systemStyle.flexWrap = 'wrap';
|
|
@@ -238,3 +294,49 @@ export function splitSystemProps(props) {
|
|
|
238
294
|
}
|
|
239
295
|
return { systemStyle, restProps: restProps };
|
|
240
296
|
}
|
|
297
|
+
export function normalizeTone(value, fallback = 'neutral') {
|
|
298
|
+
switch (value) {
|
|
299
|
+
case undefined:
|
|
300
|
+
case 'muted':
|
|
301
|
+
case 'gray':
|
|
302
|
+
case 'mauve':
|
|
303
|
+
case 'slate':
|
|
304
|
+
case 'sage':
|
|
305
|
+
case 'olive':
|
|
306
|
+
case 'sand':
|
|
307
|
+
return value === undefined ? fallback : 'neutral';
|
|
308
|
+
default:
|
|
309
|
+
return isTone(value) ? value : fallback;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function isTone(value) {
|
|
313
|
+
return (value === 'neutral' ||
|
|
314
|
+
value === 'primary' ||
|
|
315
|
+
value === 'secondary' ||
|
|
316
|
+
value === 'success' ||
|
|
317
|
+
value === 'warning' ||
|
|
318
|
+
value === 'danger' ||
|
|
319
|
+
value === 'info' ||
|
|
320
|
+
value === 'blue' ||
|
|
321
|
+
value === 'sky' ||
|
|
322
|
+
value === 'cyan' ||
|
|
323
|
+
value === 'teal' ||
|
|
324
|
+
value === 'indigo' ||
|
|
325
|
+
value === 'violet' ||
|
|
326
|
+
value === 'purple' ||
|
|
327
|
+
value === 'iris' ||
|
|
328
|
+
value === 'green' ||
|
|
329
|
+
value === 'jade' ||
|
|
330
|
+
value === 'mint' ||
|
|
331
|
+
value === 'grass' ||
|
|
332
|
+
value === 'lime' ||
|
|
333
|
+
value === 'yellow' ||
|
|
334
|
+
value === 'amber' ||
|
|
335
|
+
value === 'orange' ||
|
|
336
|
+
value === 'brown' ||
|
|
337
|
+
value === 'red' ||
|
|
338
|
+
value === 'ruby' ||
|
|
339
|
+
value === 'crimson' ||
|
|
340
|
+
value === 'pink' ||
|
|
341
|
+
value === 'tomato');
|
|
342
|
+
}
|
|
@@ -3,6 +3,13 @@ export type OrcestrThemeMode = 'dark' | 'light';
|
|
|
3
3
|
export type OrcestrThemeSurface = 'orcestr' | 'operations' | 'media' | 'catalog';
|
|
4
4
|
export type ButtonPressAnimation = 'translate' | 'scale' | 'soft' | 'none';
|
|
5
5
|
export type ModalAnimation = 'zoom-blur' | 'rise' | 'fade';
|
|
6
|
+
export type OrcestrThemeColorRole = {
|
|
7
|
+
base: string;
|
|
8
|
+
text: string;
|
|
9
|
+
surface: string;
|
|
10
|
+
border: string;
|
|
11
|
+
contrast: string;
|
|
12
|
+
};
|
|
6
13
|
export type OrcestrTheme = {
|
|
7
14
|
mode: OrcestrThemeMode;
|
|
8
15
|
surface: OrcestrThemeSurface;
|
|
@@ -16,20 +23,13 @@ export type OrcestrTheme = {
|
|
|
16
23
|
muted: string;
|
|
17
24
|
border: string;
|
|
18
25
|
borderStrong: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
dangerSoft: string;
|
|
27
|
-
success: string;
|
|
28
|
-
successSoft: string;
|
|
29
|
-
warning: string;
|
|
30
|
-
warningSoft: string;
|
|
31
|
-
info: string;
|
|
32
|
-
infoSoft: string;
|
|
26
|
+
primary: OrcestrThemeColorRole;
|
|
27
|
+
secondary: OrcestrThemeColorRole;
|
|
28
|
+
neutral: OrcestrThemeColorRole;
|
|
29
|
+
danger: OrcestrThemeColorRole;
|
|
30
|
+
success: OrcestrThemeColorRole;
|
|
31
|
+
warning: OrcestrThemeColorRole;
|
|
32
|
+
info: OrcestrThemeColorRole;
|
|
33
33
|
selected: string;
|
|
34
34
|
focusRing: string;
|
|
35
35
|
disabled: string;
|
|
@@ -89,7 +89,8 @@ export type OrcestrTheme = {
|
|
|
89
89
|
};
|
|
90
90
|
status: {
|
|
91
91
|
neutral: OrcestrThemeStatus;
|
|
92
|
-
|
|
92
|
+
primary: OrcestrThemeStatus;
|
|
93
|
+
secondary: OrcestrThemeStatus;
|
|
93
94
|
success: OrcestrThemeStatus;
|
|
94
95
|
warning: OrcestrThemeStatus;
|
|
95
96
|
danger: OrcestrThemeStatus;
|
|
@@ -145,11 +146,10 @@ export type OrcestrTheme = {
|
|
|
145
146
|
tableHeaderHeight: string;
|
|
146
147
|
fieldGap: string;
|
|
147
148
|
modalMaxWidth: string;
|
|
148
|
-
pipelineStepMinWidth: string;
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
151
|
export type OrcestrThemeOverrides = Partial<Omit<OrcestrTheme, 'colors' | 'mode' | 'surface' | 'motion' | 'radii' | 'spacing' | 'breakpoints' | 'shadows' | 'density' | 'zIndex' | 'toast' | 'typography' | 'status' | 'states' | 'components'>> & {
|
|
152
|
-
colors?:
|
|
152
|
+
colors?: PartialColorOverrides;
|
|
153
153
|
radii?: Partial<OrcestrTheme['radii']>;
|
|
154
154
|
spacing?: Partial<OrcestrTheme['spacing']>;
|
|
155
155
|
breakpoints?: Partial<OrcestrTheme['breakpoints']>;
|
|
@@ -172,10 +172,14 @@ export type OrcestrThemeStatus = {
|
|
|
172
172
|
type PartialStatusOverrides = Partial<{
|
|
173
173
|
[K in keyof OrcestrTheme['status']]: Partial<OrcestrThemeStatus>;
|
|
174
174
|
}>;
|
|
175
|
+
type PartialColorOverrides = Partial<Omit<OrcestrTheme['colors'], 'primary' | 'secondary' | 'neutral' | 'danger' | 'success' | 'warning' | 'info'>> & {
|
|
176
|
+
[K in 'primary' | 'secondary' | 'neutral' | 'danger' | 'success' | 'warning' | 'info']?: Partial<OrcestrThemeColorRole>;
|
|
177
|
+
};
|
|
175
178
|
export type OrcestrThemeContextValue = {
|
|
176
179
|
mode: OrcestrThemeMode;
|
|
177
180
|
surface: OrcestrThemeSurface;
|
|
178
181
|
theme: OrcestrTheme;
|
|
182
|
+
cssVariables: CSSProperties;
|
|
179
183
|
setMode: (mode: OrcestrThemeMode) => void;
|
|
180
184
|
setSurface: (surface: OrcestrThemeSurface) => void;
|
|
181
185
|
toggleMode: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeTypes.d.ts","sourceRoot":"","sources":["../../src/theme/themeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;AACjF,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,G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,GAAG;KACC,CAAC,IACI,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CSSProperties, type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
2
|
+
type SlotChildProps = HTMLAttributes<HTMLElement> & {
|
|
3
|
+
ref?: Ref<HTMLElement>;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function renderSlot(children: ReactNode, props: SlotChildProps & {
|
|
7
|
+
ref?: Ref<HTMLElement>;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}): ReactElement<SlotChildProps, string | import("react").JSXElementConstructor<any>> | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/utils/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,GAAG,EACX,MAAM,OAAO,CAAC;AAKf,KAAK,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAChD,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,UAAU,CACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,cAAc,GAAG;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,4FAgBJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cloneElement, isValidElement, } from 'react';
|
|
2
|
+
import { cn } from './cn';
|
|
3
|
+
import { composeRefs } from './composeRefs';
|
|
4
|
+
export function renderSlot(children, props) {
|
|
5
|
+
if (!isValidElement(children))
|
|
6
|
+
return null;
|
|
7
|
+
const child = children;
|
|
8
|
+
const { className, style, ref, ...restProps } = props;
|
|
9
|
+
return cloneElement(child, {
|
|
10
|
+
...restProps,
|
|
11
|
+
ref: composeRefs(child.props.ref, ref),
|
|
12
|
+
className: cn(className, child.props.className),
|
|
13
|
+
style: {
|
|
14
|
+
...style,
|
|
15
|
+
...child.props.style,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type { Tone } from '../../theme/systemProps';
|
|
3
|
-
import type { OrcestrActionItem } from '../Action/ActionTypes';
|
|
4
|
-
export type StatusBadgeProps = {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
tone?: Tone;
|
|
7
|
-
size?: 1 | 2 | 3 | 4;
|
|
8
|
-
testId?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function StatusBadge({ children, tone, size, testId }: StatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type TimelineItem = {
|
|
12
|
-
key: string;
|
|
13
|
-
title: ReactNode;
|
|
14
|
-
description?: ReactNode;
|
|
15
|
-
meta?: ReactNode;
|
|
16
|
-
tone?: Tone;
|
|
17
|
-
icon?: ReactNode;
|
|
18
|
-
};
|
|
19
|
-
export declare function Timeline({ items, className, testId, ...props }: HTMLAttributes<HTMLOListElement> & {
|
|
20
|
-
items: ReadonlyArray<TimelineItem>;
|
|
21
|
-
testId?: string;
|
|
22
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export type WorkflowStepStatus = 'active' | 'blocked' | 'done' | 'error' | 'pending' | 'processing';
|
|
24
|
-
export type PipelineStep = {
|
|
25
|
-
key: string;
|
|
26
|
-
label?: ReactNode;
|
|
27
|
-
title?: ReactNode;
|
|
28
|
-
detail?: ReactNode;
|
|
29
|
-
description?: ReactNode;
|
|
30
|
-
meta?: ReactNode;
|
|
31
|
-
tooltip?: ReactNode;
|
|
32
|
-
disabledReason?: ReactNode;
|
|
33
|
-
status?: WorkflowStepStatus;
|
|
34
|
-
tone?: Tone;
|
|
35
|
-
active?: boolean;
|
|
36
|
-
complete?: boolean;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
loading?: boolean;
|
|
39
|
-
onSelect?: () => void;
|
|
40
|
-
};
|
|
41
|
-
export declare function Pipeline({ steps, loading, loadingSteps, disabled, className, testId, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
42
|
-
steps?: ReadonlyArray<PipelineStep>;
|
|
43
|
-
loading?: boolean;
|
|
44
|
-
loadingSteps?: number;
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
testId?: string;
|
|
47
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
export type WorkflowSummaryBadge = {
|
|
49
|
-
key: string;
|
|
50
|
-
label: ReactNode;
|
|
51
|
-
value?: ReactNode;
|
|
52
|
-
tone?: Tone;
|
|
53
|
-
};
|
|
54
|
-
export declare function WorkflowSummaryBar({ items, className, testId, }: {
|
|
55
|
-
items: ReadonlyArray<WorkflowSummaryBadge>;
|
|
56
|
-
className?: string;
|
|
57
|
-
testId?: string;
|
|
58
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
export type LifecycleBlockReason = {
|
|
60
|
-
key: string;
|
|
61
|
-
title?: ReactNode;
|
|
62
|
-
message: ReactNode;
|
|
63
|
-
tone?: Exclude<Tone, 'brand'>;
|
|
64
|
-
actionLabel?: ReactNode;
|
|
65
|
-
onAction?: () => void;
|
|
66
|
-
};
|
|
67
|
-
export declare function LifecycleBlockReasonCallout({ reason, }: {
|
|
68
|
-
reason: LifecycleBlockReason;
|
|
69
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
70
|
-
export type LifecycleAction = Omit<OrcestrActionItem, 'children' | 'onSelect'> & {
|
|
71
|
-
disabledReason?: ReactNode;
|
|
72
|
-
onSelect: () => void;
|
|
73
|
-
};
|
|
74
|
-
export declare function LifecycleActionPanel({ title, meta, reasons, actions, className, testId, }: {
|
|
75
|
-
title?: ReactNode;
|
|
76
|
-
meta?: ReactNode;
|
|
77
|
-
reasons?: ReadonlyArray<LifecycleBlockReason>;
|
|
78
|
-
actions: ReadonlyArray<LifecycleAction>;
|
|
79
|
-
className?: string;
|
|
80
|
-
testId?: string;
|
|
81
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
82
|
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C,oBAAoB,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAWA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,EACxC,MAAM,GACT,EAAE;IACC,MAAM,EAAE,oBAAoB,CAAC;CAChC,2CAiBA;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAC7E,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,IAAI,EACJ,OAAY,EACZ,OAAO,EACP,SAAS,EACT,MAAM,GACT,EAAE;IACC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAC9C,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAuBA"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { LuArrowRight, LuCheck, LuCircleAlert, LuRefreshCw } from 'react-icons/lu';
|
|
4
|
-
import { cn } from '../../utils/cn';
|
|
5
|
-
import { Alert } from '../Alert/Alert';
|
|
6
|
-
import { Badge } from '../Badge/Badge';
|
|
7
|
-
import { Button } from '../Button/Button';
|
|
8
|
-
import { Skeleton } from '../Skeleton/Skeleton';
|
|
9
|
-
import { Tooltip } from '../Tooltip/Tooltip';
|
|
10
|
-
export function StatusBadge({ children, tone = 'neutral', size = 2, testId }) {
|
|
11
|
-
return (_jsx(Badge, { tone: tone, size: size, testId: testId, children: children }));
|
|
12
|
-
}
|
|
13
|
-
export function Timeline({ items, className, testId, ...props }) {
|
|
14
|
-
return (_jsx("ol", { className: cn('oui-timeline', className), "data-testid": testId, ...props, children: items.map((item) => (_jsxs("li", { className: 'oui-timeline-item', "data-tone": item.tone ?? 'neutral', children: [_jsx("span", { className: 'oui-timeline-marker', children: item.icon }), _jsxs("div", { className: 'oui-timeline-content', children: [_jsxs("div", { className: 'oui-timeline-title-row', children: [_jsx("strong", { children: item.title }), item.meta ? _jsx("span", { children: item.meta }) : null] }), item.description ? _jsx("p", { children: item.description }) : null] })] }, item.key))) }));
|
|
15
|
-
}
|
|
16
|
-
export function Pipeline({ steps, loading = false, loadingSteps = 5, disabled = false, className, testId, ...props }) {
|
|
17
|
-
if (loading) {
|
|
18
|
-
return (_jsx("div", { className: cn('oui-pipeline', className), "data-testid": testId, ...props, children: Array.from({ length: loadingSteps }).map((_, index) => (_jsxs("div", { className: 'oui-pipeline-step', "data-loading": 'true', children: [_jsx(Skeleton, { w: 16, h: 16, r: 7 }), _jsxs("span", { className: 'oui-pipeline-step-main', children: [_jsx(Skeleton, { w: '70%', h: 14 }), _jsx(Skeleton, { w: '46%', h: 12 })] })] }, index))) }));
|
|
19
|
-
}
|
|
20
|
-
return (_jsx("div", { className: cn('oui-pipeline', className), "data-testid": testId, ...props, children: (steps ?? []).map((step) => (_jsx(PipelineStepView, { step: step, disabled: disabled }, step.key))) }));
|
|
21
|
-
}
|
|
22
|
-
export function WorkflowSummaryBar({ items, className, testId, }) {
|
|
23
|
-
return (_jsx("div", { className: cn('oui-workflow-summary', className), "data-testid": testId, children: items.map((item) => (_jsxs(StatusBadge, { tone: item.tone ?? 'neutral', children: [item.label, item.value !== undefined ? _jsx("strong", { children: item.value }) : null] }, item.key))) }));
|
|
24
|
-
}
|
|
25
|
-
export function LifecycleBlockReasonCallout({ reason, }) {
|
|
26
|
-
return (_jsx(Alert, { tone: reason.tone ?? 'warning', title: reason.title, icon: _jsx(LuCircleAlert, {}), action: reason.onAction ? (_jsx(Button, { size: 1, v: 'surface', tone: reason.tone ?? 'warning', onClick: reason.onAction, children: reason.actionLabel })) : null, children: reason.message }));
|
|
27
|
-
}
|
|
28
|
-
export function LifecycleActionPanel({ title, meta, reasons = [], actions, className, testId, }) {
|
|
29
|
-
return (_jsxs("div", { className: cn('oui-lifecycle-panel', className), "data-testid": testId, children: [title || meta ? (_jsxs("div", { className: 'oui-lifecycle-panel-head', children: [title ? _jsx("strong", { children: title }) : null, meta ? _jsx("span", { children: meta }) : null] })) : null, reasons.length ? (_jsx("div", { className: 'oui-lifecycle-reasons', children: reasons.map((reason) => (_jsx(LifecycleBlockReasonCallout, { reason: reason }, reason.key))) })) : null, _jsx("div", { className: 'oui-lifecycle-panel-actions', children: actions.map((action) => (_jsx(LifecycleActionButton, { action: action }, action.key))) })] }));
|
|
30
|
-
}
|
|
31
|
-
function PipelineStepView({ step, disabled, }) {
|
|
32
|
-
const status = pipelineStepStatus(step);
|
|
33
|
-
const label = step.label ?? step.title;
|
|
34
|
-
const isDisabled = disabled || step.disabled || !step.onSelect || step.loading;
|
|
35
|
-
const content = (_jsxs("button", { type: 'button', className: 'oui-pipeline-step', "data-tone": step.tone ?? workflowStatusTone(status), "data-status": status, "data-active": status === 'active' ? 'true' : undefined, "data-complete": status === 'done' ? 'true' : undefined, "data-clickable": !isDisabled ? 'true' : undefined, disabled: isDisabled, onClick: step.onSelect, children: [_jsx("span", { className: 'oui-pipeline-dot', children: workflowStatusIcon(status) }), _jsxs("span", { className: 'oui-pipeline-step-main', children: [_jsx("span", { className: 'oui-pipeline-label', children: label }), step.detail ? _jsx("span", { className: 'oui-pipeline-detail', children: step.detail }) : null, step.description ? (_jsx("span", { className: 'oui-pipeline-description', children: step.description })) : null] }), step.meta ? _jsx("span", { className: 'oui-pipeline-meta', children: step.meta }) : null] }));
|
|
36
|
-
const tooltip = step.tooltip ?? step.disabledReason;
|
|
37
|
-
if (!tooltip)
|
|
38
|
-
return content;
|
|
39
|
-
return (_jsx(Tooltip, { content: tooltip, children: _jsx("span", { className: 'oui-pipeline-tooltip-wrap', children: content }) }));
|
|
40
|
-
}
|
|
41
|
-
function LifecycleActionButton({ action }) {
|
|
42
|
-
const button = (_jsx(Button, { size: 1, v: 'surface', tone: action.tone, disabled: action.disabled, loading: action.loading, leftIcon: action.icon, onClick: action.onSelect, children: action.label }));
|
|
43
|
-
if (!action.disabledReason)
|
|
44
|
-
return button;
|
|
45
|
-
return (_jsx(Tooltip, { content: action.disabledReason, children: _jsx("span", { className: 'oui-lifecycle-action-tooltip-wrap', children: button }) }));
|
|
46
|
-
}
|
|
47
|
-
function pipelineStepStatus(step) {
|
|
48
|
-
if (step.status)
|
|
49
|
-
return step.status;
|
|
50
|
-
if (step.complete)
|
|
51
|
-
return 'done';
|
|
52
|
-
if (step.active)
|
|
53
|
-
return 'active';
|
|
54
|
-
return 'pending';
|
|
55
|
-
}
|
|
56
|
-
function workflowStatusTone(status) {
|
|
57
|
-
if (status === 'done')
|
|
58
|
-
return 'success';
|
|
59
|
-
if (status === 'active' || status === 'processing')
|
|
60
|
-
return 'info';
|
|
61
|
-
if (status === 'blocked')
|
|
62
|
-
return 'warning';
|
|
63
|
-
if (status === 'error')
|
|
64
|
-
return 'danger';
|
|
65
|
-
return 'neutral';
|
|
66
|
-
}
|
|
67
|
-
function workflowStatusIcon(status) {
|
|
68
|
-
if (status === 'done')
|
|
69
|
-
return _jsx(LuCheck, { "aria-hidden": true });
|
|
70
|
-
if (status === 'active' || status === 'processing')
|
|
71
|
-
return _jsx(LuRefreshCw, { "aria-hidden": true });
|
|
72
|
-
return _jsx(LuArrowRight, { "aria-hidden": true });
|
|
73
|
-
}
|