cetec-design-system 4.3.0-0 → 4.4.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/dist/index.js +213 -29
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +13 -5
- package/dist/preset.js +180 -0
- package/dist/preset.js.map +1 -1
- package/dist/specs/recipes.json +11 -0
- package/dist/styles.css +223 -8
- package/dist/types/index.d.ts +99 -0
- package/package.json +1 -1
- package/src/recipes/filterToken.ts +189 -0
- package/src/recipes/recipes-slot.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -974,7 +974,7 @@ const spinnerVariantKeys = [
|
|
|
974
974
|
"inverse",
|
|
975
975
|
"centered"
|
|
976
976
|
];
|
|
977
|
-
const getVariantProps$
|
|
977
|
+
const getVariantProps$x = (variants) => ({ ...spinnerDefaultVariants, ...compact(variants) });
|
|
978
978
|
const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
|
|
979
979
|
__recipe__: false,
|
|
980
980
|
__name__: "spinner",
|
|
@@ -999,7 +999,7 @@ const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
|
|
|
999
999
|
splitVariantProps(props) {
|
|
1000
1000
|
return splitProps$1(props, spinnerVariantKeys);
|
|
1001
1001
|
},
|
|
1002
|
-
getVariantProps: getVariantProps$
|
|
1002
|
+
getVariantProps: getVariantProps$x
|
|
1003
1003
|
});
|
|
1004
1004
|
const tagFn = /* @__PURE__ */ createRecipe("tag", {
|
|
1005
1005
|
"variant": "default",
|
|
@@ -1667,7 +1667,7 @@ const toggleFn = memo((props = {}) => {
|
|
|
1667
1667
|
return Object.fromEntries(toggleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1668
1668
|
});
|
|
1669
1669
|
const toggleVariantKeys = [];
|
|
1670
|
-
const getVariantProps$
|
|
1670
|
+
const getVariantProps$w = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
|
|
1671
1671
|
const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
1672
1672
|
__recipe__: false,
|
|
1673
1673
|
__name__: "toggle",
|
|
@@ -1678,7 +1678,7 @@ const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
|
1678
1678
|
splitVariantProps(props) {
|
|
1679
1679
|
return splitProps$1(props, toggleVariantKeys);
|
|
1680
1680
|
},
|
|
1681
|
-
getVariantProps: getVariantProps$
|
|
1681
|
+
getVariantProps: getVariantProps$w
|
|
1682
1682
|
});
|
|
1683
1683
|
const alertDefaultVariants = {
|
|
1684
1684
|
"tone": "info"
|
|
@@ -1721,7 +1721,7 @@ const alertFn = memo((props = {}) => {
|
|
|
1721
1721
|
const alertVariantKeys = [
|
|
1722
1722
|
"tone"
|
|
1723
1723
|
];
|
|
1724
|
-
const getVariantProps$
|
|
1724
|
+
const getVariantProps$v = (variants) => ({ ...alertDefaultVariants, ...compact(variants) });
|
|
1725
1725
|
const alert = /* @__PURE__ */ Object.assign(alertFn, {
|
|
1726
1726
|
__recipe__: false,
|
|
1727
1727
|
__name__: "alert",
|
|
@@ -1740,7 +1740,7 @@ const alert = /* @__PURE__ */ Object.assign(alertFn, {
|
|
|
1740
1740
|
splitVariantProps(props) {
|
|
1741
1741
|
return splitProps$1(props, alertVariantKeys);
|
|
1742
1742
|
},
|
|
1743
|
-
getVariantProps: getVariantProps$
|
|
1743
|
+
getVariantProps: getVariantProps$v
|
|
1744
1744
|
});
|
|
1745
1745
|
const autocompleteDefaultVariants = {
|
|
1746
1746
|
"size": "md",
|
|
@@ -1797,7 +1797,7 @@ const autocompleteVariantKeys = [
|
|
|
1797
1797
|
"layer",
|
|
1798
1798
|
"size"
|
|
1799
1799
|
];
|
|
1800
|
-
const getVariantProps$
|
|
1800
|
+
const getVariantProps$u = (variants) => ({ ...autocompleteDefaultVariants, ...compact(variants) });
|
|
1801
1801
|
const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
|
|
1802
1802
|
__recipe__: false,
|
|
1803
1803
|
__name__: "autocomplete",
|
|
@@ -1819,7 +1819,7 @@ const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
|
|
|
1819
1819
|
splitVariantProps(props) {
|
|
1820
1820
|
return splitProps$1(props, autocompleteVariantKeys);
|
|
1821
1821
|
},
|
|
1822
|
-
getVariantProps: getVariantProps$
|
|
1822
|
+
getVariantProps: getVariantProps$u
|
|
1823
1823
|
});
|
|
1824
1824
|
const avatarDefaultVariants = {
|
|
1825
1825
|
"size": "md",
|
|
@@ -1856,7 +1856,7 @@ const avatarVariantKeys = [
|
|
|
1856
1856
|
"size",
|
|
1857
1857
|
"shape"
|
|
1858
1858
|
];
|
|
1859
|
-
const getVariantProps$
|
|
1859
|
+
const getVariantProps$t = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) });
|
|
1860
1860
|
const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
1861
1861
|
__recipe__: false,
|
|
1862
1862
|
__name__: "avatar",
|
|
@@ -1881,7 +1881,7 @@ const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
|
1881
1881
|
splitVariantProps(props) {
|
|
1882
1882
|
return splitProps$1(props, avatarVariantKeys);
|
|
1883
1883
|
},
|
|
1884
|
-
getVariantProps: getVariantProps$
|
|
1884
|
+
getVariantProps: getVariantProps$t
|
|
1885
1885
|
});
|
|
1886
1886
|
const badgeDefaultVariants = {
|
|
1887
1887
|
"size": "md",
|
|
@@ -1908,7 +1908,7 @@ const badgeVariantKeys = [
|
|
|
1908
1908
|
"dot",
|
|
1909
1909
|
"variant"
|
|
1910
1910
|
];
|
|
1911
|
-
const getVariantProps$
|
|
1911
|
+
const getVariantProps$s = (variants) => ({ ...badgeDefaultVariants, ...compact(variants) });
|
|
1912
1912
|
const badge = /* @__PURE__ */ Object.assign(badgeFn, {
|
|
1913
1913
|
__recipe__: false,
|
|
1914
1914
|
__name__: "badge",
|
|
@@ -1944,7 +1944,7 @@ const badge = /* @__PURE__ */ Object.assign(badgeFn, {
|
|
|
1944
1944
|
splitVariantProps(props) {
|
|
1945
1945
|
return splitProps$1(props, badgeVariantKeys);
|
|
1946
1946
|
},
|
|
1947
|
-
getVariantProps: getVariantProps$
|
|
1947
|
+
getVariantProps: getVariantProps$s
|
|
1948
1948
|
});
|
|
1949
1949
|
const breadcrumbsDefaultVariants = {};
|
|
1950
1950
|
const breadcrumbsCompoundVariants = [];
|
|
@@ -1971,7 +1971,7 @@ const breadcrumbsFn = memo((props = {}) => {
|
|
|
1971
1971
|
return Object.fromEntries(breadcrumbsSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1972
1972
|
});
|
|
1973
1973
|
const breadcrumbsVariantKeys = [];
|
|
1974
|
-
const getVariantProps$
|
|
1974
|
+
const getVariantProps$r = (variants) => ({ ...breadcrumbsDefaultVariants, ...compact(variants) });
|
|
1975
1975
|
const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
|
|
1976
1976
|
__recipe__: false,
|
|
1977
1977
|
__name__: "breadcrumbs",
|
|
@@ -1982,7 +1982,7 @@ const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
|
|
|
1982
1982
|
splitVariantProps(props) {
|
|
1983
1983
|
return splitProps$1(props, breadcrumbsVariantKeys);
|
|
1984
1984
|
},
|
|
1985
|
-
getVariantProps: getVariantProps$
|
|
1985
|
+
getVariantProps: getVariantProps$r
|
|
1986
1986
|
});
|
|
1987
1987
|
const buttonDefaultVariants = {
|
|
1988
1988
|
"variant": "standard",
|
|
@@ -2013,7 +2013,7 @@ const buttonVariantKeys = [
|
|
|
2013
2013
|
"before",
|
|
2014
2014
|
"after"
|
|
2015
2015
|
];
|
|
2016
|
-
const getVariantProps$
|
|
2016
|
+
const getVariantProps$q = (variants) => ({ ...buttonDefaultVariants, ...compact(variants) });
|
|
2017
2017
|
const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
2018
2018
|
__recipe__: false,
|
|
2019
2019
|
__name__: "button",
|
|
@@ -2047,7 +2047,7 @@ const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
|
2047
2047
|
splitVariantProps(props) {
|
|
2048
2048
|
return splitProps$1(props, buttonVariantKeys);
|
|
2049
2049
|
},
|
|
2050
|
-
getVariantProps: getVariantProps$
|
|
2050
|
+
getVariantProps: getVariantProps$q
|
|
2051
2051
|
});
|
|
2052
2052
|
const calendarDefaultVariants = {
|
|
2053
2053
|
"type": "days"
|
|
@@ -2086,7 +2086,7 @@ const calendarFn = memo((props = {}) => {
|
|
|
2086
2086
|
const calendarVariantKeys = [
|
|
2087
2087
|
"type"
|
|
2088
2088
|
];
|
|
2089
|
-
const getVariantProps$
|
|
2089
|
+
const getVariantProps$p = (variants) => ({ ...calendarDefaultVariants, ...compact(variants) });
|
|
2090
2090
|
const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
|
|
2091
2091
|
__recipe__: false,
|
|
2092
2092
|
__name__: "calendar",
|
|
@@ -2103,7 +2103,7 @@ const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
|
|
|
2103
2103
|
splitVariantProps(props) {
|
|
2104
2104
|
return splitProps$1(props, calendarVariantKeys);
|
|
2105
2105
|
},
|
|
2106
|
-
getVariantProps: getVariantProps$
|
|
2106
|
+
getVariantProps: getVariantProps$p
|
|
2107
2107
|
});
|
|
2108
2108
|
const checkboxDefaultVariants = {};
|
|
2109
2109
|
const checkboxCompoundVariants = [];
|
|
@@ -2130,7 +2130,7 @@ const checkboxFn = memo((props = {}) => {
|
|
|
2130
2130
|
return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2131
2131
|
});
|
|
2132
2132
|
const checkboxVariantKeys = [];
|
|
2133
|
-
const getVariantProps$
|
|
2133
|
+
const getVariantProps$o = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) });
|
|
2134
2134
|
const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
2135
2135
|
__recipe__: false,
|
|
2136
2136
|
__name__: "checkbox",
|
|
@@ -2141,7 +2141,7 @@ const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
|
2141
2141
|
splitVariantProps(props) {
|
|
2142
2142
|
return splitProps$1(props, checkboxVariantKeys);
|
|
2143
2143
|
},
|
|
2144
|
-
getVariantProps: getVariantProps$
|
|
2144
|
+
getVariantProps: getVariantProps$o
|
|
2145
2145
|
});
|
|
2146
2146
|
const chipDefaultVariants = {
|
|
2147
2147
|
"size": "md"
|
|
@@ -2179,7 +2179,7 @@ const chipVariantKeys = [
|
|
|
2179
2179
|
"after",
|
|
2180
2180
|
"dismissable"
|
|
2181
2181
|
];
|
|
2182
|
-
const getVariantProps$
|
|
2182
|
+
const getVariantProps$n = (variants) => ({ ...chipDefaultVariants, ...compact(variants) });
|
|
2183
2183
|
const chip = /* @__PURE__ */ Object.assign(chipFn, {
|
|
2184
2184
|
__recipe__: false,
|
|
2185
2185
|
__name__: "chip",
|
|
@@ -2206,7 +2206,7 @@ const chip = /* @__PURE__ */ Object.assign(chipFn, {
|
|
|
2206
2206
|
splitVariantProps(props) {
|
|
2207
2207
|
return splitProps$1(props, chipVariantKeys);
|
|
2208
2208
|
},
|
|
2209
|
-
getVariantProps: getVariantProps$
|
|
2209
|
+
getVariantProps: getVariantProps$n
|
|
2210
2210
|
});
|
|
2211
2211
|
const codeBlockDefaultVariants = {
|
|
2212
2212
|
"tone": "default",
|
|
@@ -2275,7 +2275,7 @@ const codeBlockVariantKeys = [
|
|
|
2275
2275
|
"collapsed",
|
|
2276
2276
|
"actionGutter"
|
|
2277
2277
|
];
|
|
2278
|
-
const getVariantProps$
|
|
2278
|
+
const getVariantProps$m = (variants) => ({ ...codeBlockDefaultVariants, ...compact(variants) });
|
|
2279
2279
|
const codeBlock = /* @__PURE__ */ Object.assign(codeBlockFn, {
|
|
2280
2280
|
__recipe__: false,
|
|
2281
2281
|
__name__: "codeBlock",
|
|
@@ -2311,7 +2311,7 @@ const codeBlock = /* @__PURE__ */ Object.assign(codeBlockFn, {
|
|
|
2311
2311
|
splitVariantProps(props) {
|
|
2312
2312
|
return splitProps$1(props, codeBlockVariantKeys);
|
|
2313
2313
|
},
|
|
2314
|
-
getVariantProps: getVariantProps$
|
|
2314
|
+
getVariantProps: getVariantProps$m
|
|
2315
2315
|
});
|
|
2316
2316
|
const dateMenusDefaultVariants = {};
|
|
2317
2317
|
const dateMenusCompoundVariants = [];
|
|
@@ -2334,7 +2334,7 @@ const dateMenusFn = memo((props = {}) => {
|
|
|
2334
2334
|
return Object.fromEntries(dateMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2335
2335
|
});
|
|
2336
2336
|
const dateMenusVariantKeys = [];
|
|
2337
|
-
const getVariantProps$
|
|
2337
|
+
const getVariantProps$l = (variants) => ({ ...dateMenusDefaultVariants, ...compact(variants) });
|
|
2338
2338
|
const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
|
|
2339
2339
|
__recipe__: false,
|
|
2340
2340
|
__name__: "dateMenus",
|
|
@@ -2345,7 +2345,7 @@ const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
|
|
|
2345
2345
|
splitVariantProps(props) {
|
|
2346
2346
|
return splitProps$1(props, dateMenusVariantKeys);
|
|
2347
2347
|
},
|
|
2348
|
-
getVariantProps: getVariantProps$
|
|
2348
|
+
getVariantProps: getVariantProps$l
|
|
2349
2349
|
});
|
|
2350
2350
|
const dateTimeMenusDefaultVariants = {};
|
|
2351
2351
|
const dateTimeMenusCompoundVariants = [];
|
|
@@ -2368,7 +2368,7 @@ const dateTimeMenusFn = memo((props = {}) => {
|
|
|
2368
2368
|
return Object.fromEntries(dateTimeMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2369
2369
|
});
|
|
2370
2370
|
const dateTimeMenusVariantKeys = [];
|
|
2371
|
-
const getVariantProps$
|
|
2371
|
+
const getVariantProps$k = (variants) => ({ ...dateTimeMenusDefaultVariants, ...compact(variants) });
|
|
2372
2372
|
const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
|
|
2373
2373
|
__recipe__: false,
|
|
2374
2374
|
__name__: "dateTimeMenus",
|
|
@@ -2379,7 +2379,7 @@ const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
|
|
|
2379
2379
|
splitVariantProps(props) {
|
|
2380
2380
|
return splitProps$1(props, dateTimeMenusVariantKeys);
|
|
2381
2381
|
},
|
|
2382
|
-
getVariantProps: getVariantProps$
|
|
2382
|
+
getVariantProps: getVariantProps$k
|
|
2383
2383
|
});
|
|
2384
2384
|
const drawerDefaultVariants = {
|
|
2385
2385
|
"side": "right",
|
|
@@ -2426,7 +2426,7 @@ const drawerVariantKeys = [
|
|
|
2426
2426
|
"size",
|
|
2427
2427
|
"scrollable"
|
|
2428
2428
|
];
|
|
2429
|
-
const getVariantProps$
|
|
2429
|
+
const getVariantProps$j = (variants) => ({ ...drawerDefaultVariants, ...compact(variants) });
|
|
2430
2430
|
const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
|
|
2431
2431
|
__recipe__: false,
|
|
2432
2432
|
__name__: "drawer",
|
|
@@ -2453,6 +2453,64 @@ const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
|
|
|
2453
2453
|
splitVariantProps(props) {
|
|
2454
2454
|
return splitProps$1(props, drawerVariantKeys);
|
|
2455
2455
|
},
|
|
2456
|
+
getVariantProps: getVariantProps$j
|
|
2457
|
+
});
|
|
2458
|
+
const filterTokenDefaultVariants = {};
|
|
2459
|
+
const filterTokenCompoundVariants = [];
|
|
2460
|
+
const filterTokenSlotNames = [
|
|
2461
|
+
[
|
|
2462
|
+
"root",
|
|
2463
|
+
"filterToken__root"
|
|
2464
|
+
],
|
|
2465
|
+
[
|
|
2466
|
+
"part",
|
|
2467
|
+
"filterToken__part"
|
|
2468
|
+
],
|
|
2469
|
+
[
|
|
2470
|
+
"field",
|
|
2471
|
+
"filterToken__field"
|
|
2472
|
+
],
|
|
2473
|
+
[
|
|
2474
|
+
"operator",
|
|
2475
|
+
"filterToken__operator"
|
|
2476
|
+
],
|
|
2477
|
+
[
|
|
2478
|
+
"value",
|
|
2479
|
+
"filterToken__value"
|
|
2480
|
+
],
|
|
2481
|
+
[
|
|
2482
|
+
"valueText",
|
|
2483
|
+
"filterToken__valueText"
|
|
2484
|
+
],
|
|
2485
|
+
[
|
|
2486
|
+
"count",
|
|
2487
|
+
"filterToken__count"
|
|
2488
|
+
],
|
|
2489
|
+
[
|
|
2490
|
+
"editor",
|
|
2491
|
+
"filterToken__editor"
|
|
2492
|
+
],
|
|
2493
|
+
[
|
|
2494
|
+
"remove",
|
|
2495
|
+
"filterToken__remove"
|
|
2496
|
+
]
|
|
2497
|
+
];
|
|
2498
|
+
const filterTokenSlotFns = /* @__PURE__ */ filterTokenSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, filterTokenDefaultVariants, getSlotCompoundVariant(filterTokenCompoundVariants, slotName))]);
|
|
2499
|
+
const filterTokenFn = memo((props = {}) => {
|
|
2500
|
+
return Object.fromEntries(filterTokenSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2501
|
+
});
|
|
2502
|
+
const filterTokenVariantKeys = [];
|
|
2503
|
+
const getVariantProps$i = (variants) => ({ ...filterTokenDefaultVariants, ...compact(variants) });
|
|
2504
|
+
const filterToken = /* @__PURE__ */ Object.assign(filterTokenFn, {
|
|
2505
|
+
__recipe__: false,
|
|
2506
|
+
__name__: "filterToken",
|
|
2507
|
+
raw: (props) => props,
|
|
2508
|
+
classNameMap: {},
|
|
2509
|
+
variantKeys: filterTokenVariantKeys,
|
|
2510
|
+
variantMap: {},
|
|
2511
|
+
splitVariantProps(props) {
|
|
2512
|
+
return splitProps$1(props, filterTokenVariantKeys);
|
|
2513
|
+
},
|
|
2456
2514
|
getVariantProps: getVariantProps$i
|
|
2457
2515
|
});
|
|
2458
2516
|
const formFieldDefaultVariants = {
|
|
@@ -15462,6 +15520,7 @@ const defaultLocaleLabels = {
|
|
|
15462
15520
|
dismiss: "Dismiss",
|
|
15463
15521
|
closeDialog: "Close dialog",
|
|
15464
15522
|
removeItem: (item) => `Remove ${item}`,
|
|
15523
|
+
removeFilter: (filter) => `Remove filter: ${filter}`,
|
|
15465
15524
|
switchToTheme: (nextTheme) => `Switch to ${nextTheme} theme`,
|
|
15466
15525
|
selectPlaceholder: "Select...",
|
|
15467
15526
|
noResults: "No results found",
|
|
@@ -22570,6 +22629,130 @@ const DrawerFooter = (props) => {
|
|
|
22570
22629
|
const classes = drawer();
|
|
22571
22630
|
return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
|
|
22572
22631
|
};
|
|
22632
|
+
const MAX_VISIBLE_VALUES = 2;
|
|
22633
|
+
const FilterToken = (props) => {
|
|
22634
|
+
const {
|
|
22635
|
+
field,
|
|
22636
|
+
operator,
|
|
22637
|
+
value,
|
|
22638
|
+
state = "applied",
|
|
22639
|
+
tone = "default",
|
|
22640
|
+
operatorLocked,
|
|
22641
|
+
editor,
|
|
22642
|
+
disabled,
|
|
22643
|
+
retainFocus,
|
|
22644
|
+
onFieldClick,
|
|
22645
|
+
onOperatorClick,
|
|
22646
|
+
onValueClick,
|
|
22647
|
+
onRemove,
|
|
22648
|
+
removeLabel,
|
|
22649
|
+
...rest
|
|
22650
|
+
} = props;
|
|
22651
|
+
const [className, otherProps] = splitProps(rest);
|
|
22652
|
+
const classes = filterToken();
|
|
22653
|
+
const { labels } = useLocale();
|
|
22654
|
+
const values = Array.isArray(value) ? value : void 0;
|
|
22655
|
+
const fullValue = Array.isArray(value) ? value.join(", ") : value;
|
|
22656
|
+
const hidden = values ? Math.max(0, values.length - MAX_VISIBLE_VALUES) : 0;
|
|
22657
|
+
const shownValue = values ? values.slice(0, MAX_VISIBLE_VALUES).join(", ") : value;
|
|
22658
|
+
const sentence = [field, operator, fullValue].filter(Boolean).join(" ");
|
|
22659
|
+
const keepFocus = retainFocus ? (e) => e.preventDefault() : void 0;
|
|
22660
|
+
const valueTextRef = useRef(null);
|
|
22661
|
+
const [clipped, setClipped] = useState(false);
|
|
22662
|
+
useLayoutEffect(() => {
|
|
22663
|
+
const node = valueTextRef.current;
|
|
22664
|
+
if (!node) {
|
|
22665
|
+
setClipped(false);
|
|
22666
|
+
return;
|
|
22667
|
+
}
|
|
22668
|
+
const check = () => setClipped(node.scrollWidth > node.clientWidth);
|
|
22669
|
+
check();
|
|
22670
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
22671
|
+
const observer = new ResizeObserver(check);
|
|
22672
|
+
observer.observe(node);
|
|
22673
|
+
return () => observer.disconnect();
|
|
22674
|
+
}, [shownValue, editor]);
|
|
22675
|
+
const part = (slot, content, onClick, extra) => onClick ? /* @__PURE__ */ jsx(
|
|
22676
|
+
Box,
|
|
22677
|
+
{
|
|
22678
|
+
as: "button",
|
|
22679
|
+
type: "button",
|
|
22680
|
+
className: cx(classes.part, slot),
|
|
22681
|
+
disabled,
|
|
22682
|
+
onMouseDown: keepFocus,
|
|
22683
|
+
onClick,
|
|
22684
|
+
...extra,
|
|
22685
|
+
children: content
|
|
22686
|
+
}
|
|
22687
|
+
) : /* @__PURE__ */ jsx(Box, { as: "span", className: cx(classes.part, slot), ...extra, children: content });
|
|
22688
|
+
const valueContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22689
|
+
/* @__PURE__ */ jsx(
|
|
22690
|
+
Box,
|
|
22691
|
+
{
|
|
22692
|
+
as: "span",
|
|
22693
|
+
ref: valueTextRef,
|
|
22694
|
+
className: classes.valueText,
|
|
22695
|
+
"aria-hidden": hidden > 0 || void 0,
|
|
22696
|
+
children: shownValue || "…"
|
|
22697
|
+
}
|
|
22698
|
+
),
|
|
22699
|
+
hidden > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22700
|
+
/* @__PURE__ */ jsx(Box, { as: "span", className: classes.count, "aria-hidden": true, children: `+${hidden}` }),
|
|
22701
|
+
/* @__PURE__ */ jsx(Box, { as: "span", srOnly: true, children: fullValue })
|
|
22702
|
+
] })
|
|
22703
|
+
] });
|
|
22704
|
+
return /* @__PURE__ */ jsxs(
|
|
22705
|
+
Box,
|
|
22706
|
+
{
|
|
22707
|
+
...dsComponent("FilterToken"),
|
|
22708
|
+
as: "span",
|
|
22709
|
+
role: "group",
|
|
22710
|
+
"aria-label": sentence,
|
|
22711
|
+
className: cx(classes.root, className),
|
|
22712
|
+
"data-state": state,
|
|
22713
|
+
"data-tone": tone,
|
|
22714
|
+
"data-disabled": disabled || void 0,
|
|
22715
|
+
...otherProps,
|
|
22716
|
+
children: [
|
|
22717
|
+
part(classes.field, field, onFieldClick ?? onValueClick),
|
|
22718
|
+
part(
|
|
22719
|
+
classes.operator,
|
|
22720
|
+
operator,
|
|
22721
|
+
operatorLocked ? void 0 : onOperatorClick,
|
|
22722
|
+
operatorLocked ? { "data-locked": true } : void 0
|
|
22723
|
+
),
|
|
22724
|
+
editor !== void 0 ? (
|
|
22725
|
+
// `inert` keeps a disabled token's editor out of the tab order.
|
|
22726
|
+
/* @__PURE__ */ jsxs(
|
|
22727
|
+
Box,
|
|
22728
|
+
{
|
|
22729
|
+
as: "span",
|
|
22730
|
+
className: cx(classes.part, classes.editor),
|
|
22731
|
+
inert: disabled || void 0,
|
|
22732
|
+
children: [
|
|
22733
|
+
shownValue && /* @__PURE__ */ jsx(Box, { as: "span", className: classes.value, children: valueContent }),
|
|
22734
|
+
editor
|
|
22735
|
+
]
|
|
22736
|
+
}
|
|
22737
|
+
)
|
|
22738
|
+
) : value !== void 0 && /* @__PURE__ */ jsx(Tooltip, { text: fullValue ?? "", disabled: hidden === 0 && !clipped, children: part(classes.value, valueContent, onValueClick) }),
|
|
22739
|
+
onRemove && state !== "removing" && /* @__PURE__ */ jsx(
|
|
22740
|
+
Box,
|
|
22741
|
+
{
|
|
22742
|
+
as: "button",
|
|
22743
|
+
type: "button",
|
|
22744
|
+
className: classes.remove,
|
|
22745
|
+
"aria-label": removeLabel ?? labels.removeFilter(sentence),
|
|
22746
|
+
disabled,
|
|
22747
|
+
onMouseDown: keepFocus,
|
|
22748
|
+
onClick: onRemove,
|
|
22749
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "16", "aria-hidden": true })
|
|
22750
|
+
}
|
|
22751
|
+
)
|
|
22752
|
+
]
|
|
22753
|
+
}
|
|
22754
|
+
);
|
|
22755
|
+
};
|
|
22573
22756
|
const Required = () => {
|
|
22574
22757
|
return /* @__PURE__ */ jsx(Text, { color: "text.danger", fontSize: "inherit", lineHeight: "tight", children: "*" });
|
|
22575
22758
|
};
|
|
@@ -26031,6 +26214,7 @@ export {
|
|
|
26031
26214
|
DrawerFooter,
|
|
26032
26215
|
DrawerHeader,
|
|
26033
26216
|
DsChainScope,
|
|
26217
|
+
FilterToken,
|
|
26034
26218
|
FormField,
|
|
26035
26219
|
Heading,
|
|
26036
26220
|
HighlightText,
|