@orcestr/ui 0.1.0 → 0.1.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/components/AppShell/AppShell.d.ts +11 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.js +8 -6
- package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -1
- package/dist/components/AppSidebar/AppSidebar.js +71 -7
- package/dist/components/Collapse/Collapse.d.ts.map +1 -1
- package/dist/components/Collapse/Collapse.js +5 -25
- package/dist/components/CopyButton/CopyButton.d.ts +24 -0
- package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton/CopyButton.js +81 -0
- package/dist/components/Drawer/Drawer.d.ts +2 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +15 -4
- package/dist/components/Toast/Toast.d.ts +0 -4
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +60 -36
- package/dist/example/CodePreview.d.ts +2 -1
- package/dist/example/CodePreview.d.ts.map +1 -1
- package/dist/example/CodePreview.js +13 -48
- package/dist/example/ExampleActionsSection.d.ts.map +1 -1
- package/dist/example/ExampleActionsSection.js +2 -2
- package/dist/example/ExampleApplicationSection.d.ts.map +1 -1
- package/dist/example/ExampleApplicationSection.js +27 -7
- package/dist/example/ExampleBasicsSections.d.ts +1 -1
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
- package/dist/example/ExampleBasicsSections.js +12 -6
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
- package/dist/example/ExampleOverlaysSection.js +15 -28
- package/dist/example/ExampleStateSection.d.ts.map +1 -1
- package/dist/example/ExampleStateSection.js +12 -11
- package/dist/example/ExampleThemePlayground.d.ts +1 -1
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
- package/dist/example/ExampleThemePlayground.js +10 -7
- package/dist/example/UiExamplePage.d.ts.map +1 -1
- package/dist/example/UiExamplePage.js +34 -43
- package/dist/example/codeSamples.d.ts +1 -1
- package/dist/example/codeSamples.d.ts.map +1 -1
- package/dist/example/codeSamples.js +171 -69
- package/dist/example/exampleData.d.ts.map +1 -1
- package/dist/example/exampleData.js +3 -9
- package/dist/example/styles.css +79 -119
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/styles/orcestr-ui.css +395 -138
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +19 -17
- package/dist/theme/defaultTheme.d.ts.map +1 -1
- package/dist/theme/defaultTheme.js +42 -37
- package/dist/theme/themeTypes.d.ts +23 -18
- package/dist/theme/themeTypes.d.ts.map +1 -1
- package/package.json +4 -1
|
@@ -19,44 +19,37 @@ const toastPositionVariants = [
|
|
|
19
19
|
position: 'top-left',
|
|
20
20
|
label: 'Status synced',
|
|
21
21
|
tone: 'success',
|
|
22
|
-
message: '
|
|
23
|
-
blur: 14,
|
|
22
|
+
message: 'Default glass toast from the left edge.',
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
25
|
position: 'top-center',
|
|
27
26
|
label: 'Command ready',
|
|
28
27
|
tone: 'info',
|
|
29
|
-
message: 'Centered toast
|
|
30
|
-
background: 'rgb(18 28 42 / 88%)',
|
|
31
|
-
blur: 10,
|
|
28
|
+
message: 'Centered toast uses the same glass surface.',
|
|
32
29
|
},
|
|
33
30
|
{
|
|
34
31
|
position: 'top-right',
|
|
35
32
|
label: 'Needs attention',
|
|
36
33
|
tone: 'warning',
|
|
37
|
-
message: 'Right edge
|
|
38
|
-
blur: 12,
|
|
34
|
+
message: 'Right edge toast keeps the same translucent surface.',
|
|
39
35
|
},
|
|
40
36
|
{
|
|
41
37
|
position: 'bottom-left',
|
|
42
38
|
label: 'Import queued',
|
|
43
39
|
tone: 'info',
|
|
44
|
-
message: '
|
|
45
|
-
blur: false,
|
|
40
|
+
message: 'Bottom left toast keeps the same theme blur.',
|
|
46
41
|
},
|
|
47
42
|
{
|
|
48
43
|
position: 'bottom-center',
|
|
49
44
|
label: 'Batch completed',
|
|
50
45
|
tone: 'success',
|
|
51
|
-
message: 'Bottom center
|
|
52
|
-
blur: 16,
|
|
46
|
+
message: 'Bottom center toast uses the theme defaults.',
|
|
53
47
|
},
|
|
54
48
|
{
|
|
55
49
|
position: 'bottom-right',
|
|
56
50
|
label: 'Export failed',
|
|
57
51
|
tone: 'danger',
|
|
58
52
|
message: 'Actionable toast from the right edge.',
|
|
59
|
-
blur: 12,
|
|
60
53
|
},
|
|
61
54
|
];
|
|
62
55
|
export function OverlaysSection({ setModalOpen, setBlurModalOpen, setFastModalOpen, setRiseModalOpen, setSlowModalOpen, setDangerModalOpen, onOpenCode, }) {
|
|
@@ -67,7 +60,13 @@ export function OverlaysSection({ setModalOpen, setBlurModalOpen, setFastModalOp
|
|
|
67
60
|
title: 'Saved successfully',
|
|
68
61
|
message: 'The settings are synced with the current theme.',
|
|
69
62
|
position: 'bottom-right',
|
|
70
|
-
}), children: "Success" }), _jsx(Button, { v: 'soft', tone: '
|
|
63
|
+
}), children: "Success" }), _jsx(Button, { v: 'soft', tone: 'success', onClick: () => toast.success({
|
|
64
|
+
title: 'Endless',
|
|
65
|
+
message: 'This success toast stays until you click it.',
|
|
66
|
+
position: 'bottom-right',
|
|
67
|
+
duration: null,
|
|
68
|
+
dedupeKey: 'endless-success-toast',
|
|
69
|
+
}), children: "Endless" }), _jsx(Button, { v: 'soft', tone: 'warning', onClick: () => toast.warning({
|
|
71
70
|
title: 'Needs attention',
|
|
72
71
|
message: 'Only 4 items need attention in this view.',
|
|
73
72
|
dedupeKey: 'needs-attention',
|
|
@@ -88,22 +87,12 @@ export function OverlaysSection({ setModalOpen, setBlurModalOpen, setFastModalOp
|
|
|
88
87
|
closeButton: true,
|
|
89
88
|
}), children: "Pinned" }), _jsx(Button, { v: 'surface', onClick: () => toast.info({
|
|
90
89
|
title: 'Glass background',
|
|
91
|
-
message: '
|
|
90
|
+
message: 'Theme blur and translucent background.',
|
|
92
91
|
position: 'bottom-right',
|
|
93
|
-
background: 'rgb(18 24 34 / 72%)',
|
|
94
|
-
blur: 18,
|
|
95
|
-
borderColor: 'rgb(255 255 255 / 18%)',
|
|
96
|
-
duration: 5200,
|
|
97
|
-
}), children: "Glass" }), _jsx(Button, { v: 'surface', onClick: () => toast.info({
|
|
98
|
-
title: 'Static background',
|
|
99
|
-
message: 'Blur can be disabled per toast.',
|
|
100
|
-
position: 'bottom-left',
|
|
101
|
-
background: 'var(--oui-floating-bg)',
|
|
102
|
-
blur: false,
|
|
103
92
|
duration: 5200,
|
|
104
|
-
}), children: "
|
|
93
|
+
}), children: "Glass" })] }), _jsx(Text, { color: 'var(--oui-muted)', fs: '13px', lh: 1.45, children: "Toasts support typed helpers, controlled position, progress line, dedupe keys, actions and fixed viewport above modals." }), _jsx("div", { className: 'oui-ui-row', children: toastPositions.map((item) => (_jsx(Button, { size: 1, v: 'surface', onClick: () => toast.info({
|
|
105
94
|
title: item.label,
|
|
106
|
-
message: 'Positioned toast with
|
|
95
|
+
message: 'Positioned toast with the default glass surface.',
|
|
107
96
|
position: item.position,
|
|
108
97
|
duration: 3600,
|
|
109
98
|
}), children: item.label }, item.position))) }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 1, tone: 'success', v: 'soft', onClick: () => {
|
|
@@ -114,8 +103,6 @@ export function OverlaysSection({ setModalOpen, setBlurModalOpen, setFastModalOp
|
|
|
114
103
|
message: item.message,
|
|
115
104
|
position: item.position,
|
|
116
105
|
tone: item.tone,
|
|
117
|
-
background: item.background,
|
|
118
|
-
blur: item.blur,
|
|
119
106
|
duration: 4200 + index * 220,
|
|
120
107
|
});
|
|
121
108
|
}, index * 120);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleStateSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleStateSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleStateSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleStateSection.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAoH/C,wBAAgB,YAAY,CAAC,EACzB,UAAU,GACb,EAAE;IACC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,2CAoCA;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,UAAU,GACb,EAAE;IACC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,2CAsEA;AAED,wBAAgB,eAAe,CAAC,EAC5B,UAAU,GACb,EAAE;IACC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,2CAgCA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { LuCircleAlert, LuCircleCheck, LuCircleX, LuClock3, LuInfo, LuLoaderCircle, LuPackageCheck, LuShieldCheck, } from 'react-icons/lu';
|
|
5
|
-
import { Badge, BadgeSelectMenu, Button, EmptyState, ErrorState, IconText, LoadingState, Stack, StateCard, Text, } from '..';
|
|
5
|
+
import { Badge, BadgeSelectMenu, Button, EmptyState, ErrorState, Flex, Grid, IconText, LoadingState, Stack, StateCard, Text, } from '..';
|
|
6
6
|
import { ExampleTile } from './CodePreview';
|
|
7
7
|
import {} from './codeSamples';
|
|
8
8
|
import { UiExampleSection } from './UiExampleSection';
|
|
@@ -16,6 +16,7 @@ const stateCardSample = {
|
|
|
16
16
|
Button,
|
|
17
17
|
EmptyState,
|
|
18
18
|
ErrorState,
|
|
19
|
+
Grid,
|
|
19
20
|
LoadingState,
|
|
20
21
|
Stack,
|
|
21
22
|
StateCard,
|
|
@@ -33,7 +34,7 @@ const validationItems = [
|
|
|
33
34
|
title='General state'
|
|
34
35
|
description='One card for informational, empty, loading and error states.'
|
|
35
36
|
/>
|
|
36
|
-
<
|
|
37
|
+
<Grid columns='repeat(auto-fit, minmax(min(100%, 260px), 1fr))' g={2}>
|
|
37
38
|
<StateCard
|
|
38
39
|
v='surface'
|
|
39
40
|
tone='primary'
|
|
@@ -54,7 +55,7 @@ const validationItems = [
|
|
|
54
55
|
title='Ghost'
|
|
55
56
|
description='No extra background.'
|
|
56
57
|
/>
|
|
57
|
-
</
|
|
58
|
+
</Grid>
|
|
58
59
|
<StateCard tone='danger' title='Validation failed'>
|
|
59
60
|
<Stack g={1}>
|
|
60
61
|
{validationItems.map((item) => (
|
|
@@ -65,11 +66,11 @@ const validationItems = [
|
|
|
65
66
|
))}
|
|
66
67
|
</Stack>
|
|
67
68
|
</StateCard>
|
|
68
|
-
<
|
|
69
|
+
<Grid columns='repeat(auto-fit, minmax(min(100%, 260px), 1fr))' g={2}>
|
|
69
70
|
<EmptyState compact description='No records yet.' />
|
|
70
71
|
<LoadingState compact description='Loading the next page.' />
|
|
71
72
|
<ErrorState compact description='Request failed.' onRetry={reload} />
|
|
72
|
-
</
|
|
73
|
+
</Grid>
|
|
73
74
|
<StateCard
|
|
74
75
|
tone='success'
|
|
75
76
|
title='Saved'
|
|
@@ -103,16 +104,16 @@ const statusItems = [
|
|
|
103
104
|
};
|
|
104
105
|
const iconTextSample = {
|
|
105
106
|
title: 'IconText',
|
|
106
|
-
code: `import {
|
|
107
|
+
code: `import {Flex, IconText} from '@orcestr/ui';
|
|
107
108
|
import {LuCircleAlert, LuCircleCheck, LuCircleX, LuInfo, LuLoaderCircle} from 'react-icons/lu';
|
|
108
109
|
|
|
109
|
-
<
|
|
110
|
+
<Flex g={2} wrap>
|
|
110
111
|
<IconText icon={<LuLoaderCircle />} iconTone='info' iconSpin>Saving changes</IconText>
|
|
111
112
|
<IconText icon={<LuCircleCheck />} iconTone='success'>Saved</IconText>
|
|
112
113
|
<IconText icon={<LuCircleX />} iconTone='danger'>Save failed</IconText>
|
|
113
114
|
<IconText icon={<LuCircleAlert />} iconTone='warning' fw={760}>Review required</IconText>
|
|
114
115
|
<IconText icon={<LuInfo />} iconTone='info' fs='13px'>Sync scheduled</IconText>
|
|
115
|
-
</
|
|
116
|
+
</Flex>`,
|
|
116
117
|
};
|
|
117
118
|
export function BadgeSection({ onOpenCode, }) {
|
|
118
119
|
const [status, setStatus] = useState('review');
|
|
@@ -121,11 +122,11 @@ export function BadgeSection({ onOpenCode, }) {
|
|
|
121
122
|
{ value: 'review', label: 'Review' },
|
|
122
123
|
{ value: 'accepted', label: 'Accepted' },
|
|
123
124
|
];
|
|
124
|
-
return (_jsx(UiExampleSection, { id: 'badges-example', title: 'Badge', description: 'Compact counters and statuses without a special wrapper.', children: _jsx(ExampleTile, { title: 'Badge', code: badgeSample.code, onOpen: onOpenCode, children: _jsxs(
|
|
125
|
+
return (_jsx(UiExampleSection, { id: 'badges-example', title: 'Badge', description: 'Compact counters and statuses without a special wrapper.', children: _jsx(ExampleTile, { title: 'Badge', code: badgeSample.code, onOpen: onOpenCode, children: _jsxs(Flex, { g: 2, wrap: true, children: [_jsxs(Badge, { tone: 'neutral', children: ["Requested ", _jsx("strong", { children: "43" })] }), _jsxs(Badge, { tone: 'info', icon: _jsx(LuClock3, {}), children: ["Ordered ", _jsx("strong", { children: "12" })] }), _jsxs(Badge, { tone: 'success', icon: _jsx(LuPackageCheck, {}), children: ["Accepted ", _jsx("strong", { children: "8" })] }), _jsx(Badge, { tone: 'warning', v: 'surface', icon: _jsx(LuShieldCheck, {}), children: "Review" }), _jsx(Badge, { tone: 'danger', v: 'outline', children: "Blocked" }), _jsx(Badge, { tone: 'primary', v: 'solid', children: "Primary" }), _jsx(BadgeSelectMenu, { value: status, items: statusItems, onValueChange: setStatus, tone: 'warning' })] }) }) }));
|
|
125
126
|
}
|
|
126
127
|
export function StateCardSection({ onOpenCode, }) {
|
|
127
|
-
return (_jsx(UiExampleSection, { id: 'state-card-example', title: 'StateCard', description: 'Block-level state for empty, loading, error, access and status surfaces.', children: _jsx(ExampleTile, { title: 'StateCard', code: stateCardSample.code, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(StateCard, { tone: 'info', title: 'General state', description: 'One card for informational, empty, loading and error states.' }), _jsxs(
|
|
128
|
+
return (_jsx(UiExampleSection, { id: 'state-card-example', title: 'StateCard', description: 'Block-level state for empty, loading, error, access and status surfaces.', children: _jsx(ExampleTile, { title: 'StateCard', code: stateCardSample.code, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(StateCard, { tone: 'info', title: 'General state', description: 'One card for informational, empty, loading and error states.' }), _jsxs(Grid, { columns: 'repeat(auto-fit, minmax(min(100%, 260px), 1fr))', g: 2, children: [_jsx(StateCard, { v: 'surface', tone: 'primary', title: 'Surface', titleTone: 'primary', description: 'Uses the regular surface with a toned title.', descriptionTone: 'muted' }), _jsx(StateCard, { v: 'outline', tone: 'warning', title: 'Outline', description: 'Useful when the card should stay quiet.' }), _jsx(StateCard, { v: 'ghost', tone: 'success', title: 'Ghost', description: 'No extra background.' })] }), _jsx(StateCard, { tone: 'danger', title: 'Validation failed', children: _jsx(Stack, { g: 1, children: validationItems.map((item) => (_jsxs(Text, { fs: '13px', lh: 1.3, children: [_jsxs("strong", { children: [item.label, ": "] }), item.message] }, item.key))) }) }), _jsxs(Grid, { columns: 'repeat(auto-fit, minmax(min(100%, 260px), 1fr))', g: 2, children: [_jsx(EmptyState, { compact: true, description: 'No records yet.' }), _jsx(LoadingState, { compact: true, description: 'Loading the next page.' }), _jsx(ErrorState, { compact: true, description: 'Request failed.', onRetry: () => undefined })] }), _jsx(StateCard, { tone: 'success', title: 'Saved', description: 'Changes were applied.', action: _jsx(Button, { size: 1, v: 'surface', children: "Open" }) })] }) }) }));
|
|
128
129
|
}
|
|
129
130
|
export function IconTextSection({ onOpenCode, }) {
|
|
130
|
-
return (_jsx(UiExampleSection, { id: 'icon-text-example', title: 'IconText', description: 'Inline text primitive with an icon, text props and independent icon tone.', children: _jsx(ExampleTile, { title: 'IconText', code: iconTextSample.code, onOpen: onOpenCode, children: _jsxs(
|
|
131
|
+
return (_jsx(UiExampleSection, { id: 'icon-text-example', title: 'IconText', description: 'Inline text primitive with an icon, text props and independent icon tone.', children: _jsx(ExampleTile, { title: 'IconText', code: iconTextSample.code, onOpen: onOpenCode, children: _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(IconText, { icon: _jsx(LuLoaderCircle, {}), iconTone: 'info', iconSpin: true, children: "Saving changes" }), _jsx(IconText, { icon: _jsx(LuCircleCheck, {}), iconTone: 'success', children: "Saved" }), _jsx(IconText, { icon: _jsx(LuCircleX, {}), iconTone: 'danger', children: "Save failed" }), _jsx(IconText, { icon: _jsx(LuCircleAlert, {}), iconTone: 'warning', fw: 760, children: "Review required" }), _jsx(IconText, { icon: _jsx(LuInfo, {}), iconTone: 'info', fs: '13px', children: "Sync scheduled" })] }) }) }));
|
|
131
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleThemePlayground.d.ts","sourceRoot":"","sources":["../../src/example/ExampleThemePlayground.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAC,MAAM,OAAO,CAAC;AAElG,OAAO,EAOH,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACvB,MAAM,IAAI,CAAC;AAEZ,KAAK,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,gB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AG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAE1E,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,aAAa,GAAG,WAAW,CAEvE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,UAE5E;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,UAElF;AA6FD,wBAAgB,sBAAsB,CAAC,EACnC,cAAc,EACd,KAAK,EACL,MAAM,EACN,cAAc,EACd,sBAAsB,GACzB,EAAE;IACC,cAAc,EAAE,aAAa,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,sBAAsB,EAAE,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAC;CAC3E,2CAwFA;AAED,wBAAgB,mBAAmB,CAAC,EAChC,cAAc,EACd,MAAM,EACN,cAAc,GACjB,EAAE;IACC,cAAc,EAAE,aAAa,CAAC;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACjD,2CAkDA;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAMlD,aAAa,CACrB"}
|
|
@@ -151,7 +151,7 @@ export const themePlaygroundPresets = [
|
|
|
151
151
|
surface: '#122f3a',
|
|
152
152
|
},
|
|
153
153
|
},
|
|
154
|
-
|
|
154
|
+
radius: {
|
|
155
155
|
md: '5px',
|
|
156
156
|
lg: '7px',
|
|
157
157
|
xl: '10px',
|
|
@@ -443,13 +443,14 @@ export function themePresetDescription(preset, locale) {
|
|
|
443
443
|
}
|
|
444
444
|
const flatTokenSections = [
|
|
445
445
|
'colors',
|
|
446
|
-
'
|
|
446
|
+
'radius',
|
|
447
447
|
'spacing',
|
|
448
448
|
'breakpoints',
|
|
449
449
|
'shadows',
|
|
450
|
-
'
|
|
450
|
+
'text',
|
|
451
451
|
'motion',
|
|
452
452
|
'toast',
|
|
453
|
+
'scrollbar',
|
|
453
454
|
'states',
|
|
454
455
|
'density',
|
|
455
456
|
'zIndex',
|
|
@@ -471,13 +472,14 @@ const themePlaygroundCopy = {
|
|
|
471
472
|
statuses: 'Статусы',
|
|
472
473
|
tokenSections: {
|
|
473
474
|
colors: 'Цвета',
|
|
474
|
-
|
|
475
|
+
radius: 'Радиус',
|
|
475
476
|
spacing: 'Отступы',
|
|
476
477
|
breakpoints: 'Брейкпоинты',
|
|
477
478
|
shadows: 'Тени',
|
|
478
|
-
|
|
479
|
+
text: 'Текст',
|
|
479
480
|
motion: 'Движение',
|
|
480
481
|
toast: 'Toast',
|
|
482
|
+
scrollbar: 'Scrollbar',
|
|
481
483
|
states: 'Состояния',
|
|
482
484
|
density: 'Плотность',
|
|
483
485
|
zIndex: 'Z-index',
|
|
@@ -497,13 +499,14 @@ const themePlaygroundCopy = {
|
|
|
497
499
|
statuses: 'Statuses',
|
|
498
500
|
tokenSections: {
|
|
499
501
|
colors: 'Colors',
|
|
500
|
-
|
|
502
|
+
radius: 'Radius',
|
|
501
503
|
spacing: 'Spacing',
|
|
502
504
|
breakpoints: 'Breakpoints',
|
|
503
505
|
shadows: 'Shadows',
|
|
504
|
-
|
|
506
|
+
text: 'Text',
|
|
505
507
|
motion: 'Motion',
|
|
506
508
|
toast: 'Toast',
|
|
509
|
+
scrollbar: 'Scrollbar',
|
|
507
510
|
states: 'States',
|
|
508
511
|
density: 'Density',
|
|
509
512
|
zIndex: 'Z-index',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiExamplePage.d.ts","sourceRoot":"","sources":["../../src/example/UiExamplePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UiExamplePage.d.ts","sourceRoot":"","sources":["../../src/example/UiExamplePage.tsx"],"names":[],"mappings":"AAYA,OAAO,EAaH,KAAK,eAAe,EACvB,MAAM,IAAI,CAAC;AAwlBZ,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EAAE,gBAAgB,EACxB,aAAoB,EACpB,cAAc,GACjB,GAAE,kBAAuB,2CA8CzB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { LuBell,
|
|
5
|
-
import { AppShell, AppShellContent, AppShellHeader, AppSidebar, OrcestrUiProvider, ScrollArea, useOrcestrTheme, useToast, } from '..';
|
|
6
|
-
import { LayoutSection,
|
|
3
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { LuBell, LuCheck, LuExternalLink, LuLanguages, LuRefreshCw, LuTrash2, } from 'react-icons/lu';
|
|
5
|
+
import { AppShell, AppShellContent, AppShellHeader, AppSidebar, IconButton, Menu, OrcestrUiProvider, ScrollArea, useOrcestrTheme, useToast, } from '..';
|
|
6
|
+
import { LayoutSection, TextSection } from './ExampleBasicsSections';
|
|
7
7
|
import { ActionsSection } from './ExampleActionsSection';
|
|
8
8
|
import { ApplicationSection } from './ExampleApplicationSection';
|
|
9
9
|
import { FieldsSection } from './ExampleFieldsSection';
|
|
@@ -22,6 +22,18 @@ const UI_EXAMPLE_SCROLL_LEAD = 50;
|
|
|
22
22
|
const UI_EXAMPLE_ACTIVE_PROBE_OFFSET = UI_EXAMPLE_SCROLL_LEAD + 220;
|
|
23
23
|
const UI_EXAMPLE_CLICK_TARGET_TOP_TOLERANCE = 180;
|
|
24
24
|
const UI_EXAMPLE_SCROLL_LOCK_TIMEOUT_MS = 1600;
|
|
25
|
+
const MemoFoundationsSection = memo(FoundationsSection);
|
|
26
|
+
const MemoTextSection = memo(TextSection);
|
|
27
|
+
const MemoIconTextSection = memo(IconTextSection);
|
|
28
|
+
const MemoLayoutSection = memo(LayoutSection);
|
|
29
|
+
const MemoActionsSection = memo(ActionsSection);
|
|
30
|
+
const MemoFieldsSection = memo(FieldsSection);
|
|
31
|
+
const MemoSelectionSection = memo(SelectionSection);
|
|
32
|
+
const MemoStateCardSection = memo(StateCardSection);
|
|
33
|
+
const MemoBadgeSection = memo(BadgeSection);
|
|
34
|
+
const MemoDataSection = memo(DataSection);
|
|
35
|
+
const MemoOverlaysSection = memo(OverlaysSection);
|
|
36
|
+
const MemoApplicationSection = memo(ApplicationSection);
|
|
25
37
|
function scrollUiExampleSection(id, behavior = 'auto') {
|
|
26
38
|
const node = document.getElementById(id);
|
|
27
39
|
const scrollRoot = document.querySelector('.oui-app-shell-content-scroll .oui-scroll-area-viewport');
|
|
@@ -79,6 +91,7 @@ function UiExampleContent({ activePresetId, onThemePresetChange, onThemeOverride
|
|
|
79
91
|
from: '2026-06-01',
|
|
80
92
|
to: '2026-06-26',
|
|
81
93
|
});
|
|
94
|
+
const openPalette = useCallback(() => setPaletteOpen(true), []);
|
|
82
95
|
useEffect(() => {
|
|
83
96
|
document.documentElement.classList.add('oui-ui-document-lock');
|
|
84
97
|
document.body.classList.add('oui-ui-document-lock');
|
|
@@ -173,7 +186,7 @@ function UiExampleContent({ activePresetId, onThemePresetChange, onThemeOverride
|
|
|
173
186
|
},
|
|
174
187
|
];
|
|
175
188
|
}, [locale, toast]);
|
|
176
|
-
return (_jsxs(AppShell, { sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, header: _jsx(AppShellHeader, {
|
|
189
|
+
return (_jsxs(AppShell, { sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, header: _jsx(AppShellHeader, { sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, navigationVisibility: 'mobile', actions: _jsx(UiExampleHeaderActions, { compact: true, locale: locale, onLocaleChange: onLocaleChange }) }), sidebar: _jsx(UiExampleSidebar, { onNavigate: () => setMobileNavOpen(false) }), children: [_jsxs("div", { className: 'oui-ui-workspace', children: [_jsx("div", { className: 'oui-ui-workspace-main', children: _jsxs(AppShellContent, { children: [_jsx(ExampleThemePlayground, { activePresetId: activePresetId, theme: theme, locale: locale, onPresetChange: onThemePresetChange, onThemeOverridesChange: onThemeOverridesChange }), _jsx(MemoFoundationsSection, { onOpenCode: setCodeExample }), _jsx(MemoTextSection, { onOpenCode: setCodeExample }), _jsx(MemoIconTextSection, { onOpenCode: setCodeExample }), _jsx(MemoLayoutSection, { onOpenCode: setCodeExample }), _jsx(MemoActionsSection, { menuItems: menuItems, onOpenCode: setCodeExample, onOpenPalette: openPalette }), _jsx(MemoFieldsSection, { stepperValue: stepperValue, onStepperValueChange: setStepperValue, dateValue: dateValue, onDateValueChange: setDateValue, dateRange: dateRange, onDateRangeChange: setDateRange, onOpenCode: setCodeExample }), _jsx(MemoSelectionSection, { locale: locale, segment: segment, onSegmentChange: setSegment, selectValue: selectValue, onSelectValueChange: setSelectValue, selectNoChevronValue: selectNoChevronValue, onSelectNoChevronValueChange: setSelectNoChevronValue, selectPlainValue: selectPlainValue, onSelectPlainValueChange: setSelectPlainValue, comboValue: comboValue, onComboValueChange: setComboValue, entityValue: entityValue, onEntityValueChange: setEntityValue, paginatedValue: paginatedValue, onPaginatedValueChange: setPaginatedValue, ownerValues: ownerValues, onOwnerValuesChange: setOwnerValues, radioValue: radioValue, onRadioValueChange: setRadioValue, tabValue: tabValue, onTabValueChange: setTabValue, onOpenCode: setCodeExample, onToast: toast.push }), _jsx(MemoStateCardSection, { onOpenCode: setCodeExample }), _jsx(MemoBadgeSection, { onOpenCode: setCodeExample }), _jsx(MemoDataSection, { onOpenCode: setCodeExample }), _jsx(MemoOverlaysSection, { setModalOpen: setModalOpen, setBlurModalOpen: setBlurModalOpen, setFastModalOpen: setFastModalOpen, setRiseModalOpen: setRiseModalOpen, setSlowModalOpen: setSlowModalOpen, setDangerModalOpen: setDangerModalOpen, onOpenCode: setCodeExample }), _jsx(MemoApplicationSection, { onOpenCode: setCodeExample })] }) }), _jsx(UiExampleThemeRail, { activePresetId: activePresetId, locale: locale, onThemePresetChange: onThemePresetChange })] }), _jsx(CodePreviewModal, { example: codeExample, onClose: () => setCodeExample(null) }), _jsx(ExampleOverlays, { locale: locale, modalOpen: modalOpen, setModalOpen: setModalOpen, nestedOpen: nestedOpen, setNestedOpen: setNestedOpen, blurModalOpen: blurModalOpen, setBlurModalOpen: setBlurModalOpen, blurNestedOpen: blurNestedOpen, setBlurNestedOpen: setBlurNestedOpen, blurFinalOpen: blurFinalOpen, setBlurFinalOpen: setBlurFinalOpen, fastModalOpen: fastModalOpen, setFastModalOpen: setFastModalOpen, slowModalOpen: slowModalOpen, setSlowModalOpen: setSlowModalOpen, riseModalOpen: riseModalOpen, setRiseModalOpen: setRiseModalOpen, dangerModalOpen: dangerModalOpen, setDangerModalOpen: setDangerModalOpen, paletteOpen: paletteOpen, setPaletteOpen: setPaletteOpen, onToast: toast.push })] }));
|
|
177
190
|
}
|
|
178
191
|
function UiExampleThemeRail({ activePresetId, locale, onThemePresetChange, }) {
|
|
179
192
|
const presets = useMemo(() => {
|
|
@@ -287,53 +300,31 @@ function UiExampleSidebar({ onNavigate }) {
|
|
|
287
300
|
items: group.items.map((item) => ({
|
|
288
301
|
key: item.id,
|
|
289
302
|
label: item.label,
|
|
290
|
-
icon: uiExampleNavIcon(item.id),
|
|
291
303
|
active: activeSection === item.id,
|
|
292
304
|
onSelect: () => navigateToSection(item.id),
|
|
293
305
|
})),
|
|
294
306
|
})), [activeSection, navigateToSection]);
|
|
295
|
-
return (_jsx(AppSidebar, { className: 'oui-ui-main-sidebar', header: _jsx(UiExampleBrand, {}), itemH: 34, groups: sidebarNavGroups
|
|
296
|
-
}
|
|
297
|
-
function UiExampleHeaderTitle({ locale }) {
|
|
298
|
-
const title = locale === 'ru'
|
|
299
|
-
? 'Единый язык компонентов для всех модулей.'
|
|
300
|
-
: 'One component language for every module.';
|
|
301
|
-
const subtitle = locale === 'ru'
|
|
302
|
-
? 'Одна тема, предсказуемый интерфейс.'
|
|
303
|
-
: 'One theme, predictable interface.';
|
|
304
|
-
return (_jsxs("div", { className: 'oui-ui-header-title', children: [_jsx("strong", { children: title }), _jsx("span", { children: subtitle })] }));
|
|
305
|
-
}
|
|
306
|
-
function uiExampleNavIcon(id) {
|
|
307
|
-
const size = 16;
|
|
308
|
-
if (id === 'theme')
|
|
309
|
-
return _jsx(LuSettings, { size: size });
|
|
310
|
-
if (id === 'foundations')
|
|
311
|
-
return _jsx(LuLayoutDashboard, { size: size });
|
|
312
|
-
if (id === 'buttons-example')
|
|
313
|
-
return _jsx(LuMousePointerClick, { size: size });
|
|
314
|
-
if (id === 'text-fields-example')
|
|
315
|
-
return _jsx(LuFileText, { size: size });
|
|
316
|
-
if (id === 'selects-example')
|
|
317
|
-
return _jsx(LuCheck, { size: size });
|
|
318
|
-
if (id === 'data-table-example')
|
|
319
|
-
return _jsx(LuClipboardList, { size: size });
|
|
320
|
-
if (id === 'toast-example')
|
|
321
|
-
return _jsx(LuBell, { size: size });
|
|
322
|
-
if (id === 'app-shell-example')
|
|
323
|
-
return _jsx(LuPanelTop, { size: size });
|
|
324
|
-
if (id === 'app-sidebar-example')
|
|
325
|
-
return _jsx(LuLayoutDashboard, { size: size });
|
|
326
|
-
if (id === 'special-modal-example')
|
|
327
|
-
return _jsx(LuBox, { size: size });
|
|
328
|
-
if (id === 'date-range-example')
|
|
329
|
-
return _jsx(LuCalendar, { size: size });
|
|
330
|
-
return null;
|
|
307
|
+
return (_jsx(AppSidebar, { className: 'oui-ui-main-sidebar', header: _jsx(UiExampleBrand, {}), itemH: 34, groups: sidebarNavGroups }));
|
|
331
308
|
}
|
|
332
309
|
function UiExampleBrand({ compact = false }) {
|
|
333
310
|
return (_jsxs("div", { className: 'oui-ui-brand', "data-compact": compact ? 'true' : undefined, children: [_jsx("span", { className: 'oui-ui-brand-mark', "aria-hidden": 'true', children: _jsx("img", { className: 'oui-ui-brand-logo', src: ORCESTR_LOGO_SRC, alt: '' }) }), _jsx("span", { className: 'oui-ui-brand-text', children: _jsx("strong", { children: "Orcestr UI" }) })] }));
|
|
334
311
|
}
|
|
335
312
|
function UiExampleHeaderActions({ compact = false, locale, onLocaleChange, }) {
|
|
336
|
-
|
|
313
|
+
const languageItems = useMemo(() => [
|
|
314
|
+
{
|
|
315
|
+
key: 'ru',
|
|
316
|
+
label: 'RU',
|
|
317
|
+
icon: locale === 'ru' ? _jsx(LuCheck, { size: 14 }) : undefined,
|
|
318
|
+
onSelect: () => onLocaleChange('ru'),
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
key: 'en',
|
|
322
|
+
label: 'EN',
|
|
323
|
+
icon: locale === 'en' ? _jsx(LuCheck, { size: 14 }) : undefined,
|
|
324
|
+
onSelect: () => onLocaleChange('en'),
|
|
325
|
+
},
|
|
326
|
+
], [locale, onLocaleChange]);
|
|
327
|
+
return (_jsxs("div", { className: 'oui-ui-header-actions', "data-compact": compact ? 'true' : undefined, children: [_jsx(Menu, { items: languageItems, trigger: _jsx(IconButton, { className: 'oui-ui-language-button', size: 2, v: 'pad', icon: _jsx(LuLanguages, { size: 16 }), "aria-label": `Language: ${locale.toUpperCase()}` }) }), _jsxs("a", { className: 'oui-ui-header-link', href: 'https://github.com/Artasov/orcestr', target: '_blank', rel: 'noreferrer', children: [_jsx(LuExternalLink, { size: 14, "aria-hidden": true }), _jsx("span", { children: "GitHub" })] })] }));
|
|
337
328
|
}
|
|
338
329
|
export function UiExamplePage({ locale: controlledLocale, defaultLocale = 'ru', onLocaleChange, } = {}) {
|
|
339
330
|
const firstPreset = getThemePlaygroundPreset('orcestr-dark');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeSamples.d.ts","sourceRoot":"","sources":["../../src/example/codeSamples.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"codeSamples.d.ts","sourceRoot":"","sources":["../../src/example/codeSamples.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAq6Cc,CAAC"}
|