@orcestr/ui 0.0.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/README.md +151 -0
- package/README.ru.md +151 -0
- package/assets/orcestr-banner.webp +0 -0
- package/dist/components/Action/ActionConfirmModal.d.ts +8 -0
- package/dist/components/Action/ActionConfirmModal.d.ts.map +1 -0
- package/dist/components/Action/ActionConfirmModal.js +13 -0
- package/dist/components/Action/ActionTypes.d.ts +47 -0
- package/dist/components/Action/ActionTypes.d.ts.map +1 -0
- package/dist/components/Action/ActionTypes.js +49 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +3 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/dist/components/ActionMenu/ActionMenu.js +1 -0
- package/dist/components/Alert/Alert.d.ts +11 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/Alert.js +7 -0
- package/dist/components/AppShell/AppShell.d.ts +102 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell/AppShell.js +96 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +8 -0
- package/dist/components/Box/Box.d.ts +11 -0
- package/dist/components/Box/Box.d.ts.map +1 -0
- package/dist/components/Box/Box.js +8 -0
- package/dist/components/Button/Button.d.ts +27 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +13 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +15 -0
- package/dist/components/Collapse/Collapse.d.ts +11 -0
- package/dist/components/Collapse/Collapse.d.ts.map +1 -0
- package/dist/components/Collapse/Collapse.js +33 -0
- package/dist/components/Combobox/Combobox.d.ts +17 -0
- package/dist/components/Combobox/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.js +32 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +21 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPalette.js +168 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +25 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +25 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.js +68 -0
- package/dist/components/DataTable/DataTable.d.ts +88 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +415 -0
- package/dist/components/DataTable/DataTableStateAdapters.d.ts +41 -0
- package/dist/components/DataTable/DataTableStateAdapters.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableStateAdapters.js +192 -0
- package/dist/components/DatePicker/DatePicker.d.ts +21 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +39 -0
- package/dist/components/DatePicker/DatePickerState.d.ts +30 -0
- package/dist/components/DatePicker/DatePickerState.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePickerState.js +106 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +19 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +6 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts +10 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts.map +1 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.js +26 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts +4 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts.map +1 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.js +20 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +1 -0
- package/dist/components/Drawer/Drawer.d.ts +30 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +83 -0
- package/dist/components/EntityPicker/EntityPicker.d.ts +41 -0
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -0
- package/dist/components/EntityPicker/EntityPicker.js +17 -0
- package/dist/components/Field/Field.d.ts +12 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/Field.js +8 -0
- package/dist/components/Flex/Flex.d.ts +9 -0
- package/dist/components/Flex/Flex.d.ts.map +1 -0
- package/dist/components/Flex/Flex.js +8 -0
- package/dist/components/Grid/Grid.d.ts +11 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/Grid.js +12 -0
- package/dist/components/Highlight/Highlight.d.ts +27 -0
- package/dist/components/Highlight/Highlight.d.ts.map +1 -0
- package/dist/components/Highlight/Highlight.js +26 -0
- package/dist/components/IconButton/IconButton.d.ts +25 -0
- package/dist/components/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.js +13 -0
- package/dist/components/IconText/IconText.d.ts +12 -0
- package/dist/components/IconText/IconText.d.ts.map +1 -0
- package/dist/components/IconText/IconText.js +7 -0
- package/dist/components/Listbox/Listbox.d.ts +13 -0
- package/dist/components/Listbox/Listbox.d.ts.map +1 -0
- package/dist/components/Listbox/Listbox.js +74 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/Menu.js +168 -0
- package/dist/components/Modal/Modal.d.ts +29 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +155 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +21 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/components/MultiSelect/MultiSelect.js +139 -0
- package/dist/components/NumberField/NumberField.d.ts +4 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -0
- package/dist/components/NumberField/NumberField.js +6 -0
- package/dist/components/Overlay/OverlayProvider.d.ts +19 -0
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -0
- package/dist/components/Overlay/OverlayProvider.js +73 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +48 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +223 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts +13 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts.map +1 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.js +10 -0
- package/dist/components/Pagination/Pagination.d.ts +7 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +9 -0
- package/dist/components/Popover/Popover.d.ts +19 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +83 -0
- package/dist/components/Portal/Portal.d.ts +6 -0
- package/dist/components/Portal/Portal.d.ts.map +1 -0
- package/dist/components/Portal/Portal.js +23 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +14 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.js +6 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +36 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.js +124 -0
- package/dist/components/Section/Section.d.ts +14 -0
- package/dist/components/Section/Section.d.ts.map +1 -0
- package/dist/components/Section/Section.js +20 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -0
- package/dist/components/Select/Select.d.ts +27 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/Select.js +142 -0
- package/dist/components/Separator/Separator.d.ts +6 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Separator/Separator.js +5 -0
- package/dist/components/Skeleton/Skeleton.d.ts +9 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +8 -0
- package/dist/components/Spinner/Spinner.d.ts +7 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +5 -0
- package/dist/components/Stack/Stack.d.ts +9 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/Stack.js +7 -0
- package/dist/components/State/State.d.ts +23 -0
- package/dist/components/State/State.d.ts.map +1 -0
- package/dist/components/State/State.js +30 -0
- package/dist/components/State/stateIcon.d.ts +3 -0
- package/dist/components/State/stateIcon.d.ts.map +1 -0
- package/dist/components/State/stateIcon.js +11 -0
- package/dist/components/StepperInput/StepperInput.d.ts +13 -0
- package/dist/components/StepperInput/StepperInput.d.ts.map +1 -0
- package/dist/components/StepperInput/StepperInput.js +22 -0
- package/dist/components/Switch/Switch.d.ts +10 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +14 -0
- package/dist/components/Tabs/Tabs.d.ts +18 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +104 -0
- package/dist/components/Text/Text.d.ts +13 -0
- package/dist/components/Text/Text.d.ts.map +1 -0
- package/dist/components/Text/Text.js +8 -0
- package/dist/components/TextArea/TextArea.d.ts +15 -0
- package/dist/components/TextArea/TextArea.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.js +17 -0
- package/dist/components/TextField/TextField.d.ts +25 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/TextField.js +31 -0
- package/dist/components/Toast/Toast.d.ts +43 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +205 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -0
- package/dist/components/Workflow/Workflow.d.ts +82 -0
- package/dist/components/Workflow/Workflow.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.js +73 -0
- package/dist/example/CodePreview.d.ts +25 -0
- package/dist/example/CodePreview.d.ts.map +1 -0
- package/dist/example/CodePreview.js +93 -0
- package/dist/example/ExampleActionsSection.d.ts +10 -0
- package/dist/example/ExampleActionsSection.d.ts.map +1 -0
- package/dist/example/ExampleActionsSection.js +10 -0
- package/dist/example/ExampleBasicsSections.d.ts +8 -0
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -0
- package/dist/example/ExampleBasicsSections.js +43 -0
- package/dist/example/ExampleDataSection.d.ts +7 -0
- package/dist/example/ExampleDataSection.d.ts.map +1 -0
- package/dist/example/ExampleDataSection.js +124 -0
- package/dist/example/ExampleFieldsSection.d.ts +17 -0
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -0
- package/dist/example/ExampleFieldsSection.js +10 -0
- package/dist/example/ExampleFoundationsSection.d.ts +5 -0
- package/dist/example/ExampleFoundationsSection.d.ts.map +1 -0
- package/dist/example/ExampleFoundationsSection.js +25 -0
- package/dist/example/ExampleOverlays.d.ts +30 -0
- package/dist/example/ExampleOverlays.d.ts.map +1 -0
- package/dist/example/ExampleOverlays.js +12 -0
- package/dist/example/ExampleOverlaysSection.d.ts +14 -0
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -0
- package/dist/example/ExampleOverlaysSection.js +126 -0
- package/dist/example/ExampleSelectionSection.d.ts +30 -0
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -0
- package/dist/example/ExampleSelectionSection.js +66 -0
- package/dist/example/ExampleStateSection.d.ts +8 -0
- package/dist/example/ExampleStateSection.d.ts.map +1 -0
- package/dist/example/ExampleStateSection.js +76 -0
- package/dist/example/ExampleThemePlayground.d.ts +417 -0
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -0
- package/dist/example/ExampleThemePlayground.js +596 -0
- package/dist/example/UiExamplePage.d.ts +2 -0
- package/dist/example/UiExamplePage.d.ts.map +1 -0
- package/dist/example/UiExamplePage.js +315 -0
- package/dist/example/UiExampleSection.d.ts +8 -0
- package/dist/example/UiExampleSection.d.ts.map +1 -0
- package/dist/example/UiExampleSection.js +5 -0
- package/dist/example/codeSamples.d.ts +30 -0
- package/dist/example/codeSamples.d.ts.map +1 -0
- package/dist/example/codeSamples.js +976 -0
- package/dist/example/exampleData.d.ts +33 -0
- package/dist/example/exampleData.d.ts.map +1 -0
- package/dist/example/exampleData.js +217 -0
- package/dist/example/styles.css +1106 -0
- package/dist/hooks/useControllableState.d.ts +6 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +16 -0
- package/dist/hooks/useDisclosure.d.ts +12 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.js +14 -0
- package/dist/hooks/useEscapeKey.d.ts +2 -0
- package/dist/hooks/useEscapeKey.d.ts.map +1 -0
- package/dist/hooks/useEscapeKey.js +15 -0
- package/dist/hooks/useFloatingLayer.d.ts +19 -0
- package/dist/hooks/useFloatingLayer.d.ts.map +1 -0
- package/dist/hooks/useFloatingLayer.js +26 -0
- package/dist/hooks/useFloatingPosition.d.ts +17 -0
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -0
- package/dist/hooks/useFloatingPosition.js +132 -0
- package/dist/hooks/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.js +54 -0
- package/dist/hooks/useListNavigation.d.ts +17 -0
- package/dist/hooks/useListNavigation.d.ts.map +1 -0
- package/dist/hooks/useListNavigation.js +44 -0
- package/dist/hooks/useOutsidePointerDown.d.ts +3 -0
- package/dist/hooks/useOutsidePointerDown.d.ts.map +1 -0
- package/dist/hooks/useOutsidePointerDown.js +20 -0
- package/dist/hooks/usePresence.d.ts +5 -0
- package/dist/hooks/usePresence.d.ts.map +1 -0
- package/dist/hooks/usePresence.js +35 -0
- package/dist/hooks/useTypeahead.d.ts +2 -0
- package/dist/hooks/useTypeahead.d.ts.map +1 -0
- package/dist/hooks/useTypeahead.js +23 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/locale/LocaleProvider.d.ts +89 -0
- package/dist/locale/LocaleProvider.d.ts.map +1 -0
- package/dist/locale/LocaleProvider.js +174 -0
- package/dist/provider/OrcestrUiProvider.d.ts +28 -0
- package/dist/provider/OrcestrUiProvider.d.ts.map +1 -0
- package/dist/provider/OrcestrUiProvider.js +9 -0
- package/dist/react-query.d.ts +2 -0
- package/dist/react-query.d.ts.map +1 -0
- package/dist/react-query.js +1 -0
- package/dist/styles/orcestr-ui.css +4676 -0
- package/dist/theme/ThemeProvider.d.ts +3 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +280 -0
- package/dist/theme/defaultTheme.d.ts +12 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +516 -0
- package/dist/theme/systemProps.d.ts +53 -0
- package/dist/theme/systemProps.d.ts.map +1 -0
- package/dist/theme/systemProps.js +240 -0
- package/dist/theme/themeTypes.d.ts +197 -0
- package/dist/theme/themeTypes.d.ts.map +1 -0
- package/dist/theme/themeTypes.js +1 -0
- package/dist/theme/useTheme.d.ts +4 -0
- package/dist/theme/useTheme.d.ts.map +1 -0
- package/dist/theme/useTheme.js +10 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +3 -0
- package/dist/utils/composeRefs.d.ts +3 -0
- package/dist/utils/composeRefs.d.ts.map +1 -0
- package/dist/utils/composeRefs.js +14 -0
- package/dist/utils/mergeProps.d.ts +4 -0
- package/dist/utils/mergeProps.d.ts.map +1 -0
- package/dist/utils/mergeProps.js +26 -0
- package/dist/utils/ownerDocument.d.ts +2 -0
- package/dist/utils/ownerDocument.d.ts.map +1 -0
- package/dist/utils/ownerDocument.js +3 -0
- package/dist/utils/polymorphic.d.ts +6 -0
- package/dist/utils/polymorphic.d.ts.map +1 -0
- package/dist/utils/polymorphic.js +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
const systemKeys = new Set([
|
|
2
|
+
'm',
|
|
3
|
+
'mt',
|
|
4
|
+
'mr',
|
|
5
|
+
'mb',
|
|
6
|
+
'ml',
|
|
7
|
+
'mx',
|
|
8
|
+
'my',
|
|
9
|
+
'p',
|
|
10
|
+
'pt',
|
|
11
|
+
'pr',
|
|
12
|
+
'pb',
|
|
13
|
+
'pl',
|
|
14
|
+
'px',
|
|
15
|
+
'py',
|
|
16
|
+
'g',
|
|
17
|
+
'w',
|
|
18
|
+
'minW',
|
|
19
|
+
'maxW',
|
|
20
|
+
'size',
|
|
21
|
+
'h',
|
|
22
|
+
'minH',
|
|
23
|
+
'maxH',
|
|
24
|
+
'display',
|
|
25
|
+
'position',
|
|
26
|
+
'overflow',
|
|
27
|
+
'flex',
|
|
28
|
+
'a',
|
|
29
|
+
'j',
|
|
30
|
+
'row',
|
|
31
|
+
'col',
|
|
32
|
+
'wrap',
|
|
33
|
+
'nowrap',
|
|
34
|
+
'inline',
|
|
35
|
+
'fs',
|
|
36
|
+
'fw',
|
|
37
|
+
'lh',
|
|
38
|
+
'ta',
|
|
39
|
+
'color',
|
|
40
|
+
'r',
|
|
41
|
+
'truncate',
|
|
42
|
+
]);
|
|
43
|
+
const spacing = ['0', '4px', '8px', '12px', '16px', '20px', '24px', '32px', '40px'];
|
|
44
|
+
const radiusScale = ['0', '2px', '4px', '6px', '8px', '10px', '12px', '999px'];
|
|
45
|
+
function sizeValue(value) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (typeof value === 'number')
|
|
49
|
+
return spacing[value] ?? `${value}px`;
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
function radiusValue(value) {
|
|
53
|
+
if (value === undefined)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (typeof value === 'number')
|
|
56
|
+
return radiusScale[value] ?? `${value}px`;
|
|
57
|
+
const normalized = value.trim();
|
|
58
|
+
if (/^[0-7]$/.test(normalized))
|
|
59
|
+
return radiusScale[Number(normalized)];
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
function alignValue(value) {
|
|
63
|
+
switch (value) {
|
|
64
|
+
case 's':
|
|
65
|
+
return 'flex-start';
|
|
66
|
+
case 'c':
|
|
67
|
+
return 'center';
|
|
68
|
+
case 'e':
|
|
69
|
+
return 'flex-end';
|
|
70
|
+
case 'st':
|
|
71
|
+
return 'stretch';
|
|
72
|
+
case 'b':
|
|
73
|
+
return 'baseline';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function justifyValue(value) {
|
|
77
|
+
switch (value) {
|
|
78
|
+
case 's':
|
|
79
|
+
return 'flex-start';
|
|
80
|
+
case 'c':
|
|
81
|
+
return 'center';
|
|
82
|
+
case 'e':
|
|
83
|
+
return 'flex-end';
|
|
84
|
+
case 'sb':
|
|
85
|
+
return 'space-between';
|
|
86
|
+
case 'sa':
|
|
87
|
+
return 'space-around';
|
|
88
|
+
case 'se':
|
|
89
|
+
return 'space-evenly';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export function splitSystemProps(props) {
|
|
93
|
+
const systemStyle = {};
|
|
94
|
+
const restProps = {};
|
|
95
|
+
for (const [key, value] of Object.entries(props)) {
|
|
96
|
+
if (!systemKeys.has(key)) {
|
|
97
|
+
restProps[key] = value;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (value === undefined || value === null)
|
|
101
|
+
continue;
|
|
102
|
+
switch (key) {
|
|
103
|
+
case 'm':
|
|
104
|
+
systemStyle.margin = sizeValue(value);
|
|
105
|
+
break;
|
|
106
|
+
case 'mt':
|
|
107
|
+
systemStyle.marginTop = sizeValue(value);
|
|
108
|
+
break;
|
|
109
|
+
case 'mr':
|
|
110
|
+
systemStyle.marginRight = sizeValue(value);
|
|
111
|
+
break;
|
|
112
|
+
case 'mb':
|
|
113
|
+
systemStyle.marginBottom = sizeValue(value);
|
|
114
|
+
break;
|
|
115
|
+
case 'ml':
|
|
116
|
+
systemStyle.marginLeft = sizeValue(value);
|
|
117
|
+
break;
|
|
118
|
+
case 'mx':
|
|
119
|
+
systemStyle.marginInline = sizeValue(value);
|
|
120
|
+
break;
|
|
121
|
+
case 'my':
|
|
122
|
+
systemStyle.marginBlock = sizeValue(value);
|
|
123
|
+
break;
|
|
124
|
+
case 'p':
|
|
125
|
+
systemStyle.padding = sizeValue(value);
|
|
126
|
+
break;
|
|
127
|
+
case 'pt':
|
|
128
|
+
systemStyle.paddingTop = sizeValue(value);
|
|
129
|
+
break;
|
|
130
|
+
case 'pr':
|
|
131
|
+
systemStyle.paddingRight = sizeValue(value);
|
|
132
|
+
break;
|
|
133
|
+
case 'pb':
|
|
134
|
+
systemStyle.paddingBottom = sizeValue(value);
|
|
135
|
+
break;
|
|
136
|
+
case 'pl':
|
|
137
|
+
systemStyle.paddingLeft = sizeValue(value);
|
|
138
|
+
break;
|
|
139
|
+
case 'px':
|
|
140
|
+
systemStyle.paddingInline = sizeValue(value);
|
|
141
|
+
break;
|
|
142
|
+
case 'py':
|
|
143
|
+
systemStyle.paddingBlock = sizeValue(value);
|
|
144
|
+
break;
|
|
145
|
+
case 'g':
|
|
146
|
+
systemStyle.gap = sizeValue(value);
|
|
147
|
+
break;
|
|
148
|
+
case 'w':
|
|
149
|
+
systemStyle.width = sizeValue(value);
|
|
150
|
+
break;
|
|
151
|
+
case 'minW':
|
|
152
|
+
systemStyle.minWidth = sizeValue(value);
|
|
153
|
+
break;
|
|
154
|
+
case 'maxW':
|
|
155
|
+
systemStyle.maxWidth = sizeValue(value);
|
|
156
|
+
break;
|
|
157
|
+
case 'size': {
|
|
158
|
+
const resolvedSize = sizeValue(value);
|
|
159
|
+
systemStyle.width = resolvedSize;
|
|
160
|
+
systemStyle.height = resolvedSize;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case 'h':
|
|
164
|
+
systemStyle.height = sizeValue(value);
|
|
165
|
+
break;
|
|
166
|
+
case 'minH':
|
|
167
|
+
systemStyle.minHeight = sizeValue(value);
|
|
168
|
+
break;
|
|
169
|
+
case 'maxH':
|
|
170
|
+
systemStyle.maxHeight = sizeValue(value);
|
|
171
|
+
break;
|
|
172
|
+
case 'display':
|
|
173
|
+
systemStyle.display = value;
|
|
174
|
+
break;
|
|
175
|
+
case 'position':
|
|
176
|
+
systemStyle.position = value;
|
|
177
|
+
break;
|
|
178
|
+
case 'overflow':
|
|
179
|
+
systemStyle.overflow = value;
|
|
180
|
+
break;
|
|
181
|
+
case 'flex':
|
|
182
|
+
systemStyle.flex = value;
|
|
183
|
+
break;
|
|
184
|
+
case 'a':
|
|
185
|
+
systemStyle.alignItems = alignValue(value);
|
|
186
|
+
break;
|
|
187
|
+
case 'j':
|
|
188
|
+
systemStyle.justifyContent = justifyValue(value);
|
|
189
|
+
break;
|
|
190
|
+
case 'row':
|
|
191
|
+
if (value)
|
|
192
|
+
systemStyle.flexDirection = 'row';
|
|
193
|
+
break;
|
|
194
|
+
case 'col':
|
|
195
|
+
if (value)
|
|
196
|
+
systemStyle.flexDirection = 'column';
|
|
197
|
+
break;
|
|
198
|
+
case 'wrap':
|
|
199
|
+
if (value)
|
|
200
|
+
systemStyle.flexWrap = 'wrap';
|
|
201
|
+
break;
|
|
202
|
+
case 'nowrap':
|
|
203
|
+
if (value)
|
|
204
|
+
systemStyle.flexWrap = 'nowrap';
|
|
205
|
+
break;
|
|
206
|
+
case 'inline':
|
|
207
|
+
if (value)
|
|
208
|
+
systemStyle.display = 'inline-flex';
|
|
209
|
+
break;
|
|
210
|
+
case 'fs':
|
|
211
|
+
systemStyle.fontSize = sizeValue(value);
|
|
212
|
+
break;
|
|
213
|
+
case 'fw':
|
|
214
|
+
systemStyle.fontWeight = value;
|
|
215
|
+
break;
|
|
216
|
+
case 'lh':
|
|
217
|
+
systemStyle.lineHeight = value;
|
|
218
|
+
break;
|
|
219
|
+
case 'ta':
|
|
220
|
+
systemStyle.textAlign = value;
|
|
221
|
+
break;
|
|
222
|
+
case 'color':
|
|
223
|
+
systemStyle.color = value;
|
|
224
|
+
break;
|
|
225
|
+
case 'r':
|
|
226
|
+
systemStyle.borderRadius = radiusValue(value);
|
|
227
|
+
break;
|
|
228
|
+
case 'truncate':
|
|
229
|
+
if (value) {
|
|
230
|
+
systemStyle.overflow = 'hidden';
|
|
231
|
+
systemStyle.textOverflow = 'ellipsis';
|
|
232
|
+
systemStyle.whiteSpace = 'nowrap';
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
default:
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return { systemStyle, restProps: restProps };
|
|
240
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type OrcestrThemeMode = 'dark' | 'light';
|
|
3
|
+
export type OrcestrThemeSurface = 'orcestr' | 'operations' | 'media' | 'catalog';
|
|
4
|
+
export type ButtonPressAnimation = 'translate' | 'scale' | 'soft' | 'none';
|
|
5
|
+
export type ModalAnimation = 'zoom-blur' | 'rise' | 'fade';
|
|
6
|
+
export type OrcestrTheme = {
|
|
7
|
+
mode: OrcestrThemeMode;
|
|
8
|
+
surface: OrcestrThemeSurface;
|
|
9
|
+
colors: {
|
|
10
|
+
bg: string;
|
|
11
|
+
panel: string;
|
|
12
|
+
panelSoft: string;
|
|
13
|
+
control: string;
|
|
14
|
+
controlHover: string;
|
|
15
|
+
text: string;
|
|
16
|
+
muted: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderStrong: string;
|
|
19
|
+
brand: string;
|
|
20
|
+
brandStrong: string;
|
|
21
|
+
brandSolid: string;
|
|
22
|
+
brandSolidHover: string;
|
|
23
|
+
brandSoft: string;
|
|
24
|
+
brandText: string;
|
|
25
|
+
danger: string;
|
|
26
|
+
dangerSoft: string;
|
|
27
|
+
success: string;
|
|
28
|
+
successSoft: string;
|
|
29
|
+
warning: string;
|
|
30
|
+
warningSoft: string;
|
|
31
|
+
info: string;
|
|
32
|
+
infoSoft: string;
|
|
33
|
+
selected: string;
|
|
34
|
+
focusRing: string;
|
|
35
|
+
disabled: string;
|
|
36
|
+
overlay: string;
|
|
37
|
+
floating: string;
|
|
38
|
+
section: string;
|
|
39
|
+
sectionNested: string;
|
|
40
|
+
pad: string;
|
|
41
|
+
padHover: string;
|
|
42
|
+
skeletonShimmer: string;
|
|
43
|
+
};
|
|
44
|
+
radii: {
|
|
45
|
+
sm: string;
|
|
46
|
+
md: string;
|
|
47
|
+
lg: string;
|
|
48
|
+
xl: string;
|
|
49
|
+
full: string;
|
|
50
|
+
};
|
|
51
|
+
spacing: {
|
|
52
|
+
px: string;
|
|
53
|
+
xs: string;
|
|
54
|
+
sm: string;
|
|
55
|
+
md: string;
|
|
56
|
+
lg: string;
|
|
57
|
+
xl: string;
|
|
58
|
+
xxl: string;
|
|
59
|
+
section: string;
|
|
60
|
+
page: string;
|
|
61
|
+
};
|
|
62
|
+
breakpoints: {
|
|
63
|
+
compact: string;
|
|
64
|
+
tablet: string;
|
|
65
|
+
desktop: string;
|
|
66
|
+
wide: string;
|
|
67
|
+
};
|
|
68
|
+
shadows: {
|
|
69
|
+
sm: string;
|
|
70
|
+
md: string;
|
|
71
|
+
overlay: string;
|
|
72
|
+
section: string;
|
|
73
|
+
focus: string;
|
|
74
|
+
};
|
|
75
|
+
typography: {
|
|
76
|
+
fontFamily: string;
|
|
77
|
+
monoFontFamily: string;
|
|
78
|
+
titleSize: string;
|
|
79
|
+
headingSize: string;
|
|
80
|
+
bodySize: string;
|
|
81
|
+
compactSize: string;
|
|
82
|
+
labelSize: string;
|
|
83
|
+
lineHeight: string;
|
|
84
|
+
headingLineHeight: string;
|
|
85
|
+
weightRegular: number;
|
|
86
|
+
weightMedium: number;
|
|
87
|
+
weightBold: number;
|
|
88
|
+
letterSpacing: string;
|
|
89
|
+
};
|
|
90
|
+
status: {
|
|
91
|
+
neutral: OrcestrThemeStatus;
|
|
92
|
+
brand: OrcestrThemeStatus;
|
|
93
|
+
success: OrcestrThemeStatus;
|
|
94
|
+
warning: OrcestrThemeStatus;
|
|
95
|
+
danger: OrcestrThemeStatus;
|
|
96
|
+
info: OrcestrThemeStatus;
|
|
97
|
+
};
|
|
98
|
+
motion: {
|
|
99
|
+
fast: string;
|
|
100
|
+
normal: string;
|
|
101
|
+
slow: string;
|
|
102
|
+
modalDuration: string;
|
|
103
|
+
modalAnimation: ModalAnimation;
|
|
104
|
+
modalOverlayColor: string;
|
|
105
|
+
modalOverlayOpacity: number;
|
|
106
|
+
modalOverlayBlur: number | string;
|
|
107
|
+
ease: string;
|
|
108
|
+
pressAnimation: ButtonPressAnimation;
|
|
109
|
+
};
|
|
110
|
+
toast: {
|
|
111
|
+
background: string;
|
|
112
|
+
blur: number | string | false;
|
|
113
|
+
borderColor: string;
|
|
114
|
+
shadow: string;
|
|
115
|
+
animationDuration: string;
|
|
116
|
+
exitDuration: string;
|
|
117
|
+
progressHeight: string;
|
|
118
|
+
};
|
|
119
|
+
states: {
|
|
120
|
+
hoverOpacity: number;
|
|
121
|
+
activeOpacity: number;
|
|
122
|
+
disabledOpacity: number;
|
|
123
|
+
loadingOpacity: number;
|
|
124
|
+
selectedOpacity: number;
|
|
125
|
+
focusRingWidth: string;
|
|
126
|
+
};
|
|
127
|
+
density: {
|
|
128
|
+
compactControl: string;
|
|
129
|
+
regularControl: string;
|
|
130
|
+
spaciousControl: string;
|
|
131
|
+
pagePadding: string;
|
|
132
|
+
sectionGap: string;
|
|
133
|
+
};
|
|
134
|
+
zIndex: {
|
|
135
|
+
sticky: number;
|
|
136
|
+
dropdown: number;
|
|
137
|
+
overlay: number;
|
|
138
|
+
modal: number;
|
|
139
|
+
toast: number;
|
|
140
|
+
};
|
|
141
|
+
components: {
|
|
142
|
+
buttonRadius: string;
|
|
143
|
+
buttonFontWeight: number;
|
|
144
|
+
tableCellPaddingY: string;
|
|
145
|
+
tableHeaderHeight: string;
|
|
146
|
+
fieldGap: string;
|
|
147
|
+
modalMaxWidth: string;
|
|
148
|
+
pipelineStepMinWidth: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export type OrcestrThemeOverrides = Partial<Omit<OrcestrTheme, 'colors' | 'mode' | 'surface' | 'motion' | 'radii' | 'spacing' | 'breakpoints' | 'shadows' | 'density' | 'zIndex' | 'toast' | 'typography' | 'status' | 'states' | 'components'>> & {
|
|
152
|
+
colors?: Partial<OrcestrTheme['colors']>;
|
|
153
|
+
radii?: Partial<OrcestrTheme['radii']>;
|
|
154
|
+
spacing?: Partial<OrcestrTheme['spacing']>;
|
|
155
|
+
breakpoints?: Partial<OrcestrTheme['breakpoints']>;
|
|
156
|
+
shadows?: Partial<OrcestrTheme['shadows']>;
|
|
157
|
+
typography?: Partial<OrcestrTheme['typography']>;
|
|
158
|
+
status?: PartialStatusOverrides;
|
|
159
|
+
motion?: Partial<OrcestrTheme['motion']>;
|
|
160
|
+
density?: Partial<OrcestrTheme['density']>;
|
|
161
|
+
zIndex?: Partial<OrcestrTheme['zIndex']>;
|
|
162
|
+
toast?: Partial<OrcestrTheme['toast']>;
|
|
163
|
+
states?: Partial<OrcestrTheme['states']>;
|
|
164
|
+
components?: Partial<OrcestrTheme['components']>;
|
|
165
|
+
};
|
|
166
|
+
export type OrcestrThemeStatus = {
|
|
167
|
+
color: string;
|
|
168
|
+
text: string;
|
|
169
|
+
soft: string;
|
|
170
|
+
border: string;
|
|
171
|
+
};
|
|
172
|
+
type PartialStatusOverrides = Partial<{
|
|
173
|
+
[K in keyof OrcestrTheme['status']]: Partial<OrcestrThemeStatus>;
|
|
174
|
+
}>;
|
|
175
|
+
export type OrcestrThemeContextValue = {
|
|
176
|
+
mode: OrcestrThemeMode;
|
|
177
|
+
surface: OrcestrThemeSurface;
|
|
178
|
+
theme: OrcestrTheme;
|
|
179
|
+
setMode: (mode: OrcestrThemeMode) => void;
|
|
180
|
+
setSurface: (surface: OrcestrThemeSurface) => void;
|
|
181
|
+
toggleMode: () => void;
|
|
182
|
+
};
|
|
183
|
+
export type OrcestrThemeProviderProps = {
|
|
184
|
+
children: ReactNode;
|
|
185
|
+
mode?: OrcestrThemeMode;
|
|
186
|
+
defaultMode?: OrcestrThemeMode;
|
|
187
|
+
defaultSurface?: OrcestrThemeSurface;
|
|
188
|
+
surface?: OrcestrThemeSurface;
|
|
189
|
+
onModeChange?: (mode: OrcestrThemeMode) => void;
|
|
190
|
+
onSurfaceChange?: (surface: OrcestrThemeSurface) => void;
|
|
191
|
+
themeOverrides?: OrcestrThemeOverrides;
|
|
192
|
+
className?: string;
|
|
193
|
+
style?: CSSProperties;
|
|
194
|
+
testId?: string;
|
|
195
|
+
};
|
|
196
|
+
export {};
|
|
197
|
+
//# sourceMappingURL=themeTypes.d.ts.map
|
|
@@ -0,0 +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,MA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C/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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OrcestrThemeContextValue } from './themeTypes';
|
|
2
|
+
export declare const OrcestrThemeContext: import("react").Context<OrcestrThemeContextValue | null>;
|
|
3
|
+
export declare function useOrcestrTheme(): OrcestrThemeContextValue;
|
|
4
|
+
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,cAAc,CAAC;AAE3D,eAAO,MAAM,mBAAmB,0DAE/B,CAAC;AAEF,wBAAgB,eAAe,IAAI,wBAAwB,CAM1D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
export const OrcestrThemeContext = createContext(null);
|
|
4
|
+
export function useOrcestrTheme() {
|
|
5
|
+
const context = useContext(OrcestrThemeContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error('useOrcestrTheme must be used within OrcestrUiProvider');
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,wBAAgB,EAAE,CACd,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,GACpD,MAAM,CAER"}
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composeRefs.d.ts","sourceRoot":"","sources":["../../src/utils/composeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,IACrD,MAAM,CAAC,GAAG,IAAI,UAUzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeProps.d.ts","sourceRoot":"","sources":["../../src/utils/mergeProps.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMxC,wBAAgB,UAAU,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAC7D,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,GACV,CAAC,GAAG,CAAC,CAoBP"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function isHandler(key, value) {
|
|
2
|
+
return /^on[A-Z]/.test(key) && typeof value === 'function';
|
|
3
|
+
}
|
|
4
|
+
export function mergeProps(first, second) {
|
|
5
|
+
const result = { ...first, ...second };
|
|
6
|
+
for (const key of Object.keys(first)) {
|
|
7
|
+
const firstValue = first[key];
|
|
8
|
+
const secondValue = second[key];
|
|
9
|
+
if (key === 'className') {
|
|
10
|
+
result[key] = [firstValue, secondValue].filter(Boolean).join(' ');
|
|
11
|
+
}
|
|
12
|
+
else if (key === 'style') {
|
|
13
|
+
result[key] = {
|
|
14
|
+
...firstValue,
|
|
15
|
+
...secondValue,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
else if (isHandler(key, firstValue) && isHandler(key, secondValue)) {
|
|
19
|
+
result[key] = (...args) => {
|
|
20
|
+
firstValue(...args);
|
|
21
|
+
secondValue(...args);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownerDocument.d.ts","sourceRoot":"","sources":["../../src/utils/ownerDocument.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,CAE1D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
export type PolymorphicProps<T extends ElementType, P = object> = P & Omit<ComponentPropsWithoutRef<T>, keyof P | 'as'> & {
|
|
3
|
+
as?: T;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=polymorphic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorphic.d.ts","sourceRoot":"","sources":["../../src/utils/polymorphic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAE5E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAC/D,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG;IAChD,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orcestr/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shared React UI package for Orcestr products.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Artasov/orcestr-ui.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Artasov/orcestr-ui#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Artasov/orcestr-ui/issues"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"./dist/styles/*.css",
|
|
17
|
+
"./dist/example/*.css"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md",
|
|
22
|
+
"README.ru.md",
|
|
23
|
+
"assets"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./styles.css": "./dist/styles/orcestr-ui.css",
|
|
34
|
+
"./example/styles.css": "./dist/example/styles.css",
|
|
35
|
+
"./example/UiExamplePage": {
|
|
36
|
+
"types": "./dist/example/UiExamplePage.d.ts",
|
|
37
|
+
"import": "./dist/example/UiExamplePage.js"
|
|
38
|
+
},
|
|
39
|
+
"./react-query": {
|
|
40
|
+
"types": "./dist/react-query.d.ts",
|
|
41
|
+
"import": "./dist/react-query.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"clean": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\"",
|
|
46
|
+
"build": "npm run clean && tsc -p tsconfig.build.json && npm run build:styles",
|
|
47
|
+
"build:styles": "sass src/styles/orcestr-ui.sass dist/styles/orcestr-ui.css --no-source-map && sass src/example/styles.sass dist/example/styles.css --no-source-map",
|
|
48
|
+
"check": "npm run typecheck",
|
|
49
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
50
|
+
"release:patch": "node scripts/release.mjs patch",
|
|
51
|
+
"release:minor": "node scripts/release.mjs minor",
|
|
52
|
+
"release:major": "node scripts/release.mjs major",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
54
|
+
"test": "node --test \"src/**/*.test.mts\""
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@tanstack/react-query": "^5.99.0",
|
|
58
|
+
"react": "^19.0.0",
|
|
59
|
+
"react-dom": "^19.0.0",
|
|
60
|
+
"react-icons": "^5.6.0"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"@tanstack/react-query": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@tanstack/react-query": "5.99.2",
|
|
69
|
+
"@types/node": "25.6.0",
|
|
70
|
+
"@types/react": "19.2.14",
|
|
71
|
+
"@types/react-dom": "19.2.3",
|
|
72
|
+
"react": "19.2.5",
|
|
73
|
+
"react-dom": "19.2.5",
|
|
74
|
+
"react-icons": "5.6.0",
|
|
75
|
+
"sass": "^1.101.0",
|
|
76
|
+
"typescript": "5.9.3"
|
|
77
|
+
}
|
|
78
|
+
}
|