@orcestr/ui 0.1.0 → 0.2.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/README.md +11 -11
- package/README.ru.md +10 -10
- package/dist/components/Action/ActionConfirmModal.d.ts.map +1 -1
- package/dist/components/Action/ActionTypes.d.ts +1 -1
- package/dist/components/Action/ActionTypes.d.ts.map +1 -1
- package/dist/components/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- 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 +15 -14
- package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -1
- package/dist/components/AppSidebar/AppSidebar.js +84 -15
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -1
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +5 -5
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Collapse/Collapse.d.ts.map +1 -1
- package/dist/components/Collapse/Collapse.js +5 -25
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.js +7 -2
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +6 -12
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +3 -3
- 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/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +29 -22
- package/dist/components/DataTable/DataTableStateAdapters.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableStateAdapters.js +3 -4
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/DatePickerState.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerState.js +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts.map +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.js +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- 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 +3 -3
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
- package/dist/components/EntityPicker/EntityPicker.js +2 -2
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Highlight/Highlight.d.ts.map +1 -1
- package/dist/components/Highlight/Highlight.js +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +3 -3
- package/dist/components/IconText/IconText.d.ts.map +1 -1
- package/dist/components/IconText/IconText.js +3 -1
- package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -1
- package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -1
- package/dist/components/InlineEdit/InlineEdit.js +22 -7
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
- package/dist/components/LinkButton/LinkButton.js +2 -2
- package/dist/components/Listbox/Listbox.js +2 -2
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +5 -5
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +4 -8
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +5 -7
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/NumberField.js +1 -1
- package/dist/components/Overlay/OverlayProvider.d.ts +1 -1
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/components/Overlay/OverlayProvider.js +3 -7
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +9 -8
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.js +2 -2
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +16 -18
- package/dist/components/Portal/Portal.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +10 -23
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +4 -4
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Separator/Separator.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -1
- package/dist/components/SpecialModal/SpecialModal.js +2 -2
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +1 -1
- package/dist/components/State/State.d.ts.map +1 -1
- package/dist/components/State/State.js +5 -5
- package/dist/components/State/stateIcon.d.ts.map +1 -1
- package/dist/components/StepperInput/StepperInput.js +2 -2
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +24 -15
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.js +2 -2
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +3 -3
- 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 +63 -45
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +7 -9
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/example/CodePreview.d.ts +2 -1
- package/dist/example/CodePreview.d.ts.map +1 -1
- package/dist/example/CodePreview.js +18 -53
- package/dist/example/ExampleActionsSection.d.ts +1 -1
- package/dist/example/ExampleActionsSection.d.ts.map +1 -1
- package/dist/example/ExampleActionsSection.js +3 -3
- package/dist/example/ExampleApplicationSection.d.ts.map +1 -1
- package/dist/example/ExampleApplicationSection.js +91 -23
- package/dist/example/ExampleBasicsSections.d.ts +1 -1
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
- package/dist/example/ExampleBasicsSections.js +22 -8
- package/dist/example/ExampleDataSection.d.ts.map +1 -1
- package/dist/example/ExampleDataSection.js +5 -5
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
- package/dist/example/ExampleFieldsSection.js +8 -10
- package/dist/example/ExampleFoundationsSection.d.ts +1 -1
- package/dist/example/ExampleFoundationsSection.d.ts.map +1 -1
- package/dist/example/ExampleFoundationsSection.js +4 -4
- package/dist/example/ExampleOverlays.d.ts.map +1 -1
- package/dist/example/ExampleOverlays.js +4 -4
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
- package/dist/example/ExampleOverlaysSection.js +22 -35
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
- package/dist/example/ExampleSelectionSection.js +8 -8
- package/dist/example/ExampleStateSection.d.ts +3 -3
- package/dist/example/ExampleStateSection.d.ts.map +1 -1
- package/dist/example/ExampleStateSection.js +15 -14
- package/dist/example/ExampleThemePlayground.d.ts +26 -26
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
- package/dist/example/ExampleThemePlayground.js +58 -44
- package/dist/example/UiExamplePage.d.ts.map +1 -1
- package/dist/example/UiExamplePage.js +42 -55
- package/dist/example/UiExampleSection.d.ts.map +1 -1
- package/dist/example/UiExampleSection.js +1 -1
- package/dist/example/codeSamples.d.ts +1 -1
- package/dist/example/codeSamples.d.ts.map +1 -1
- package/dist/example/codeSamples.js +172 -70
- package/dist/example/exampleData.d.ts.map +1 -1
- package/dist/example/exampleData.js +5 -11
- package/dist/example/styles.css +79 -119
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +1 -3
- package/dist/hooks/useFloatingLayer.d.ts.map +1 -1
- package/dist/hooks/useFloatingLayer.js +1 -1
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -1
- package/dist/hooks/useFloatingPosition.js +10 -15
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useListNavigation.d.ts.map +1 -1
- package/dist/hooks/useListNavigation.js +2 -4
- package/dist/hooks/useOutsidePointerDown.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/locale/LocaleProvider.d.ts.map +1 -1
- package/dist/locale/LocaleProvider.js +1 -1
- package/dist/provider/OrcestrUiProvider.d.ts.map +1 -1
- package/dist/styles/orcestr-ui.css +658 -1033
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +21 -29
- package/dist/theme/defaultTheme.d.ts.map +1 -1
- package/dist/theme/defaultTheme.js +200 -89
- package/dist/theme/systemProps.d.ts +2 -2
- package/dist/theme/systemProps.d.ts.map +1 -1
- package/dist/theme/systemProps.js +4 -35
- package/dist/theme/themeTypes.d.ts +24 -19
- package/dist/theme/themeTypes.d.ts.map +1 -1
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/composeRefs.d.ts.map +1 -1
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/polymorphic.d.ts.map +1 -1
- package/package.json +4 -1
|
@@ -11,20 +11,20 @@ import { stateIcon } from './stateIcon';
|
|
|
11
11
|
export function StateCard({ tone = 'neutral', v = 'soft', icon, iconTone, title, titleTone, description, descriptionTone, titleFs, descriptionFs = '13px', action, compact = false, className, children, testId, ...props }) {
|
|
12
12
|
const hasBody = description || children;
|
|
13
13
|
const actualTitleFs = titleFs ?? (compact ? '14px' : '15px');
|
|
14
|
-
return (_jsxs("div", { className: cn('oui-state-card', className), "data-tone": tone, "data-variant": v, "data-compact": compact ? 'true' : undefined, "data-testid": testId, ...props, children: [_jsxs("div", { className:
|
|
14
|
+
return (_jsxs("div", { className: cn('oui-state-card', className), "data-tone": tone, "data-variant": v, "data-compact": compact ? 'true' : undefined, "data-testid": testId, ...props, children: [_jsxs("div", { className: "oui-state-card-main", children: [_jsx(IconText, { fw: 760, fs: actualTitleFs, icon: icon ?? stateIcon(tone), iconTone: iconTone ?? (tone === 'neutral' ? 'muted' : tone), tone: titleTone, children: title }), hasBody ? (_jsxs("div", { className: "oui-state-card-body", children: [description ? (_jsx(Text, { className: "oui-state-card-description", fs: descriptionFs, tone: descriptionTone, children: description })) : null, children] })) : null] }), action ? _jsx("div", { className: "oui-state-card-action", children: action }) : null] }));
|
|
15
15
|
}
|
|
16
16
|
export function EmptyState({ title, ...props }) {
|
|
17
17
|
const { copy } = useOrcestrUiLocale();
|
|
18
|
-
return _jsx(StateCard, { tone:
|
|
18
|
+
return _jsx(StateCard, { tone: "neutral", title: title ?? copy.common.noData, ...props });
|
|
19
19
|
}
|
|
20
20
|
export function LoadingState({ title, description, ...props }) {
|
|
21
21
|
const { copy } = useOrcestrUiLocale();
|
|
22
|
-
return (_jsx(StateCard, { tone:
|
|
22
|
+
return (_jsx(StateCard, { tone: "info", icon: _jsx(Spinner, {}), title: title ?? copy.common.loading, description: description, ...props }));
|
|
23
23
|
}
|
|
24
24
|
export function ErrorState({ title, retryLabel, onRetry, action, ...props }) {
|
|
25
25
|
const { copy } = useOrcestrUiLocale();
|
|
26
|
-
return (_jsx(StateCard, { tone:
|
|
26
|
+
return (_jsx(StateCard, { tone: "danger", title: title ?? copy.table.unableToLoad, action: onRetry ? (_jsx(Button, { size: 1, v: "surface", tone: "danger", onClick: onRetry, children: retryLabel ?? copy.common.retry })) : (action), ...props }));
|
|
27
27
|
}
|
|
28
28
|
export function AccessDeniedState(props) {
|
|
29
|
-
return _jsx(StateCard, { tone:
|
|
29
|
+
return _jsx(StateCard, { tone: "warning", icon: _jsx(LuLock, {}), ...props });
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateIcon.d.ts","sourceRoot":"","sources":["../../../src/components/State/stateIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"stateIcon.d.ts","sourceRoot":"","sources":["../../../src/components/State/stateIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,2CAKnC"}
|
|
@@ -14,9 +14,9 @@ export function StepperInput({ value, onChange, min, max, step = 1, disabled, un
|
|
|
14
14
|
const clamped = Math.max(min ?? next, Math.min(max ?? next, next));
|
|
15
15
|
onChange(clamped);
|
|
16
16
|
};
|
|
17
|
-
return (_jsxs("span", { className:
|
|
17
|
+
return (_jsxs("span", { className: "oui-stepper", "data-testid": testId, children: [_jsx(IconButton, { size: 1, v: "surface", icon: _jsx(LuMinus, { size: 14 }), round: false, pressAnimation: "none", className: "oui-stepper-button oui-stepper-decrease", "aria-label": decreaseLabel ?? copy.common.decrease, testId: testId ? `${testId}-decrease` : undefined, disabled: disabled || !canDecrease, onClick: () => commit(value - step) }), _jsx(TextField, { value: displayValue, disabled: disabled, className: "oui-stepper-field", size: 1, testId: testId ? `${testId}-input` : undefined, onChange: (event) => {
|
|
18
18
|
const next = Number(event.target.value);
|
|
19
19
|
if (Number.isFinite(next))
|
|
20
20
|
commit(next);
|
|
21
|
-
}, rightSlot: unit ? _jsx("span", { children: unit }) : null, w:
|
|
21
|
+
}, rightSlot: unit ? _jsx("span", { children: unit }) : null, w: "86px" }), _jsx(IconButton, { size: 1, v: "surface", icon: _jsx(LuPlus, { size: 14 }), round: false, pressAnimation: "none", className: "oui-stepper-button oui-stepper-increase", "aria-label": increaseLabel ?? copy.common.increase, testId: testId ? `${testId}-increase` : undefined, disabled: disabled || !canIncrease, onClick: () => commit(value + step) })] }));
|
|
22
22
|
}
|
|
@@ -11,5 +11,5 @@ export const Switch = forwardRef(function Switch({ className, label, children, c
|
|
|
11
11
|
onChange?.(event);
|
|
12
12
|
onCheckedChange?.(event.target.checked);
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs("label", { className: cn('oui-switch', className), "data-checked": actualChecked ? 'true' : undefined, "data-disabled": disabled ? 'true' : undefined, "data-testid": testId, children: [_jsx("input", { ref: ref, type:
|
|
14
|
+
return (_jsxs("label", { className: cn('oui-switch', className), "data-checked": actualChecked ? 'true' : undefined, "data-disabled": disabled ? 'true' : undefined, "data-testid": testId, children: [_jsx("input", { ref: ref, type: "checkbox", checked: actualChecked, disabled: disabled, onChange: handleChange, ...props }), _jsx("span", { className: "oui-switch-track", children: _jsx("span", { className: "oui-switch-thumb" }) }), label || children ? _jsx("span", { children: label ?? children }) : null] }));
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAG1F,KAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,wBAAwB,CAAC,OAAO,CAAC,GAC1D,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,SAAS;WALP,MAAM;QACT,OAAO,GAAG,SAAS;aACd,MAAM;oDAmBrB,CAAC;AAEH,eAAO,MAAM,WAAW,sOAIvB,CAAC;AAEF,eAAO,MAAM,SAAS,sOAIrB,CAAC;AAEF,eAAO,MAAM,QAAQ,0NAIpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,wBAAwB,CAAC,IAAI,CAAC,GACvD,WAAW,GAAG;IACV,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,SAAS;YAJN,KAAK;aACJ,MAAM;wDAkBrB,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAC7D,WAAW,GAAG;IACV,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,qBAAqB;YAJlB,KAAK;aACJ,MAAM;wDAkBtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;YArBf,KAAK;aACJ,MAAM;wDAmCtB,CAAC;AAEF,eAAO,MAAM,KAAK;WAxGH,MAAM;QACT,OAAO,GAAG,SAAS;aACd,MAAM;;;eAFR,MAAM;YACT,OAAO,GAAG,SAAS;iBACd,MAAM;;;;;;gBAyCP,KAAK;iBACJ,MAAM;;;gBAsBP,KAAK;iBACJ,MAAM;;;gBADP,KAAK;iBACJ,MAAM;;CA6CrB,CAAC"}
|
|
@@ -21,11 +21,11 @@ export const TableCell = forwardRef(function TableCell({ className, style, align
|
|
|
21
21
|
});
|
|
22
22
|
export const TableColumnHeaderCell = forwardRef(function TableColumnHeaderCell({ className, style, align, testId, ...props }, ref) {
|
|
23
23
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
24
|
-
return (_jsx("th", { ref: ref, scope:
|
|
24
|
+
return (_jsx("th", { ref: ref, scope: "col", className: cn('oui-table-column-header-cell', className), "data-align": align, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps }));
|
|
25
25
|
});
|
|
26
26
|
export const TableRowHeaderCell = forwardRef(function TableRowHeaderCell({ className, style, align, testId, ...props }, ref) {
|
|
27
27
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
28
|
-
return (_jsx("th", { ref: ref, scope:
|
|
28
|
+
return (_jsx("th", { ref: ref, scope: "row", className: cn('oui-table-row-header-cell', className), "data-align": align, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps }));
|
|
29
29
|
});
|
|
30
30
|
export const Table = Object.assign(TableRoot, {
|
|
31
31
|
Root: TableRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,wBAAwB,EAU7B,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAOf,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,wBAAwB,EAU7B,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAOf,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAsBF,iBAAS,QAAQ,CAAC,EACd,KAAK,EACL,KAAK,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,MAAM,GACT,EAAE;IACC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,kDAoKA;AAkBD,KAAK,SAAS,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG;IAClF,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,iBAAS,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAmD7F;AAED,KAAK,SAAS,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAC7E,QAAQ,EAAE,SAAS,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,iBAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,iBAAqB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAmKvF;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,iBAAS,OAAO,CAAC,EACb,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,IAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,GAAG,KAAK,EACX,EAAE,YAAY,2CAwCd;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,iBAAS,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CA4B7F;AAoBD,eAAO,MAAM,IAAI;;;;;CAKf,CAAC"}
|
|
@@ -5,6 +5,17 @@ import { LuChevronLeft, LuChevronRight } from 'react-icons/lu';
|
|
|
5
5
|
import { cn } from '../../utils/cn';
|
|
6
6
|
import { Collapse } from '../Collapse/Collapse';
|
|
7
7
|
import { IconButton } from '../IconButton/IconButton';
|
|
8
|
+
function stableTabRect(current, next) {
|
|
9
|
+
if (!current || !next)
|
|
10
|
+
return next;
|
|
11
|
+
if (current.left === next.left &&
|
|
12
|
+
current.top === next.top &&
|
|
13
|
+
current.width === next.width &&
|
|
14
|
+
current.height === next.height) {
|
|
15
|
+
return current;
|
|
16
|
+
}
|
|
17
|
+
return next;
|
|
18
|
+
}
|
|
8
19
|
function ItemTabs({ items, value, onValueChange, className, listClassName, contentClassName, testId, }) {
|
|
9
20
|
const active = items.find((item) => item.value === value) ?? items[0];
|
|
10
21
|
const listRef = useRef(null);
|
|
@@ -30,9 +41,9 @@ function ItemTabs({ items, value, onValueChange, className, listClassName, conte
|
|
|
30
41
|
height: trigger.offsetHeight,
|
|
31
42
|
};
|
|
32
43
|
};
|
|
33
|
-
setActiveRect(readRect(active?.value));
|
|
44
|
+
setActiveRect((current) => stableTabRect(current, readRect(active?.value)));
|
|
34
45
|
const nextHoverRect = readRect(hoveredValue);
|
|
35
|
-
setHoverRect((current) => nextHoverRect
|
|
46
|
+
setHoverRect((current) => nextHoverRect ? stableTabRect(current, nextHoverRect) : current);
|
|
36
47
|
setHoverVisible(Boolean(hoveredValue && nextHoverRect && hoveredValue !== active?.value));
|
|
37
48
|
}, [active?.value, hoveredValue]);
|
|
38
49
|
const moveFocus = (currentValue, direction) => {
|
|
@@ -67,14 +78,14 @@ function ItemTabs({ items, value, onValueChange, className, listClassName, conte
|
|
|
67
78
|
}, [items, measure]);
|
|
68
79
|
if (!active)
|
|
69
80
|
return null;
|
|
70
|
-
return (_jsxs("div", { className: cn('oui-tabs', className), "data-testid": testId, children: [_jsx("div", { className:
|
|
81
|
+
return (_jsxs("div", { className: cn('oui-tabs', className), "data-testid": testId, children: [_jsx("div", { className: "oui-tabs-shell", children: _jsxs("div", { ref: listRef, className: cn('oui-tabs-list', listClassName), role: "tablist", "data-testid": testId ? `${testId}-list` : undefined, onMouseLeave: () => setHoveredValue(null), children: [activeRect ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-active-indicator", style: indicatorStyle(activeRect) })) : null, hoverRect ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-hover-indicator", "data-visible": hoverVisible ? 'true' : undefined, style: indicatorStyle(hoverRect) })) : null, items.map((item) => {
|
|
71
82
|
const isActive = active.value === item.value;
|
|
72
83
|
return (_jsxs("button", { ref: (element) => {
|
|
73
84
|
if (element)
|
|
74
85
|
triggerRefs.current.set(item.value, element);
|
|
75
86
|
else
|
|
76
87
|
triggerRefs.current.delete(item.value);
|
|
77
|
-
}, type:
|
|
88
|
+
}, type: "button", role: "tab", "aria-selected": isActive, className: "oui-tabs-trigger", "data-active": isActive ? 'true' : undefined, "data-testid": testId ? `${testId}-${item.value}` : undefined, onMouseEnter: () => setHoveredValue(item.value), onFocus: () => setHoveredValue(item.value), onBlur: () => setHoveredValue(null), onKeyDown: (event) => {
|
|
78
89
|
if (event.key === 'ArrowRight') {
|
|
79
90
|
event.preventDefault();
|
|
80
91
|
moveFocus(item.value, 1);
|
|
@@ -91,10 +102,10 @@ function ItemTabs({ items, value, onValueChange, className, listClassName, conte
|
|
|
91
102
|
event.preventDefault();
|
|
92
103
|
focusEdge('last');
|
|
93
104
|
}
|
|
94
|
-
}, onClick: () => onValueChange(item.value), children: [item.icon ? (_jsx("span", { className:
|
|
105
|
+
}, onClick: () => onValueChange(item.value), children: [item.icon ? (_jsx("span", { className: "oui-tabs-trigger-icon", "aria-hidden": true, children: item.icon })) : null, _jsx("span", { className: "oui-tabs-trigger-label", children: item.label }), item.badge ? (_jsx("span", { className: "oui-tabs-trigger-badge", children: item.badge })) : null] }, item.value));
|
|
95
106
|
})] }) }), _jsx("div", { className: cn('oui-tabs-content', contentClassName), "data-testid": testId ? `${testId}-content` : undefined, children: items.map((item) => {
|
|
96
107
|
const open = active.value === item.value;
|
|
97
|
-
return (_jsx(Collapse, { open: open, children: _jsx("div", { role:
|
|
108
|
+
return (_jsx(Collapse, { open: open, children: _jsx("div", { role: "tabpanel", className: "oui-tabs-panel", "data-active": open ? 'true' : undefined, "data-testid": testId ? `${testId}-${item.value}-panel` : undefined, children: item.content }) }, item.value));
|
|
98
109
|
}) })] }));
|
|
99
110
|
}
|
|
100
111
|
const TabsCtx = createContext(null);
|
|
@@ -169,9 +180,9 @@ function List({ children, indicatorPaddingY = 4, className, style, ...props }) {
|
|
|
169
180
|
if (nextValue === ctx.activeValue)
|
|
170
181
|
active = rect;
|
|
171
182
|
});
|
|
172
|
-
setHoverRect((current) => hover
|
|
183
|
+
setHoverRect((current) => (hover ? stableTabRect(current, hover) : current));
|
|
173
184
|
setHoverVisible(Boolean(hover && ctx.hoveredValue !== ctx.activeValue));
|
|
174
|
-
setActiveRect(active);
|
|
185
|
+
setActiveRect((current) => stableTabRect(current, active));
|
|
175
186
|
setCanScrollLeft(list.scrollLeft > 1);
|
|
176
187
|
setCanScrollRight(list.scrollLeft + list.clientWidth < list.scrollWidth - 1);
|
|
177
188
|
}, [ctx.activeValue, ctx.hoveredValue]);
|
|
@@ -206,9 +217,7 @@ function List({ children, indicatorPaddingY = 4, className, style, ...props }) {
|
|
|
206
217
|
const list = listRef.current;
|
|
207
218
|
if (!list || list.scrollWidth <= list.clientWidth + 1)
|
|
208
219
|
return;
|
|
209
|
-
const rawDelta = Math.abs(event.deltaY) >= Math.abs(event.deltaX)
|
|
210
|
-
? event.deltaY
|
|
211
|
-
: event.deltaX;
|
|
220
|
+
const rawDelta = Math.abs(event.deltaY) >= Math.abs(event.deltaX) ? event.deltaY : event.deltaX;
|
|
212
221
|
if (rawDelta === 0)
|
|
213
222
|
return;
|
|
214
223
|
const delta = event.deltaMode === 1
|
|
@@ -231,7 +240,7 @@ function List({ children, indicatorPaddingY = 4, className, style, ...props }) {
|
|
|
231
240
|
return () => list.removeEventListener('wheel', handleWheel);
|
|
232
241
|
}, [handleWheel]);
|
|
233
242
|
const hasOverflowControls = canScrollLeft || canScrollRight;
|
|
234
|
-
return (_jsxs("div", { className:
|
|
243
|
+
return (_jsxs("div", { className: "oui-tabs-compound-shell", children: [canScrollLeft ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-edge oui-tabs-edge-left" })) : null, canScrollRight ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-edge oui-tabs-edge-right" })) : null, canScrollLeft ? (_jsx(IconButton, { type: "button", v: "soft", tone: "neutral", round: true, size: 1, onClick: () => scrollList(-1), "aria-label": "Scroll tabs left", className: "oui-tabs-scroll-button oui-tabs-scroll-button-left", children: _jsx(LuChevronLeft, { size: 16 }) })) : null, canScrollRight ? (_jsx(IconButton, { type: "button", v: "soft", tone: "neutral", round: true, size: 1, onClick: () => scrollList(1), "aria-label": "Scroll tabs right", className: "oui-tabs-scroll-button oui-tabs-scroll-button-right", children: _jsx(LuChevronRight, { size: 16 }) })) : null, _jsxs("div", { ref: listRef, role: "tablist", onMouseLeave: () => ctx.setHoveredValue(null), className: cn('oui-tabs-list-scroll', className), "data-overflow": hasOverflowControls ? 'true' : undefined, style: style, ...props, children: [activeRect ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-compound-active-indicator", style: compoundIndicatorStyle(activeRect, indicatorPaddingY) })) : null, hoverRect ? (_jsx("span", { "aria-hidden": true, className: "oui-tabs-compound-hover-indicator", "data-visible": hoverVisible ? 'true' : undefined, style: compoundIndicatorStyle(hoverRect, indicatorPaddingY) })) : null, children] })] }));
|
|
235
244
|
}
|
|
236
245
|
function Trigger({ value, children, icon, size = '2', className, onMouseEnter, onClick, ...props }) {
|
|
237
246
|
const ctx = useTabsCtx();
|
|
@@ -241,7 +250,7 @@ function Trigger({ value, children, icon, size = '2', className, onMouseEnter, o
|
|
|
241
250
|
ctx.registerTrigger(value, ref.current);
|
|
242
251
|
return () => ctx.registerTrigger(value, null);
|
|
243
252
|
}, [ctx, value]);
|
|
244
|
-
return (_jsxs("button", { ref: ref, type:
|
|
253
|
+
return (_jsxs("button", { ref: ref, type: "button", role: "tab", "aria-selected": isActive, className: cn('oui-tabs-trigger', className), "data-active": isActive ? 'true' : undefined, "data-size": size, "data-tabs-trigger": value, onMouseEnter: (event) => {
|
|
245
254
|
ctx.setHoveredValue(value);
|
|
246
255
|
onMouseEnter?.(event);
|
|
247
256
|
}, onClick: (event) => {
|
|
@@ -250,7 +259,7 @@ function Trigger({ value, children, icon, size = '2', className, onMouseEnter, o
|
|
|
250
259
|
return;
|
|
251
260
|
ctx.setHoveredValue(value);
|
|
252
261
|
ctx.setActiveValue(value);
|
|
253
|
-
}, ...props, children: [icon ? (_jsx("span", { className:
|
|
262
|
+
}, ...props, children: [icon ? (_jsx("span", { className: "oui-tabs-trigger-icon", "aria-hidden": true, children: icon })) : null, children] }));
|
|
254
263
|
}
|
|
255
264
|
function Content({ value, children, className, mountOnActive = false, ...props }) {
|
|
256
265
|
const ctx = useTabsCtx();
|
|
@@ -263,7 +272,7 @@ function Content({ value, children, className, mountOnActive = false, ...props }
|
|
|
263
272
|
return () => window.cancelAnimationFrame(frameId);
|
|
264
273
|
}, [mounted, open]);
|
|
265
274
|
const shouldRenderChildren = !mountOnActive || mounted || open;
|
|
266
|
-
return (_jsx("div", { role:
|
|
275
|
+
return (_jsx("div", { role: "tabpanel", className: cn('oui-tabs-compound-panel', className), "data-tabs-content": value, hidden: !open, ...props, children: _jsx(Collapse, { open: open, children: _jsx("div", { className: "oui-tabs-compound-panel-inner", children: shouldRenderChildren ? children : null }) }) }));
|
|
267
276
|
}
|
|
268
277
|
function indicatorStyle(rect) {
|
|
269
278
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAY,MAAM,OAAO,CAAC;AAG9F,OAAO,EAGH,KAAK,WAAW,EAChB,KAAK,SAAS,EACjB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,CAAC,GACpD,WAAW,GAAG;IACV,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,IAAI;SAVJ,WAAW;WACT,SAAS;cACN,OAAO;WACV,MAAM;aACJ,MAAM;UACT,MAAM;WACL,MAAM;aACJ,MAAM;+CA+BrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
3
|
import { cn } from '../../utils/cn';
|
|
4
4
|
import { normalizeTone, splitSystemProps, } from '../../theme/systemProps';
|
|
5
5
|
import { renderSlot } from '../../utils/slot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1F,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,GACnE,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,QAAQ;WANN,MAAM;cACH,OAAO;iBACJ,OAAO;aACX,MAAM;uDAwCrB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useLayoutEffect, useRef
|
|
3
|
+
import { forwardRef, useLayoutEffect, useRef } from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
5
|
import { composeRefs } from '../../utils/composeRefs';
|
|
6
|
-
import { splitSystemProps
|
|
6
|
+
import { splitSystemProps } from '../../theme/systemProps';
|
|
7
7
|
export const TextArea = forwardRef(function TextArea({ className, style, size = 2, invalid = false, autoResize = false, value, testId, children: _children, dangerouslySetInnerHTML: _dangerouslySetInnerHTML, ...props }, ref) {
|
|
8
8
|
const localRef = useRef(null);
|
|
9
9
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAMf,OAAO,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1F,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,GAC5E,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,SAAS;WAXP,MAAM;cACH,OAAO;gBACL,OAAO;eACR,SAAS;gBACR,SAAS;gBACT,OAAO;cACT,MAAM,IAAI;iBACP,MAAM;aACV,MAAM;oDAkFrB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { LuX } from 'react-icons/lu';
|
|
|
5
5
|
import { useOrcestrUiLocale } from '../../locale/LocaleProvider';
|
|
6
6
|
import { cn } from '../../utils/cn';
|
|
7
7
|
import { composeRefs } from '../../utils/composeRefs';
|
|
8
|
-
import { splitSystemProps
|
|
8
|
+
import { splitSystemProps } from '../../theme/systemProps';
|
|
9
9
|
export const TextField = forwardRef(function TextField({ className, style, size = 3, invalid = false, fullWidth = true, leftSlot, rightSlot, clearable = false, onClear, clearLabel, testId, value, defaultValue, onChange, disabled, id, children: _children, dangerouslySetInnerHTML: _dangerouslySetInnerHTML, ...props }, ref) {
|
|
10
10
|
const { copy } = useOrcestrUiLocale();
|
|
11
11
|
const generatedId = useId();
|
|
@@ -20,12 +20,12 @@ export const TextField = forwardRef(function TextField({ className, style, size
|
|
|
20
20
|
setInternalValue(event.target.value);
|
|
21
21
|
onChange?.(event);
|
|
22
22
|
};
|
|
23
|
-
return (_jsxs("span", { className: cn('oui-text-field', fullWidth && 'oui-text-field-full', className), "data-size": size, "data-invalid": invalid ? 'true' : undefined, "data-disabled": disabled ? 'true' : undefined, style: { ...systemStyle, ...style }, children: [leftSlot ?
|
|
23
|
+
return (_jsxs("span", { className: cn('oui-text-field', fullWidth && 'oui-text-field-full', className), "data-size": size, "data-invalid": invalid ? 'true' : undefined, "data-disabled": disabled ? 'true' : undefined, style: { ...systemStyle, ...style }, children: [leftSlot ? _jsx("span", { className: "oui-text-field-slot", children: leftSlot }) : null, _jsx("input", { ref: composeRefs(ref, localRef), id: inputId, className: "oui-text-field-input", "data-testid": testId, value: actualValue, onChange: handleChange, disabled: disabled, "aria-invalid": invalid || undefined, ...restProps }), canClear ? (_jsx("button", { type: "button", className: "oui-text-field-clear", "aria-label": clearLabel ?? copy.common.clear, onClick: (event) => {
|
|
24
24
|
event.preventDefault();
|
|
25
25
|
event.stopPropagation();
|
|
26
26
|
if (value === undefined)
|
|
27
27
|
setInternalValue('');
|
|
28
28
|
localRef.current?.focus();
|
|
29
29
|
onClear?.();
|
|
30
|
-
}, children: _jsx(LuX, { size: 14 }) })) : null, rightSlot ?
|
|
30
|
+
}, children: _jsx(LuX, { size: 14 }) })) : null, rightSlot ? _jsx("span", { className: "oui-text-field-slot", children: rightSlot }) : null] }));
|
|
31
31
|
});
|
|
@@ -12,10 +12,6 @@ export type ToastOptions = {
|
|
|
12
12
|
tone?: ToastTone;
|
|
13
13
|
icon?: ReactNode | false;
|
|
14
14
|
position?: ToastPosition;
|
|
15
|
-
background?: string;
|
|
16
|
-
blur?: number | string | false;
|
|
17
|
-
borderColor?: string;
|
|
18
|
-
shadow?: string;
|
|
19
15
|
progressColor?: string;
|
|
20
16
|
action?: ToastAction;
|
|
21
17
|
duration?: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EASH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AASf,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClE,MAAM,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EASH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AASf,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClE,MAAM,MAAM,aAAa,GACrB,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,CAAC;AAE/F,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC;AAe/C,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC;IACtD,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IACpC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAmCF,wBAAgB,aAAa,CAAC,EAC1B,QAAQ,EACR,eAAwC,EACxC,UAA+B,EAC/B,MAAM,GACT,EAAE;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAsMA;AAED,wBAAgB,QAAQ,sBAMvB"}
|
|
@@ -41,6 +41,7 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
41
41
|
const nextId = useRef(1);
|
|
42
42
|
const timeoutIds = useRef(new Map());
|
|
43
43
|
const removalIds = useRef(new Map());
|
|
44
|
+
const timers = useRef(new Map());
|
|
44
45
|
const setToastItems = useCallback((update) => {
|
|
45
46
|
setItems((current) => {
|
|
46
47
|
const next = update(current);
|
|
@@ -54,6 +55,14 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
54
55
|
window.clearTimeout(timeoutId);
|
|
55
56
|
timeoutIds.current.delete(id);
|
|
56
57
|
}
|
|
58
|
+
timers.current.delete(id);
|
|
59
|
+
}, []);
|
|
60
|
+
const stopTimer = useCallback((id) => {
|
|
61
|
+
const timeoutId = timeoutIds.current.get(id);
|
|
62
|
+
if (timeoutId !== undefined) {
|
|
63
|
+
window.clearTimeout(timeoutId);
|
|
64
|
+
timeoutIds.current.delete(id);
|
|
65
|
+
}
|
|
57
66
|
}, []);
|
|
58
67
|
const clearRemovalTimer = useCallback((id) => {
|
|
59
68
|
const timeoutId = removalIds.current.get(id);
|
|
@@ -63,12 +72,13 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
63
72
|
}
|
|
64
73
|
}, []);
|
|
65
74
|
const removeToast = useCallback((id) => {
|
|
75
|
+
clearTimer(id);
|
|
66
76
|
clearRemovalTimer(id);
|
|
67
77
|
setToastItems((current) => current.filter((item) => item.id !== id));
|
|
68
|
-
}, [clearRemovalTimer, setToastItems]);
|
|
78
|
+
}, [clearRemovalTimer, clearTimer, setToastItems]);
|
|
69
79
|
const dismiss = useCallback((id) => {
|
|
70
80
|
clearTimer(id);
|
|
71
|
-
setToastItems((current) => current.map((item) => item.id === id ? { ...item, state: 'closing' } : item));
|
|
81
|
+
setToastItems((current) => current.map((item) => (item.id === id ? { ...item, state: 'closing' } : item)));
|
|
72
82
|
clearRemovalTimer(id);
|
|
73
83
|
const removalId = window.setTimeout(() => {
|
|
74
84
|
removeToast(id);
|
|
@@ -78,20 +88,48 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
78
88
|
const clear = useCallback(() => {
|
|
79
89
|
timeoutIds.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
80
90
|
timeoutIds.current.clear();
|
|
91
|
+
timers.current.clear();
|
|
81
92
|
removalIds.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
82
93
|
removalIds.current.clear();
|
|
83
94
|
setToastItems(() => []);
|
|
84
95
|
}, [setToastItems]);
|
|
85
|
-
const scheduleDismiss = useCallback((item) => {
|
|
86
|
-
|
|
87
|
-
if (item.duration === null)
|
|
96
|
+
const scheduleDismiss = useCallback((item, remainingMs) => {
|
|
97
|
+
stopTimer(item.id);
|
|
98
|
+
if (item.duration === null) {
|
|
99
|
+
timers.current.delete(item.id);
|
|
88
100
|
return;
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
}
|
|
102
|
+
const duration = remainingMs ?? item.duration ?? DEFAULT_TOAST_DURATION;
|
|
103
|
+
if (duration <= 0) {
|
|
104
|
+
dismiss(item.id);
|
|
91
105
|
return;
|
|
106
|
+
}
|
|
107
|
+
timers.current.set(item.id, {
|
|
108
|
+
startedAt: Date.now(),
|
|
109
|
+
remaining: duration,
|
|
110
|
+
});
|
|
92
111
|
const timeoutId = window.setTimeout(() => dismiss(item.id), duration);
|
|
93
112
|
timeoutIds.current.set(item.id, timeoutId);
|
|
94
|
-
}, [
|
|
113
|
+
}, [dismiss, stopTimer]);
|
|
114
|
+
const pauseDismiss = useCallback((id) => {
|
|
115
|
+
const timer = timers.current.get(id);
|
|
116
|
+
if (!timer || !timeoutIds.current.has(id))
|
|
117
|
+
return;
|
|
118
|
+
stopTimer(id);
|
|
119
|
+
timers.current.set(id, {
|
|
120
|
+
startedAt: timer.startedAt,
|
|
121
|
+
remaining: Math.max(0, timer.remaining - (Date.now() - timer.startedAt)),
|
|
122
|
+
});
|
|
123
|
+
}, [stopTimer]);
|
|
124
|
+
const resumeDismiss = useCallback((id) => {
|
|
125
|
+
if (timeoutIds.current.has(id))
|
|
126
|
+
return;
|
|
127
|
+
const item = itemsRef.current.find((currentItem) => currentItem.id === id);
|
|
128
|
+
const timer = timers.current.get(id);
|
|
129
|
+
if (!item || !timer || item.state === 'closing')
|
|
130
|
+
return;
|
|
131
|
+
scheduleDismiss(item, timer.remaining);
|
|
132
|
+
}, [scheduleDismiss]);
|
|
95
133
|
const push = useCallback((input, tone) => {
|
|
96
134
|
const normalized = normalizeToast(input, tone, defaultPosition);
|
|
97
135
|
const existingItem = normalized.dedupeKey
|
|
@@ -113,13 +151,7 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
113
151
|
});
|
|
114
152
|
scheduleDismiss(item);
|
|
115
153
|
return item.id;
|
|
116
|
-
}, [
|
|
117
|
-
clearRemovalTimer,
|
|
118
|
-
defaultPosition,
|
|
119
|
-
maxVisible,
|
|
120
|
-
scheduleDismiss,
|
|
121
|
-
setToastItems,
|
|
122
|
-
]);
|
|
154
|
+
}, [clearRemovalTimer, defaultPosition, maxVisible, scheduleDismiss, setToastItems]);
|
|
123
155
|
const value = useMemo(() => ({
|
|
124
156
|
push,
|
|
125
157
|
success: (input) => push(input, 'success'),
|
|
@@ -134,7 +166,7 @@ export function ToastProvider({ children, defaultPosition = DEFAULT_TOAST_POSITI
|
|
|
134
166
|
const positionItems = items.filter((item) => item.position === position);
|
|
135
167
|
if (positionItems.length === 0)
|
|
136
168
|
return null;
|
|
137
|
-
return (_jsx("div", { className:
|
|
169
|
+
return (_jsx("div", { className: "oui-toast-stack", "data-position": position, "data-testid": testId ? `${testId}-${position}` : undefined, "aria-live": "polite", "aria-relevant": "additions text", style: { zIndex: overlay.zIndex.toast }, children: positionItems.map((item) => (_jsx(ToastCard, { item: item, onDismiss: dismiss, onPause: pauseDismiss, onResume: resumeDismiss, onExited: removeToast, testId: testId ? `${testId}-${item.id}` : undefined }, item.id))) }, position));
|
|
138
170
|
}) })] }));
|
|
139
171
|
}
|
|
140
172
|
export function useToast() {
|
|
@@ -144,45 +176,31 @@ export function useToast() {
|
|
|
144
176
|
}
|
|
145
177
|
return context;
|
|
146
178
|
}
|
|
147
|
-
function ToastCard({ item, onDismiss, onExited, testId, }) {
|
|
179
|
+
function ToastCard({ item, onDismiss, onPause, onResume, onExited, testId, }) {
|
|
148
180
|
const { copy } = useOrcestrUiLocale();
|
|
149
181
|
const duration = toastDuration(item);
|
|
150
182
|
const hasProgress = item.duration !== null && duration > 0;
|
|
151
|
-
const icon = item.icon === false ? null : item.icon ?? toastIcon(item.tone);
|
|
152
|
-
const effectiveBlur = item.blur !== undefined ? cssLength(item.blur) : 'var(--oui-toast-blur, 14px)';
|
|
183
|
+
const icon = item.icon === false ? null : (item.icon ?? toastIcon(item.tone));
|
|
153
184
|
const style = {
|
|
154
|
-
...(item.background ? { '--oui-toast-bg': item.background } : null),
|
|
155
|
-
'--oui-toast-effective-blur': effectiveBlur,
|
|
156
|
-
...(item.borderColor ? { '--oui-toast-custom-border-color': item.borderColor } : null),
|
|
157
|
-
...(item.shadow ? { '--oui-toast-shadow': item.shadow } : null),
|
|
158
185
|
...(item.progressColor ? { '--oui-toast-progress-color': item.progressColor } : null),
|
|
159
186
|
};
|
|
160
|
-
|
|
161
|
-
backdropFilter: `blur(${effectiveBlur})`,
|
|
162
|
-
WebkitBackdropFilter: `blur(${effectiveBlur})`,
|
|
163
|
-
};
|
|
164
|
-
return (_jsxs("div", { className: 'oui-toast-frame', "data-position": item.position, "data-state": item.state, style: style, onAnimationEnd: (event) => {
|
|
187
|
+
return (_jsx("div", { className: "oui-toast-viewport oui-toast-frame", "data-position": item.position, "data-state": item.state, style: style, onAnimationEnd: (event) => {
|
|
165
188
|
if (event.animationName === 'ouiToastOut') {
|
|
166
189
|
onExited(item.id);
|
|
167
190
|
}
|
|
168
|
-
}, children:
|
|
169
|
-
|
|
191
|
+
}, children: _jsxs("div", { className: "oui-toast", "data-tone": item.tone, "data-state": item.state, "data-position": item.position, "data-clickable": item.dismissible === false ? undefined : 'true', "data-testid": testId, role: item.tone === 'danger' ? 'alert' : 'status', onMouseEnter: () => onPause(item.id), onMouseLeave: () => onResume(item.id), onClick: () => {
|
|
192
|
+
if (item.dismissible !== false)
|
|
193
|
+
onDismiss(item.id);
|
|
194
|
+
}, children: [_jsxs("div", { className: "oui-toast-content", children: [icon ? (_jsx("span", { className: "oui-toast-icon", "data-tone": item.tone, children: icon })) : null, _jsxs("div", { className: "oui-toast-main", children: [_jsx("div", { className: "oui-toast-title", children: item.title }), item.message ? (_jsx("div", { className: "oui-toast-message", children: item.message })) : null, item.action ? (_jsx(Button, { className: "oui-toast-action", size: 1, v: "surface", tone: item.tone, onClick: (event) => {
|
|
195
|
+
event.stopPropagation();
|
|
196
|
+
item.action?.onClick();
|
|
197
|
+
if (item.action?.closeOnClick !== false) {
|
|
198
|
+
onDismiss(item.id);
|
|
199
|
+
}
|
|
200
|
+
}, children: item.action.label })) : null] })] }), item.closeButton ? (_jsx(IconButton, { className: "oui-toast-close", size: 1, v: "ghost", icon: _jsx(LuX, { size: 14 }), "aria-label": copy.common.dismissNotification, onClick: (event) => {
|
|
201
|
+
event.stopPropagation();
|
|
170
202
|
onDismiss(item.id);
|
|
171
|
-
|
|
172
|
-
event.stopPropagation();
|
|
173
|
-
item.action?.onClick();
|
|
174
|
-
if (item.action?.closeOnClick !== false) {
|
|
175
|
-
onDismiss(item.id);
|
|
176
|
-
}
|
|
177
|
-
}, children: item.action.label })) : null] })] }), item.closeButton ? (_jsx(IconButton, { className: 'oui-toast-close', size: 1, v: 'ghost', icon: _jsx(LuX, { size: 14 }), "aria-label": copy.common.dismissNotification, onClick: (event) => {
|
|
178
|
-
event.stopPropagation();
|
|
179
|
-
onDismiss(item.id);
|
|
180
|
-
} })) : null, hasProgress ? (_jsx("span", { className: 'oui-toast-progress', style: { '--oui-toast-duration': `${duration}ms` } }, item.createdAt)) : null] })] }));
|
|
181
|
-
}
|
|
182
|
-
function cssLength(value) {
|
|
183
|
-
if (value === false)
|
|
184
|
-
return '0px';
|
|
185
|
-
return typeof value === 'number' ? `${value}px` : value;
|
|
203
|
+
} })) : null, hasProgress ? (_jsx("span", { className: "oui-toast-progress", style: { '--oui-toast-duration': `${duration}ms` } }, item.createdAt)) : null] }) }));
|
|
186
204
|
}
|
|
187
205
|
function toastDuration(item) {
|
|
188
206
|
return item.duration ?? DEFAULT_TOAST_DURATION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQH,KAAK,SAAS,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQH,KAAK,SAAS,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAqBxF,MAAM,MAAM,YAAY,GAAG;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,OAAO,sGAmFlB,CAAC"}
|
|
@@ -16,7 +16,7 @@ export const Tooltip = forwardRef(function Tooltip({ content, children, side = '
|
|
|
16
16
|
setInternalOpen(nextOpen);
|
|
17
17
|
onOpenChange?.(nextOpen);
|
|
18
18
|
};
|
|
19
|
-
const { triggerRef, contentRef, present, state, style
|
|
19
|
+
const { triggerRef, contentRef, present, state, style } = useFloatingLayer({
|
|
20
20
|
open: actualOpen,
|
|
21
21
|
presenceDuration: 140,
|
|
22
22
|
side,
|
|
@@ -33,14 +33,12 @@ export const Tooltip = forwardRef(function Tooltip({ content, children, side = '
|
|
|
33
33
|
},
|
|
34
34
|
onBlur: () => setOpen(false),
|
|
35
35
|
};
|
|
36
|
-
const trigger = isValidElement(children)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
: (_jsx("span", { ref: composeRefs(triggerRef, ref), className: 'oui-tooltip-trigger', "data-testid": testId, ...triggerHandlers, children: children }));
|
|
43
|
-
return (_jsxs(_Fragment, { children: [trigger, present ? (_jsx(Portal, { children: _jsx("div", { ref: contentRef, role: 'tooltip', className: cn('oui-tooltip-content', className), "data-state": state, "data-layer": 'dropdown', "data-testid": testId ? `${testId}-content` : undefined, style: {
|
|
36
|
+
const trigger = isValidElement(children) ? (cloneTooltipTrigger(children, {
|
|
37
|
+
ref: composeRefs(triggerRef, ref),
|
|
38
|
+
testId,
|
|
39
|
+
...triggerHandlers,
|
|
40
|
+
})) : (_jsx("span", { ref: composeRefs(triggerRef, ref), className: "oui-tooltip-trigger", "data-testid": testId, ...triggerHandlers, children: children }));
|
|
41
|
+
return (_jsxs(_Fragment, { children: [trigger, present ? (_jsx(Portal, { children: _jsx("div", { ref: contentRef, role: "tooltip", className: cn('oui-tooltip-content', className), "data-state": state, "data-layer": "dropdown", "data-testid": testId ? `${testId}-content` : undefined, style: {
|
|
44
42
|
...style,
|
|
45
43
|
zIndex: overlayLayerZIndex(overlay.zIndex, 'dropdown', layerIndex),
|
|
46
44
|
}, children: content }) })) : null] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAIlE,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,MAAM,CAAC,GAAG;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc;aAHd,MAAM;mDAclB,CAAC"}
|
|
@@ -15,8 +15,9 @@ export declare function ExampleTile({ id, title, code, onOpen, className, childr
|
|
|
15
15
|
export declare function InlineCodeBlock({ code }: {
|
|
16
16
|
code: string;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function CodeBlock({ code }: {
|
|
18
|
+
export declare function CodeBlock({ code, mode }: {
|
|
19
19
|
code: string;
|
|
20
|
+
mode?: 'scroll' | 'inline';
|
|
20
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export declare function CodePreviewModal({ example, onClose, }: {
|
|
22
23
|
example: CodeExample | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../src/example/CodePreview.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../src/example/CodePreview.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAmCjD,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAYA;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAMA;AAED,wBAAgB,WAAW,CAAC,EACxB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,GACX,EAAE,WAAW,GAAG;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACvB,2CAUA;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CA4BzD;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,IAAe,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE,2CA0ChG;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,OAAO,EACP,OAAO,GACV,EAAE;IACC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,2CAwBA"}
|