@erxes/ui 4.0.0-v2.0 → 4.0.0-v2.2
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 -8
- package/dist/base.css +17 -4
- package/dist/components/accordion.d.ts +6 -7
- package/dist/components/accordion.js +8 -13
- package/dist/components/alert-dialog.d.ts +12 -11
- package/dist/components/alert-dialog.js +26 -29
- package/dist/components/alert.js +2 -2
- package/dist/components/avatar.d.ts +7 -5
- package/dist/components/avatar.js +30 -19
- package/dist/components/background-gradient-animation.d.ts +2 -11
- package/dist/components/background-gradient-animation.js +21 -50
- package/dist/components/badge.d.ts +3 -2
- package/dist/components/badge.js +36 -21
- package/dist/components/breadcrumb.d.ts +6 -4
- package/dist/components/breadcrumb.js +18 -14
- package/dist/components/button.d.ts +15 -7
- package/dist/components/button.js +46 -23
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/chart-config.d.ts +4 -18
- package/dist/components/chart-config.js +1 -6
- package/dist/components/charts.d.ts +1 -1
- package/dist/components/charts.js +20 -28
- package/dist/components/checkbox.d.ts +2 -3
- package/dist/components/checkbox.js +4 -6
- package/dist/components/choicebox-group.d.ts +1 -1
- package/dist/components/choicebox-group.js +5 -9
- package/dist/components/collapsible.d.ts +5 -9
- package/dist/components/collapsible.js +8 -25
- package/dist/components/color-picker.js +9 -8
- package/dist/components/combobox.d.ts +6 -6
- package/dist/components/combobox.js +19 -18
- package/dist/components/command-bar.js +22 -19
- package/dist/components/command.d.ts +18 -8
- package/dist/components/command.js +62 -26
- package/dist/components/context-menu.d.ts +17 -29
- package/dist/components/context-menu.js +20 -66
- package/dist/components/copy-text.js +7 -11
- package/dist/components/date-picker.js +21 -18
- package/dist/components/date-text-input.js +3 -3
- package/dist/components/date-time-input.d.ts +12 -0
- package/dist/components/date-time-input.js +21 -0
- package/dist/components/dialog.d.ts +17 -12
- package/dist/components/dialog.js +36 -32
- package/dist/components/drag-handle.d.ts +2 -2
- package/dist/components/drag-handle.js +0 -1
- package/dist/components/dropdown-menu.d.ts +35 -16
- package/dist/components/dropdown-menu.js +78 -37
- package/dist/components/empty.js +2 -2
- package/dist/components/form.d.ts +15 -6
- package/dist/components/form.js +34 -17
- package/dist/components/hover-card.d.ts +6 -5
- package/dist/components/hover-card.js +18 -9
- package/dist/components/info-card.js +5 -6
- package/dist/components/input-group.d.ts +22 -0
- package/dist/components/input-group.js +42 -0
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +21 -8
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +3 -3
- package/dist/components/label.js +9 -6
- package/dist/components/multiselect.d.ts +21 -6
- package/dist/components/multiselect.js +81 -127
- package/dist/components/on-demand.d.ts +17 -0
- package/dist/components/on-demand.js +42 -0
- package/dist/components/popover.d.ts +18 -9
- package/dist/components/popover.js +38 -13
- package/dist/components/radio-group.d.ts +5 -5
- package/dist/components/radio-group.js +23 -29
- package/dist/components/resizable.d.ts +8 -21
- package/dist/components/resizable.js +5 -10
- package/dist/components/scroll-area.d.ts +12 -7
- package/dist/components/scroll-area.js +18 -18
- package/dist/components/select.d.ts +22 -14
- package/dist/components/select.js +90 -51
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/separator.js +8 -12
- package/dist/components/sheet.d.ts +15 -11
- package/dist/components/sheet.js +66 -50
- package/dist/components/sidebar/context.js +4 -4
- package/dist/components/sidebar/group.d.ts +9 -8
- package/dist/components/sidebar/group.js +18 -13
- package/dist/components/sidebar/layout.d.ts +7 -2
- package/dist/components/sidebar/layout.js +11 -3
- package/dist/components/sidebar/menu-sub.d.ts +4 -3
- package/dist/components/sidebar/menu-sub.js +13 -13
- package/dist/components/sidebar/menu.d.ts +6 -6
- package/dist/components/sidebar/menu.js +28 -40
- package/dist/components/sidebar/panel.js +38 -21
- package/dist/components/sidebar/root.d.ts +1 -2
- package/dist/components/sidebar/root.js +7 -8
- package/dist/components/sidebar/trigger.js +1 -1
- package/dist/components/sidebar-tree-indicator.js +4 -4
- package/dist/components/skeleton.d.ts +7 -1
- package/dist/components/skeleton.js +18 -2
- package/dist/components/slider.d.ts +5 -5
- package/dist/components/slider.js +20 -11
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +24 -188
- package/dist/components/string-array.js +2 -2
- package/dist/components/switch.d.ts +2 -3
- package/dist/components/switch.js +6 -8
- package/dist/components/table.d.ts +14 -3
- package/dist/components/table.js +33 -9
- package/dist/components/tabs.d.ts +34 -8
- package/dist/components/tabs.js +96 -23
- package/dist/components/text-overflow.d.ts +8 -10
- package/dist/components/text-overflow.js +33 -39
- package/dist/components/textarea.d.ts +8 -1
- package/dist/components/textarea.js +24 -3
- package/dist/components/toaster.d.ts +1 -0
- package/dist/components/toaster.js +41 -20
- package/dist/components/toggle-group.d.ts +5 -3
- package/dist/components/toggle-group.js +11 -12
- package/dist/components/toggle.d.ts +3 -4
- package/dist/components/toggle.js +6 -6
- package/dist/components/tooltip.d.ts +7 -6
- package/dist/components/tooltip.js +18 -8
- package/dist/components/upload.d.ts +7 -2
- package/dist/components/upload.js +28 -7
- package/dist/components.css +325 -0
- package/dist/constants/CountryPhoneCodes.d.ts +1 -1
- package/dist/constants/CountryPhoneCodes.js +2 -2
- package/dist/federation.d.ts +13 -0
- package/dist/federation.js +28 -0
- package/dist/fonts.css +1 -1
- package/dist/hooks/use-confirm.js +17 -19
- package/dist/hooks/use-toast.d.ts +14 -16
- package/dist/hooks/use-toast.js +13 -108
- package/dist/index.d.ts +13 -8
- package/dist/index.js +11 -7
- package/dist/lib/cn-tables.d.ts +27 -0
- package/dist/lib/cn-tables.js +128 -0
- package/dist/lib/utils.d.ts +14 -2
- package/dist/lib/utils.js +14 -6
- package/dist/modules/attachments/attachment-media.js +56 -56
- package/dist/modules/blocks/components/BarcodeAttribute.js +11 -8
- package/dist/modules/blocks/components/BarcodeSizeSettings.js +5 -6
- package/dist/modules/blocks/components/BlockEditor.js +14 -4
- package/dist/modules/blocks/components/BlockEditorInlineContent.d.ts +26 -36
- package/dist/modules/blocks/components/BlockEditorInlineContent.js +2 -2
- package/dist/modules/blocks/components/BlockToolbar.d.ts +6 -0
- package/dist/modules/blocks/components/BlockToolbar.js +19 -4
- package/dist/modules/blocks/components/CustomFileBlock.d.ts +13 -39
- package/dist/modules/blocks/components/CustomFileBlock.js +8 -9
- package/dist/modules/blocks/components/CustomImageBlock.d.ts +28 -78
- package/dist/modules/blocks/components/CustomImageBlock.js +20 -99
- package/dist/modules/blocks/components/CustomVideoBlock.d.ts +26 -63
- package/dist/modules/blocks/components/CustomVideoBlock.js +10 -8
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.d.ts +13 -39
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.js +1 -2
- package/dist/modules/blocks/components/Editor.d.ts +1 -1
- package/dist/modules/blocks/components/Editor.js +5 -4
- package/dist/modules/blocks/components/FontFamilyButton.js +25 -21
- package/dist/modules/blocks/components/FontSizeButton.js +26 -22
- package/dist/modules/blocks/components/GalleryBlock.d.ts +7 -25
- package/dist/modules/blocks/components/GalleryBlock.js +2 -35
- package/dist/modules/blocks/components/GalleryBlockContent.js +8 -3
- package/dist/modules/blocks/components/GalleryBlockParts.js +23 -21
- package/dist/modules/blocks/components/GalleryExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/GalleryExternalHtml.js +36 -0
- package/dist/modules/blocks/components/ImageExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/ImageExternalHtml.js +51 -0
- package/dist/modules/blocks/components/ImageStyleButton.js +22 -18
- package/dist/modules/blocks/components/LazyEditor.d.ts +9 -0
- package/dist/modules/blocks/components/LazyEditor.js +14 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.d.ts +24 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.js +98 -0
- package/dist/modules/blocks/components/SlashMenu.js +2 -2
- package/dist/modules/blocks/components/SuggestionMenu.js +5 -6
- package/dist/modules/blocks/components/TableColorPicker.d.ts +1 -1
- package/dist/modules/blocks/components/TableColorPicker.js +20 -27
- package/dist/modules/blocks/components/TableHandleWithRemove.js +34 -50
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.js +3 -4
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +3 -4
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.d.ts +3 -0
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.js +8 -0
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.js +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +5 -16
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.d.ts +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.js +24 -20
- package/dist/modules/blocks/constant/blockEditorSchema.d.ts +268 -653
- package/dist/modules/blocks/constant/blockEditorSchema.js +33 -41
- package/dist/modules/blocks/constant/galleryBlockConfig.d.ts +1 -2
- package/dist/modules/blocks/constant/imageBlockConfig.d.ts +46 -0
- package/dist/modules/blocks/constant/imageBlockConfig.js +39 -0
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.d.ts +2 -3
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.js +7 -9
- package/dist/modules/blocks/hooks/toolbar/useCodeActive.js +5 -7
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.d.ts +9 -0
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.js +27 -0
- package/dist/modules/blocks/hooks/useBlockEditor.d.ts +2 -0
- package/dist/modules/blocks/hooks/useBlockEditor.js +9 -3
- package/dist/modules/blocks/hooks/useEditorValue.d.ts +2 -1
- package/dist/modules/blocks/hooks/useEditorValue.js +8 -19
- package/dist/modules/blocks/types/TextEditor.d.ts +3 -1
- package/dist/modules/blocks/types/toolbar/ImageStyleOption.d.ts +1 -1
- package/dist/modules/blocks/utils/getSlashMenuItems.js +0 -15
- package/dist/modules/blocks/utils/parseBlocks.d.ts +3 -1
- package/dist/modules/blocks/utils/parseBlocks.js +14 -1
- package/dist/modules/display/components/EmailDisplay.js +26 -27
- package/dist/modules/display/components/PhoneDisplay.js +2 -2
- package/dist/modules/display/components/RelativeDateDisplay.d.ts +2 -2
- package/dist/modules/display/components/RelativeDateDisplay.js +7 -10
- package/dist/modules/filter/components/FilterBar.js +6 -6
- package/dist/modules/filter/components/FilterDialog.js +13 -20
- package/dist/modules/filter/components/FilterPopover.js +20 -28
- package/dist/modules/hotkey/components/PopoverScoped.d.ts +5 -4
- package/dist/modules/hotkey/components/PopoverScoped.js +5 -5
- package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +3 -3
- package/dist/modules/hotkey/hooks/useScopedHotkeys.js +15 -24
- package/dist/modules/icons/components/IconComponent.d.ts +1 -1
- package/dist/modules/icons/components/IconPicker.js +15 -14
- package/dist/modules/inputs/components/ContactFieldParts.js +13 -14
- package/dist/modules/inputs/components/EmailFieldForm.js +2 -3
- package/dist/modules/inputs/components/FullNameField.js +6 -4
- package/dist/modules/inputs/components/PhoneFieldForm.js +2 -1
- package/dist/modules/layout/components/AppLayout.js +18 -20
- package/dist/modules/layout/components/AppLayoutPageSlot.js +1 -1
- package/dist/modules/layout/components/AppLayoutResizeHandle.js +1 -1
- package/dist/modules/layout/components/Page.d.ts +6 -1
- package/dist/modules/layout/components/Page.js +11 -3
- package/dist/modules/layout/components/PageHeader.d.ts +10 -3
- package/dist/modules/layout/components/PageHeader.js +23 -5
- package/dist/modules/navigation-menu/components/NavigationMenu.js +12 -15
- package/dist/modules/pickers/EntityPicker.d.ts +30 -0
- package/dist/modules/pickers/EntityPicker.js +60 -0
- package/dist/modules/pickers/SelectMember.d.ts +41 -0
- package/dist/modules/pickers/SelectMember.js +122 -0
- package/dist/modules/pickers/members.d.ts +30 -0
- package/dist/modules/pickers/members.js +18 -0
- package/dist/modules/record-field/components/NumberField.d.ts +2 -2
- package/dist/modules/record-field/components/NumberField.js +22 -25
- package/dist/modules/record-field/components/TextField.d.ts +3 -3
- package/dist/modules/record-field/components/TextField.js +25 -28
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +3 -1
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +18 -12
- package/dist/modules/record-table/components/CheckboxColumn.d.ts +4 -3
- package/dist/modules/record-table/components/CheckboxColumn.js +52 -35
- package/dist/modules/record-table/components/MoreColumn.js +4 -3
- package/dist/modules/record-table/components/RecordTable.d.ts +3 -2
- package/dist/modules/record-table/components/RecordTable.js +2 -1
- package/dist/modules/record-table/components/RecordTableCell.d.ts +6 -3
- package/dist/modules/record-table/components/RecordTableCell.js +17 -11
- package/dist/modules/record-table/components/RecordTableCellInline.d.ts +15 -4
- package/dist/modules/record-table/components/RecordTableCellInline.js +48 -24
- package/dist/modules/record-table/components/RecordTableColumnSelector.d.ts +1 -2
- package/dist/modules/record-table/components/RecordTableColumnSelector.js +48 -45
- package/dist/modules/record-table/components/RecordTableContainer.d.ts +8 -3
- package/dist/modules/record-table/components/RecordTableContainer.js +28 -16
- package/dist/modules/record-table/components/RecordTableCursor.js +4 -4
- package/dist/modules/record-table/components/RecordTableHead.d.ts +9 -4
- package/dist/modules/record-table/components/RecordTableHead.js +40 -34
- package/dist/modules/record-table/components/RecordTableHeader.js +24 -15
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +30 -7
- package/dist/modules/record-table/components/RecordTableProvider.js +32 -22
- package/dist/modules/record-table/components/RecordTableRoot.d.ts +2 -1
- package/dist/modules/record-table/components/RecordTableRoot.js +7 -12
- package/dist/modules/record-table/components/RecordTableRow.d.ts +8 -1
- package/dist/modules/record-table/components/RecordTableRow.js +13 -12
- package/dist/modules/record-table/components/RecordTableRowList.d.ts +6 -1
- package/dist/modules/record-table/components/RecordTableRowList.js +28 -20
- package/dist/modules/record-table/components/RecordTableRowSkeleton.js +8 -12
- package/dist/modules/record-table/hooks/useColumnLayout.d.ts +2 -2
- package/dist/modules/record-table/hooks/useColumnLayout.js +8 -5
- package/dist/modules/record-table/hooks/useTablePreferences.d.ts +5 -5
- package/dist/modules/record-table/hooks/useTablePreferences.js +3 -3
- package/dist/modules/record-table/utils/columnLayout.d.ts +4 -4
- package/dist/modules/record-table/utils/columnLayout.js +7 -7
- package/dist/modules/record-table/utils/columnUtils.d.ts +3 -2
- package/dist/modules/record-table/utils/rowFields.d.ts +1 -0
- package/dist/modules/record-table/utils/rowFields.js +10 -9
- package/dist/state/sidebarPanelState.d.ts +5 -1
- package/dist/state/sidebarPanelState.js +4 -1
- package/dist/styles.css +3 -0
- package/dist/theme.css +104 -70
- package/dist/utils/file-storage.d.ts +1 -1
- package/dist/utils/plugin-runtime.d.ts +1 -1
- package/dist/utils/plugin-styles.d.ts +6 -0
- package/dist/utils/plugin-styles.js +53 -0
- package/dist/utils/record-timeline.d.ts +1 -1
- package/dist/utils/record-timeline.js +1 -1
- package/package.json +27 -22
- package/dist/components/multiselect-options.d.ts +0 -16
- package/dist/components/multiselect-options.js +0 -13
- package/dist/components/multiselect-parts.d.ts +0 -23
- package/dist/components/multiselect-parts.js +0 -62
- package/dist/components/multiselect-state.d.ts +0 -66
- package/dist/components/multiselect-state.js +0 -131
- package/dist/components/time-picker.d.ts +0 -10
- package/dist/components/time-picker.js +0 -33
- package/dist/components/toasts.d.ts +0 -21
- package/dist/components/toasts.js +0 -69
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.js +0 -24
- package/dist/modules/blocks/hooks/toolbar/useFontSize.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontSize.js +0 -24
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.d.ts +0 -6
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontFamily.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontFamily.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontSize.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontSize.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.d.ts +0 -4
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.d.ts +0 -3
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.js +0 -0
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.js +0 -30
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.js +0 -41
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.d.ts +0 -9
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.js +0 -15
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.d.ts +0 -4
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.js +0 -4
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# @erxes/ui
|
|
2
2
|
|
|
3
3
|
Published as `@erxes/ui` under the `v2-next` dist-tag and imported as `erxes-ui`: plugins install
|
|
4
|
-
`"erxes-ui": "npm:@erxes/ui@v2-next"`, `apps/
|
|
4
|
+
`"erxes-ui": "npm:@erxes/ui@v2-next"`, `apps/web` depends on `"erxes-ui": "workspace:@erxes/ui@*"`,
|
|
5
5
|
and the Module Federation shared key is `erxes-ui`. The `latest` and `next` tags belong to old
|
|
6
6
|
erxes's 3.x.
|
|
7
7
|
|
|
8
|
-
The design system
|
|
8
|
+
The design system web and plugin UIs share: UI primitives, layout, record tables, filters,
|
|
9
9
|
the block editor, hooks and shared state. In the workspace `exports` point at `src/` and
|
|
10
|
-
`apps/
|
|
10
|
+
`apps/web` compiles it. `pnpm build` (tsdown) writes the publishable `dist/`, one module and
|
|
11
11
|
`.d.ts` per source file, and checks the packed package with publint and attw; `publishConfig`
|
|
12
12
|
holds the `exports` a published copy uses.
|
|
13
13
|
|
|
14
14
|
## Who imports it
|
|
15
15
|
|
|
16
|
-
- `apps/
|
|
16
|
+
- `apps/web` imports `erxes-ui` and, for a few files, `erxes-ui/<path>` (the `./*` export).
|
|
17
17
|
- Plugin UIs get `erxes-ui` from the host as a Module Federation singleton and import only the
|
|
18
18
|
root, `src/index.ts`. A removed export breaks them at runtime, not at build time.
|
|
19
19
|
|
|
@@ -21,12 +21,15 @@ holds the `exports` a published copy uses.
|
|
|
21
21
|
|
|
22
22
|
Only what something uses:
|
|
23
23
|
|
|
24
|
-
- what
|
|
24
|
+
- what web imports,
|
|
25
25
|
- what plugin UIs import (the HR plugin is the first consumer),
|
|
26
26
|
- the plugin API in the plugin skills: `getPluginRuntime`, `pluginFetch`, `pluginJson`,
|
|
27
|
-
`useLiveSignal`, `RecordTimeline`, `getPluginAssetsUrl` and the `IUIConfig` types,
|
|
27
|
+
`useLiveSignal`, `RecordTimeline`, `getPluginAssetsUrl`, `addPluginStyles` and the `IUIConfig` types,
|
|
28
28
|
- the design-system primitives in `src/components` (Accordion, Card, Slider …), even unused,
|
|
29
|
-
because plugins build on them
|
|
29
|
+
because plugins build on them,
|
|
30
|
+
- the pickers in `src/modules/pickers`: `EntityPicker`, and `SelectMember`, `MemberInline` and
|
|
31
|
+
`useMembersById`, which take `memberQueries` from `@erxes/core-contract/client`. They read
|
|
32
|
+
through TanStack query options, so erxes-ui imports nothing from core.
|
|
30
33
|
|
|
31
34
|
Anything else is removed, not kept "in case". Before you remove an export, check the HR plugin
|
|
32
35
|
UI and `.agents/skills/plugin-contract/SKILL.md`.
|
|
@@ -35,4 +38,4 @@ UI and `.agents/skills/plugin-contract/SKILL.md`.
|
|
|
35
38
|
|
|
36
39
|
`styles.css` builds Tailwind from this package's sources and imports `theme.css` (tokens) and
|
|
37
40
|
`base.css` (page defaults, light and dark theme). `fonts.css` loads Inter and Roboto Mono for an
|
|
38
|
-
app not hosted by
|
|
41
|
+
app not hosted by web.
|
package/dist/base.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Default erxes theme and page defaults, shared by every app that hosts erxes
|
|
3
|
-
UI:
|
|
3
|
+
UI: web, standalone product apps and the published erxes-ui styles.
|
|
4
4
|
theme.css maps Tailwind utilities to these tokens; plugin remotes import only
|
|
5
5
|
theme.css, because the host page already declares the values below.
|
|
6
6
|
Import after Tailwind and theme.css, so `@apply` resolves.
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
|
|
16
16
|
--primary: oklch(0.514 0.2276 276.98);
|
|
17
17
|
--primary-foreground: oklch(0.9848 0 0);
|
|
18
|
+
/* Primary as text (links, active items): dark mode's --primary reads at 2.6:1 on dark surfaces. */
|
|
19
|
+
--primary-text: var(--primary);
|
|
18
20
|
|
|
19
21
|
--secondary: oklch(0.8372 0.0563 288.17);
|
|
20
22
|
--muted: oklch(0.9619 0 0);
|
|
21
|
-
--muted-foreground: oklch(0.
|
|
23
|
+
--muted-foreground: oklch(0.52 0.0057 17.33);
|
|
22
24
|
|
|
23
25
|
--accent: oklch(0.9688 0.0008 286.38);
|
|
24
|
-
|
|
26
|
+
/* Field labels, placeholders and table heads use it as text: 4.5:1 on white and on --muted (WCAG AA). */
|
|
27
|
+
--accent-foreground: oklch(0.52 0.0074 286.21);
|
|
25
28
|
|
|
26
29
|
--destructive: oklch(0.6368 0.2078 25.33);
|
|
27
30
|
--destructive-foreground: oklch(0.9848 0 0);
|
|
@@ -29,6 +32,11 @@
|
|
|
29
32
|
--success: oklch(0.7205 0.192 149.49);
|
|
30
33
|
--warning: oklch(0.7453 0.1322 54.63);
|
|
31
34
|
--info: oklch(0.6261 0.1859 259.6);
|
|
35
|
+
/* Status colours as text on their own 10% tint (badges): 4.5:1 or more. */
|
|
36
|
+
--success-text: oklch(0.47 0.14 149.49);
|
|
37
|
+
--warning-text: oklch(0.5 0.12 54.63);
|
|
38
|
+
--destructive-text: oklch(0.5 0.19 25.33);
|
|
39
|
+
--info-text: oklch(0.5 0.17 259.6);
|
|
32
40
|
|
|
33
41
|
--scroll: oklch(0.8634 0.0059 286.27);
|
|
34
42
|
--border: oklch(0.9197 0.0041 286.32);
|
|
@@ -66,13 +74,14 @@
|
|
|
66
74
|
|
|
67
75
|
--primary: oklch(0.514 0.2276 276.98);
|
|
68
76
|
--primary-foreground: oklch(0.9848 0 0);
|
|
77
|
+
--primary-text: oklch(0.7 0.15 276.98);
|
|
69
78
|
|
|
70
79
|
--secondary: oklch(0.2219 0.0798 280.68);
|
|
71
80
|
--muted: oklch(0.2591 0 0);
|
|
72
81
|
--muted-foreground: oklch(0.7132 0.0043 17.26);
|
|
73
82
|
|
|
74
83
|
--accent: oklch(0.245 0.0037 286.12);
|
|
75
|
-
--accent-foreground: oklch(0.
|
|
84
|
+
--accent-foreground: oklch(0.7132 0.0102 286.05);
|
|
76
85
|
|
|
77
86
|
--destructive: oklch(0.6368 0.2078 25.33);
|
|
78
87
|
--destructive-foreground: oklch(0.98 0.01 257);
|
|
@@ -80,6 +89,10 @@
|
|
|
80
89
|
--success: oklch(0.7205 0.192 149.49);
|
|
81
90
|
--warning: oklch(0.7453 0.1322 54.63);
|
|
82
91
|
--info: oklch(0.6261 0.1859 259.6);
|
|
92
|
+
--success-text: var(--success);
|
|
93
|
+
--warning-text: var(--warning);
|
|
94
|
+
--destructive-text: oklch(0.72 0.17 25.33);
|
|
95
|
+
--info-text: oklch(0.72 0.15 259.6);
|
|
83
96
|
|
|
84
97
|
--scroll: oklch(0.3701 0.0113 285.84);
|
|
85
98
|
--border: oklch(0.28 0.0104 285.76);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
export declare const Accordion: React.ForwardRefExoticComponent<(Accordion$1.AccordionMultipleProps | Accordion$1.AccordionSingleProps) & React.RefAttributes<HTMLDivElement>> & {
|
|
1
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
2
|
+
declare const AccordionItem: ({ className, ...props }: Accordion$1.Item.Props) => import("react").JSX.Element;
|
|
3
|
+
declare const AccordionTrigger: ({ className, children, ...props }: Accordion$1.Trigger.Props) => import("react").JSX.Element;
|
|
4
|
+
declare const AccordionPanel: ({ className, children, ...props }: Accordion$1.Panel.Props) => import("react").JSX.Element;
|
|
5
|
+
export declare const Accordion: (<Value = any>(props: Accordion$1.Root.Props<Value>) => React.JSX.Element) & {
|
|
7
6
|
Item: typeof AccordionItem;
|
|
8
7
|
Trigger: typeof AccordionTrigger;
|
|
9
|
-
|
|
8
|
+
Panel: typeof AccordionPanel;
|
|
10
9
|
};
|
|
11
10
|
export {};
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Accordion as Accordion$1 } from "radix-ui";
|
|
2
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
3
|
import { IconChevronDown } from "@tabler/icons-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
// src/components/accordion.tsx
|
|
7
|
-
const
|
|
8
|
-
const AccordionItem = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
9
|
-
ref,
|
|
6
|
+
const AccordionItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
10
7
|
className: cn("border-b border-border", className),
|
|
11
8
|
...props
|
|
12
9
|
});
|
|
13
|
-
const AccordionTrigger = ({
|
|
10
|
+
const AccordionTrigger = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
14
11
|
className: "flex",
|
|
15
12
|
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
16
|
-
|
|
17
|
-
className: cn("flex flex-1 items-center justify-between py-4 text-left font-semibold transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className),
|
|
13
|
+
className: cn("flex flex-1 items-center justify-between py-4 text-left font-semibold transition-all hover:underline [&[data-panel-open]>svg]:rotate-180", className),
|
|
18
14
|
...props,
|
|
19
15
|
children: [children, /* @__PURE__ */ jsx(IconChevronDown, {
|
|
20
16
|
className: "shrink-0 opacity-60 transition-transform duration-200 size-4",
|
|
@@ -22,18 +18,17 @@ const AccordionTrigger = ({ ref, className, children, ...props }) => /* @__PURE_
|
|
|
22
18
|
})]
|
|
23
19
|
})
|
|
24
20
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
className: "overflow-y-clip text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
21
|
+
const AccordionPanel = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
22
|
+
className: "overflow-y-clip text-sm transition-all data-closed:animate-accordion-up data-open:animate-accordion-down",
|
|
28
23
|
...props,
|
|
29
24
|
children: /* @__PURE__ */ jsx("div", {
|
|
30
25
|
className: cn("pb-4 pt-0", className),
|
|
31
26
|
children
|
|
32
27
|
})
|
|
33
28
|
});
|
|
34
|
-
const Accordion = Object.assign(
|
|
29
|
+
const Accordion = Object.assign(Accordion$1.Root, {
|
|
35
30
|
Item: AccordionItem,
|
|
36
31
|
Trigger: AccordionTrigger,
|
|
37
|
-
|
|
32
|
+
Panel: AccordionPanel
|
|
38
33
|
});
|
|
39
34
|
export { Accordion };
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { AlertDialog as AlertDialog$1 } from "
|
|
3
|
-
|
|
4
|
-
declare const AlertDialogContent: ({
|
|
3
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
declare const AlertDialogContent: ({ className, initialFocus, ...props }: AlertDialog$1.Popup.Props) => React.JSX.Element;
|
|
5
6
|
declare const AlertDialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
6
7
|
declare const AlertDialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
7
|
-
declare const AlertDialogTitle: ({
|
|
8
|
-
declare const AlertDialogDescription: ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
declare const AlertDialogTitle: ({ className, ...props }: AlertDialog$1.Title.Props) => React.JSX.Element;
|
|
9
|
+
declare const AlertDialogDescription: ({ className, ...props }: AlertDialog$1.Description.Props) => React.JSX.Element;
|
|
10
|
+
/** Both buttons close the dialog; Action is the primary one. */
|
|
11
|
+
type AlertDialogButtonProps = AlertDialog$1.Close.Props & Pick<VariantProps<typeof buttonVariants>, 'variant'>;
|
|
12
|
+
declare const AlertDialogAction: ({ className, variant, ...props }: AlertDialogButtonProps) => React.JSX.Element;
|
|
13
|
+
declare const AlertDialogCancel: ({ className, variant, ...props }: AlertDialogButtonProps) => React.JSX.Element;
|
|
14
|
+
export declare const AlertDialog: typeof AlertDialog$1.Root & {
|
|
12
15
|
Action: typeof AlertDialogAction;
|
|
13
16
|
Cancel: typeof AlertDialogCancel;
|
|
14
17
|
Content: typeof AlertDialogContent;
|
|
15
18
|
Description: typeof AlertDialogDescription;
|
|
16
19
|
Footer: typeof AlertDialogFooter;
|
|
17
20
|
Header: typeof AlertDialogHeader;
|
|
18
|
-
Overlay: typeof AlertDialogOverlay;
|
|
19
|
-
Portal: React.FC<AlertDialog$1.AlertDialogPortalProps>;
|
|
20
21
|
Title: typeof AlertDialogTitle;
|
|
21
|
-
Trigger:
|
|
22
|
+
Trigger: AlertDialog$1.Trigger;
|
|
22
23
|
};
|
|
23
24
|
export {};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { buttonVariants } from "./button.js";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { AlertDialog as AlertDialog$1 } from "radix-ui";
|
|
5
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createContext, use, useRef } from "react";
|
|
5
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
6
6
|
// src/components/alert-dialog.tsx
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})] })
|
|
7
|
+
const CancelRefContext = createContext(null);
|
|
8
|
+
const AlertDialogContent = ({ className, initialFocus, ...props }) => {
|
|
9
|
+
const cancelRef = useRef(null);
|
|
10
|
+
return /* @__PURE__ */ jsx(CancelRefContext, {
|
|
11
|
+
value: cancelRef,
|
|
12
|
+
children: /* @__PURE__ */ jsxs(AlertDialog$1.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
13
|
+
forceRender: true,
|
|
14
|
+
className: "fixed inset-0 z-50 bg-black/80 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0"
|
|
15
|
+
}), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
16
|
+
initialFocus: initialFocus ?? cancelRef,
|
|
17
|
+
className: cn("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-closed:slide-out-to-top-1/2 data-open:slide-in-from-top-1/2 sm:rounded-lg", className),
|
|
18
|
+
...props
|
|
19
|
+
})] })
|
|
20
|
+
});
|
|
21
|
+
};
|
|
20
22
|
const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
21
23
|
className: cn("flex flex-col space-y-2 text-center sm:text-left", className),
|
|
22
24
|
...props
|
|
@@ -25,36 +27,31 @@ const AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div"
|
|
|
25
27
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
26
28
|
...props
|
|
27
29
|
});
|
|
28
|
-
const AlertDialogTitle = ({
|
|
29
|
-
ref,
|
|
30
|
+
const AlertDialogTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
30
31
|
className: cn("text-lg font-semibold", className),
|
|
31
32
|
...props
|
|
32
33
|
});
|
|
33
|
-
const AlertDialogDescription = ({
|
|
34
|
-
ref,
|
|
34
|
+
const AlertDialogDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
35
35
|
className: cn("text-sm text-muted-foreground", className),
|
|
36
36
|
...props
|
|
37
37
|
});
|
|
38
|
-
const AlertDialogAction = ({
|
|
39
|
-
|
|
40
|
-
className: cn(buttonVariants(), className),
|
|
38
|
+
const AlertDialogAction = ({ className, variant, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
39
|
+
className: cn(buttonVariants({ variant }), className),
|
|
41
40
|
...props
|
|
42
41
|
});
|
|
43
|
-
const AlertDialogCancel = ({
|
|
44
|
-
ref,
|
|
45
|
-
className: cn(buttonVariants({ variant
|
|
42
|
+
const AlertDialogCancel = ({ className, variant = "outline", ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
43
|
+
ref: use(CancelRefContext),
|
|
44
|
+
className: cn(buttonVariants({ variant }), "mt-2 sm:mt-0", className),
|
|
46
45
|
...props
|
|
47
46
|
});
|
|
48
|
-
const AlertDialog = Object.assign(
|
|
47
|
+
const AlertDialog = Object.assign(AlertDialog$1.Root, {
|
|
49
48
|
Action: AlertDialogAction,
|
|
50
49
|
Cancel: AlertDialogCancel,
|
|
51
50
|
Content: AlertDialogContent,
|
|
52
51
|
Description: AlertDialogDescription,
|
|
53
52
|
Footer: AlertDialogFooter,
|
|
54
53
|
Header: AlertDialogHeader,
|
|
55
|
-
Overlay: AlertDialogOverlay,
|
|
56
|
-
Portal: AlertDialogPortal,
|
|
57
54
|
Title: AlertDialogTitle,
|
|
58
|
-
Trigger:
|
|
55
|
+
Trigger: AlertDialog$1.Trigger
|
|
59
56
|
});
|
|
60
57
|
export { AlertDialog };
|
package/dist/components/alert.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
// src/components/alert.tsx
|
|
6
|
-
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid
|
|
6
|
+
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-leading has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
7
7
|
variants: { variant: {
|
|
8
8
|
default: "",
|
|
9
9
|
warning: "text-warning border-warning/50 [&>svg]:text-current data-[slot=alert-description]:*:text-warning/90",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Avatar as Avatar$1 } from "radix-ui";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
4
4
|
declare const avatarVariants: (props?: ({
|
|
5
|
+
corners?: "circle" | "square" | null | undefined;
|
|
6
|
+
ring?: "lg" | "sm" | null | undefined;
|
|
5
7
|
size?: "default" | "lg" | "sm" | "xl" | "xs" | null | undefined;
|
|
6
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
export type AvatarProps = React.
|
|
8
|
-
declare const AvatarRoot: ({
|
|
9
|
-
declare const AvatarImage: ({
|
|
10
|
-
declare const AvatarFallback: ({
|
|
9
|
+
export type AvatarProps = React.ComponentProps<typeof Avatar$1.Root> & VariantProps<typeof avatarVariants>;
|
|
10
|
+
declare const AvatarRoot: ({ className, corners, ring, size, ...props }: AvatarProps) => React.JSX.Element;
|
|
11
|
+
declare const AvatarImage: ({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>) => React.JSX.Element;
|
|
12
|
+
declare const AvatarFallback: ({ className, style, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>) => React.JSX.Element;
|
|
11
13
|
export declare const Avatar: typeof AvatarRoot & {
|
|
12
14
|
Image: typeof AvatarImage;
|
|
13
15
|
Fallback: typeof AvatarFallback;
|
|
@@ -1,36 +1,47 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Avatar as Avatar$1 } from "radix-ui";
|
|
4
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
5
4
|
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
6
6
|
// src/components/avatar.tsx
|
|
7
|
-
const avatarVariants = cva("relative flex shrink-0 overflow-hidden
|
|
8
|
-
variants: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const avatarVariants = cva("relative flex shrink-0 overflow-hidden border-0", {
|
|
8
|
+
variants: {
|
|
9
|
+
corners: {
|
|
10
|
+
circle: "rounded-full",
|
|
11
|
+
square: "rounded-md"
|
|
12
|
+
},
|
|
13
|
+
ring: {
|
|
14
|
+
sm: "bg-background ring-2 ring-background",
|
|
15
|
+
lg: "bg-background ring-4 ring-background"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
xs: "size-3 text-4xs",
|
|
19
|
+
sm: "size-3.5 text-3xs",
|
|
20
|
+
default: "size-4 text-xs",
|
|
21
|
+
lg: "size-6 text-sm",
|
|
22
|
+
xl: "size-8 text-base"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
corners: "circle",
|
|
27
|
+
size: "default"
|
|
28
|
+
}
|
|
16
29
|
});
|
|
17
|
-
const AvatarRoot = ({
|
|
18
|
-
ref,
|
|
30
|
+
const AvatarRoot = ({ className, corners, ring, size, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
19
31
|
className: cn(avatarVariants({
|
|
20
|
-
|
|
32
|
+
corners,
|
|
33
|
+
ring,
|
|
21
34
|
size
|
|
22
35
|
}), className),
|
|
23
36
|
...props
|
|
24
37
|
});
|
|
25
|
-
const AvatarImage = ({
|
|
26
|
-
ref,
|
|
38
|
+
const AvatarImage = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
27
39
|
className: cn("aspect-square h-full w-full object-cover", className),
|
|
28
40
|
...props
|
|
29
41
|
});
|
|
30
|
-
const AvatarFallback = ({
|
|
42
|
+
const AvatarFallback = ({ className, style, ...props }) => {
|
|
31
43
|
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
32
|
-
|
|
33
|
-
className: cn("flex h-full w-full items-center justify-center rounded-full uppercase bg-muted text-muted-foreground", className),
|
|
44
|
+
className: cn("flex h-full w-full items-center justify-center uppercase bg-muted text-muted-foreground", className),
|
|
34
45
|
...props
|
|
35
46
|
});
|
|
36
47
|
};
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
/** Slowly moving colour blobs behind `children
|
|
3
|
-
export declare const BackgroundGradientAnimation: ({
|
|
4
|
-
gradientBackgroundStart?: string;
|
|
5
|
-
gradientBackgroundEnd?: string;
|
|
6
|
-
firstColor?: string;
|
|
7
|
-
secondColor?: string;
|
|
8
|
-
thirdColor?: string;
|
|
9
|
-
fourthColor?: string;
|
|
10
|
-
fifthColor?: string;
|
|
11
|
-
size?: string;
|
|
12
|
-
blendingValue?: string;
|
|
2
|
+
/** Slowly moving colour blobs behind `children` (components.css draws them). */
|
|
3
|
+
export declare const BackgroundGradientAnimation: ({ children, className, containerClassName }: {
|
|
13
4
|
children?: ReactNode;
|
|
14
5
|
className?: string;
|
|
15
6
|
containerClassName?: string;
|
|
@@ -2,29 +2,13 @@ import { cn } from "../lib/utils.js";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
// src/components/background-gradient-animation.tsx
|
|
4
4
|
const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
5
|
-
|
|
6
|
-
/** The moving colour blobs: their gradient, orbit origin, animation and opacity. */
|
|
5
|
+
/** The moving colour blobs, each with its own orbit animation and opacity. */
|
|
7
6
|
const BLOBS = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
name: "second",
|
|
14
|
-
className: "[background:radial-gradient(circle_at_center,_rgba(var(--second-color),_0.8)_0,_rgba(var(--second-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-400px)] animate-second opacity-100"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "third",
|
|
18
|
-
className: "[background:radial-gradient(circle_at_center,_rgba(var(--third-color),_0.8)_0,_rgba(var(--third-color),_0)_50%)_no-repeat] [transform-origin:calc(50%+400px)] animate-third opacity-100"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "fourth",
|
|
22
|
-
className: "[background:radial-gradient(circle_at_center,_rgba(var(--fourth-color),_0.8)_0,_rgba(var(--fourth-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-200px)] animate-fourth opacity-70"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "fifth",
|
|
26
|
-
className: "[background:radial-gradient(circle_at_center,_rgba(var(--fifth-color),_0.8)_0,_rgba(var(--fifth-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-800px)_calc(50%+800px)] animate-fifth opacity-100"
|
|
27
|
-
}
|
|
7
|
+
"gradient-blob-1 animate-first",
|
|
8
|
+
"gradient-blob-2 animate-second",
|
|
9
|
+
"gradient-blob-3 animate-third",
|
|
10
|
+
"gradient-blob-4 animate-fourth opacity-70",
|
|
11
|
+
"gradient-blob-5 animate-fifth"
|
|
28
12
|
];
|
|
29
13
|
const GooFilter = () => /* @__PURE__ */ jsx("svg", {
|
|
30
14
|
className: "hidden",
|
|
@@ -49,32 +33,19 @@ const GooFilter = () => /* @__PURE__ */ jsx("svg", {
|
|
|
49
33
|
]
|
|
50
34
|
}) })
|
|
51
35
|
});
|
|
52
|
-
/** Slowly moving colour blobs behind `children
|
|
53
|
-
const BackgroundGradientAnimation = ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ jsx(GooFilter, {}),
|
|
69
|
-
/* @__PURE__ */ jsx("div", {
|
|
70
|
-
className: cn("absolute z-10 flex h-full w-full flex-col px-8 py-4", className),
|
|
71
|
-
children
|
|
72
|
-
}),
|
|
73
|
-
/* @__PURE__ */ jsx("div", {
|
|
74
|
-
className: cn("gradients-container h-full w-full blur-lg", IS_SAFARI ? "blur-2xl" : "[filter:url(#blurMe)_blur(40px)]"),
|
|
75
|
-
children: BLOBS.map((blob) => /* @__PURE__ */ jsx("div", { className: cn(BLOB_BASE, blob.className) }, blob.name))
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
});
|
|
79
|
-
};
|
|
36
|
+
/** Slowly moving colour blobs behind `children` (components.css draws them). */
|
|
37
|
+
const BackgroundGradientAnimation = ({ children, className, containerClassName }) => /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: cn("gradient-backdrop relative top-0 left-0 flex w-1/2 flex-col overflow-hidden", containerClassName),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(GooFilter, {}),
|
|
41
|
+
/* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: cn("absolute z-10 flex h-full w-full flex-col px-8 py-4", className),
|
|
43
|
+
children
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: cn("h-full w-full", IS_SAFARI ? "blur-2xl" : "goo"),
|
|
47
|
+
children: BLOBS.map((blob) => /* @__PURE__ */ jsx("div", { className: cn("gradient-blob", blob) }, blob))
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
80
51
|
export { BackgroundGradientAnimation };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
export declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "ghost" | "info" | "secondary" | "success" | "warning" | null | undefined;
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "info" | "muted" | "secondary" | "success" | "warning" | null | undefined;
|
|
5
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
7
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
8
|
onClose?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const Badge: ({ ref, className, variant, children, onClose, ...props }: BadgeProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
10
|
+
export declare const Badge: ({ ref, className, variant, size, children, onClose, ...props }: BadgeProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element;
|
package/dist/components/badge.js
CHANGED
|
@@ -1,37 +1,52 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import "react";
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
4
3
|
import { IconX } from "@tabler/icons-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
// src/components/badge.tsx
|
|
8
|
-
const badgeVariants = cva("inline-flex items-center rounded-sm
|
|
9
|
-
variants: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const badgeVariants = cva("inline-flex items-center rounded-sm transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 whitespace-nowrap font-medium w-fit border gap-1", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary/10 text-primary-text border-primary/10",
|
|
12
|
+
secondary: "bg-accent",
|
|
13
|
+
/** A count of what didn't fit ("+3"). */
|
|
14
|
+
muted: "bg-accent text-muted-foreground",
|
|
15
|
+
ghost: "hover:bg-accent border-none hover:shadow-xs",
|
|
16
|
+
success: "bg-success/10 text-(--success-text) border-success/10",
|
|
17
|
+
warning: "bg-warning/10 text-(--warning-text) border-warning/10",
|
|
18
|
+
destructive: "bg-destructive/10 text-(--destructive-text) border-destructive/10",
|
|
19
|
+
info: "bg-info/10 text-(--info-text) border-info/10"
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
default: "h-6 px-2 text-xs",
|
|
23
|
+
/** A tag inside a line of text: a source, a priority. */
|
|
24
|
+
sm: "h-4 px-1.5 text-3xs",
|
|
25
|
+
lg: "h-7 px-2.5 text-sm"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default",
|
|
30
|
+
size: "default"
|
|
31
|
+
}
|
|
19
32
|
});
|
|
20
|
-
const Badge = ({ ref, className, variant, children, onClose, ...props }) => {
|
|
33
|
+
const Badge = ({ ref, className, variant, size, children, onClose, ...props }) => {
|
|
21
34
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
35
|
ref,
|
|
23
|
-
className: cn(badgeVariants({
|
|
36
|
+
className: cn(badgeVariants({
|
|
37
|
+
variant,
|
|
38
|
+
size
|
|
39
|
+
}), onClose && "pr-1", className),
|
|
24
40
|
...props,
|
|
25
|
-
children: [children, onClose && /* @__PURE__ */ jsx(
|
|
26
|
-
variant: "ghost",
|
|
27
|
-
size: "icon",
|
|
41
|
+
children: [children, onClose && /* @__PURE__ */ jsx(IconX, {
|
|
28
42
|
onClick: (e) => {
|
|
29
43
|
e.stopPropagation();
|
|
30
44
|
onClose();
|
|
31
45
|
},
|
|
32
|
-
className:
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
className: cn(buttonVariants({
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
size: "icon"
|
|
49
|
+
}), "size-3.5 p-0 hover:bg-transparent flex-none")
|
|
35
50
|
})]
|
|
36
51
|
});
|
|
37
52
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
3
|
declare const BreadcrumbRoot: ({ ref, ...props }: React.ComponentProps<'nav'> & {
|
|
3
4
|
separator?: React.ReactNode;
|
|
4
5
|
}) => React.JSX.Element;
|
|
5
6
|
declare const BreadcrumbList: ({ ref, className, ...props }: React.ComponentProps<'ol'>) => React.JSX.Element;
|
|
6
7
|
declare const BreadcrumbItem: ({ ref, className, ...props }: React.ComponentProps<'li'>) => React.JSX.Element;
|
|
7
|
-
declare const BreadcrumbLink: ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
declare const BreadcrumbLink: ({ className, children, ...props }: React.ComponentProps<'a'>) => React.JSX.Element;
|
|
9
|
+
declare const breadcrumbPageVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "text" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare const BreadcrumbPage: ({ ref, className, variant, ...props }: React.ComponentProps<'span'> & VariantProps<typeof breadcrumbPageVariants>) => React.JSX.Element;
|
|
11
13
|
declare const BreadcrumbSeparator: ({ children, className, ...props }: React.ComponentProps<'li'>) => React.JSX.Element;
|
|
12
14
|
declare const BreadcrumbEllipsis: ({ className, ...props }: React.ComponentProps<'span'>) => React.JSX.Element;
|
|
13
15
|
export declare const Breadcrumb: typeof BreadcrumbRoot & {
|