@svadmin/ui 0.70.0 → 0.73.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 +40 -25
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/actions.js +1 -1
- package/dist/app.css +7804 -5188
- package/dist/app.theme.css +7738 -5173
- package/dist/class-properties.generated.d.ts +1 -0
- package/dist/class-properties.generated.js +2 -0
- package/dist/classnames.d.ts +8 -0
- package/dist/classnames.js +26 -0
- package/dist/component-registry.svelte.d.ts +33 -19
- package/dist/component-registry.svelte.js +6 -4
- package/dist/components/AdminApp.svelte +55 -53
- package/dist/components/AdminApp.svelte.d.ts +2 -2
- package/dist/components/ApiSettings.svelte +19 -1
- package/dist/components/AuditLogDrawer.svelte +14 -3
- package/dist/components/AutoForm.svelte +162 -50
- package/dist/components/AutoForm.svelte.d.ts +4 -0
- package/dist/components/AutoTable.svelte +599 -259
- package/dist/components/AutoTable.svelte.d.ts +6 -0
- package/dist/components/BoundRecordDetailDrawer.svelte +172 -0
- package/dist/components/BoundRecordDetailDrawer.svelte.d.ts +11 -0
- package/dist/components/Breadcrumbs.svelte +7 -4
- package/dist/components/CancelTaskButton.svelte +9 -5
- package/dist/components/ColumnHeaderFilter.svelte +4 -3
- package/dist/components/ColumnSettings.svelte +1 -0
- package/dist/components/ComboboxField.svelte +118 -36
- package/dist/components/ComboboxField.svelte.d.ts +5 -4
- package/dist/components/CreatePage.svelte +7 -1
- package/dist/components/CreatePage.svelte.d.ts +2 -0
- package/dist/components/DateRangeInput.svelte +75 -0
- package/dist/components/DateRangeInput.svelte.d.ts +25 -0
- package/dist/components/DateTimeInput.svelte +65 -0
- package/dist/components/DateTimeInput.svelte.d.ts +19 -0
- package/dist/components/DetailDrawer.svelte +4 -0
- package/dist/components/DetailDrawer.svelte.d.ts +1 -0
- package/dist/components/DevTools.svelte +8 -21
- package/dist/components/DraggableGrid.svelte +1 -0
- package/dist/components/DraggableHeader.svelte +5 -9
- package/dist/components/DraggableHeader.svelte.d.ts +43 -18
- package/dist/components/DraggableRowTable.svelte +2 -2
- package/dist/components/DynamicFormList.svelte +17 -17
- package/dist/components/DynamicFormList.svelte.d.ts +2 -1
- package/dist/components/EditPage.svelte +7 -1
- package/dist/components/EditPage.svelte.d.ts +2 -0
- package/dist/components/EditableTable.svelte +4 -0
- package/dist/components/ErrorPage.svelte +3 -1
- package/dist/components/FieldDisplay.svelte +14 -0
- package/dist/components/FieldDisplay.svelte.d.ts +7 -0
- package/dist/components/FieldRenderer.svelte +96 -20
- package/dist/components/FileUpload.svelte +250 -0
- package/dist/components/FileUpload.svelte.d.ts +32 -0
- package/dist/components/FilterBuilder.svelte +236 -268
- package/dist/components/FilterBuilder.svelte.d.ts +3 -0
- package/dist/components/FilterDropdown.svelte.d.ts +1 -1
- package/dist/components/Header.svelte +5 -6
- package/dist/components/ImportWizard.svelte +182 -94
- package/dist/components/InfiniteList.svelte +22 -8
- package/dist/components/InfiniteList.svelte.d.ts +5 -3
- package/dist/components/InlineEdit.svelte +114 -44
- package/dist/components/JsonSchemaForm.svelte +256 -95
- package/dist/components/JsonSchemaForm.svelte.d.ts +12 -1
- package/dist/components/Layout.svelte +20 -17
- package/dist/components/LazyTaskQueueDrawer.svelte +26 -0
- package/dist/components/LazyTaskQueueDrawer.svelte.d.ts +8 -0
- package/dist/components/ListPage.svelte +11 -6
- package/dist/components/ListPage.svelte.d.ts +2 -0
- package/dist/components/LoginPage.svelte +1 -1
- package/dist/components/MasterDetailView.svelte +3 -3
- package/dist/components/MediaLibraryModal.svelte +5 -2
- package/dist/components/MentionsInput.svelte +4 -3
- package/dist/components/MoneyInput.svelte +25 -0
- package/dist/components/MoneyInput.svelte.d.ts +20 -0
- package/dist/components/NavigateToResource.svelte +3 -2
- package/dist/components/NumberInput.svelte +25 -0
- package/dist/components/NumberInput.svelte.d.ts +19 -0
- package/dist/components/NumericInput.svelte +110 -0
- package/dist/components/NumericInput.svelte.d.ts +23 -0
- package/dist/components/PercentInput.svelte +25 -0
- package/dist/components/PercentInput.svelte.d.ts +20 -0
- package/dist/components/PermissionMatrix.svelte +4 -3
- package/dist/components/ProfilePage.svelte +2 -2
- package/dist/components/QuickEditDrawer.svelte +42 -0
- package/dist/components/QuickEditDrawer.svelte.d.ts +10 -0
- package/dist/components/RecordDetailDrawer.svelte +16 -108
- package/dist/components/RecordDetailDrawer.svelte.d.ts +2 -0
- package/dist/components/RecordRowActions.svelte +41 -0
- package/dist/components/RecordRowActions.svelte.d.ts +14 -0
- package/dist/components/ResourceAccessGuard.svelte +7 -5
- package/dist/components/ResourceOperationsPage.svelte +25 -19
- package/dist/components/ResourceOperationsPage.svelte.d.ts +5 -1
- package/dist/components/RetryTaskButton.svelte +9 -5
- package/dist/components/RowActions.svelte +5 -3
- package/dist/components/SensitiveDataMask.svelte +3 -3
- package/dist/components/SettingsPage.svelte +1 -1
- package/dist/components/ShowInferencer.svelte +4 -2
- package/dist/components/ShowInferencer.svelte.d.ts +2 -0
- package/dist/components/ShowPage.svelte +49 -39
- package/dist/components/ShowPage.svelte.d.ts +2 -0
- package/dist/components/Sidebar.svelte +15 -13
- package/dist/components/SplitPaneLayout.svelte +4 -2
- package/dist/components/SpreadsheetView.svelte +81 -286
- package/dist/components/StepsForm.svelte +166 -49
- package/dist/components/StepsForm.svelte.d.ts +1 -0
- package/dist/components/SvarAutoTable.svelte +39 -0
- package/dist/components/SvarAutoTable.svelte.d.ts +13 -0
- package/dist/components/SvarDataGrid.svelte +362 -0
- package/dist/components/SvarDataGrid.svelte.d.ts +57 -0
- package/dist/components/SvarGridCell.svelte +10 -0
- package/dist/components/SvarGridCell.svelte.d.ts +7 -0
- package/dist/components/SvarResourceRead.svelte +50 -0
- package/dist/components/SvarResourceRead.svelte.d.ts +23 -0
- package/dist/components/SvarResourceTable.svelte +63 -0
- package/dist/components/SvarResourceTable.svelte.d.ts +42 -0
- package/dist/components/SvarResourceTableView.svelte +364 -0
- package/dist/components/SvarResourceTableView.svelte.d.ts +4 -0
- package/dist/components/TaskDetails.svelte +20 -7
- package/dist/components/TaskList.svelte +19 -7
- package/dist/components/TaskQueueDrawer.svelte +92 -37
- package/dist/components/Toast.svelte +4 -2
- package/dist/components/TooltipButton.svelte +1 -1
- package/dist/components/TreeSelect.svelte +212 -30
- package/dist/components/TreeSelect.svelte.d.ts +3 -1
- package/dist/components/ValidatedField.svelte +27 -0
- package/dist/components/ValidatedField.svelte.d.ts +35 -0
- package/dist/components/account/ImportMembersPage.svelte +2 -2
- package/dist/components/account/SecurityLogPage.svelte +3 -1
- package/dist/components/account/SettingsEnterprisePage.svelte +7 -5
- package/dist/components/account/TeamMembersPage.svelte +1 -1
- package/dist/components/auto-table-grid.d.ts +26 -0
- package/dist/components/auto-table-grid.js +1 -0
- package/dist/components/buttons/CloneButton.svelte +6 -4
- package/dist/components/buttons/DeleteButton.svelte +95 -29
- package/dist/components/buttons/DeleteButton.svelte.d.ts +2 -0
- package/dist/components/buttons/EditButton.svelte +6 -4
- package/dist/components/buttons/ExportButton.svelte +22 -4
- package/dist/components/buttons/ImportButton.svelte +83 -38
- package/dist/components/buttons/ImportButton.svelte.d.ts +6 -10
- package/dist/components/buttons/RefreshButton.svelte +48 -8
- package/dist/components/buttons/ShowButton.svelte +6 -4
- package/dist/components/content/ApiKeyList.svelte +3 -1
- package/dist/components/content/ContentPageHeader.svelte +12 -9
- package/dist/components/content/ContentPageShell.svelte +8 -9
- package/dist/components/content/FileBrowser.svelte +35 -0
- package/dist/components/content/FileBrowser.svelte.d.ts +14 -0
- package/dist/components/content/FileList.svelte +3 -1
- package/dist/components/content/MemberList.svelte +3 -1
- package/dist/components/content/MetricBlock.svelte +10 -13
- package/dist/components/content/NetworkTable.svelte +6 -4
- package/dist/components/content/NetworkTable.svelte.d.ts +1 -0
- package/dist/components/content/PageToolbar.svelte +6 -10
- package/dist/components/content/SectionHeader.svelte +8 -13
- package/dist/components/content/SecurityEventTable.svelte +3 -1
- package/dist/components/content/SettingsFieldRow.svelte +9 -23
- package/dist/components/content/SettingsGroup.svelte +11 -27
- package/dist/components/content/StatusBadge.svelte +3 -8
- package/dist/components/content/StatusTabs.svelte +2 -2
- package/dist/components/content/WorkspaceLayout.svelte +8 -12
- package/dist/components/enterprise/filter-tree.d.ts +48 -0
- package/dist/components/enterprise/filter-tree.js +224 -0
- package/dist/components/enterprise/json-schema-form.d.ts +39 -0
- package/dist/components/enterprise/json-schema-form.js +195 -0
- package/dist/components/enterprise/recursive-schema-form.d.ts +30 -0
- package/dist/components/enterprise/recursive-schema-form.js +196 -0
- package/dist/components/enterprise/spreadsheet-formula.d.ts +12 -0
- package/dist/components/enterprise/spreadsheet-formula.js +245 -0
- package/dist/components/fieldComponentMap.d.ts +18 -13
- package/dist/components/fieldComponentMap.js +100 -47
- package/dist/components/fields/AvatarField.svelte +1 -1
- package/dist/components/fields/ChoiceField.svelte +16 -0
- package/dist/components/fields/ChoiceField.svelte.d.ts +10 -0
- package/dist/components/fields/CodeField.svelte +11 -12
- package/dist/components/fields/CodeField.svelte.d.ts +1 -1
- package/dist/components/fields/DateField.svelte +4 -3
- package/dist/components/fields/DateRangeField.svelte +2 -4
- package/dist/components/fields/ImageField.svelte +3 -1
- package/dist/components/fields/ImagesField.svelte +23 -0
- package/dist/components/fields/ImagesField.svelte.d.ts +6 -0
- package/dist/components/fields/JsonField.svelte +19 -13
- package/dist/components/fields/PasswordField.svelte +5 -0
- package/dist/components/fields/PasswordField.svelte.d.ts +6 -0
- package/dist/components/fields/date-field-value.d.ts +2 -0
- package/dist/components/fields/date-field-value.js +13 -0
- package/dist/components/fields/json-value.d.ts +11 -0
- package/dist/components/fields/json-value.js +28 -0
- package/dist/components/json-schema-form-state.d.ts +37 -0
- package/dist/components/json-schema-form-state.js +168 -0
- package/dist/components/profile/ActivityTimeline.svelte +2 -2
- package/dist/components/record-detail.svelte.d.ts +19 -0
- package/dist/components/record-detail.svelte.js +34 -0
- package/dist/components/saved-list-views.js +29 -29
- package/dist/components/svar-grid-cells.d.ts +14 -0
- package/dist/components/svar-grid-cells.js +2 -0
- package/dist/components/svar-grid-contract.d.ts +80 -0
- package/dist/components/svar-grid-contract.js +159 -0
- package/dist/components/svar-grid-interactions.d.ts +54 -0
- package/dist/components/svar-grid-interactions.js +174 -0
- package/dist/components/svar-grid-loading.d.ts +40 -0
- package/dist/components/svar-grid-loading.js +180 -0
- package/dist/components/svar-grid-operations.d.ts +37 -0
- package/dist/components/svar-grid-operations.js +186 -0
- package/dist/components/svar-grid-panes.d.ts +34 -0
- package/dist/components/svar-grid-panes.js +66 -0
- package/dist/components/svar-grid-resource-loading.d.ts +18 -0
- package/dist/components/svar-grid-resource-loading.js +68 -0
- package/dist/components/svar-grid-resource-session.svelte.d.ts +29 -0
- package/dist/components/svar-grid-resource-session.svelte.js +61 -0
- package/dist/components/table-contract.d.ts +13 -0
- package/dist/components/table-contract.js +42 -0
- package/dist/components/task-utils.js +4 -2
- package/dist/components/ui/alert/alert-variants.d.ts +2 -3
- package/dist/components/ui/alert/alert-variants.js +1 -2
- package/dist/components/ui/alert/alert.svelte +4 -5
- package/dist/components/ui/alert/alert.svelte.d.ts +3 -8
- package/dist/components/ui/alert/index.js +0 -2
- package/dist/components/ui/avatar/avatar-variants.d.ts +2 -3
- package/dist/components/ui/avatar/avatar-variants.js +1 -2
- package/dist/components/ui/avatar/avatar.svelte +5 -6
- package/dist/components/ui/avatar/avatar.svelte.d.ts +3 -8
- package/dist/components/ui/badge/badge-variants.d.ts +2 -3
- package/dist/components/ui/badge/badge-variants.js +3 -2
- package/dist/components/ui/badge/badge.svelte +4 -5
- package/dist/components/ui/badge/badge.svelte.d.ts +3 -8
- package/dist/components/ui/badge/index.js +0 -2
- package/dist/components/ui/button/button-variants.d.ts +2 -3
- package/dist/components/ui/button/button-variants.js +5 -3
- package/dist/components/ui/button/button.svelte +100 -44
- package/dist/components/ui/button/button.svelte.d.ts +8 -12
- package/dist/components/ui/button/index.js +0 -2
- package/dist/components/ui/command/command-dialog.svelte +3 -1
- package/dist/components/ui/command/command-dialog.svelte.d.ts +1 -1
- package/dist/components/ui/command/command-group.svelte +4 -2
- package/dist/components/ui/command/command-item.svelte +4 -2
- package/dist/components/ui/command/command-separator.svelte +3 -1
- package/dist/components/ui/command/index.d.ts +5 -5
- package/dist/components/ui/input/input.svelte +41 -24
- package/dist/components/ui/input/input.svelte.d.ts +5 -4
- package/dist/components/ui/sheet/sheet.svelte +9 -3
- package/dist/components/ui/sheet/sheet.svelte.d.ts +1 -0
- package/dist/components/ui/textarea/textarea.svelte +2 -1
- package/dist/components/ui/tooltip/tooltip.svelte +4 -2
- package/dist/components.css +3079 -0
- package/dist/design-contract.d.ts +13 -0
- package/dist/design-contract.js +11 -0
- package/dist/design-system.d.ts +15 -0
- package/dist/design-system.js +7 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +9 -0
- package/dist/inline-value.d.ts +5 -0
- package/dist/inline-value.js +24 -0
- package/dist/numeric-input.d.ts +2 -0
- package/dist/numeric-input.js +9 -0
- package/dist/page-chrome.css +12 -49
- package/dist/recipes.d.ts +4 -0
- package/dist/recipes.js +4 -0
- package/dist/rendering/index.d.ts +87 -0
- package/dist/rendering/index.js +117 -0
- package/dist/styled-system/css/conditions.js +36 -0
- package/dist/styled-system/css/css.d.ts +22 -0
- package/dist/styled-system/css/css.js +45 -0
- package/dist/styled-system/css/cva.d.ts +6 -0
- package/dist/styled-system/css/cva.js +87 -0
- package/dist/styled-system/css/cx.d.ts +5 -0
- package/dist/styled-system/css/cx.js +15 -0
- package/dist/styled-system/css/index.d.ts +5 -0
- package/dist/styled-system/css/index.js +4 -0
- package/dist/styled-system/css/sva.d.ts +4 -0
- package/dist/styled-system/css/sva.js +46 -0
- package/dist/styled-system/helpers.js +316 -0
- package/dist/styled-system/patterns/aspect-ratio.d.ts +20 -0
- package/dist/styled-system/patterns/aspect-ratio.js +38 -0
- package/dist/styled-system/patterns/bleed.d.ts +21 -0
- package/dist/styled-system/patterns/bleed.js +24 -0
- package/dist/styled-system/patterns/box.d.ts +20 -0
- package/dist/styled-system/patterns/box.js +15 -0
- package/dist/styled-system/patterns/center.d.ts +20 -0
- package/dist/styled-system/patterns/center.js +21 -0
- package/dist/styled-system/patterns/circle.d.ts +20 -0
- package/dist/styled-system/patterns/circle.js +25 -0
- package/dist/styled-system/patterns/container.d.ts +20 -0
- package/dist/styled-system/patterns/container.js +21 -0
- package/dist/styled-system/patterns/cq.d.ts +21 -0
- package/dist/styled-system/patterns/cq.js +21 -0
- package/dist/styled-system/patterns/divider.d.ts +22 -0
- package/dist/styled-system/patterns/divider.js +25 -0
- package/dist/styled-system/patterns/flex.d.ts +26 -0
- package/dist/styled-system/patterns/flex.js +26 -0
- package/dist/styled-system/patterns/float.d.ts +23 -0
- package/dist/styled-system/patterns/float.js +52 -0
- package/dist/styled-system/patterns/grid-item.d.ts +25 -0
- package/dist/styled-system/patterns/grid-item.js +25 -0
- package/dist/styled-system/patterns/grid.d.ts +24 -0
- package/dist/styled-system/patterns/grid.js +27 -0
- package/dist/styled-system/patterns/hstack.d.ts +21 -0
- package/dist/styled-system/patterns/hstack.js +24 -0
- package/dist/styled-system/patterns/index.d.ts +21 -0
- package/dist/styled-system/patterns/index.js +20 -0
- package/dist/styled-system/patterns/link-overlay.d.ts +20 -0
- package/dist/styled-system/patterns/link-overlay.js +24 -0
- package/dist/styled-system/patterns/spacer.d.ts +20 -0
- package/dist/styled-system/patterns/spacer.js +25 -0
- package/dist/styled-system/patterns/square.d.ts +20 -0
- package/dist/styled-system/patterns/square.js +24 -0
- package/dist/styled-system/patterns/stack.d.ts +23 -0
- package/dist/styled-system/patterns/stack.js +24 -0
- package/dist/styled-system/patterns/visually-hidden.d.ts +20 -0
- package/dist/styled-system/patterns/visually-hidden.js +18 -0
- package/dist/styled-system/patterns/vstack.d.ts +21 -0
- package/dist/styled-system/patterns/vstack.js +24 -0
- package/dist/styled-system/patterns/wrap.d.ts +24 -0
- package/dist/styled-system/patterns/wrap.js +25 -0
- package/dist/styled-system/recipes/content-header.d.ts +31 -0
- package/dist/styled-system/recipes/content-header.js +65 -0
- package/dist/styled-system/recipes/content-page.d.ts +34 -0
- package/dist/styled-system/recipes/content-page.js +43 -0
- package/dist/styled-system/recipes/create-recipe.js +82 -0
- package/dist/styled-system/recipes/index.d.ts +17 -0
- package/dist/styled-system/recipes/index.js +16 -0
- package/dist/styled-system/recipes/metric-block.d.ts +34 -0
- package/dist/styled-system/recipes/metric-block.js +76 -0
- package/dist/styled-system/recipes/product-list.d.ts +31 -0
- package/dist/styled-system/recipes/product-list.js +73 -0
- package/dist/styled-system/recipes/product-section.d.ts +31 -0
- package/dist/styled-system/recipes/product-section.js +49 -0
- package/dist/styled-system/recipes/product-settings-row.d.ts +34 -0
- package/dist/styled-system/recipes/product-settings-row.js +58 -0
- package/dist/styled-system/recipes/product-settings.d.ts +31 -0
- package/dist/styled-system/recipes/product-settings.js +57 -0
- package/dist/styled-system/recipes/product-status.d.ts +34 -0
- package/dist/styled-system/recipes/product-status.js +45 -0
- package/dist/styled-system/recipes/product-toolbar.d.ts +31 -0
- package/dist/styled-system/recipes/product-toolbar.js +41 -0
- package/dist/styled-system/recipes/product-workspace.d.ts +34 -0
- package/dist/styled-system/recipes/product-workspace.js +58 -0
- package/dist/styled-system/recipes/surface-metric.d.ts +38 -0
- package/dist/styled-system/recipes/surface-metric.js +63 -0
- package/dist/styled-system/recipes/surface-table.d.ts +34 -0
- package/dist/styled-system/recipes/surface-table.js +62 -0
- package/dist/styled-system/recipes/ui-badge.d.ts +31 -0
- package/dist/styled-system/recipes/ui-badge.js +38 -0
- package/dist/styled-system/recipes/ui-button.d.ts +32 -0
- package/dist/styled-system/recipes/ui-button.js +43 -0
- package/dist/styled-system/recipes/ui-input.d.ts +31 -0
- package/dist/styled-system/recipes/ui-input.js +49 -0
- package/dist/styled-system/recipes/ui-textarea.d.ts +31 -0
- package/dist/styled-system/recipes/ui-textarea.js +24 -0
- package/dist/styled-system/styles.css +1257 -0
- package/dist/styled-system/tokens/index.d.ts +9 -0
- package/dist/styled-system/tokens/index.js +268 -0
- package/dist/styled-system/tokens/tokens.d.ts +36 -0
- package/dist/styled-system/types/composition.d.ts +227 -0
- package/dist/styled-system/types/conditions.d.ts +236 -0
- package/dist/styled-system/types/csstype.d.ts +22570 -0
- package/dist/styled-system/types/index.d.ts +6 -0
- package/dist/styled-system/types/parts.d.ts +8 -0
- package/dist/styled-system/types/pattern.d.ts +78 -0
- package/dist/styled-system/types/prop-type.d.ts +223 -0
- package/dist/styled-system/types/recipe.d.ts +181 -0
- package/dist/styled-system/types/selectors.d.ts +59 -0
- package/dist/styled-system/types/static-css.d.ts +56 -0
- package/dist/styled-system/types/style-props.d.ts +8088 -0
- package/dist/styled-system/types/system-types.d.ts +151 -0
- package/dist/styles/aliases.css +49 -0
- package/dist/styles/compatibility.epilogue.css +384 -0
- package/dist/styles/compatibility.prelude.css +5513 -0
- package/dist/styles/conditional-states.css +28 -0
- package/dist/styles/conditional-utilities.css +22 -0
- package/dist/styles/recipes.css +1262 -0
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +38 -14
- package/styles-compatibility.json +12 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { CssProperty, SystemStyleObject } from './system-types';
|
|
3
|
+
import type { TokenCategory } from '../tokens/index';
|
|
4
|
+
|
|
5
|
+
type Primitive = string | number | boolean | null | undefined
|
|
6
|
+
type LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)
|
|
7
|
+
|
|
8
|
+
export type PatternProperty =
|
|
9
|
+
| { type: 'property'; value: CssProperty; description?: string }
|
|
10
|
+
| { type: 'enum'; value: string[]; description?: string }
|
|
11
|
+
| { type: 'token'; value: TokenCategory; property?: CssProperty; description?: string }
|
|
12
|
+
| { type: 'string' | 'boolean' | 'number'; description?: string }
|
|
13
|
+
|
|
14
|
+
export interface PatternHelpers {
|
|
15
|
+
map: (value: any, fn: (value: string) => string | undefined) => any
|
|
16
|
+
isCssUnit: (value: any) => boolean
|
|
17
|
+
isCssVar: (value: any) => boolean
|
|
18
|
+
isCssFunction: (value: any) => boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PatternProperties {
|
|
22
|
+
[key: string]: PatternProperty
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type InferProps<T> = Record<LiteralUnion<keyof T>, any>
|
|
26
|
+
|
|
27
|
+
export type PatternDefaultValue<T> = Partial<InferProps<T>>
|
|
28
|
+
|
|
29
|
+
export type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>
|
|
30
|
+
|
|
31
|
+
export interface PatternConfig<T extends PatternProperties = PatternProperties> {
|
|
32
|
+
/**
|
|
33
|
+
* The description of the pattern. This will be used in the JSDoc comment.
|
|
34
|
+
*/
|
|
35
|
+
description?: string
|
|
36
|
+
/**
|
|
37
|
+
* The JSX element rendered by the pattern
|
|
38
|
+
* @default 'div'
|
|
39
|
+
*/
|
|
40
|
+
jsxElement?: string
|
|
41
|
+
/**
|
|
42
|
+
* The properties of the pattern.
|
|
43
|
+
*/
|
|
44
|
+
properties?: T
|
|
45
|
+
/**
|
|
46
|
+
* The default values of the pattern.
|
|
47
|
+
*/
|
|
48
|
+
defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>
|
|
49
|
+
/**
|
|
50
|
+
* The css object this pattern will generate.
|
|
51
|
+
*/
|
|
52
|
+
transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject
|
|
53
|
+
/**
|
|
54
|
+
* Whether the pattern is deprecated.
|
|
55
|
+
*/
|
|
56
|
+
deprecated?: boolean | string
|
|
57
|
+
/**
|
|
58
|
+
* The jsx element name this pattern will generate.
|
|
59
|
+
*/
|
|
60
|
+
jsxName?: string
|
|
61
|
+
/**
|
|
62
|
+
* The jsx elements to track for this pattern. Can be string or Regexp.
|
|
63
|
+
*
|
|
64
|
+
* @default capitalize(pattern.name)
|
|
65
|
+
* @example ['Button', 'Link', /Button$/]
|
|
66
|
+
*/
|
|
67
|
+
jsx?: Array<string | RegExp>
|
|
68
|
+
/**
|
|
69
|
+
* Whether to only generate types for the specified properties.
|
|
70
|
+
* This will disallow css properties
|
|
71
|
+
*/
|
|
72
|
+
strict?: boolean
|
|
73
|
+
/**
|
|
74
|
+
* @experimental
|
|
75
|
+
* Disallow certain css properties for this pattern
|
|
76
|
+
*/
|
|
77
|
+
blocklist?: LiteralUnion<CssProperty>[]
|
|
78
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from './conditions';
|
|
3
|
+
import type { CssProperties } from './system-types';
|
|
4
|
+
import type { Tokens } from '../tokens/index';
|
|
5
|
+
|
|
6
|
+
export interface UtilityValues {
|
|
7
|
+
top: Tokens["spacing"];
|
|
8
|
+
left: Tokens["spacing"];
|
|
9
|
+
inset: "auto" | Tokens["spacing"];
|
|
10
|
+
insetInline: Tokens["spacing"];
|
|
11
|
+
insetBlock: Tokens["spacing"];
|
|
12
|
+
insetBlockEnd: Tokens["spacing"];
|
|
13
|
+
insetBlockStart: Tokens["spacing"];
|
|
14
|
+
insetInlineEnd: Tokens["spacing"];
|
|
15
|
+
insetInlineStart: Tokens["spacing"];
|
|
16
|
+
right: Tokens["spacing"];
|
|
17
|
+
bottom: Tokens["spacing"];
|
|
18
|
+
float: "start" | "end" | CssProperties["float"];
|
|
19
|
+
flexBasis: Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full";
|
|
20
|
+
flex: "1" | "auto" | "initial" | "none";
|
|
21
|
+
gridAutoColumns: "min" | "max" | "fr";
|
|
22
|
+
gridAutoRows: "min" | "max" | "fr";
|
|
23
|
+
gap: Tokens["spacing"];
|
|
24
|
+
gridGap: Tokens["spacing"];
|
|
25
|
+
gridRowGap: Tokens["spacing"];
|
|
26
|
+
gridColumnGap: Tokens["spacing"];
|
|
27
|
+
rowGap: Tokens["spacing"];
|
|
28
|
+
columnGap: Tokens["spacing"];
|
|
29
|
+
padding: Tokens["spacing"];
|
|
30
|
+
paddingLeft: Tokens["spacing"];
|
|
31
|
+
paddingRight: Tokens["spacing"];
|
|
32
|
+
paddingTop: Tokens["spacing"];
|
|
33
|
+
paddingBottom: Tokens["spacing"];
|
|
34
|
+
paddingBlock: Tokens["spacing"];
|
|
35
|
+
paddingBlockEnd: Tokens["spacing"];
|
|
36
|
+
paddingBlockStart: Tokens["spacing"];
|
|
37
|
+
paddingInline: Tokens["spacing"];
|
|
38
|
+
paddingInlineEnd: Tokens["spacing"];
|
|
39
|
+
paddingInlineStart: Tokens["spacing"];
|
|
40
|
+
marginLeft: "auto" | Tokens["spacing"];
|
|
41
|
+
marginRight: "auto" | Tokens["spacing"];
|
|
42
|
+
marginTop: "auto" | Tokens["spacing"];
|
|
43
|
+
marginBottom: "auto" | Tokens["spacing"];
|
|
44
|
+
margin: "auto" | Tokens["spacing"];
|
|
45
|
+
marginBlock: "auto" | Tokens["spacing"];
|
|
46
|
+
marginBlockEnd: "auto" | Tokens["spacing"];
|
|
47
|
+
marginBlockStart: "auto" | Tokens["spacing"];
|
|
48
|
+
marginInline: "auto" | Tokens["spacing"];
|
|
49
|
+
marginInlineEnd: "auto" | Tokens["spacing"];
|
|
50
|
+
marginInlineStart: "auto" | Tokens["spacing"];
|
|
51
|
+
spaceX: "auto" | Tokens["spacing"] | CssProperties["marginInlineStart"];
|
|
52
|
+
spaceY: "auto" | Tokens["spacing"] | CssProperties["marginBlockStart"];
|
|
53
|
+
outlineColor: Tokens["colors"];
|
|
54
|
+
outlineOffset: Tokens["spacing"];
|
|
55
|
+
focusRing: "outside" | "inside" | "mixed" | "none";
|
|
56
|
+
focusVisibleRing: "outside" | "inside" | "mixed" | "none";
|
|
57
|
+
focusRingColor: Tokens["colors"];
|
|
58
|
+
focusRingOffset: Tokens["spacing"];
|
|
59
|
+
focusRingWidth: CssProperties["outlineWidth"];
|
|
60
|
+
focusRingStyle: CssProperties["outlineStyle"];
|
|
61
|
+
divideColor: Tokens["colors"];
|
|
62
|
+
divideStyle: CssProperties["borderStyle"];
|
|
63
|
+
width: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
64
|
+
inlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
65
|
+
minWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
66
|
+
minInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
67
|
+
maxWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
68
|
+
maxInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
69
|
+
height: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
70
|
+
blockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
71
|
+
minHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
72
|
+
minBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
73
|
+
maxHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
74
|
+
maxBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
75
|
+
boxSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
76
|
+
color: Tokens["colors"];
|
|
77
|
+
fontSize: Tokens["fontSizes"];
|
|
78
|
+
fontWeight: Tokens["fontWeights"];
|
|
79
|
+
fontSmoothing: "antialiased" | "subpixel-antialiased";
|
|
80
|
+
letterSpacing: Tokens["letterSpacings"];
|
|
81
|
+
lineHeight: Tokens["lineHeights"];
|
|
82
|
+
textDecorationColor: Tokens["colors"];
|
|
83
|
+
textEmphasisColor: Tokens["colors"];
|
|
84
|
+
textIndent: Tokens["spacing"];
|
|
85
|
+
textShadow: Tokens["shadows"];
|
|
86
|
+
textShadowColor: Tokens["colors"];
|
|
87
|
+
WebkitTextFillColor: Tokens["colors"];
|
|
88
|
+
textWrap: "wrap" | "balance" | "nowrap";
|
|
89
|
+
truncate: boolean;
|
|
90
|
+
background: Tokens["colors"];
|
|
91
|
+
backgroundColor: Tokens["colors"];
|
|
92
|
+
backgroundGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
93
|
+
backgroundLinear: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
94
|
+
textGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
95
|
+
gradientFrom: Tokens["colors"];
|
|
96
|
+
gradientTo: Tokens["colors"];
|
|
97
|
+
gradientVia: Tokens["colors"];
|
|
98
|
+
borderRadius: Tokens["radii"];
|
|
99
|
+
borderTopLeftRadius: Tokens["radii"];
|
|
100
|
+
borderTopRightRadius: Tokens["radii"];
|
|
101
|
+
borderBottomRightRadius: Tokens["radii"];
|
|
102
|
+
borderBottomLeftRadius: Tokens["radii"];
|
|
103
|
+
borderTopRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
104
|
+
borderRightRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
105
|
+
borderBottomRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
106
|
+
borderLeftRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
107
|
+
borderStartStartRadius: Tokens["radii"];
|
|
108
|
+
borderStartEndRadius: Tokens["radii"];
|
|
109
|
+
borderStartRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
110
|
+
borderEndStartRadius: Tokens["radii"];
|
|
111
|
+
borderEndEndRadius: Tokens["radii"];
|
|
112
|
+
borderEndRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
113
|
+
borderColor: Tokens["colors"];
|
|
114
|
+
borderInlineColor: Tokens["colors"];
|
|
115
|
+
borderBlockColor: Tokens["colors"];
|
|
116
|
+
borderLeftColor: Tokens["colors"];
|
|
117
|
+
borderInlineStartColor: Tokens["colors"];
|
|
118
|
+
borderRightColor: Tokens["colors"];
|
|
119
|
+
borderInlineEndColor: Tokens["colors"];
|
|
120
|
+
borderTopColor: Tokens["colors"];
|
|
121
|
+
borderBottomColor: Tokens["colors"];
|
|
122
|
+
borderBlockEndColor: Tokens["colors"];
|
|
123
|
+
borderBlockStartColor: Tokens["colors"];
|
|
124
|
+
boxShadow: Tokens["shadows"];
|
|
125
|
+
boxShadowColor: Tokens["colors"];
|
|
126
|
+
filter: "auto";
|
|
127
|
+
backdropFilter: "auto";
|
|
128
|
+
borderSpacing: Tokens["spacing"] | "auto";
|
|
129
|
+
borderSpacingX: Tokens["spacing"];
|
|
130
|
+
borderSpacingY: Tokens["spacing"];
|
|
131
|
+
transitionProperty: "common" | "colors" | "size" | "position" | "background";
|
|
132
|
+
transition: "all" | "common" | "size" | "position" | "background" | "colors" | "opacity" | "shadow" | "transform";
|
|
133
|
+
rotate: "auto" | "auto-3d" | CssProperties["rotate"];
|
|
134
|
+
rotateX: CssProperties["rotate"];
|
|
135
|
+
rotateY: CssProperties["rotate"];
|
|
136
|
+
rotateZ: CssProperties["rotate"];
|
|
137
|
+
scale: "auto" | CssProperties["scale"];
|
|
138
|
+
translate: "auto" | "auto-3d" | CssProperties["translate"];
|
|
139
|
+
translateX: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
140
|
+
translateY: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
141
|
+
translateZ: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
142
|
+
accentColor: Tokens["colors"];
|
|
143
|
+
caretColor: Tokens["colors"];
|
|
144
|
+
scrollbar: "visible" | "hidden";
|
|
145
|
+
scrollbarColor: Tokens["colors"];
|
|
146
|
+
scrollbarWidth: Tokens["sizes"];
|
|
147
|
+
scrollMargin: Tokens["spacing"];
|
|
148
|
+
scrollMarginLeft: Tokens["spacing"];
|
|
149
|
+
scrollMarginRight: Tokens["spacing"];
|
|
150
|
+
scrollMarginTop: Tokens["spacing"];
|
|
151
|
+
scrollMarginBottom: Tokens["spacing"];
|
|
152
|
+
scrollMarginBlock: Tokens["spacing"];
|
|
153
|
+
scrollMarginBlockEnd: Tokens["spacing"];
|
|
154
|
+
scrollMarginBlockStart: Tokens["spacing"];
|
|
155
|
+
scrollMarginInline: Tokens["spacing"];
|
|
156
|
+
scrollMarginInlineEnd: Tokens["spacing"];
|
|
157
|
+
scrollMarginInlineStart: Tokens["spacing"];
|
|
158
|
+
scrollPadding: Tokens["spacing"];
|
|
159
|
+
scrollPaddingBlock: Tokens["spacing"];
|
|
160
|
+
scrollPaddingBlockStart: Tokens["spacing"];
|
|
161
|
+
scrollPaddingBlockEnd: Tokens["spacing"];
|
|
162
|
+
scrollPaddingInline: Tokens["spacing"];
|
|
163
|
+
scrollPaddingInlineEnd: Tokens["spacing"];
|
|
164
|
+
scrollPaddingInlineStart: Tokens["spacing"];
|
|
165
|
+
scrollPaddingLeft: Tokens["spacing"];
|
|
166
|
+
scrollPaddingRight: Tokens["spacing"];
|
|
167
|
+
scrollPaddingTop: Tokens["spacing"];
|
|
168
|
+
scrollPaddingBottom: Tokens["spacing"];
|
|
169
|
+
scrollSnapType: "none" | "x" | "y" | "both";
|
|
170
|
+
scrollSnapStrictness: "mandatory" | "proximity";
|
|
171
|
+
scrollSnapMargin: Tokens["spacing"];
|
|
172
|
+
scrollSnapMarginTop: Tokens["spacing"];
|
|
173
|
+
scrollSnapMarginBottom: Tokens["spacing"];
|
|
174
|
+
scrollSnapMarginLeft: Tokens["spacing"];
|
|
175
|
+
scrollSnapMarginRight: Tokens["spacing"];
|
|
176
|
+
fill: Tokens["colors"];
|
|
177
|
+
stroke: Tokens["colors"];
|
|
178
|
+
srOnly: boolean;
|
|
179
|
+
debug: boolean;
|
|
180
|
+
containerName: CssProperties["containerName"];
|
|
181
|
+
colorPalette: "surface" | "foreground" | "muted" | "border" | "success" | "warning" | "danger" | "info" | "content";
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
type WithColorOpacityModifier<T> = [T] extends [string] ? `${T}/${string}` & { __colorOpacityModifier?: true } : never
|
|
187
|
+
|
|
188
|
+
type ImportantMark = "!" | "!important"
|
|
189
|
+
type WhitespaceImportant = ` ${ImportantMark}`
|
|
190
|
+
type Important = ImportantMark | WhitespaceImportant
|
|
191
|
+
type WithImportant<T> = [T] extends [string] ? `${T}${Important}` & { __important?: true } : never
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Only relevant when using `strictTokens` or `strictPropertyValues` in your config.
|
|
195
|
+
* - Allows you to use an escape hatch (e.g. `[123px]`) to use any string as a value.
|
|
196
|
+
* - Allows you to use a color opacity modifier (e.g. `red/300`) with known color values.
|
|
197
|
+
* - Allows you to use an important mark (e.g. `!` or `!important`) in the value.
|
|
198
|
+
*
|
|
199
|
+
* This is useful when you want to use a value that is not defined in the config or want to opt-out of the defaults.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* css({
|
|
203
|
+
* fontSize: '[123px]', // ⚠️ will not throw even if you haven't defined 123px as a token
|
|
204
|
+
* })
|
|
205
|
+
*
|
|
206
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#stricttokens
|
|
207
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
|
|
208
|
+
*/
|
|
209
|
+
export type WithEscapeHatch<T> = T | `[${string}]` | WithColorOpacityModifier<T> | WithImportant<T>
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Will restrict the value of properties that have predefined values to those values only.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* css({
|
|
216
|
+
* display: 'abc', // ❌ will throw
|
|
217
|
+
* })
|
|
218
|
+
*
|
|
219
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
|
|
220
|
+
*/
|
|
221
|
+
export type OnlyKnown<Key, Value> = Value extends boolean
|
|
222
|
+
? Value
|
|
223
|
+
: Value extends `${infer _}` ? Value : never
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { RecipeRule } from './static-css';
|
|
3
|
+
import type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types';
|
|
4
|
+
|
|
5
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
6
|
+
|
|
7
|
+
export type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>
|
|
8
|
+
|
|
9
|
+
export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T
|
|
10
|
+
? {}
|
|
11
|
+
: {
|
|
12
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Extract the variant as optional props from a `cva` function.
|
|
19
|
+
* Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.
|
|
20
|
+
*/
|
|
21
|
+
export type RecipeVariantProps<
|
|
22
|
+
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
|
|
23
|
+
> = Pretty<Parameters<T>[0]>
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Extract the variants from a `cva` function.
|
|
27
|
+
*/
|
|
28
|
+
export type RecipeVariant<
|
|
29
|
+
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
|
|
30
|
+
> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>
|
|
31
|
+
|
|
32
|
+
type RecipeVariantMap<T extends RecipeVariantRecord> = {
|
|
33
|
+
[K in keyof T]: Array<keyof T[K]>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* -----------------------------------------------------------------------------
|
|
37
|
+
* Recipe / Standard
|
|
38
|
+
* -----------------------------------------------------------------------------*/
|
|
39
|
+
|
|
40
|
+
export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {
|
|
41
|
+
__type: RecipeSelection<T>
|
|
42
|
+
variantKeys: (keyof T)[]
|
|
43
|
+
variantMap: RecipeVariantMap<T>
|
|
44
|
+
raw: (props?: RecipeSelection<T>) => SystemStyleObject
|
|
45
|
+
config: RecipeConfig<T>
|
|
46
|
+
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
47
|
+
props: Props,
|
|
48
|
+
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
49
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type OneOrMore<T> = T | Array<T>
|
|
53
|
+
|
|
54
|
+
export type RecipeCompoundSelection<T> = {
|
|
55
|
+
[K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type RecipeCompoundVariant<T> = T & {
|
|
59
|
+
css: SystemStyleObject
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {
|
|
63
|
+
/**
|
|
64
|
+
* The base styles of the recipe.
|
|
65
|
+
*/
|
|
66
|
+
base?: SystemStyleObject
|
|
67
|
+
/**
|
|
68
|
+
* Whether the recipe is deprecated.
|
|
69
|
+
*/
|
|
70
|
+
deprecated?: boolean | string
|
|
71
|
+
/**
|
|
72
|
+
* The multi-variant styles of the recipe.
|
|
73
|
+
*/
|
|
74
|
+
variants?: T
|
|
75
|
+
/**
|
|
76
|
+
* The default variants of the recipe.
|
|
77
|
+
*/
|
|
78
|
+
defaultVariants?: RecipeSelection<T>
|
|
79
|
+
/**
|
|
80
|
+
* The styles to apply when a combination of variants is selected.
|
|
81
|
+
*/
|
|
82
|
+
compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
|
|
86
|
+
|
|
87
|
+
interface RecipeConfigMeta {
|
|
88
|
+
/**
|
|
89
|
+
* The class name of the recipe.
|
|
90
|
+
*/
|
|
91
|
+
className: string
|
|
92
|
+
/**
|
|
93
|
+
* The description of the recipe. This will be used in the JSDoc comment.
|
|
94
|
+
*/
|
|
95
|
+
description?: string
|
|
96
|
+
/**
|
|
97
|
+
* The jsx elements to track for this recipe. Can be string or Regexp.
|
|
98
|
+
*
|
|
99
|
+
* @default capitalize(recipe.name)
|
|
100
|
+
* @example ['Button', 'Link', /Button$/]
|
|
101
|
+
*/
|
|
102
|
+
jsx?: Array<string | RegExp>
|
|
103
|
+
/**
|
|
104
|
+
* Variants to pre-generate, will be include in the final `config.staticCss`
|
|
105
|
+
*/
|
|
106
|
+
staticCss?: RecipeRule[]
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>
|
|
110
|
+
extends RecipeDefinition<T>,
|
|
111
|
+
RecipeConfigMeta {}
|
|
112
|
+
|
|
113
|
+
/* -----------------------------------------------------------------------------
|
|
114
|
+
* Recipe / Slot
|
|
115
|
+
* -----------------------------------------------------------------------------*/
|
|
116
|
+
|
|
117
|
+
type SlotRecord<S extends string, T> = Partial<Record<S, T>>
|
|
118
|
+
|
|
119
|
+
export type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>
|
|
120
|
+
|
|
121
|
+
export type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (
|
|
122
|
+
props?: RecipeSelection<T>,
|
|
123
|
+
) => SlotRecord<S, string>
|
|
124
|
+
|
|
125
|
+
export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>
|
|
126
|
+
extends SlotRecipeVariantFn<S, T> {
|
|
127
|
+
raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>
|
|
128
|
+
variantKeys: (keyof T)[]
|
|
129
|
+
variantMap: RecipeVariantMap<T>
|
|
130
|
+
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
131
|
+
props: Props,
|
|
132
|
+
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
133
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type SlotRecipeCompoundVariant<S extends string, T> = T & {
|
|
137
|
+
css: SlotRecord<S, SystemStyleObject>
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface SlotRecipeDefinition<
|
|
141
|
+
S extends string = string,
|
|
142
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
143
|
+
> {
|
|
144
|
+
/**
|
|
145
|
+
* An optional class name that can be used to target slots in the DOM.
|
|
146
|
+
*/
|
|
147
|
+
className?: string
|
|
148
|
+
/**
|
|
149
|
+
* Whether the recipe is deprecated.
|
|
150
|
+
*/
|
|
151
|
+
deprecated?: boolean | string
|
|
152
|
+
/**
|
|
153
|
+
* The parts/slots of the recipe.
|
|
154
|
+
*/
|
|
155
|
+
slots: S[] | Readonly<S[]>
|
|
156
|
+
/**
|
|
157
|
+
* The base styles of the recipe.
|
|
158
|
+
*/
|
|
159
|
+
base?: SlotRecord<S, SystemStyleObject>
|
|
160
|
+
/**
|
|
161
|
+
* The multi-variant styles of the recipe.
|
|
162
|
+
*/
|
|
163
|
+
variants?: T
|
|
164
|
+
/**
|
|
165
|
+
* The default variants of the recipe.
|
|
166
|
+
*/
|
|
167
|
+
defaultVariants?: RecipeSelection<T>
|
|
168
|
+
/**
|
|
169
|
+
* The styles to apply when a combination of variants is selected.
|
|
170
|
+
*/
|
|
171
|
+
compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
|
|
175
|
+
config: SlotRecipeDefinition<S, T>,
|
|
176
|
+
) => SlotRecipeRuntimeFn<S, T>
|
|
177
|
+
|
|
178
|
+
export type SlotRecipeConfig<
|
|
179
|
+
S extends string = string,
|
|
180
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
181
|
+
> = SlotRecipeDefinition<S, T> & RecipeConfigMeta
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { Pseudos } from './csstype';
|
|
3
|
+
|
|
4
|
+
type AriaAttributes =
|
|
5
|
+
| '[aria-disabled]'
|
|
6
|
+
| '[aria-hidden]'
|
|
7
|
+
| '[aria-invalid]'
|
|
8
|
+
| '[aria-readonly]'
|
|
9
|
+
| '[aria-required]'
|
|
10
|
+
| '[aria-selected]'
|
|
11
|
+
| '[aria-checked]'
|
|
12
|
+
| '[aria-expanded]'
|
|
13
|
+
| '[aria-pressed]'
|
|
14
|
+
| `[aria-current=${'page' | 'step' | 'location' | 'date' | 'time'}]`
|
|
15
|
+
| '[aria-invalid]'
|
|
16
|
+
| `[aria-sort=${'ascending' | 'descending'}]`
|
|
17
|
+
|
|
18
|
+
type DataAttributes =
|
|
19
|
+
| '[data-selected]'
|
|
20
|
+
| '[data-highlighted]'
|
|
21
|
+
| '[data-hover]'
|
|
22
|
+
| '[data-active]'
|
|
23
|
+
| '[data-checked]'
|
|
24
|
+
| '[data-disabled]'
|
|
25
|
+
| '[data-readonly]'
|
|
26
|
+
| '[data-focus]'
|
|
27
|
+
| '[data-focus-visible]'
|
|
28
|
+
| '[data-focus-visible-added]'
|
|
29
|
+
| '[data-invalid]'
|
|
30
|
+
| '[data-pressed]'
|
|
31
|
+
| '[data-expanded]'
|
|
32
|
+
| '[data-grabbed]'
|
|
33
|
+
| '[data-dragged]'
|
|
34
|
+
| '[data-orientation=horizontal]'
|
|
35
|
+
| '[data-orientation=vertical]'
|
|
36
|
+
| '[data-in-range]'
|
|
37
|
+
| '[data-out-of-range]'
|
|
38
|
+
| '[data-placeholder-shown]'
|
|
39
|
+
| `[data-part=${string}]`
|
|
40
|
+
| `[data-attr=${string}]`
|
|
41
|
+
| `[data-placement=${string}]`
|
|
42
|
+
| `[data-theme=${string}]`
|
|
43
|
+
| `[data-size=${string}]`
|
|
44
|
+
| `[data-state=${string}]`
|
|
45
|
+
| '[data-empty]'
|
|
46
|
+
| '[data-loading]'
|
|
47
|
+
| '[data-loaded]'
|
|
48
|
+
| '[data-enter]'
|
|
49
|
+
| '[data-entering]'
|
|
50
|
+
| '[data-exited]'
|
|
51
|
+
| '[data-exiting]'
|
|
52
|
+
|
|
53
|
+
type AttributeSelector = `&${Pseudos | DataAttributes | AriaAttributes}`
|
|
54
|
+
type ParentSelector = `${DataAttributes | AriaAttributes} &`
|
|
55
|
+
|
|
56
|
+
type AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page' | 'scope' | 'starting-style'
|
|
57
|
+
|
|
58
|
+
export type AnySelector = `${string}&` | `&${string}` | `@${AtRuleType}${string}`
|
|
59
|
+
export type Selectors = AttributeSelector | ParentSelector
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
interface ConditionOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The conditions to generate for the rule.
|
|
5
|
+
* @example ['hover', 'focus']
|
|
6
|
+
*/
|
|
7
|
+
conditions?: string[]
|
|
8
|
+
/**
|
|
9
|
+
* Whether to generate responsive styles for the rule.
|
|
10
|
+
*/
|
|
11
|
+
responsive?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CssRule extends ConditionOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The css properties to generate utilities for.
|
|
17
|
+
* @example ['margin', 'padding']
|
|
18
|
+
*/
|
|
19
|
+
properties: {
|
|
20
|
+
[property: string]: Array<string | number>
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface RecipeRuleVariants {
|
|
25
|
+
[variant: string]: boolean | string[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type RecipeRuleObject = RecipeRuleVariants & ConditionOptions
|
|
29
|
+
export type RecipeRule = '*' | RecipeRuleObject
|
|
30
|
+
|
|
31
|
+
export type PatternRule = '*' | CssRule
|
|
32
|
+
|
|
33
|
+
export interface StaticCssOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The css utility classes to generate.
|
|
36
|
+
*/
|
|
37
|
+
css?: CssRule[]
|
|
38
|
+
/**
|
|
39
|
+
* The css recipes to generate.
|
|
40
|
+
*/
|
|
41
|
+
recipes?:
|
|
42
|
+
| '*'
|
|
43
|
+
| {
|
|
44
|
+
[recipe: string]: RecipeRule[]
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The css patterns to generate.
|
|
48
|
+
*/
|
|
49
|
+
patterns?: {
|
|
50
|
+
[pattern: string]: PatternRule[]
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The CSS themes to generate
|
|
54
|
+
*/
|
|
55
|
+
themes?: string[]
|
|
56
|
+
}
|