@godxjp/ui 5.0.2 → 6.0.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 +101 -142
- package/package.json +124 -128
- package/scripts/ui-audit.mjs +179 -0
- package/src/app/__tests__/app-provider.test.tsx +232 -0
- package/src/app/__tests__/date-format-labels.test.ts +36 -0
- package/src/app/__tests__/date-formats.test.ts +44 -0
- package/src/app/__tests__/timezones.test.ts +65 -0
- package/src/app/app-provider.tsx +227 -0
- package/src/app/date-format-labels.ts +21 -0
- package/src/app/date-formats.ts +30 -0
- package/src/app/index.ts +40 -0
- package/src/app/locales.ts +32 -0
- package/src/app/request-headers.ts +31 -0
- package/src/app/storage.ts +44 -0
- package/src/app/time-format-labels.ts +19 -0
- package/src/app/time-formats.ts +15 -0
- package/src/app/timezones.ts +208 -0
- package/src/app/types.ts +39 -0
- package/src/app/use-formatting.ts +47 -0
- package/src/components/__tests__/accessibility-primitives.test.tsx +65 -0
- package/src/components/__tests__/docs-parity.test.ts +41 -0
- package/src/components/__tests__/shadcn-release-guardrails.test.ts +71 -0
- package/src/components/__tests__/theme-axes-integration.test.tsx +242 -0
- package/src/components/admin/index.ts +76 -0
- package/src/components/data-display/__tests__/card-table.test.tsx +328 -0
- package/src/components/data-display/__tests__/data-display.test.tsx +73 -0
- package/src/components/data-display/__tests__/data-table.test.tsx +84 -0
- package/src/components/data-display/__tests__/popover.test.tsx +92 -0
- package/src/components/data-display/__tests__/scroll-area-collapsible.test.tsx +66 -0
- package/src/components/data-display/badge.tsx +27 -0
- package/src/components/data-display/card.tsx +194 -0
- package/src/components/data-display/code-badge.tsx +28 -0
- package/src/components/data-display/collapsible.tsx +5 -0
- package/src/components/data-display/data-table.tsx +476 -0
- package/src/components/data-display/empty-state.tsx +22 -0
- package/src/components/data-display/index.ts +41 -0
- package/src/components/data-display/key-value-grid.tsx +46 -0
- package/src/components/data-display/popover.tsx +62 -0
- package/src/components/data-display/progress-meter.tsx +20 -0
- package/src/components/data-display/scan-panel.tsx +16 -0
- package/src/components/data-display/scroll-area.tsx +42 -0
- package/src/components/data-display/status-badge.tsx +83 -0
- package/src/components/data-display/table.tsx +59 -0
- package/src/components/data-display/timeline.tsx +42 -0
- package/src/components/data-display/tree-list.tsx +42 -0
- package/src/components/data-entry/__fixtures__/tree-options.ts +80 -0
- package/src/components/data-entry/__tests__/cascader-tree-transfer.test.tsx +417 -0
- package/src/components/data-entry/__tests__/checkbox-group.test.tsx +40 -0
- package/src/components/data-entry/__tests__/checkbox.test.tsx +20 -0
- package/src/components/data-entry/__tests__/date-autocomplete.test.tsx +94 -0
- package/src/components/data-entry/__tests__/form-field.test.tsx +49 -0
- package/src/components/data-entry/__tests__/input-textarea.test.tsx +38 -0
- package/src/components/data-entry/__tests__/label-select.test.tsx +62 -0
- package/src/components/data-entry/__tests__/pickers.test.tsx +74 -0
- package/src/components/data-entry/__tests__/radio.test.tsx +46 -0
- package/src/components/data-entry/__tests__/search-input.test.tsx +32 -0
- package/src/components/data-entry/__tests__/switch-field.test.tsx +52 -0
- package/src/components/data-entry/__tests__/upload.test.tsx +125 -0
- package/src/components/data-entry/autocomplete.tsx +91 -0
- package/src/components/data-entry/calendar.tsx +90 -0
- package/src/components/data-entry/cascader.tsx +305 -0
- package/src/components/data-entry/checkbox-group.tsx +90 -0
- package/src/components/data-entry/checkbox.tsx +30 -0
- package/src/components/data-entry/choice-field.tsx +27 -0
- package/src/components/data-entry/choice-option.ts +20 -0
- package/src/components/data-entry/color-picker.tsx +75 -0
- package/src/components/data-entry/command.tsx +56 -0
- package/src/components/data-entry/country-select.tsx +88 -0
- package/src/components/data-entry/date-picker.tsx +69 -0
- package/src/components/data-entry/date-range-picker.tsx +75 -0
- package/src/components/data-entry/form-field.tsx +59 -0
- package/src/components/data-entry/index.ts +62 -0
- package/src/components/data-entry/input.tsx +26 -0
- package/src/components/data-entry/label.tsx +25 -0
- package/src/components/data-entry/radio.tsx +109 -0
- package/src/components/data-entry/search-input.tsx +103 -0
- package/src/components/data-entry/select.tsx +149 -0
- package/src/components/data-entry/slider.tsx +38 -0
- package/src/components/data-entry/switch-field.tsx +91 -0
- package/src/components/data-entry/switch.tsx +24 -0
- package/src/components/data-entry/textarea.tsx +12 -0
- package/src/components/data-entry/time-picker.tsx +214 -0
- package/src/components/data-entry/transfer.tsx +231 -0
- package/src/components/data-entry/tree-select-strategy.ts +6 -0
- package/src/components/data-entry/tree-select.tsx +279 -0
- package/src/components/data-entry/tree-utils.ts +221 -0
- package/src/components/data-entry/upload-crop-dialog.tsx +109 -0
- package/src/components/data-entry/upload-types.ts +86 -0
- package/src/components/data-entry/upload.tsx +498 -0
- package/src/components/data-entry/use-upload-draft.ts +93 -0
- package/src/components/feedback/__tests__/alert.test.tsx +127 -0
- package/src/components/feedback/__tests__/dialog.test.tsx +290 -0
- package/src/components/feedback/__tests__/sheet.test.tsx +94 -0
- package/src/components/feedback/__tests__/skeleton.test.tsx +25 -0
- package/src/components/feedback/__tests__/toast.test.tsx +52 -0
- package/src/components/feedback/alert.tsx +167 -0
- package/src/components/feedback/dialog.tsx +325 -0
- package/src/components/feedback/index.ts +53 -0
- package/src/components/feedback/sheet.tsx +130 -0
- package/src/components/feedback/skeleton.tsx +95 -0
- package/src/components/feedback/sonner.tsx +54 -0
- package/src/components/feedback/toaster.tsx +1 -0
- package/src/components/feedback/use-toast.ts +62 -0
- package/src/components/general/__tests__/button.test.tsx +71 -0
- package/src/components/general/button.tsx +61 -0
- package/src/components/general/index.ts +2 -0
- package/src/components/layout/__tests__/page-container.test.tsx +69 -0
- package/src/components/layout/__tests__/page-inset.test.tsx +14 -0
- package/src/components/layout/__tests__/stack-inline.test.tsx +39 -0
- package/src/components/layout/app-shell.tsx +42 -0
- package/src/components/layout/breadcrumb.tsx +35 -0
- package/src/components/layout/index.ts +31 -0
- package/src/components/layout/inline.tsx +13 -0
- package/src/components/layout/menu.tsx +34 -0
- package/src/components/layout/mobile-frame.tsx +57 -0
- package/src/components/layout/page-container.tsx +81 -0
- package/src/components/layout/page-inset.tsx +16 -0
- package/src/components/layout/responsive-grid.tsx +14 -0
- package/src/components/layout/shell-app.tsx +30 -0
- package/src/components/layout/sidebar.tsx +98 -0
- package/src/components/layout/split-pane.tsx +16 -0
- package/src/components/layout/stack.tsx +13 -0
- package/src/components/layout/topbar.tsx +108 -0
- package/src/components/navigation/__tests__/app-pickers.test.tsx +118 -0
- package/src/components/navigation/__tests__/dropdown-menu.test.tsx +104 -0
- package/src/components/navigation/__tests__/navigation.test.tsx +61 -0
- package/src/components/navigation/__tests__/pagination-steps-tabs.test.tsx +76 -0
- package/src/components/navigation/date-format-picker.tsx +55 -0
- package/src/components/navigation/dropdown-menu.tsx +190 -0
- package/src/components/navigation/filter-bar.tsx +38 -0
- package/src/components/navigation/index.ts +28 -0
- package/src/components/navigation/locale-picker.tsx +49 -0
- package/src/components/navigation/page-header.tsx +50 -0
- package/src/components/navigation/pagination-utils.ts +35 -0
- package/src/components/navigation/pagination.tsx +168 -0
- package/src/components/navigation/steps.tsx +163 -0
- package/src/components/navigation/tabs-items.tsx +69 -0
- package/src/components/navigation/tabs.tsx +67 -0
- package/src/components/navigation/time-format-picker.tsx +55 -0
- package/src/components/navigation/timezone-picker.tsx +63 -0
- package/src/components/query/__tests__/data-state.test.tsx +214 -0
- package/src/components/query/__tests__/infinite-prefetch.test.tsx +105 -0
- package/src/components/query/__tests__/query-helpers.test.tsx +61 -0
- package/src/components/query/data-state.tsx +58 -0
- package/src/components/query/index.ts +10 -0
- package/src/components/query/infinite-query-state.tsx +99 -0
- package/src/components/query/mutation-feedback.tsx +31 -0
- package/src/components/query/prefetch-link.tsx +45 -0
- package/src/components/query/query-refetch-button.tsx +41 -0
- package/src/components/ui/alert-dialog.tsx +1 -0
- package/src/components/ui/alert.tsx +1 -0
- package/src/components/ui/autocomplete.tsx +1 -0
- package/src/components/ui/badge.tsx +1 -0
- package/src/components/ui/button.tsx +1 -0
- package/src/components/ui/calendar.tsx +1 -0
- package/src/components/ui/card.tsx +1 -0
- package/src/components/ui/checkbox.tsx +1 -0
- package/src/components/ui/color-picker.tsx +1 -0
- package/src/components/ui/command.tsx +1 -0
- package/src/components/ui/date-picker.tsx +1 -0
- package/src/components/ui/date-range-picker.tsx +1 -0
- package/src/components/ui/dialog.tsx +1 -0
- package/src/components/ui/dropdown-menu.tsx +1 -0
- package/src/components/ui/index.tsx +31 -0
- package/src/components/ui/input.tsx +1 -0
- package/src/components/ui/label.tsx +1 -0
- package/src/components/ui/pagination.tsx +1 -0
- package/src/components/ui/popover.tsx +1 -0
- package/src/components/ui/radio.tsx +1 -0
- package/src/components/ui/scroll-area.tsx +1 -0
- package/src/components/ui/select.tsx +1 -0
- package/src/components/ui/sheet.tsx +1 -0
- package/src/components/ui/slider.tsx +1 -0
- package/src/components/ui/sonner.tsx +1 -0
- package/src/components/ui/switch.tsx +1 -0
- package/src/components/ui/table.tsx +1 -0
- package/src/components/ui/tabs-items.tsx +1 -0
- package/src/components/ui/tabs.tsx +1 -0
- package/src/components/ui/textarea.tsx +1 -0
- package/src/components/ui/time-picker.tsx +1 -0
- package/src/components/ui/upload.tsx +1 -0
- package/src/form/__tests__/use-zod-form.test.tsx +97 -0
- package/src/form/form-field-control.tsx +44 -0
- package/src/form/form-root.tsx +29 -0
- package/src/form/index.ts +7 -0
- package/src/form/use-zod-form.ts +29 -0
- package/src/i18n/__tests__/translate.test.ts +23 -0
- package/src/i18n/index.ts +9 -0
- package/src/i18n/messages/en.json +171 -0
- package/src/i18n/messages/ja.json +171 -0
- package/src/i18n/messages/vi.json +171 -0
- package/src/i18n/translate.ts +74 -0
- package/src/i18n/use-translation.ts +53 -0
- package/src/index.ts +3 -0
- package/src/lib/__tests__/control-styles.test.ts +78 -0
- package/src/lib/__tests__/datetime.test.ts +77 -0
- package/src/lib/__tests__/format-date.test.ts +97 -0
- package/src/lib/__tests__/format.test.ts +62 -0
- package/src/lib/__tests__/theme-tokens-audit.test.ts +176 -0
- package/src/lib/__tests__/theme-tokens-css.test.ts +118 -0
- package/src/lib/__tests__/token-governance.test.ts +191 -0
- package/src/lib/__tests__/variants.test.ts +18 -0
- package/src/lib/control-styles.ts +33 -0
- package/src/lib/datetime/detect.ts +25 -0
- package/src/lib/datetime/format-date.ts +100 -0
- package/src/lib/datetime/format.ts +140 -0
- package/src/lib/datetime/index.ts +25 -0
- package/src/lib/datetime/parse.ts +51 -0
- package/src/lib/datetime/sync.ts +48 -0
- package/src/lib/format.ts +114 -0
- package/src/lib/hooks.ts +54 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/variants.ts +40 -0
- package/src/props/components/app.prop.ts +99 -0
- package/src/props/components/data-display.prop.ts +73 -0
- package/src/props/components/data-entry.prop.ts +334 -0
- package/src/props/components/feedback.prop.ts +80 -0
- package/src/props/components/form.prop.ts +46 -0
- package/src/props/components/general.prop.ts +18 -0
- package/src/props/components/index.ts +99 -0
- package/src/props/components/layout.prop.ts +130 -0
- package/src/props/components/navigation.prop.ts +88 -0
- package/src/props/components/query.prop.ts +94 -0
- package/src/props/index.ts +17 -0
- package/src/props/registry.ts +603 -0
- package/src/props/vocabulary/content.prop.ts +35 -0
- package/src/props/vocabulary/data.prop.ts +46 -0
- package/src/props/vocabulary/index.ts +73 -0
- package/src/props/vocabulary/interaction.prop.ts +42 -0
- package/src/props/vocabulary/layout.prop.ts +25 -0
- package/src/props/vocabulary/navigation.prop.ts +19 -0
- package/src/props/vocabulary/shared.prop.ts +59 -0
- package/src/styles/alert-layout.css +191 -0
- package/src/styles/badge-layout.css +22 -0
- package/src/styles/card-layout.css +373 -0
- package/src/styles/control.css +504 -0
- package/src/styles/data-display-layout.css +246 -0
- package/src/styles/density.css +43 -0
- package/src/styles/dialog-layout.css +84 -0
- package/src/styles/index.css +105 -0
- package/src/styles/layout.css +479 -0
- package/src/styles/shell-layout.css +604 -0
- package/src/styles/table-layout.css +109 -0
- package/src/test/__tests__/render-loop-guard.test.tsx +38 -0
- package/src/test/jest-dom.d.ts +4 -0
- package/src/test/render-loop-guard.tsx +50 -0
- package/src/test/render.tsx +29 -0
- package/src/test/theme-globals.test.ts +77 -0
- package/src/test/theme-globals.ts +134 -0
- package/src/test/theme-test-utils.tsx +67 -0
- package/src/theme/example.service.css +37 -0
- package/src/tokens/base.css +13 -0
- package/src/tokens/foundation.css +151 -0
- package/src/tokens/primitives/badge.css +13 -0
- package/src/tokens/primitives/card.css +29 -0
- package/src/tokens/primitives/control.css +55 -0
- package/src/tokens/primitives/feedback.css +17 -0
- package/src/tokens/primitives/layout.css +20 -0
- package/src/tokens/primitives/navigation.css +13 -0
- package/src/tokens/primitives/table.css +10 -0
- package/BRAND.md +0 -296
- package/CHANGELOG.md +0 -668
- package/config/eslint.js +0 -54
- package/config/prettier.cjs +0 -20
- package/config/tsconfig.base.json +0 -22
- package/config/vitest.base.ts +0 -26
- package/dist/MiniMonth-YAmPGEpC.d.ts +0 -143
- package/dist/Table.types-BbsxoIYE.d.ts +0 -352
- package/dist/color-DO0qqUAb.d.ts +0 -38
- package/dist/components/composites.d.ts +0 -963
- package/dist/components/composites.js +0 -7343
- package/dist/components/composites.js.map +0 -1
- package/dist/components/primitives.d.ts +0 -2744
- package/dist/components/primitives.js +0 -7356
- package/dist/components/primitives.js.map +0 -1
- package/dist/components/shell.d.ts +0 -182
- package/dist/components/shell.js +0 -774
- package/dist/components/shell.js.map +0 -1
- package/dist/hooks.d.ts +0 -100
- package/dist/hooks.js +0 -558
- package/dist/hooks.js.map +0 -1
- package/dist/i18n.d.ts +0 -61
- package/dist/i18n.js +0 -860
- package/dist/i18n.js.map +0 -1
- package/dist/index.d.ts +0 -33
- package/dist/index.js +0 -13062
- package/dist/index.js.map +0 -1
- package/dist/padding-DY0JV5Ja.d.ts +0 -16
- package/dist/preferences.d.ts +0 -132
- package/dist/preferences.js +0 -262
- package/dist/preferences.js.map +0 -1
- package/dist/props.d.ts +0 -86
- package/dist/props.js +0 -16
- package/dist/props.js.map +0 -1
- package/dist/size-CQwNvOWd.d.ts +0 -19
- package/dist/types-LTj-2bl-.d.ts +0 -30
- package/dist/useTableViews-D5NIAJ7h.d.ts +0 -154
- package/src/tokens/tailwind.css +0 -158
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated -- barrel re-exports legacy PageHeaderProp */
|
|
2
|
+
export type {
|
|
3
|
+
AppShellProp,
|
|
4
|
+
InlineProp,
|
|
5
|
+
PageContainerProp,
|
|
6
|
+
PageHeaderProp,
|
|
7
|
+
PageInsetProp,
|
|
8
|
+
SidebarItemProp,
|
|
9
|
+
SidebarProductProp,
|
|
10
|
+
SidebarProp,
|
|
11
|
+
SidebarSectionProp,
|
|
12
|
+
StackProp,
|
|
13
|
+
TopbarProductProp,
|
|
14
|
+
TopbarProjectProp,
|
|
15
|
+
TopbarProp,
|
|
16
|
+
} from "./layout.prop";
|
|
17
|
+
export type { ButtonProp } from "./general.prop";
|
|
18
|
+
export type {
|
|
19
|
+
InputProp,
|
|
20
|
+
TextareaProp,
|
|
21
|
+
FormFieldProp,
|
|
22
|
+
SearchInputProp,
|
|
23
|
+
CheckboxProp,
|
|
24
|
+
CheckboxGroupProp,
|
|
25
|
+
ChoiceOptionProp,
|
|
26
|
+
RadioProp,
|
|
27
|
+
RadioGroupProp,
|
|
28
|
+
SwitchProp,
|
|
29
|
+
SliderProp,
|
|
30
|
+
CalendarProp,
|
|
31
|
+
DatePickerProp,
|
|
32
|
+
DateRangePickerProp,
|
|
33
|
+
TimePickerProp,
|
|
34
|
+
ColorPickerProp,
|
|
35
|
+
AutocompleteProp,
|
|
36
|
+
AutocompleteOptionProp,
|
|
37
|
+
UploadProp,
|
|
38
|
+
UploadFileItemProp,
|
|
39
|
+
UploadVariantProp,
|
|
40
|
+
TreeOptionProp,
|
|
41
|
+
TreeFieldNamesProp,
|
|
42
|
+
CascaderProp,
|
|
43
|
+
TreeSelectProp,
|
|
44
|
+
ShowCheckedStrategyProp,
|
|
45
|
+
TransferProp,
|
|
46
|
+
TransferItemProp,
|
|
47
|
+
} from "./data-entry.prop";
|
|
48
|
+
export type {
|
|
49
|
+
EmptyStateProp,
|
|
50
|
+
KeyValueGridProp,
|
|
51
|
+
KeyValueGridItemProp,
|
|
52
|
+
StatusBadgeProp,
|
|
53
|
+
DataTableProp,
|
|
54
|
+
BadgeProp,
|
|
55
|
+
} from "./data-display.prop";
|
|
56
|
+
export type {
|
|
57
|
+
DialogConfirmProp,
|
|
58
|
+
AlertQueryErrorProp,
|
|
59
|
+
AlertProp,
|
|
60
|
+
AlertTitleProp,
|
|
61
|
+
AlertContentProp,
|
|
62
|
+
AlertDescriptionProp,
|
|
63
|
+
AlertActionsProp,
|
|
64
|
+
SkeletonRowsProp,
|
|
65
|
+
} from "./feedback.prop";
|
|
66
|
+
export type {
|
|
67
|
+
DataStateProp,
|
|
68
|
+
MutationFeedbackProp,
|
|
69
|
+
QueryRefetchButtonProp,
|
|
70
|
+
InfiniteQueryStateProp,
|
|
71
|
+
InfiniteQueryHelpers,
|
|
72
|
+
PrefetchLinkProp,
|
|
73
|
+
} from "./query.prop";
|
|
74
|
+
export type {
|
|
75
|
+
FilterBarProp,
|
|
76
|
+
FilterGroupProp,
|
|
77
|
+
PaginationProp,
|
|
78
|
+
StepsProp,
|
|
79
|
+
StepItemProp,
|
|
80
|
+
StepStatusProp,
|
|
81
|
+
TabsItemsProp,
|
|
82
|
+
TabItemProp,
|
|
83
|
+
} from "./navigation.prop";
|
|
84
|
+
export type {
|
|
85
|
+
AppProviderProp,
|
|
86
|
+
AppContextValue,
|
|
87
|
+
LocalePickerProp,
|
|
88
|
+
TimezonePickerProp,
|
|
89
|
+
TimeFormatPickerProp,
|
|
90
|
+
DateFormatPickerProp,
|
|
91
|
+
} from "./app.prop";
|
|
92
|
+
export type {
|
|
93
|
+
ZodSchemaProp,
|
|
94
|
+
UseZodFormOptionsProp,
|
|
95
|
+
UseZodFormReturnProp,
|
|
96
|
+
FormRootProp,
|
|
97
|
+
FormFieldControlProp,
|
|
98
|
+
FieldErrorMessageProp,
|
|
99
|
+
} from "./form.prop";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** Layout component prop types — @see docs/COMPONENTS.md#layout */
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import type { ComponentType, ReactNode, SVGProps } from "react";
|
|
4
|
+
import type {
|
|
5
|
+
BreadcrumbProp,
|
|
6
|
+
PageTitleProp,
|
|
7
|
+
SubtitleProp,
|
|
8
|
+
ExtraProp,
|
|
9
|
+
FooterProp,
|
|
10
|
+
PageDensityProp,
|
|
11
|
+
PageContainerVariantProp,
|
|
12
|
+
StackGapProp,
|
|
13
|
+
InlineGapProp,
|
|
14
|
+
ClassNameProp,
|
|
15
|
+
ChildrenProp,
|
|
16
|
+
} from "../vocabulary";
|
|
17
|
+
|
|
18
|
+
/** @see PageContainer */
|
|
19
|
+
export type PageContainerProp = {
|
|
20
|
+
title: PageTitleProp;
|
|
21
|
+
subtitle?: SubtitleProp;
|
|
22
|
+
extra?: ExtraProp;
|
|
23
|
+
footer?: FooterProp;
|
|
24
|
+
breadcrumb?: BreadcrumbProp;
|
|
25
|
+
density?: PageDensityProp;
|
|
26
|
+
variant?: PageContainerVariantProp;
|
|
27
|
+
/** Pin footer to viewport bottom on scroll — pairs well with `variant="narrow"`. */
|
|
28
|
+
stickyFooter?: boolean;
|
|
29
|
+
children?: ChildrenProp;
|
|
30
|
+
className?: ClassNameProp;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @see Stack */
|
|
34
|
+
export type StackProp = React.HTMLAttributes<HTMLDivElement> & {
|
|
35
|
+
gap?: StackGapProp;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @see Inline */
|
|
39
|
+
export type InlineProp = React.HTMLAttributes<HTMLDivElement> & {
|
|
40
|
+
gap?: InlineGapProp;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @see PageInset — padded strip inside flush PageContainer (FilterBar, intro). */
|
|
44
|
+
export type PageInsetProp = React.HTMLAttributes<HTMLDivElement> & {
|
|
45
|
+
children?: ChildrenProp;
|
|
46
|
+
className?: ClassNameProp;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** @see AppShell */
|
|
50
|
+
export type AppShellProp = {
|
|
51
|
+
sidebar: ReactNode;
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
topbar?: ReactNode;
|
|
54
|
+
topbarLeft?: ReactNode;
|
|
55
|
+
topbarRight?: ReactNode;
|
|
56
|
+
logo?: ReactNode;
|
|
57
|
+
breadcrumb?: ReactNode;
|
|
58
|
+
footer?: ReactNode;
|
|
59
|
+
sidebarCollapsed?: boolean;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @see Sidebar */
|
|
63
|
+
export type SidebarProductProp = {
|
|
64
|
+
name: string;
|
|
65
|
+
role?: string;
|
|
66
|
+
color?: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** @see Sidebar */
|
|
70
|
+
export type SidebarItemProp = {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
icon: ComponentType<SVGProps<SVGSVGElement>>;
|
|
74
|
+
badge?: ReactNode;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** @see Sidebar */
|
|
79
|
+
export type SidebarSectionProp = {
|
|
80
|
+
label?: string;
|
|
81
|
+
items: SidebarItemProp[];
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @see Sidebar */
|
|
85
|
+
export type SidebarProp = {
|
|
86
|
+
activeId: string;
|
|
87
|
+
onSelect?: (id: string) => void;
|
|
88
|
+
sections: SidebarSectionProp[];
|
|
89
|
+
product?: SidebarProductProp;
|
|
90
|
+
onProductClick?: () => void;
|
|
91
|
+
brand?: ReactNode;
|
|
92
|
+
collapsed?: boolean;
|
|
93
|
+
footer?: ReactNode;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** @see Topbar */
|
|
97
|
+
export type TopbarProductProp = {
|
|
98
|
+
name: string;
|
|
99
|
+
color?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** @see Topbar */
|
|
103
|
+
export type TopbarProjectProp = {
|
|
104
|
+
name: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** @see Topbar */
|
|
108
|
+
export type TopbarProp = {
|
|
109
|
+
product: TopbarProductProp;
|
|
110
|
+
project?: TopbarProjectProp | null;
|
|
111
|
+
onProductOpen?: () => void;
|
|
112
|
+
onProjectOpen?: () => void;
|
|
113
|
+
onSearchOpen?: () => void;
|
|
114
|
+
onTweaksOpen?: () => void;
|
|
115
|
+
collapsed?: boolean;
|
|
116
|
+
onToggleCollapsed?: () => void;
|
|
117
|
+
rightSlot?: ReactNode;
|
|
118
|
+
unread?: boolean;
|
|
119
|
+
onNotificationsOpen?: () => void;
|
|
120
|
+
user?: ReactNode;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** @deprecated Use PageContainerProp — header-only legacy shell. */
|
|
124
|
+
export type PageHeaderProp = {
|
|
125
|
+
title: PageTitleProp;
|
|
126
|
+
description?: SubtitleProp;
|
|
127
|
+
breadcrumb?: BreadcrumbProp;
|
|
128
|
+
actions?: ExtraProp;
|
|
129
|
+
className?: ClassNameProp;
|
|
130
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Navigation component prop types — @see docs/COMPONENTS.md#navigation */
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import type {
|
|
4
|
+
ChildrenProp,
|
|
5
|
+
ClassNameProp,
|
|
6
|
+
DisabledProp,
|
|
7
|
+
HasActiveFiltersProp,
|
|
8
|
+
LabelProp,
|
|
9
|
+
OnClearFiltersProp,
|
|
10
|
+
} from "../vocabulary";
|
|
11
|
+
|
|
12
|
+
/** @see FilterBar */
|
|
13
|
+
export type FilterBarProp = {
|
|
14
|
+
onClear?: OnClearFiltersProp;
|
|
15
|
+
hasActiveFilters?: HasActiveFiltersProp;
|
|
16
|
+
className?: ClassNameProp;
|
|
17
|
+
children: ChildrenProp;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @see FilterGroup */
|
|
21
|
+
export type FilterGroupProp = {
|
|
22
|
+
label: LabelProp;
|
|
23
|
+
className?: ClassNameProp;
|
|
24
|
+
children: ChildrenProp;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @see Pagination — offset/page-based (distinct from DataTable cursor pagination). */
|
|
28
|
+
export type PaginationProp = {
|
|
29
|
+
current?: number;
|
|
30
|
+
total?: number;
|
|
31
|
+
pageSize?: number;
|
|
32
|
+
pageSizeOptions?: number[];
|
|
33
|
+
showSizeChanger?: boolean;
|
|
34
|
+
showTotal?: boolean | ((total: number, range: [number, number]) => React.ReactNode);
|
|
35
|
+
simple?: boolean;
|
|
36
|
+
disabled?: DisabledProp;
|
|
37
|
+
className?: ClassNameProp;
|
|
38
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type StepStatusProp = "wait" | "process" | "finish" | "error";
|
|
42
|
+
|
|
43
|
+
/** @see StepItem */
|
|
44
|
+
export type StepItemProp = {
|
|
45
|
+
title: React.ReactNode;
|
|
46
|
+
subTitle?: React.ReactNode;
|
|
47
|
+
/** Ant Design `content` — alias `description` supported */
|
|
48
|
+
content?: React.ReactNode;
|
|
49
|
+
description?: React.ReactNode;
|
|
50
|
+
icon?: React.ReactNode;
|
|
51
|
+
status?: StepStatusProp;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @see Steps */
|
|
56
|
+
export type StepsProp = {
|
|
57
|
+
items?: StepItemProp[];
|
|
58
|
+
current?: number;
|
|
59
|
+
initial?: number;
|
|
60
|
+
status?: StepStatusProp;
|
|
61
|
+
orientation?: "horizontal" | "vertical";
|
|
62
|
+
type?: "default" | "dot";
|
|
63
|
+
size?: "default" | "small";
|
|
64
|
+
titlePlacement?: "horizontal" | "vertical";
|
|
65
|
+
onChange?: (current: number) => void;
|
|
66
|
+
className?: ClassNameProp;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Tab pane — Ant Design `items` entry. */
|
|
70
|
+
export type TabItemProp = {
|
|
71
|
+
key: string;
|
|
72
|
+
label: React.ReactNode;
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
icon?: React.ReactNode;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** @see TabsItems — high-level tabs with `items` array. */
|
|
79
|
+
export type TabsItemsProp = {
|
|
80
|
+
items: TabItemProp[];
|
|
81
|
+
value?: string;
|
|
82
|
+
defaultValue?: string;
|
|
83
|
+
onValueChange?: (key: string) => void;
|
|
84
|
+
variant?: "default" | "line" | "card";
|
|
85
|
+
className?: ClassNameProp;
|
|
86
|
+
listClassName?: ClassNameProp;
|
|
87
|
+
contentClassName?: ClassNameProp;
|
|
88
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** Query / async lifecycle helpers — @see docs/COMPONENTS.md#query */
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import type {
|
|
4
|
+
InfiniteData,
|
|
5
|
+
QueryKey,
|
|
6
|
+
UseInfiniteQueryResult,
|
|
7
|
+
UseMutationResult,
|
|
8
|
+
UseQueryResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import type { LinkProps } from "react-router-dom";
|
|
11
|
+
import type { ButtonProp } from "./general.prop";
|
|
12
|
+
import type { ClassNameProp, HandlerProp } from "../vocabulary";
|
|
13
|
+
|
|
14
|
+
/** @see DataState — TanStack Query lifecycle widget (not a visual component). */
|
|
15
|
+
export type DataStateProp<T> = {
|
|
16
|
+
query: UseQueryResult<T>;
|
|
17
|
+
skeleton: React.ReactNode;
|
|
18
|
+
empty?: React.ReactNode;
|
|
19
|
+
isEmpty?: (data: NonNullable<T>) => boolean;
|
|
20
|
+
errorRenderer?: (error: unknown, retry: () => void) => React.ReactNode;
|
|
21
|
+
/** Default error UI retry button. Default `true`. */
|
|
22
|
+
showRetry?: boolean;
|
|
23
|
+
/** Default `() => query.refetch()`. */
|
|
24
|
+
onRetry?: HandlerProp;
|
|
25
|
+
children: (data: NonNullable<T>) => React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type MutationLike = Pick<
|
|
29
|
+
UseMutationResult<unknown, unknown, unknown, unknown>,
|
|
30
|
+
"isError" | "error" | "isPending"
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
/** @see MutationFeedback — inline mutation error (form submit, simulator run). */
|
|
34
|
+
export type MutationFeedbackProp = {
|
|
35
|
+
mutation: MutationLike;
|
|
36
|
+
onRetry?: HandlerProp;
|
|
37
|
+
showRetry?: boolean;
|
|
38
|
+
/** Optional inline pending slot while `mutation.isPending`. */
|
|
39
|
+
pending?: React.ReactNode;
|
|
40
|
+
className?: ClassNameProp;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type QueryRefetchLike = Pick<UseQueryResult<unknown>, "isFetching" | "refetch">;
|
|
44
|
+
|
|
45
|
+
/** @see QueryRefetchButton — header Refresh wired to `query.refetch()`. */
|
|
46
|
+
export type QueryRefetchButtonProp = Omit<ButtonProp, "onClick" | "disabled"> & {
|
|
47
|
+
query: QueryRefetchLike;
|
|
48
|
+
label?: React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type InfiniteQueryLike<TPage> = Pick<
|
|
52
|
+
UseInfiniteQueryResult<InfiniteData<TPage>, unknown>,
|
|
53
|
+
| "isPending"
|
|
54
|
+
| "isError"
|
|
55
|
+
| "isFetching"
|
|
56
|
+
| "isFetchingNextPage"
|
|
57
|
+
| "error"
|
|
58
|
+
| "data"
|
|
59
|
+
| "hasNextPage"
|
|
60
|
+
| "fetchNextPage"
|
|
61
|
+
| "refetch"
|
|
62
|
+
>;
|
|
63
|
+
|
|
64
|
+
export type InfiniteQueryHelpers = {
|
|
65
|
+
fetchNextPage: () => void;
|
|
66
|
+
hasNextPage: boolean;
|
|
67
|
+
isFetchingNextPage: boolean;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @see InfiniteQueryState — useInfiniteQuery lifecycle + load more. */
|
|
71
|
+
export type InfiniteQueryStateProp<TPage, TFlat> = {
|
|
72
|
+
query: InfiniteQueryLike<TPage>;
|
|
73
|
+
skeleton: React.ReactNode;
|
|
74
|
+
empty?: React.ReactNode;
|
|
75
|
+
flatten: (data: { pages: TPage[] }) => TFlat;
|
|
76
|
+
isEmpty?: (flat: TFlat) => boolean;
|
|
77
|
+
errorRenderer?: (error: unknown, retry: () => void) => React.ReactNode;
|
|
78
|
+
showRetry?: boolean;
|
|
79
|
+
onRetry?: HandlerProp;
|
|
80
|
+
loadingMore?: React.ReactNode;
|
|
81
|
+
/** Custom load-more footer; `false` hides footer entirely. */
|
|
82
|
+
loadMore?: React.ReactNode | false;
|
|
83
|
+
/** Show default load-more button when `hasNextPage`. Default `true`. */
|
|
84
|
+
showLoadMore?: boolean;
|
|
85
|
+
children: (flat: TFlat, helpers: InfiniteQueryHelpers) => React.ReactNode;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @see PrefetchLink — Link + prefetchQuery on hover/focus. */
|
|
89
|
+
export type PrefetchLinkProp = LinkProps & {
|
|
90
|
+
queryKey: QueryKey;
|
|
91
|
+
queryFn: () => Promise<unknown>;
|
|
92
|
+
prefetchOn?: "hover" | "focus" | "both" | "none";
|
|
93
|
+
staleTime?: number;
|
|
94
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./vocabulary";
|
|
2
|
+
export * from "./components";
|
|
3
|
+
export {
|
|
4
|
+
VOCABULARY_REGISTRY,
|
|
5
|
+
COMPONENT_PROP_REGISTRY,
|
|
6
|
+
PROP_ALIASES_FORBIDDEN,
|
|
7
|
+
type VocabularyPropName,
|
|
8
|
+
type ComponentPropName,
|
|
9
|
+
} from "./registry";
|
|
10
|
+
|
|
11
|
+
// Backward-compatible re-exports (migrate to *Prop names)
|
|
12
|
+
export type { PageContainerProp as PageContainerProps } from "./components/layout.prop";
|
|
13
|
+
export type { StackProp as StackProps } from "./components/layout.prop";
|
|
14
|
+
export type { InlineProp as InlineProps } from "./components/layout.prop";
|
|
15
|
+
export type { ButtonProp as ButtonProps } from "./components/general.prop";
|
|
16
|
+
export type { BreadcrumbItemProp as BreadcrumbItem } from "./vocabulary/navigation.prop";
|
|
17
|
+
export type { ColumnDefProp as ColumnDef } from "./vocabulary/data.prop";
|