@techsio/ui-kit 0.61.0 → 0.63.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 -4
- package/dist/atoms/action-icon.js +9 -4
- package/dist/atoms/badge.js +59 -33
- package/dist/atoms/button.js +73 -54
- package/dist/atoms/checkbox.js +5 -1
- package/dist/atoms/hotkeys.js +5 -1
- package/dist/atoms/icon.js +9 -4
- package/dist/atoms/image.js +9 -2
- package/dist/atoms/input.js +10 -6
- package/dist/atoms/label.js +6 -1
- package/dist/atoms/link-button.js +9 -4
- package/dist/atoms/link.js +6 -1
- package/dist/atoms/numeric-input.js +11 -7
- package/dist/atoms/rating.js +5 -1
- package/dist/atoms/skeleton.js +22 -15
- package/dist/atoms/status-text.js +6 -1
- package/dist/atoms/textarea.js +23 -12
- package/dist/atoms/tooltip.js +10 -5
- package/dist/internal/molecules/vertical-navigation.styles.js +7 -7
- package/dist/molecules/accordion.js +20 -14
- package/dist/molecules/availability-status.js +2 -1
- package/dist/molecules/breadcrumb.js +9 -4
- package/dist/molecules/carousel.js +5 -1
- package/dist/molecules/cascade-select.js +8 -4
- package/dist/molecules/color-select.js +5 -1
- package/dist/molecules/combobox.js +8 -4
- package/dist/molecules/date-picker.js +26 -22
- package/dist/molecules/dialog.js +7 -3
- package/dist/molecules/drawer.js +9 -5
- package/dist/molecules/file-upload.js +9 -5
- package/dist/molecules/form-checkbox.js +5 -1
- package/dist/molecules/form-input.js +12 -2
- package/dist/molecules/form-numeric-input.js +11 -1
- package/dist/molecules/form-textarea.js +12 -2
- package/dist/molecules/menu.js +17 -7
- package/dist/molecules/pagination.js +13 -8
- package/dist/molecules/phone-input.js +5 -1
- package/dist/molecules/popover.js +10 -6
- package/dist/molecules/price-block.js +1 -1
- package/dist/molecules/product-card.js +5 -5
- package/dist/molecules/quantity-field.js +5 -1
- package/dist/molecules/radio-card.js +26 -21
- package/dist/molecules/radio-group.js +24 -19
- package/dist/molecules/search-form.js +8 -4
- package/dist/molecules/select.js +8 -4
- package/dist/molecules/slider.js +5 -1
- package/dist/molecules/steps.js +24 -14
- package/dist/molecules/switch.js +5 -1
- package/dist/molecules/tabs.js +13 -8
- package/dist/molecules/toast.js +3 -3
- package/dist/molecules/totals-summary.js +5 -5
- package/dist/molecules/tree-view.js +7 -2
- package/dist/molecules/vertical-navigation.js +23 -13
- package/dist/organisms/data-table.fields.js +2 -2
- package/dist/organisms/data-table.js +41 -23
- package/dist/organisms/footer.js +5 -1
- package/dist/organisms/gallery.js +1 -1
- package/dist/organisms/header.js +7 -3
- package/dist/organisms/line-item.js +2 -2
- package/dist/organisms/sidebar.js +5 -6
- package/dist/organisms/table.js +10 -5
- package/dist/src/atoms/action-icon.d.ts +5 -5
- package/dist/src/atoms/action-icon.d.ts.map +1 -1
- package/dist/src/atoms/badge.d.ts +55 -40
- package/dist/src/atoms/badge.d.ts.map +1 -1
- package/dist/src/atoms/button.d.ts +29 -18
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +2 -2
- package/dist/src/atoms/checkbox.d.ts.map +1 -1
- package/dist/src/atoms/hotkeys.d.ts +2 -2
- package/dist/src/atoms/hotkeys.d.ts.map +1 -1
- package/dist/src/atoms/icon.d.ts +5 -5
- package/dist/src/atoms/icon.d.ts.map +1 -1
- package/dist/src/atoms/image.d.ts +2 -2
- package/dist/src/atoms/image.d.ts.map +1 -1
- package/dist/src/atoms/input.d.ts +5 -5
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/label.d.ts +2 -2
- package/dist/src/atoms/label.d.ts.map +1 -1
- package/dist/src/atoms/link-button.d.ts +34 -29
- package/dist/src/atoms/link-button.d.ts.map +1 -1
- package/dist/src/atoms/link.d.ts +2 -2
- package/dist/src/atoms/link.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +9 -8
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/rating.d.ts +2 -2
- package/dist/src/atoms/rating.d.ts.map +1 -1
- package/dist/src/atoms/skeleton.d.ts +9 -9
- package/dist/src/atoms/skeleton.d.ts.map +1 -1
- package/dist/src/atoms/status-text.d.ts +2 -2
- package/dist/src/atoms/status-text.d.ts.map +1 -1
- package/dist/src/atoms/textarea.d.ts +17 -8
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/atoms/tooltip.d.ts +7 -7
- package/dist/src/atoms/tooltip.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts +2 -2
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts +9 -9
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts.map +1 -1
- package/dist/src/molecules/accordion.d.ts +25 -14
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/availability-status.d.ts +1 -1
- package/dist/src/molecules/availability-status.d.ts.map +1 -1
- package/dist/src/molecules/breadcrumb.d.ts +6 -6
- package/dist/src/molecules/breadcrumb.d.ts.map +1 -1
- package/dist/src/molecules/carousel.d.ts +2 -2
- package/dist/src/molecules/carousel.d.ts.map +1 -1
- package/dist/src/molecules/cascade-select.d.ts +3 -3
- package/dist/src/molecules/cascade-select.d.ts.map +1 -1
- package/dist/src/molecules/color-select.d.ts +2 -2
- package/dist/src/molecules/color-select.d.ts.map +1 -1
- package/dist/src/molecules/combobox.d.ts +2 -2
- package/dist/src/molecules/combobox.d.ts.map +1 -1
- package/dist/src/molecules/command.d.ts +1 -1
- package/dist/src/molecules/date-picker.d.ts +5 -5
- package/dist/src/molecules/date-picker.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +1 -1
- package/dist/src/molecules/dialog.d.ts.map +1 -1
- package/dist/src/molecules/drawer.d.ts +1 -1
- package/dist/src/molecules/drawer.d.ts.map +1 -1
- package/dist/src/molecules/file-upload.d.ts +2 -2
- package/dist/src/molecules/file-upload.d.ts.map +1 -1
- package/dist/src/molecules/form-checkbox.d.ts +1 -1
- package/dist/src/molecules/form-checkbox.d.ts.map +1 -1
- package/dist/src/molecules/form-input.d.ts +2 -2
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/molecules/form-numeric-input.d.ts +2 -2
- package/dist/src/molecules/form-numeric-input.d.ts.map +1 -1
- package/dist/src/molecules/form-textarea.d.ts +2 -2
- package/dist/src/molecules/form-textarea.d.ts.map +1 -1
- package/dist/src/molecules/menu.d.ts +2 -2
- package/dist/src/molecules/menu.d.ts.map +1 -1
- package/dist/src/molecules/pagination.d.ts +15 -15
- package/dist/src/molecules/pagination.d.ts.map +1 -1
- package/dist/src/molecules/phone-input.d.ts +2 -2
- package/dist/src/molecules/phone-input.d.ts.map +1 -1
- package/dist/src/molecules/popover.d.ts +4 -4
- package/dist/src/molecules/popover.d.ts.map +1 -1
- package/dist/src/molecules/price-block.d.ts +1 -1
- package/dist/src/molecules/product-card.d.ts +7 -7
- package/dist/src/molecules/product-card.d.ts.map +1 -1
- package/dist/src/molecules/quantity-field.d.ts +2 -2
- package/dist/src/molecules/quantity-field.d.ts.map +1 -1
- package/dist/src/molecules/radio-card.d.ts +7 -7
- package/dist/src/molecules/radio-card.d.ts.map +1 -1
- package/dist/src/molecules/radio-group.d.ts +7 -7
- package/dist/src/molecules/radio-group.d.ts.map +1 -1
- package/dist/src/molecules/search-form.d.ts +3 -3
- package/dist/src/molecules/search-form.d.ts.map +1 -1
- package/dist/src/molecules/select.d.ts +1 -1
- package/dist/src/molecules/select.d.ts.map +1 -1
- package/dist/src/molecules/slider.d.ts +1 -1
- package/dist/src/molecules/slider.d.ts.map +1 -1
- package/dist/src/molecules/steps.d.ts +7 -7
- package/dist/src/molecules/steps.d.ts.map +1 -1
- package/dist/src/molecules/switch.d.ts +1 -1
- package/dist/src/molecules/switch.d.ts.map +1 -1
- package/dist/src/molecules/tabs.d.ts +8 -8
- package/dist/src/molecules/tabs.d.ts.map +1 -1
- package/dist/src/molecules/totals-summary.d.ts +2 -2
- package/dist/src/molecules/tour.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts.map +1 -1
- package/dist/src/molecules/vertical-navigation.d.ts +13 -11
- package/dist/src/molecules/vertical-navigation.d.ts.map +1 -1
- package/dist/src/organisms/data-table.d.ts +5 -5
- package/dist/src/organisms/data-table.d.ts.map +1 -1
- package/dist/src/organisms/footer.d.ts +2 -2
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/gallery.d.ts +1 -1
- package/dist/src/organisms/header.d.ts +2 -2
- package/dist/src/organisms/header.d.ts.map +1 -1
- package/dist/src/organisms/line-item.d.ts +2 -2
- package/dist/src/organisms/line-item.d.ts.map +1 -1
- package/dist/src/organisms/sidebar.d.ts +4 -3
- package/dist/src/organisms/sidebar.d.ts.map +1 -1
- package/dist/src/organisms/table.d.ts +5 -5
- package/dist/src/organisms/table.d.ts.map +1 -1
- package/dist/src/templates/accordion.d.ts +2 -2
- package/dist/src/templates/accordion.d.ts.map +1 -1
- package/dist/src/templates/breadcrumb.d.ts +1 -1
- package/dist/src/templates/carousel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts.map +1 -1
- package/dist/src/templates/gallery.d.ts +1 -1
- package/dist/src/templates/numeric-input.d.ts +1 -1
- package/dist/src/templates/popover.d.ts +1 -1
- package/dist/src/templates/product-card.d.ts +1 -1
- package/dist/src/templates/select.d.ts +1 -1
- package/dist/src/templates/tabs.d.ts +2 -2
- package/dist/src/templates/tabs.d.ts.map +1 -1
- package/dist/src/theme/theme-config.d.ts +11 -0
- package/dist/src/theme/theme-config.d.ts.map +1 -1
- package/dist/src/theme/theme-provider.d.ts.map +1 -1
- package/dist/src/theme/ui-provider.d.ts +48 -0
- package/dist/src/theme/ui-provider.d.ts.map +1 -0
- package/dist/templates/accordion.js +1 -3
- package/dist/templates/facet-filter-panel.js +20 -9
- package/dist/templates/product-card.js +3 -3
- package/dist/templates/tabs.js +1 -3
- package/dist/theme/theme-config.js +12 -1
- package/dist/theme/theme-provider.js +6 -2
- package/dist/theme/theme-toggle.js +4 -4
- package/dist/theme/ui-provider.js +53 -0
- package/package.json +1 -2
- package/src/tokens/_foundation-overrides.css +1 -1
- package/src/tokens/_scheme-scopes.css +9 -0
- package/src/tokens/_semantic.css +1 -1
- package/src/tokens/_shape.css +125 -0
- package/src/tokens/_tokens-base.css +1 -0
- package/src/tokens/components/atoms/_action-icon.css +1 -1
- package/src/tokens/components/atoms/_badge.css +13 -0
- package/src/tokens/components/atoms/_icon.css +1 -1
- package/src/tokens/components/molecules/_chart.css +1 -1
- package/src/tokens/components/molecules/_combobox.css +1 -1
|
@@ -9,7 +9,11 @@ import { Icon } from "../atoms/icon.js";
|
|
|
9
9
|
import { LinkButton } from "../atoms/link-button.js";
|
|
10
10
|
import { VerticalNavigationBranchContext, VerticalNavigationContext, VerticalNavigationDepthContext, useVerticalNavigationBranchContext, useVerticalNavigationContext } from "../internal/molecules/vertical-navigation.context.js";
|
|
11
11
|
import { verticalNavigationStyles } from "../internal/molecules/vertical-navigation.styles.js";
|
|
12
|
-
|
|
12
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
13
|
+
function VerticalNavigation({ size: sizeProp, maxIndentDepth = 3, dir, className, children, ...props }) {
|
|
14
|
+
const { size = "md" } = useUIDefaults("VerticalNavigation", {
|
|
15
|
+
size: sizeProp
|
|
16
|
+
}, verticalNavigationStyles);
|
|
13
17
|
return /*#__PURE__*/ jsx(VerticalNavigationContext.Provider, {
|
|
14
18
|
value: {
|
|
15
19
|
size,
|
|
@@ -98,7 +102,7 @@ VerticalNavigation.Link = function({ current = false, className, ...props }) {
|
|
|
98
102
|
"data-part": "link",
|
|
99
103
|
"data-scope": "vertical-navigation",
|
|
100
104
|
size: "current",
|
|
101
|
-
|
|
105
|
+
unstyled: true
|
|
102
106
|
});
|
|
103
107
|
};
|
|
104
108
|
VerticalNavigation.Branch = function({ id, open, defaultOpen, onOpenChange, disabled, getRootNode, containsCurrent = false, children, className, ...props }) {
|
|
@@ -147,7 +151,7 @@ VerticalNavigation.BranchTrigger = function({ className, disabled, ...props }) {
|
|
|
147
151
|
"data-scope": "vertical-navigation",
|
|
148
152
|
disabled: disabled || api.disabled,
|
|
149
153
|
size: "current",
|
|
150
|
-
|
|
154
|
+
unstyled: true
|
|
151
155
|
});
|
|
152
156
|
};
|
|
153
157
|
VerticalNavigation.BranchIndicator = function({ className, ...props }) {
|
|
@@ -169,40 +173,46 @@ VerticalNavigation.BranchIndicator = function({ className, ...props }) {
|
|
|
169
173
|
})
|
|
170
174
|
});
|
|
171
175
|
};
|
|
172
|
-
VerticalNavigation.BranchContent = function({
|
|
176
|
+
VerticalNavigation.BranchContent = function({ appearance: appearanceProp, severity = "primary", indent = true, showGuide = false, className, ...props }) {
|
|
177
|
+
const { appearance = "plain" } = useUIDefaults("VerticalNavigation", {
|
|
178
|
+
appearance: appearanceProp
|
|
179
|
+
}, verticalNavigationStyles);
|
|
173
180
|
const { maxIndentDepth } = useVerticalNavigationContext();
|
|
174
181
|
const { api } = useVerticalNavigationBranchContext();
|
|
175
182
|
const depth = useContext(VerticalNavigationDepthContext);
|
|
176
183
|
return /*#__PURE__*/ jsx("div", {
|
|
177
184
|
...mergeProps(props, api.getContentProps()),
|
|
178
185
|
className: verticalNavigationStyles({
|
|
179
|
-
|
|
180
|
-
|
|
186
|
+
appearance,
|
|
187
|
+
severity
|
|
181
188
|
}).content({
|
|
182
189
|
className
|
|
183
190
|
}),
|
|
191
|
+
"data-appearance": appearance,
|
|
184
192
|
"data-guide": showGuide || void 0,
|
|
185
193
|
"data-indented": indent && depth <= maxIndentDepth || void 0,
|
|
186
194
|
"data-part": "branch-content",
|
|
187
195
|
"data-scope": "vertical-navigation",
|
|
188
|
-
"data-
|
|
189
|
-
"data-variant": variant
|
|
196
|
+
"data-severity": severity
|
|
190
197
|
});
|
|
191
198
|
};
|
|
192
|
-
VerticalNavigation.Group = function({
|
|
199
|
+
VerticalNavigation.Group = function({ appearance: appearanceProp, severity = "primary", className, ...props }) {
|
|
193
200
|
useVerticalNavigationContext();
|
|
201
|
+
const { appearance = "plain" } = useUIDefaults("VerticalNavigation", {
|
|
202
|
+
appearance: appearanceProp
|
|
203
|
+
}, verticalNavigationStyles);
|
|
194
204
|
return /*#__PURE__*/ jsx("div", {
|
|
195
205
|
...props,
|
|
196
206
|
className: verticalNavigationStyles({
|
|
197
|
-
|
|
198
|
-
|
|
207
|
+
appearance,
|
|
208
|
+
severity
|
|
199
209
|
}).group({
|
|
200
210
|
className
|
|
201
211
|
}),
|
|
212
|
+
"data-appearance": appearance,
|
|
202
213
|
"data-part": "group",
|
|
203
214
|
"data-scope": "vertical-navigation",
|
|
204
|
-
"data-
|
|
205
|
-
"data-variant": variant
|
|
215
|
+
"data-severity": severity
|
|
206
216
|
});
|
|
207
217
|
};
|
|
208
218
|
VerticalNavigation.GroupLabel = function({ className, ...props }) {
|
|
@@ -179,8 +179,8 @@ function FilterConditionMenu({ operators, operatorLabels, value, onChange, disab
|
|
|
179
179
|
}),
|
|
180
180
|
disabled: disabled,
|
|
181
181
|
icon: "icon-[mdi--filter-variant]",
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
severity: "neutral",
|
|
183
|
+
size: size
|
|
184
184
|
}),
|
|
185
185
|
items: labelled.map((o)=>({
|
|
186
186
|
type: "radio",
|
|
@@ -22,6 +22,7 @@ import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
|
22
22
|
import { Menu } from "../molecules/menu.js";
|
|
23
23
|
import { Pagination } from "../molecules/pagination.js";
|
|
24
24
|
import { SearchForm } from "../molecules/search-form.js";
|
|
25
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
25
26
|
import { tv } from "../utils.js";
|
|
26
27
|
import { DEFAULT_EDITOR_RENDERERS, DEFAULT_FILTER_RENDERERS, FieldSelect, FieldTableLayoutContext, columnLabel, isBlank } from "./data-table.fields.js";
|
|
27
28
|
import { DATA_TABLE_Z, applyColumnDefaults, conditionalFilterFn, dataTableFeatures, getColumnSizeStyles, getPinningStyles, isFirstEndPinned, isLastStartPinned, resolveColumnType } from "./data-table.helpers.js";
|
|
@@ -646,12 +647,27 @@ function composeRowRef(dnd, consumerRef) {
|
|
|
646
647
|
};
|
|
647
648
|
}
|
|
648
649
|
function DataTable(props) {
|
|
649
|
-
const { data, columns: userColumns, getRowId, id: idProp, className, ref,
|
|
650
|
+
const { data, columns: userColumns, getRowId, id: idProp, className, ref, appearance: appearanceProp, size: sizeProp, stickyHeader, interactive, showColumnBorder, caption, hideHeader, maxHeight, enableSorting = true, enableGlobalFilter = false, enableColumnFilters = false, enableRowSelection = false, enableColumnVisibility = false, enableColumnPinning = false, enableColumnReorder = false, enableColumnResizing = false, tableLayout = "auto", enableRowReorder = false, enableExpanding = false, enablePagination = false, enableVirtualization = false, getSubRows, getRowCanExpand, getCellSpan, sorting: sortingProp, onSortingChange, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, rowSelection: rowSelectionProp, onRowSelectionChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, columnOrder: columnOrderProp, onColumnOrderChange, columnPinning: columnPinningProp, onColumnPinningChange, expanded: expandedProp, onExpandedChange, pagination: paginationProp, onPaginationChange, pageSizeOptions = [
|
|
650
651
|
10,
|
|
651
652
|
25,
|
|
652
653
|
50,
|
|
653
654
|
100
|
|
654
655
|
], manualSorting, manualFiltering, manualPagination, rowCount, pageCount, hasNextPage, onRowClick, onReachEnd, onColumnReorder, onRowReorder, onCellEditCommit, onReady, renderToolbar, toolbarActions, renderEmpty, renderRowActions, renderHeaderFilter, renderExpandedRow, slotProps, translations: translationsProp, estimateRowHeight = 44, reachEndThreshold = 240, enableInlineEdit = false, editingRowId: editingRowIdProp, onEditingRowIdChange, onEditStart, onEditChange, onEditCommit, onEditCancel, onEditValidationError, lockInteractionsWhileEditing = true, onInteractionBlocked, filterRenderers, editorRenderers, stickyActions = true, paginationProps, canEditRow, rowActions, getRowLabel, striped = false, tintNestedRows = false, loading = false, loadingRowCount = 5, loadingMore = false, selectionMode = "multiple", maxSelectedRows, canSelectRow, onSelectionLimitReached } = props;
|
|
656
|
+
const { appearance = "line", size = "md" } = useUIDefaults("DataTable", {
|
|
657
|
+
appearance: appearanceProp,
|
|
658
|
+
size: sizeProp
|
|
659
|
+
}, {
|
|
660
|
+
appearance: [
|
|
661
|
+
"line",
|
|
662
|
+
"outline",
|
|
663
|
+
"striped"
|
|
664
|
+
],
|
|
665
|
+
size: [
|
|
666
|
+
"sm",
|
|
667
|
+
"md",
|
|
668
|
+
"lg"
|
|
669
|
+
]
|
|
670
|
+
});
|
|
655
671
|
const messages = useUiMessages();
|
|
656
672
|
const translations = useMemo(()=>resolveDataTableTranslations(messages.dataTable, translationsProp), [
|
|
657
673
|
messages.dataTable,
|
|
@@ -664,8 +680,8 @@ function DataTable(props) {
|
|
|
664
680
|
translations
|
|
665
681
|
]);
|
|
666
682
|
const [tableDragPlugins] = useState(()=>createTableDragPlugins(buildTableDragAccessibility(dragMessages)));
|
|
667
|
-
const outlined = "outline" ===
|
|
668
|
-
const effectiveStriped = striped || "striped" ===
|
|
683
|
+
const outlined = "outline" === appearance;
|
|
684
|
+
const effectiveStriped = striped || "striped" === appearance;
|
|
669
685
|
const styles = dataTableVariants({
|
|
670
686
|
outlined,
|
|
671
687
|
fixedLayout: "fixed" === tableLayout
|
|
@@ -1429,6 +1445,8 @@ function DataTable(props) {
|
|
|
1429
1445
|
"data-leaf-column": 0 === column.columns.length ? column.id : void 0,
|
|
1430
1446
|
"data-pinned": column.getIsPinned() || void 0,
|
|
1431
1447
|
ref: dnd?.nodeRef,
|
|
1448
|
+
role: header.isPlaceholder ? "presentation" : void 0,
|
|
1449
|
+
scope: header.isPlaceholder ? void 0 : "col",
|
|
1432
1450
|
style: {
|
|
1433
1451
|
...OPAQUE_HEADER_BG,
|
|
1434
1452
|
...stickyRowOffset(stickyHeader, headerOffsets, groupIndex),
|
|
@@ -1576,6 +1594,7 @@ function DataTable(props) {
|
|
|
1576
1594
|
if (editingRowId === row.id) return /*#__PURE__*/ jsxs(Fragment, {
|
|
1577
1595
|
children: [
|
|
1578
1596
|
/*#__PURE__*/ jsx(Button, {
|
|
1597
|
+
appearance: "outline",
|
|
1579
1598
|
"aria-label": translations.cancelEditLabel,
|
|
1580
1599
|
disabled: savePending,
|
|
1581
1600
|
icon: "token-icon-close",
|
|
@@ -1583,9 +1602,8 @@ function DataTable(props) {
|
|
|
1583
1602
|
event.stopPropagation();
|
|
1584
1603
|
cancelEdit();
|
|
1585
1604
|
},
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
variant: "secondary"
|
|
1605
|
+
severity: "secondary",
|
|
1606
|
+
size: size
|
|
1589
1607
|
}),
|
|
1590
1608
|
/*#__PURE__*/ jsx(Button, {
|
|
1591
1609
|
"aria-describedby": saveError ? `${instanceId}-save-error` : void 0,
|
|
@@ -1597,8 +1615,8 @@ function DataTable(props) {
|
|
|
1597
1615
|
event.stopPropagation();
|
|
1598
1616
|
commitEdit();
|
|
1599
1617
|
},
|
|
1600
|
-
|
|
1601
|
-
|
|
1618
|
+
severity: "primary",
|
|
1619
|
+
size: size
|
|
1602
1620
|
})
|
|
1603
1621
|
]
|
|
1604
1622
|
});
|
|
@@ -1611,8 +1629,8 @@ function DataTable(props) {
|
|
|
1611
1629
|
e.stopPropagation();
|
|
1612
1630
|
startEdit(row);
|
|
1613
1631
|
},
|
|
1614
|
-
|
|
1615
|
-
|
|
1632
|
+
severity: "neutral",
|
|
1633
|
+
size: size
|
|
1616
1634
|
});
|
|
1617
1635
|
};
|
|
1618
1636
|
const rowActionsContent = (row)=>{
|
|
@@ -1639,6 +1657,7 @@ function DataTable(props) {
|
|
|
1639
1657
|
"data-part": "actions-cell-content",
|
|
1640
1658
|
children: [
|
|
1641
1659
|
enableExpanding && row.getCanExpand() ? /*#__PURE__*/ jsx(Button, {
|
|
1660
|
+
appearance: "ghost",
|
|
1642
1661
|
"aria-controls": expandAriaControls(row.id),
|
|
1643
1662
|
"aria-expanded": row.getIsExpanded(),
|
|
1644
1663
|
"aria-label": row.getIsExpanded() ? translations.collapseRowLabel : translations.expandRowLabel,
|
|
@@ -1649,11 +1668,11 @@ function DataTable(props) {
|
|
|
1649
1668
|
if (blocked("expand")) return;
|
|
1650
1669
|
row.getToggleExpandedHandler()();
|
|
1651
1670
|
},
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
variant: "secondary"
|
|
1671
|
+
severity: "secondary",
|
|
1672
|
+
size: "sm"
|
|
1655
1673
|
}) : null,
|
|
1656
1674
|
rowActions?.map((action)=>action.hidden?.(row) ? null : /*#__PURE__*/ jsx(Button, {
|
|
1675
|
+
appearance: "ghost",
|
|
1657
1676
|
"aria-label": action.label,
|
|
1658
1677
|
disabled: action.disabled?.(row) || locked,
|
|
1659
1678
|
icon: action.icon,
|
|
@@ -1661,9 +1680,8 @@ function DataTable(props) {
|
|
|
1661
1680
|
e.stopPropagation();
|
|
1662
1681
|
action.onAction(row);
|
|
1663
1682
|
},
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
variant: "danger" === action.tone ? "danger" : "secondary"
|
|
1683
|
+
severity: "danger" === action.severity ? "danger" : "secondary",
|
|
1684
|
+
size: "sm"
|
|
1667
1685
|
}, action.id)),
|
|
1668
1686
|
rowActionsContent(row),
|
|
1669
1687
|
editingRowId === row.id && savePending && /*#__PURE__*/ jsx(StatusText, {
|
|
@@ -1929,13 +1947,13 @@ function DataTable(props) {
|
|
|
1929
1947
|
const tableEl = /*#__PURE__*/ jsx(FieldTableLayoutContext.Provider, {
|
|
1930
1948
|
value: tableLayout,
|
|
1931
1949
|
children: /*#__PURE__*/ jsxs(Table, {
|
|
1950
|
+
appearance: outlined || "striped" === appearance ? "line" : appearance,
|
|
1932
1951
|
"aria-busy": loading || loadingMore || invalidPage || void 0,
|
|
1933
1952
|
"aria-rowcount": accessibleRowCount,
|
|
1934
1953
|
interactive: (interactive || !!onRowClick) && !locked,
|
|
1935
1954
|
showColumnBorder: showColumnBorder,
|
|
1936
1955
|
size: size,
|
|
1937
1956
|
stickyHeader: stickyHeader,
|
|
1938
|
-
variant: outlined || "striped" === variant ? "line" : variant,
|
|
1939
1957
|
...slotProps?.root,
|
|
1940
1958
|
style: {
|
|
1941
1959
|
tableLayout,
|
|
@@ -2172,9 +2190,9 @@ DataTable.ColumnVisibility = function() {
|
|
|
2172
2190
|
customTrigger: /*#__PURE__*/ jsx(Button, {
|
|
2173
2191
|
"aria-label": translations.columnsLabel,
|
|
2174
2192
|
icon: "icon-[mdi--cog-outline]",
|
|
2193
|
+
severity: "primary",
|
|
2175
2194
|
size: "sm",
|
|
2176
|
-
title: translations.columnsLabel
|
|
2177
|
-
variant: "primary"
|
|
2195
|
+
title: translations.columnsLabel
|
|
2178
2196
|
}),
|
|
2179
2197
|
items: items,
|
|
2180
2198
|
onCheckedChange: (item)=>{
|
|
@@ -2262,25 +2280,25 @@ DataTable.Pagination = function() {
|
|
|
2262
2280
|
pager.unknownTotal ? /*#__PURE__*/ jsxs(Fragment, {
|
|
2263
2281
|
children: [
|
|
2264
2282
|
/*#__PURE__*/ jsx(Button, {
|
|
2283
|
+
appearance: "outline",
|
|
2265
2284
|
"aria-disabled": paginationBusy || void 0,
|
|
2266
2285
|
disabled: locked || 0 === pager.pageIndex,
|
|
2267
2286
|
onClick: ()=>{
|
|
2268
2287
|
if (!(paginationBusy || blocked("paginate"))) table.previousPage();
|
|
2269
2288
|
},
|
|
2289
|
+
severity: "secondary",
|
|
2270
2290
|
size: size,
|
|
2271
|
-
theme: "outlined",
|
|
2272
|
-
variant: "secondary",
|
|
2273
2291
|
children: translations.previousPageLabel
|
|
2274
2292
|
}),
|
|
2275
2293
|
/*#__PURE__*/ jsx(Button, {
|
|
2294
|
+
appearance: "outline",
|
|
2276
2295
|
"aria-disabled": paginationBusy || void 0,
|
|
2277
2296
|
disabled: locked || !pager.canNext,
|
|
2278
2297
|
onClick: ()=>{
|
|
2279
2298
|
if (!(paginationBusy || blocked("paginate"))) table.nextPage();
|
|
2280
2299
|
},
|
|
2300
|
+
severity: "secondary",
|
|
2281
2301
|
size: size,
|
|
2282
|
-
theme: "outlined",
|
|
2283
|
-
variant: "secondary",
|
|
2284
2302
|
children: translations.nextPageLabel
|
|
2285
2303
|
})
|
|
2286
2304
|
]
|
package/dist/organisms/footer.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Children, Fragment, cloneElement, createContext, isValidElement, useContext } from "react";
|
|
4
4
|
import { Link } from "../atoms/link.js";
|
|
5
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
5
6
|
import { tv } from "../utils.js";
|
|
6
7
|
const footerVariants = tv({
|
|
7
8
|
slots: {
|
|
@@ -84,7 +85,10 @@ const footerVariants = tv({
|
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
87
|
const FooterContext = /*#__PURE__*/ createContext({});
|
|
87
|
-
function Footer({ children, size, sectionFlow, direction, layout, className, ...props }) {
|
|
88
|
+
function Footer({ children, size: sizeProp, sectionFlow, direction, layout, className, ...props }) {
|
|
89
|
+
const { size } = useUIDefaults("Footer", {
|
|
90
|
+
size: sizeProp
|
|
91
|
+
}, footerVariants);
|
|
88
92
|
const { root } = footerVariants({
|
|
89
93
|
size,
|
|
90
94
|
direction
|
|
@@ -238,8 +238,8 @@ Gallery.Thumbnail = function({ index, children, imageAs, imageClassName, classNa
|
|
|
238
238
|
onClick: handleClick,
|
|
239
239
|
size: "current",
|
|
240
240
|
style: resolvedStyle,
|
|
241
|
-
theme: "unstyled",
|
|
242
241
|
type: "button",
|
|
242
|
+
unstyled: true,
|
|
243
243
|
...props,
|
|
244
244
|
children: children ?? item.thumbnailContent ?? fallbackThumbnail
|
|
245
245
|
});
|
package/dist/organisms/header.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { createContext, useContext, useEffect, useId, useRef, useState } from "react";
|
|
4
4
|
import { Button } from "../atoms/button.js";
|
|
5
5
|
import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
6
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
6
7
|
import { tv } from "../utils.js";
|
|
7
8
|
const headerVariants = tv({
|
|
8
9
|
slots: {
|
|
@@ -110,7 +111,10 @@ const HeaderContext = /*#__PURE__*/ createContext({
|
|
|
110
111
|
setIsMobileMenuOpen: ()=>void 0,
|
|
111
112
|
toggleMobileMenu: ()=>void 0
|
|
112
113
|
});
|
|
113
|
-
function Header({ size
|
|
114
|
+
function Header({ size: sizeProp, direction = "horizontal", className, children, ref, ...props }) {
|
|
115
|
+
const { size = "md" } = useUIDefaults("Header", {
|
|
116
|
+
size: sizeProp
|
|
117
|
+
}, headerVariants);
|
|
114
118
|
const generatedMenuId = useId();
|
|
115
119
|
const [mobileMenuId, setMobileMenuId] = useState(`${generatedMenuId}-mobile-menu`);
|
|
116
120
|
const hamburgerRef = useRef(null);
|
|
@@ -316,8 +320,8 @@ Header.Hamburger = function({ className, ref, onClick, "aria-label": ariaLabel,
|
|
|
316
320
|
if (ref) ref.current = node;
|
|
317
321
|
},
|
|
318
322
|
size: "current",
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
type: "button",
|
|
324
|
+
unstyled: true
|
|
321
325
|
});
|
|
322
326
|
};
|
|
323
327
|
export { Header, HeaderContext };
|
|
@@ -180,11 +180,12 @@ LineItem.Actions = function({ className, ...props }) {
|
|
|
180
180
|
inert: pending || void 0
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
|
-
LineItem.Remove = function({ label, onClick, disabled, size = "sm",
|
|
183
|
+
LineItem.Remove = function({ label, onClick, disabled, size = "sm", appearance = "ghost", ...props }) {
|
|
184
184
|
const { title, readOnly, pending } = useLineItemContext();
|
|
185
185
|
if (readOnly) return null;
|
|
186
186
|
return /*#__PURE__*/ jsx(Button, {
|
|
187
187
|
...props,
|
|
188
|
+
appearance: appearance,
|
|
188
189
|
"aria-label": `${label}: ${title}`,
|
|
189
190
|
"data-part": "remove",
|
|
190
191
|
disabled: pending || disabled,
|
|
@@ -192,7 +193,6 @@ LineItem.Remove = function({ label, onClick, disabled, size = "sm", theme = "bor
|
|
|
192
193
|
if (!(pending || disabled)) onClick?.(event);
|
|
193
194
|
},
|
|
194
195
|
size: size,
|
|
195
|
-
theme: theme,
|
|
196
196
|
type: "button",
|
|
197
197
|
children: label
|
|
198
198
|
});
|
|
@@ -210,7 +210,7 @@ Sidebar.Trigger = function({ "aria-label": ariaLabel, className, icon = "token-i
|
|
|
210
210
|
children: button
|
|
211
211
|
});
|
|
212
212
|
};
|
|
213
|
-
Sidebar.CloseTrigger = function({ "aria-label": ariaLabel, className, icon = "token-icon-sidebar-close", onClick,
|
|
213
|
+
Sidebar.CloseTrigger = function({ "aria-label": ariaLabel, className, icon = "token-icon-sidebar-close", onClick, severity = "neutral", ...props }) {
|
|
214
214
|
const context = useSidebarContext();
|
|
215
215
|
const panel = useSidebarPanelContext();
|
|
216
216
|
if (context.isDesktop) return null;
|
|
@@ -228,8 +228,7 @@ Sidebar.CloseTrigger = function({ "aria-label": ariaLabel, className, icon = "to
|
|
|
228
228
|
onClick?.(event);
|
|
229
229
|
if (!event.defaultPrevented) onMachineClick?.(event);
|
|
230
230
|
},
|
|
231
|
-
|
|
232
|
-
tone: tone
|
|
231
|
+
severity: severity
|
|
233
232
|
});
|
|
234
233
|
};
|
|
235
234
|
Sidebar.Inset = function({ className, ref, ...props }) {
|
|
@@ -394,10 +393,10 @@ Sidebar.PaneGroup = function({ className, ref, ...props }) {
|
|
|
394
393
|
ref: ref
|
|
395
394
|
});
|
|
396
395
|
};
|
|
397
|
-
Sidebar.Pane = function({ className, ref,
|
|
396
|
+
Sidebar.Pane = function({ className, ref, paneSize = "auto", visibility = "always", ...props }) {
|
|
398
397
|
const panel = useSidebarPanelContext();
|
|
399
398
|
const { pane } = sidebarVariants({
|
|
400
|
-
paneSize
|
|
399
|
+
paneSize
|
|
401
400
|
});
|
|
402
401
|
return /*#__PURE__*/ jsx("div", {
|
|
403
402
|
...props,
|
|
@@ -406,7 +405,7 @@ Sidebar.Pane = function({ className, ref, size = "auto", visibility = "always",
|
|
|
406
405
|
}),
|
|
407
406
|
"data-part": "pane",
|
|
408
407
|
"data-scope": "sidebar",
|
|
409
|
-
"data-size":
|
|
408
|
+
"data-size": paneSize,
|
|
410
409
|
"data-visibility": visibility,
|
|
411
410
|
hidden: "expanded" === visibility && !panel.expanded,
|
|
412
411
|
ref: ref
|
package/dist/organisms/table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
4
5
|
import { tv } from "../utils.js";
|
|
5
6
|
const tableVariants = tv({
|
|
6
7
|
slots: {
|
|
@@ -39,7 +40,7 @@ const tableVariants = tv({
|
|
|
39
40
|
]
|
|
40
41
|
},
|
|
41
42
|
variants: {
|
|
42
|
-
|
|
43
|
+
appearance: {
|
|
43
44
|
line: {
|
|
44
45
|
root: "",
|
|
45
46
|
row: "border-b-(length:--border-table-width) border-table-border"
|
|
@@ -110,7 +111,7 @@ const tableVariants = tv({
|
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
defaultVariants: {
|
|
113
|
-
|
|
114
|
+
appearance: "line",
|
|
114
115
|
size: "md",
|
|
115
116
|
interactive: false,
|
|
116
117
|
stickyHeader: false,
|
|
@@ -125,9 +126,13 @@ function useTableContext() {
|
|
|
125
126
|
if (!context) throw new Error("Table components must be used within Table");
|
|
126
127
|
return context;
|
|
127
128
|
}
|
|
128
|
-
function Table({
|
|
129
|
+
function Table({ appearance: appearanceProp, size: sizeProp, interactive, stickyHeader, stickyFirstColumn, showColumnBorder, captionPlacement, children, ref, className, ...props }) {
|
|
130
|
+
const { size, appearance } = useUIDefaults("Table", {
|
|
131
|
+
size: sizeProp,
|
|
132
|
+
appearance: appearanceProp
|
|
133
|
+
}, tableVariants);
|
|
129
134
|
const styles = tableVariants({
|
|
130
|
-
|
|
135
|
+
appearance,
|
|
131
136
|
size,
|
|
132
137
|
interactive,
|
|
133
138
|
stickyHeader,
|
|
@@ -137,7 +142,7 @@ function Table({ variant, size, interactive, stickyHeader, stickyFirstColumn, sh
|
|
|
137
142
|
});
|
|
138
143
|
return /*#__PURE__*/ jsx(TableContext.Provider, {
|
|
139
144
|
value: {
|
|
140
|
-
|
|
145
|
+
appearance,
|
|
141
146
|
size,
|
|
142
147
|
interactive,
|
|
143
148
|
stickyHeader,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ActionIcon — @techsio/ui-kit atom.
|
|
3
3
|
*
|
|
4
4
|
* @component ActionIcon
|
|
5
|
-
* @componentVersion
|
|
5
|
+
* @componentVersion v2.0.0
|
|
6
6
|
* @skill action-icon-usage
|
|
7
7
|
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
8
|
*
|
|
@@ -18,7 +18,7 @@ declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
|
18
18
|
md: "size-icon-control-md text-action-icon-md";
|
|
19
19
|
lg: "size-action-icon-lg text-action-icon-lg";
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
severity: {
|
|
22
22
|
neutral: string[];
|
|
23
23
|
danger: string[];
|
|
24
24
|
};
|
|
@@ -28,7 +28,7 @@ declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
28
|
md: "size-icon-control-md text-action-icon-md";
|
|
29
29
|
lg: "size-action-icon-lg text-action-icon-lg";
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
severity: {
|
|
32
32
|
neutral: string[];
|
|
33
33
|
danger: string[];
|
|
34
34
|
};
|
|
@@ -38,7 +38,7 @@ declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
|
38
38
|
md: "size-icon-control-md text-action-icon-md";
|
|
39
39
|
lg: "size-action-icon-lg text-action-icon-lg";
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
severity: {
|
|
42
42
|
neutral: string[];
|
|
43
43
|
danger: string[];
|
|
44
44
|
};
|
|
@@ -56,7 +56,7 @@ export type ActionIconProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "chi
|
|
|
56
56
|
icon: IconType;
|
|
57
57
|
ref?: Ref<HTMLButtonElement>;
|
|
58
58
|
};
|
|
59
|
-
export declare function ActionIcon({ icon, size,
|
|
59
|
+
export declare function ActionIcon({ icon, size: sizeProp, severity, type, className, ref, ...props }: ActionIconProps): import("react").JSX.Element;
|
|
60
60
|
export declare namespace ActionIcon {
|
|
61
61
|
var displayName: string;
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/action-icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"action-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/action-icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAY5C,QAAA,MAAM,kBAAkB;;;;;;;QAgBlB,OAAO;QAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;cAWV,CAAA;AAEF,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEjE,oEAAoE;AACpE,KAAK,cAAc,GACf;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,YAAY,GAAG,iBAAiB,CAC9C,GACC,kBAAkB,GAClB,cAAc,GAAG;IACf,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAC7B,CAAA;AAEH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,IAAe,EACf,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAgBjB;yBAxBe,UAAU"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Badge — @techsio/ui-kit atom.
|
|
3
3
|
*
|
|
4
4
|
* @component Badge
|
|
5
|
-
* @componentVersion
|
|
5
|
+
* @componentVersion v2.0.0
|
|
6
6
|
* @skill badge-usage
|
|
7
7
|
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
8
|
*
|
|
@@ -12,17 +12,21 @@
|
|
|
12
12
|
import type { ComponentPropsWithRef } from "react";
|
|
13
13
|
import type { VariantProps } from "tailwind-variants";
|
|
14
14
|
declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
15
|
-
|
|
16
|
-
primary:
|
|
17
|
-
secondary:
|
|
18
|
-
tertiary:
|
|
19
|
-
discount:
|
|
20
|
-
info:
|
|
21
|
-
success:
|
|
22
|
-
warning:
|
|
23
|
-
danger:
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
severity: {
|
|
16
|
+
primary: "";
|
|
17
|
+
secondary: "";
|
|
18
|
+
tertiary: "";
|
|
19
|
+
discount: "";
|
|
20
|
+
info: "";
|
|
21
|
+
success: "";
|
|
22
|
+
warning: "";
|
|
23
|
+
danger: "";
|
|
24
|
+
neutral: "border-badge-border-outline bg-badge-bg-outline text-badge-fg-outline";
|
|
25
|
+
custom: "";
|
|
26
|
+
};
|
|
27
|
+
appearance: {
|
|
28
|
+
solid: "";
|
|
29
|
+
outline: "bg-badge-bg-outline text-badge-fg-outline";
|
|
26
30
|
};
|
|
27
31
|
size: {
|
|
28
32
|
sm: string[];
|
|
@@ -31,17 +35,21 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
31
35
|
xl: string[];
|
|
32
36
|
};
|
|
33
37
|
}, undefined, string[], {
|
|
34
|
-
|
|
35
|
-
primary:
|
|
36
|
-
secondary:
|
|
37
|
-
tertiary:
|
|
38
|
-
discount:
|
|
39
|
-
info:
|
|
40
|
-
success:
|
|
41
|
-
warning:
|
|
42
|
-
danger:
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
severity: {
|
|
39
|
+
primary: "";
|
|
40
|
+
secondary: "";
|
|
41
|
+
tertiary: "";
|
|
42
|
+
discount: "";
|
|
43
|
+
info: "";
|
|
44
|
+
success: "";
|
|
45
|
+
warning: "";
|
|
46
|
+
danger: "";
|
|
47
|
+
neutral: "border-badge-border-outline bg-badge-bg-outline text-badge-fg-outline";
|
|
48
|
+
custom: "";
|
|
49
|
+
};
|
|
50
|
+
appearance: {
|
|
51
|
+
solid: "";
|
|
52
|
+
outline: "bg-badge-bg-outline text-badge-fg-outline";
|
|
45
53
|
};
|
|
46
54
|
size: {
|
|
47
55
|
sm: string[];
|
|
@@ -50,17 +58,21 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
50
58
|
xl: string[];
|
|
51
59
|
};
|
|
52
60
|
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
53
|
-
|
|
54
|
-
primary:
|
|
55
|
-
secondary:
|
|
56
|
-
tertiary:
|
|
57
|
-
discount:
|
|
58
|
-
info:
|
|
59
|
-
success:
|
|
60
|
-
warning:
|
|
61
|
-
danger:
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
severity: {
|
|
62
|
+
primary: "";
|
|
63
|
+
secondary: "";
|
|
64
|
+
tertiary: "";
|
|
65
|
+
discount: "";
|
|
66
|
+
info: "";
|
|
67
|
+
success: "";
|
|
68
|
+
warning: "";
|
|
69
|
+
danger: "";
|
|
70
|
+
neutral: "border-badge-border-outline bg-badge-bg-outline text-badge-fg-outline";
|
|
71
|
+
custom: "";
|
|
72
|
+
};
|
|
73
|
+
appearance: {
|
|
74
|
+
solid: "";
|
|
75
|
+
outline: "bg-badge-bg-outline text-badge-fg-outline";
|
|
64
76
|
};
|
|
65
77
|
size: {
|
|
66
78
|
sm: string[];
|
|
@@ -69,22 +81,25 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
69
81
|
xl: string[];
|
|
70
82
|
};
|
|
71
83
|
}, undefined>>;
|
|
72
|
-
type
|
|
84
|
+
export type BadgeSeverity = NonNullable<VariantProps<typeof badgeVariants>["severity"]>;
|
|
85
|
+
export type BadgeAppearance = NonNullable<VariantProps<typeof badgeVariants>["appearance"]>;
|
|
73
86
|
type BadgeSize = NonNullable<VariantProps<typeof badgeVariants>["size"]>;
|
|
74
87
|
type BaseBadgeProps = Omit<ComponentPropsWithRef<"span">, "color" | "children"> & {
|
|
75
88
|
children: string;
|
|
76
89
|
size?: BadgeSize;
|
|
90
|
+
/** Fill style. Falls back to the nearest `UIProvider`, then `solid`. */
|
|
91
|
+
appearance?: BadgeAppearance;
|
|
77
92
|
};
|
|
78
93
|
type DefaultBadgeProps = BaseBadgeProps & {
|
|
79
|
-
|
|
94
|
+
severity?: Exclude<BadgeSeverity, "custom">;
|
|
80
95
|
};
|
|
81
|
-
type
|
|
82
|
-
|
|
96
|
+
type CustomBadgeProps = BaseBadgeProps & {
|
|
97
|
+
severity: "custom";
|
|
83
98
|
bgColor: string;
|
|
84
99
|
fgColor: string;
|
|
85
100
|
borderColor: string;
|
|
86
101
|
};
|
|
87
|
-
export type BadgeProps = DefaultBadgeProps |
|
|
88
|
-
export declare function Badge({
|
|
102
|
+
export type BadgeProps = DefaultBadgeProps | CustomBadgeProps;
|
|
103
|
+
export declare function Badge({ severity, size: sizeProp, appearance: appearanceProp, className, children, style, ...props }: BadgeProps): import("react").JSX.Element;
|
|
89
104
|
export {};
|
|
90
105
|
//# sourceMappingURL=badge.d.ts.map
|