cetec-design-system 3.5.1-0 → 4.0.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 +653 -77
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +36 -10
- package/dist/preset.js +478 -34
- package/dist/preset.js.map +1 -1
- package/dist/specs/keyframes.json +44 -0
- package/dist/specs/recipes.json +104 -16
- package/dist/styles.css +478 -42
- package/dist/types/index.d.ts +397 -37
- package/package.json +8 -11
- package/src/recipes/code.ts +38 -24
- package/src/recipes/codeBlock.ts +279 -0
- package/src/recipes/drawer.ts +150 -0
- package/src/recipes/recipes-regular.ts +1 -1
- package/src/recipes/recipes-slot.ts +2 -0
- package/src/styles/utilities/keyframes.ts +17 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { createContext, useContext, useMemo, forwardRef, createElement, useLayoutEffect, useState, useRef, useSyncExternalStore,
|
|
3
|
+
import { createContext, useContext, useMemo, forwardRef, createElement, useLayoutEffect, useState, useRef, useSyncExternalStore, useEffect, useCallback, useId as useId$1, isValidElement, Children, cloneElement, useReducer } from "react";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import { b as breakpoints, c as containerSizes } from "./containerSizes-nJuD-1Ap.js";
|
|
6
6
|
import { useForm } from "@tanstack/react-form";
|
|
@@ -543,8 +543,16 @@ const checkboxInput = /* @__PURE__ */ Object.assign(memo(checkboxInputFn.recipeF
|
|
|
543
543
|
},
|
|
544
544
|
getVariantProps: checkboxInputFn.getVariantProps
|
|
545
545
|
});
|
|
546
|
-
const codeFn = /* @__PURE__ */ createRecipe("code", {
|
|
547
|
-
|
|
546
|
+
const codeFn = /* @__PURE__ */ createRecipe("code", {
|
|
547
|
+
"variant": "subtle"
|
|
548
|
+
}, []);
|
|
549
|
+
const codeVariantMap = {
|
|
550
|
+
"variant": [
|
|
551
|
+
"subtle",
|
|
552
|
+
"outline",
|
|
553
|
+
"plain"
|
|
554
|
+
]
|
|
555
|
+
};
|
|
548
556
|
const codeVariantKeys = Object.keys(codeVariantMap);
|
|
549
557
|
const code = /* @__PURE__ */ Object.assign(memo(codeFn.recipeFn), {
|
|
550
558
|
__recipe__: true,
|
|
@@ -883,24 +891,6 @@ const list = /* @__PURE__ */ Object.assign(memo(listFn.recipeFn), {
|
|
|
883
891
|
},
|
|
884
892
|
getVariantProps: listFn.getVariantProps
|
|
885
893
|
});
|
|
886
|
-
const preFn = /* @__PURE__ */ createRecipe("pre", {}, []);
|
|
887
|
-
const preVariantMap = {};
|
|
888
|
-
const preVariantKeys = Object.keys(preVariantMap);
|
|
889
|
-
const pre = /* @__PURE__ */ Object.assign(memo(preFn.recipeFn), {
|
|
890
|
-
__recipe__: true,
|
|
891
|
-
__name__: "pre",
|
|
892
|
-
__getCompoundVariantCss__: preFn.__getCompoundVariantCss__,
|
|
893
|
-
raw: (props) => props,
|
|
894
|
-
variantKeys: preVariantKeys,
|
|
895
|
-
variantMap: preVariantMap,
|
|
896
|
-
merge(recipe) {
|
|
897
|
-
return mergeRecipes(this, recipe);
|
|
898
|
-
},
|
|
899
|
-
splitVariantProps(props) {
|
|
900
|
-
return splitProps$1(props, preVariantKeys);
|
|
901
|
-
},
|
|
902
|
-
getVariantProps: preFn.getVariantProps
|
|
903
|
-
});
|
|
904
894
|
const radioInputFn = /* @__PURE__ */ createRecipe("radioInput", {}, []);
|
|
905
895
|
const radioInputVariantMap = {};
|
|
906
896
|
const radioInputVariantKeys = Object.keys(radioInputVariantMap);
|
|
@@ -984,7 +974,7 @@ const spinnerVariantKeys = [
|
|
|
984
974
|
"inverse",
|
|
985
975
|
"centered"
|
|
986
976
|
];
|
|
987
|
-
const getVariantProps$
|
|
977
|
+
const getVariantProps$v = (variants) => ({ ...spinnerDefaultVariants, ...compact(variants) });
|
|
988
978
|
const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
|
|
989
979
|
__recipe__: false,
|
|
990
980
|
__name__: "spinner",
|
|
@@ -1009,7 +999,7 @@ const spinner = /* @__PURE__ */ Object.assign(spinnerFn, {
|
|
|
1009
999
|
splitVariantProps(props) {
|
|
1010
1000
|
return splitProps$1(props, spinnerVariantKeys);
|
|
1011
1001
|
},
|
|
1012
|
-
getVariantProps: getVariantProps$
|
|
1002
|
+
getVariantProps: getVariantProps$v
|
|
1013
1003
|
});
|
|
1014
1004
|
const tagFn = /* @__PURE__ */ createRecipe("tag", {
|
|
1015
1005
|
"variant": "default",
|
|
@@ -1677,7 +1667,7 @@ const toggleFn = memo((props = {}) => {
|
|
|
1677
1667
|
return Object.fromEntries(toggleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1678
1668
|
});
|
|
1679
1669
|
const toggleVariantKeys = [];
|
|
1680
|
-
const getVariantProps$
|
|
1670
|
+
const getVariantProps$u = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
|
|
1681
1671
|
const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
1682
1672
|
__recipe__: false,
|
|
1683
1673
|
__name__: "toggle",
|
|
@@ -1688,7 +1678,7 @@ const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
|
1688
1678
|
splitVariantProps(props) {
|
|
1689
1679
|
return splitProps$1(props, toggleVariantKeys);
|
|
1690
1680
|
},
|
|
1691
|
-
getVariantProps: getVariantProps$
|
|
1681
|
+
getVariantProps: getVariantProps$u
|
|
1692
1682
|
});
|
|
1693
1683
|
const alertDefaultVariants = {
|
|
1694
1684
|
"tone": "info"
|
|
@@ -1731,7 +1721,7 @@ const alertFn = memo((props = {}) => {
|
|
|
1731
1721
|
const alertVariantKeys = [
|
|
1732
1722
|
"tone"
|
|
1733
1723
|
];
|
|
1734
|
-
const getVariantProps$
|
|
1724
|
+
const getVariantProps$t = (variants) => ({ ...alertDefaultVariants, ...compact(variants) });
|
|
1735
1725
|
const alert = /* @__PURE__ */ Object.assign(alertFn, {
|
|
1736
1726
|
__recipe__: false,
|
|
1737
1727
|
__name__: "alert",
|
|
@@ -1750,7 +1740,7 @@ const alert = /* @__PURE__ */ Object.assign(alertFn, {
|
|
|
1750
1740
|
splitVariantProps(props) {
|
|
1751
1741
|
return splitProps$1(props, alertVariantKeys);
|
|
1752
1742
|
},
|
|
1753
|
-
getVariantProps: getVariantProps$
|
|
1743
|
+
getVariantProps: getVariantProps$t
|
|
1754
1744
|
});
|
|
1755
1745
|
const autocompleteDefaultVariants = {
|
|
1756
1746
|
"size": "md",
|
|
@@ -1807,7 +1797,7 @@ const autocompleteVariantKeys = [
|
|
|
1807
1797
|
"layer",
|
|
1808
1798
|
"size"
|
|
1809
1799
|
];
|
|
1810
|
-
const getVariantProps$
|
|
1800
|
+
const getVariantProps$s = (variants) => ({ ...autocompleteDefaultVariants, ...compact(variants) });
|
|
1811
1801
|
const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
|
|
1812
1802
|
__recipe__: false,
|
|
1813
1803
|
__name__: "autocomplete",
|
|
@@ -1829,7 +1819,7 @@ const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
|
|
|
1829
1819
|
splitVariantProps(props) {
|
|
1830
1820
|
return splitProps$1(props, autocompleteVariantKeys);
|
|
1831
1821
|
},
|
|
1832
|
-
getVariantProps: getVariantProps$
|
|
1822
|
+
getVariantProps: getVariantProps$s
|
|
1833
1823
|
});
|
|
1834
1824
|
const avatarDefaultVariants = {
|
|
1835
1825
|
"size": "md",
|
|
@@ -1866,7 +1856,7 @@ const avatarVariantKeys = [
|
|
|
1866
1856
|
"size",
|
|
1867
1857
|
"shape"
|
|
1868
1858
|
];
|
|
1869
|
-
const getVariantProps$
|
|
1859
|
+
const getVariantProps$r = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) });
|
|
1870
1860
|
const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
1871
1861
|
__recipe__: false,
|
|
1872
1862
|
__name__: "avatar",
|
|
@@ -1891,7 +1881,7 @@ const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
|
1891
1881
|
splitVariantProps(props) {
|
|
1892
1882
|
return splitProps$1(props, avatarVariantKeys);
|
|
1893
1883
|
},
|
|
1894
|
-
getVariantProps: getVariantProps$
|
|
1884
|
+
getVariantProps: getVariantProps$r
|
|
1895
1885
|
});
|
|
1896
1886
|
const badgeDefaultVariants = {
|
|
1897
1887
|
"size": "md",
|
|
@@ -1918,7 +1908,7 @@ const badgeVariantKeys = [
|
|
|
1918
1908
|
"dot",
|
|
1919
1909
|
"variant"
|
|
1920
1910
|
];
|
|
1921
|
-
const getVariantProps$
|
|
1911
|
+
const getVariantProps$q = (variants) => ({ ...badgeDefaultVariants, ...compact(variants) });
|
|
1922
1912
|
const badge = /* @__PURE__ */ Object.assign(badgeFn, {
|
|
1923
1913
|
__recipe__: false,
|
|
1924
1914
|
__name__: "badge",
|
|
@@ -1954,7 +1944,7 @@ const badge = /* @__PURE__ */ Object.assign(badgeFn, {
|
|
|
1954
1944
|
splitVariantProps(props) {
|
|
1955
1945
|
return splitProps$1(props, badgeVariantKeys);
|
|
1956
1946
|
},
|
|
1957
|
-
getVariantProps: getVariantProps$
|
|
1947
|
+
getVariantProps: getVariantProps$q
|
|
1958
1948
|
});
|
|
1959
1949
|
const breadcrumbsDefaultVariants = {};
|
|
1960
1950
|
const breadcrumbsCompoundVariants = [];
|
|
@@ -1981,7 +1971,7 @@ const breadcrumbsFn = memo((props = {}) => {
|
|
|
1981
1971
|
return Object.fromEntries(breadcrumbsSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1982
1972
|
});
|
|
1983
1973
|
const breadcrumbsVariantKeys = [];
|
|
1984
|
-
const getVariantProps$
|
|
1974
|
+
const getVariantProps$p = (variants) => ({ ...breadcrumbsDefaultVariants, ...compact(variants) });
|
|
1985
1975
|
const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
|
|
1986
1976
|
__recipe__: false,
|
|
1987
1977
|
__name__: "breadcrumbs",
|
|
@@ -1992,7 +1982,7 @@ const breadcrumbs = /* @__PURE__ */ Object.assign(breadcrumbsFn, {
|
|
|
1992
1982
|
splitVariantProps(props) {
|
|
1993
1983
|
return splitProps$1(props, breadcrumbsVariantKeys);
|
|
1994
1984
|
},
|
|
1995
|
-
getVariantProps: getVariantProps$
|
|
1985
|
+
getVariantProps: getVariantProps$p
|
|
1996
1986
|
});
|
|
1997
1987
|
const buttonDefaultVariants = {
|
|
1998
1988
|
"variant": "standard",
|
|
@@ -2023,7 +2013,7 @@ const buttonVariantKeys = [
|
|
|
2023
2013
|
"before",
|
|
2024
2014
|
"after"
|
|
2025
2015
|
];
|
|
2026
|
-
const getVariantProps$
|
|
2016
|
+
const getVariantProps$o = (variants) => ({ ...buttonDefaultVariants, ...compact(variants) });
|
|
2027
2017
|
const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
2028
2018
|
__recipe__: false,
|
|
2029
2019
|
__name__: "button",
|
|
@@ -2057,7 +2047,7 @@ const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
|
2057
2047
|
splitVariantProps(props) {
|
|
2058
2048
|
return splitProps$1(props, buttonVariantKeys);
|
|
2059
2049
|
},
|
|
2060
|
-
getVariantProps: getVariantProps$
|
|
2050
|
+
getVariantProps: getVariantProps$o
|
|
2061
2051
|
});
|
|
2062
2052
|
const calendarDefaultVariants = {
|
|
2063
2053
|
"type": "days"
|
|
@@ -2096,7 +2086,7 @@ const calendarFn = memo((props = {}) => {
|
|
|
2096
2086
|
const calendarVariantKeys = [
|
|
2097
2087
|
"type"
|
|
2098
2088
|
];
|
|
2099
|
-
const getVariantProps$
|
|
2089
|
+
const getVariantProps$n = (variants) => ({ ...calendarDefaultVariants, ...compact(variants) });
|
|
2100
2090
|
const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
|
|
2101
2091
|
__recipe__: false,
|
|
2102
2092
|
__name__: "calendar",
|
|
@@ -2113,7 +2103,7 @@ const calendar = /* @__PURE__ */ Object.assign(calendarFn, {
|
|
|
2113
2103
|
splitVariantProps(props) {
|
|
2114
2104
|
return splitProps$1(props, calendarVariantKeys);
|
|
2115
2105
|
},
|
|
2116
|
-
getVariantProps: getVariantProps$
|
|
2106
|
+
getVariantProps: getVariantProps$n
|
|
2117
2107
|
});
|
|
2118
2108
|
const checkboxDefaultVariants = {};
|
|
2119
2109
|
const checkboxCompoundVariants = [];
|
|
@@ -2140,7 +2130,7 @@ const checkboxFn = memo((props = {}) => {
|
|
|
2140
2130
|
return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2141
2131
|
});
|
|
2142
2132
|
const checkboxVariantKeys = [];
|
|
2143
|
-
const getVariantProps$
|
|
2133
|
+
const getVariantProps$m = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) });
|
|
2144
2134
|
const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
2145
2135
|
__recipe__: false,
|
|
2146
2136
|
__name__: "checkbox",
|
|
@@ -2151,7 +2141,7 @@ const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
|
2151
2141
|
splitVariantProps(props) {
|
|
2152
2142
|
return splitProps$1(props, checkboxVariantKeys);
|
|
2153
2143
|
},
|
|
2154
|
-
getVariantProps: getVariantProps$
|
|
2144
|
+
getVariantProps: getVariantProps$m
|
|
2155
2145
|
});
|
|
2156
2146
|
const chipDefaultVariants = {
|
|
2157
2147
|
"size": "md"
|
|
@@ -2189,7 +2179,7 @@ const chipVariantKeys = [
|
|
|
2189
2179
|
"after",
|
|
2190
2180
|
"dismissable"
|
|
2191
2181
|
];
|
|
2192
|
-
const getVariantProps$
|
|
2182
|
+
const getVariantProps$l = (variants) => ({ ...chipDefaultVariants, ...compact(variants) });
|
|
2193
2183
|
const chip = /* @__PURE__ */ Object.assign(chipFn, {
|
|
2194
2184
|
__recipe__: false,
|
|
2195
2185
|
__name__: "chip",
|
|
@@ -2216,7 +2206,112 @@ const chip = /* @__PURE__ */ Object.assign(chipFn, {
|
|
|
2216
2206
|
splitVariantProps(props) {
|
|
2217
2207
|
return splitProps$1(props, chipVariantKeys);
|
|
2218
2208
|
},
|
|
2219
|
-
getVariantProps: getVariantProps$
|
|
2209
|
+
getVariantProps: getVariantProps$l
|
|
2210
|
+
});
|
|
2211
|
+
const codeBlockDefaultVariants = {
|
|
2212
|
+
"tone": "default",
|
|
2213
|
+
"size": "md",
|
|
2214
|
+
"wrap": false,
|
|
2215
|
+
"lineNumbers": false,
|
|
2216
|
+
"collapsed": false,
|
|
2217
|
+
"actionGutter": false
|
|
2218
|
+
};
|
|
2219
|
+
const codeBlockCompoundVariants = [];
|
|
2220
|
+
const codeBlockSlotNames = [
|
|
2221
|
+
[
|
|
2222
|
+
"root",
|
|
2223
|
+
"codeBlock__root"
|
|
2224
|
+
],
|
|
2225
|
+
[
|
|
2226
|
+
"header",
|
|
2227
|
+
"codeBlock__header"
|
|
2228
|
+
],
|
|
2229
|
+
[
|
|
2230
|
+
"title",
|
|
2231
|
+
"codeBlock__title"
|
|
2232
|
+
],
|
|
2233
|
+
[
|
|
2234
|
+
"actions",
|
|
2235
|
+
"codeBlock__actions"
|
|
2236
|
+
],
|
|
2237
|
+
[
|
|
2238
|
+
"floatingActions",
|
|
2239
|
+
"codeBlock__floatingActions"
|
|
2240
|
+
],
|
|
2241
|
+
[
|
|
2242
|
+
"content",
|
|
2243
|
+
"codeBlock__content"
|
|
2244
|
+
],
|
|
2245
|
+
[
|
|
2246
|
+
"pre",
|
|
2247
|
+
"codeBlock__pre"
|
|
2248
|
+
],
|
|
2249
|
+
[
|
|
2250
|
+
"code",
|
|
2251
|
+
"codeBlock__code"
|
|
2252
|
+
],
|
|
2253
|
+
[
|
|
2254
|
+
"line",
|
|
2255
|
+
"codeBlock__line"
|
|
2256
|
+
],
|
|
2257
|
+
[
|
|
2258
|
+
"lineNumber",
|
|
2259
|
+
"codeBlock__lineNumber"
|
|
2260
|
+
],
|
|
2261
|
+
[
|
|
2262
|
+
"expand",
|
|
2263
|
+
"codeBlock__expand"
|
|
2264
|
+
]
|
|
2265
|
+
];
|
|
2266
|
+
const codeBlockSlotFns = /* @__PURE__ */ codeBlockSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, codeBlockDefaultVariants, getSlotCompoundVariant(codeBlockCompoundVariants, slotName))]);
|
|
2267
|
+
const codeBlockFn = memo((props = {}) => {
|
|
2268
|
+
return Object.fromEntries(codeBlockSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2269
|
+
});
|
|
2270
|
+
const codeBlockVariantKeys = [
|
|
2271
|
+
"tone",
|
|
2272
|
+
"size",
|
|
2273
|
+
"wrap",
|
|
2274
|
+
"lineNumbers",
|
|
2275
|
+
"collapsed",
|
|
2276
|
+
"actionGutter"
|
|
2277
|
+
];
|
|
2278
|
+
const getVariantProps$k = (variants) => ({ ...codeBlockDefaultVariants, ...compact(variants) });
|
|
2279
|
+
const codeBlock = /* @__PURE__ */ Object.assign(codeBlockFn, {
|
|
2280
|
+
__recipe__: false,
|
|
2281
|
+
__name__: "codeBlock",
|
|
2282
|
+
raw: (props) => props,
|
|
2283
|
+
classNameMap: {},
|
|
2284
|
+
variantKeys: codeBlockVariantKeys,
|
|
2285
|
+
variantMap: {
|
|
2286
|
+
"tone": [
|
|
2287
|
+
"default",
|
|
2288
|
+
"inverse"
|
|
2289
|
+
],
|
|
2290
|
+
"size": [
|
|
2291
|
+
"sm",
|
|
2292
|
+
"md"
|
|
2293
|
+
],
|
|
2294
|
+
"wrap": [
|
|
2295
|
+
"true",
|
|
2296
|
+
"false"
|
|
2297
|
+
],
|
|
2298
|
+
"lineNumbers": [
|
|
2299
|
+
"true",
|
|
2300
|
+
"false"
|
|
2301
|
+
],
|
|
2302
|
+
"collapsed": [
|
|
2303
|
+
"true",
|
|
2304
|
+
"false"
|
|
2305
|
+
],
|
|
2306
|
+
"actionGutter": [
|
|
2307
|
+
"true",
|
|
2308
|
+
"false"
|
|
2309
|
+
]
|
|
2310
|
+
},
|
|
2311
|
+
splitVariantProps(props) {
|
|
2312
|
+
return splitProps$1(props, codeBlockVariantKeys);
|
|
2313
|
+
},
|
|
2314
|
+
getVariantProps: getVariantProps$k
|
|
2220
2315
|
});
|
|
2221
2316
|
const dateMenusDefaultVariants = {};
|
|
2222
2317
|
const dateMenusCompoundVariants = [];
|
|
@@ -2239,7 +2334,7 @@ const dateMenusFn = memo((props = {}) => {
|
|
|
2239
2334
|
return Object.fromEntries(dateMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2240
2335
|
});
|
|
2241
2336
|
const dateMenusVariantKeys = [];
|
|
2242
|
-
const getVariantProps$
|
|
2337
|
+
const getVariantProps$j = (variants) => ({ ...dateMenusDefaultVariants, ...compact(variants) });
|
|
2243
2338
|
const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
|
|
2244
2339
|
__recipe__: false,
|
|
2245
2340
|
__name__: "dateMenus",
|
|
@@ -2250,7 +2345,7 @@ const dateMenus = /* @__PURE__ */ Object.assign(dateMenusFn, {
|
|
|
2250
2345
|
splitVariantProps(props) {
|
|
2251
2346
|
return splitProps$1(props, dateMenusVariantKeys);
|
|
2252
2347
|
},
|
|
2253
|
-
getVariantProps: getVariantProps$
|
|
2348
|
+
getVariantProps: getVariantProps$j
|
|
2254
2349
|
});
|
|
2255
2350
|
const dateTimeMenusDefaultVariants = {};
|
|
2256
2351
|
const dateTimeMenusCompoundVariants = [];
|
|
@@ -2273,7 +2368,7 @@ const dateTimeMenusFn = memo((props = {}) => {
|
|
|
2273
2368
|
return Object.fromEntries(dateTimeMenusSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2274
2369
|
});
|
|
2275
2370
|
const dateTimeMenusVariantKeys = [];
|
|
2276
|
-
const getVariantProps$
|
|
2371
|
+
const getVariantProps$i = (variants) => ({ ...dateTimeMenusDefaultVariants, ...compact(variants) });
|
|
2277
2372
|
const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
|
|
2278
2373
|
__recipe__: false,
|
|
2279
2374
|
__name__: "dateTimeMenus",
|
|
@@ -2284,6 +2379,80 @@ const dateTimeMenus = /* @__PURE__ */ Object.assign(dateTimeMenusFn, {
|
|
|
2284
2379
|
splitVariantProps(props) {
|
|
2285
2380
|
return splitProps$1(props, dateTimeMenusVariantKeys);
|
|
2286
2381
|
},
|
|
2382
|
+
getVariantProps: getVariantProps$i
|
|
2383
|
+
});
|
|
2384
|
+
const drawerDefaultVariants = {
|
|
2385
|
+
"side": "right",
|
|
2386
|
+
"size": "md",
|
|
2387
|
+
"scrollable": true
|
|
2388
|
+
};
|
|
2389
|
+
const drawerCompoundVariants = [];
|
|
2390
|
+
const drawerSlotNames = [
|
|
2391
|
+
[
|
|
2392
|
+
"overlay",
|
|
2393
|
+
"drawer__overlay"
|
|
2394
|
+
],
|
|
2395
|
+
[
|
|
2396
|
+
"container",
|
|
2397
|
+
"drawer__container"
|
|
2398
|
+
],
|
|
2399
|
+
[
|
|
2400
|
+
"header",
|
|
2401
|
+
"drawer__header"
|
|
2402
|
+
],
|
|
2403
|
+
[
|
|
2404
|
+
"title",
|
|
2405
|
+
"drawer__title"
|
|
2406
|
+
],
|
|
2407
|
+
[
|
|
2408
|
+
"closeButton",
|
|
2409
|
+
"drawer__closeButton"
|
|
2410
|
+
],
|
|
2411
|
+
[
|
|
2412
|
+
"body",
|
|
2413
|
+
"drawer__body"
|
|
2414
|
+
],
|
|
2415
|
+
[
|
|
2416
|
+
"footer",
|
|
2417
|
+
"drawer__footer"
|
|
2418
|
+
]
|
|
2419
|
+
];
|
|
2420
|
+
const drawerSlotFns = /* @__PURE__ */ drawerSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, drawerDefaultVariants, getSlotCompoundVariant(drawerCompoundVariants, slotName))]);
|
|
2421
|
+
const drawerFn = memo((props = {}) => {
|
|
2422
|
+
return Object.fromEntries(drawerSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2423
|
+
});
|
|
2424
|
+
const drawerVariantKeys = [
|
|
2425
|
+
"side",
|
|
2426
|
+
"size",
|
|
2427
|
+
"scrollable"
|
|
2428
|
+
];
|
|
2429
|
+
const getVariantProps$h = (variants) => ({ ...drawerDefaultVariants, ...compact(variants) });
|
|
2430
|
+
const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
|
|
2431
|
+
__recipe__: false,
|
|
2432
|
+
__name__: "drawer",
|
|
2433
|
+
raw: (props) => props,
|
|
2434
|
+
classNameMap: {},
|
|
2435
|
+
variantKeys: drawerVariantKeys,
|
|
2436
|
+
variantMap: {
|
|
2437
|
+
"side": [
|
|
2438
|
+
"right",
|
|
2439
|
+
"left"
|
|
2440
|
+
],
|
|
2441
|
+
"size": [
|
|
2442
|
+
"sm",
|
|
2443
|
+
"md",
|
|
2444
|
+
"lg",
|
|
2445
|
+
"xl",
|
|
2446
|
+
"full"
|
|
2447
|
+
],
|
|
2448
|
+
"scrollable": [
|
|
2449
|
+
"true",
|
|
2450
|
+
"false"
|
|
2451
|
+
]
|
|
2452
|
+
},
|
|
2453
|
+
splitVariantProps(props) {
|
|
2454
|
+
return splitProps$1(props, drawerVariantKeys);
|
|
2455
|
+
},
|
|
2287
2456
|
getVariantProps: getVariantProps$h
|
|
2288
2457
|
});
|
|
2289
2458
|
const formFieldDefaultVariants = {
|
|
@@ -15670,6 +15839,44 @@ function useContainerQuery(containerRef, size2, direction = "min") {
|
|
|
15670
15839
|
() => false
|
|
15671
15840
|
);
|
|
15672
15841
|
}
|
|
15842
|
+
function useClipboard(options = {}) {
|
|
15843
|
+
const { timeout = 2e3 } = options;
|
|
15844
|
+
const [copied, setCopied] = useState(false);
|
|
15845
|
+
const [failed, setFailed] = useState(false);
|
|
15846
|
+
const timerRef = useRef(null);
|
|
15847
|
+
const attemptRef = useRef(0);
|
|
15848
|
+
useEffect(
|
|
15849
|
+
() => () => {
|
|
15850
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
15851
|
+
},
|
|
15852
|
+
[]
|
|
15853
|
+
);
|
|
15854
|
+
const copy = useCallback(
|
|
15855
|
+
async (text2) => {
|
|
15856
|
+
const attempt = ++attemptRef.current;
|
|
15857
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
15858
|
+
setFailed(false);
|
|
15859
|
+
try {
|
|
15860
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) {
|
|
15861
|
+
throw new Error("Clipboard API is not available.");
|
|
15862
|
+
}
|
|
15863
|
+
await navigator.clipboard.writeText(text2);
|
|
15864
|
+
} catch {
|
|
15865
|
+
if (attempt !== attemptRef.current) return false;
|
|
15866
|
+
setCopied(false);
|
|
15867
|
+
setFailed(true);
|
|
15868
|
+
return false;
|
|
15869
|
+
}
|
|
15870
|
+
if (attempt !== attemptRef.current) return true;
|
|
15871
|
+
setCopied(true);
|
|
15872
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
15873
|
+
timerRef.current = setTimeout(() => setCopied(false), timeout);
|
|
15874
|
+
return true;
|
|
15875
|
+
},
|
|
15876
|
+
[timeout]
|
|
15877
|
+
);
|
|
15878
|
+
return { copy, copied, failed };
|
|
15879
|
+
}
|
|
15673
15880
|
const Tag = (props) => {
|
|
15674
15881
|
const { variant, hue, iconBefore, iconAfter, children, ...rest } = props;
|
|
15675
15882
|
const [className, otherProps] = splitProps(rest);
|
|
@@ -16925,36 +17132,207 @@ const ChipGroup = (props) => {
|
|
|
16925
17132
|
) });
|
|
16926
17133
|
};
|
|
16927
17134
|
const Code = (props) => {
|
|
16928
|
-
const {
|
|
17135
|
+
const { variant, language, children, ...rest } = props;
|
|
16929
17136
|
const [className, otherProps] = splitProps(rest);
|
|
16930
17137
|
return /* @__PURE__ */ jsx(
|
|
16931
17138
|
Box,
|
|
16932
17139
|
{
|
|
16933
17140
|
...dsComponent("Code"),
|
|
16934
17141
|
as: "code",
|
|
16935
|
-
className: cx(code({}), className),
|
|
16936
|
-
|
|
17142
|
+
className: cx(code({ variant }), className),
|
|
17143
|
+
"data-language": language,
|
|
16937
17144
|
...otherProps,
|
|
16938
|
-
children
|
|
17145
|
+
children
|
|
16939
17146
|
}
|
|
16940
17147
|
);
|
|
16941
17148
|
};
|
|
16942
|
-
const
|
|
17149
|
+
const DS_PART_ATTRIBUTE = "data-ds-part";
|
|
17150
|
+
const dsPart = (part) => ({
|
|
17151
|
+
[DS_PART_ATTRIBUTE]: part
|
|
17152
|
+
});
|
|
17153
|
+
const stripTrailingNewline = (value) => value.replace(/\r?\n$/, "");
|
|
17154
|
+
const scrollbarHeight = (element) => {
|
|
17155
|
+
const styles = getComputedStyle(element);
|
|
17156
|
+
return Math.max(
|
|
17157
|
+
0,
|
|
17158
|
+
element.offsetHeight - element.clientHeight - parseFloat(styles.borderTopWidth) - parseFloat(styles.borderBottomWidth)
|
|
17159
|
+
);
|
|
17160
|
+
};
|
|
17161
|
+
const CodeBlock = (props) => {
|
|
16943
17162
|
const {
|
|
17163
|
+
code: codeProp,
|
|
16944
17164
|
children,
|
|
16945
|
-
|
|
16946
|
-
|
|
17165
|
+
language,
|
|
17166
|
+
title,
|
|
17167
|
+
copyable = true,
|
|
17168
|
+
copyLabel = "Copy code",
|
|
17169
|
+
maxLines,
|
|
17170
|
+
expanded: expandedProp,
|
|
17171
|
+
defaultExpanded = false,
|
|
17172
|
+
onExpandedChange,
|
|
17173
|
+
lineNumbers = false,
|
|
17174
|
+
tone = "default",
|
|
17175
|
+
size: size2,
|
|
17176
|
+
wrap,
|
|
17177
|
+
style,
|
|
16947
17178
|
...rest
|
|
16948
17179
|
} = props;
|
|
16949
17180
|
const [className, otherProps] = splitProps(rest);
|
|
16950
|
-
|
|
17181
|
+
const text2 = stripTrailingNewline(codeProp ?? children ?? "");
|
|
17182
|
+
const lines = text2.split(/\r?\n/);
|
|
17183
|
+
const lineCount = lines.length;
|
|
17184
|
+
const showLineNumbers = lineNumbers !== false;
|
|
17185
|
+
const lineStart = typeof lineNumbers === "object" ? lineNumbers.start : 1;
|
|
17186
|
+
const lastLineNumber = lineStart + lineCount - 1;
|
|
17187
|
+
const [expanded, setExpanded] = useControllableState({
|
|
17188
|
+
value: expandedProp,
|
|
17189
|
+
defaultValue: defaultExpanded,
|
|
17190
|
+
onChange: onExpandedChange
|
|
17191
|
+
});
|
|
17192
|
+
const canCollapse = maxLines !== void 0 && lineCount > maxLines;
|
|
17193
|
+
const collapsed = canCollapse && !expanded;
|
|
17194
|
+
const floatingCopy = copyable && title === void 0;
|
|
17195
|
+
const classes = codeBlock({
|
|
17196
|
+
tone,
|
|
17197
|
+
size: size2,
|
|
17198
|
+
wrap,
|
|
17199
|
+
lineNumbers: showLineNumbers,
|
|
17200
|
+
collapsed,
|
|
17201
|
+
actionGutter: floatingCopy
|
|
17202
|
+
});
|
|
17203
|
+
const { copy, copied, failed } = useClipboard();
|
|
17204
|
+
const labelId = useId$1();
|
|
17205
|
+
const contentId = useId$1();
|
|
17206
|
+
const contentRef = useRef(null);
|
|
17207
|
+
const [overflowing, setOverflowing] = useState(false);
|
|
17208
|
+
const [collapsedHeight, setCollapsedHeight] = useState();
|
|
17209
|
+
useLayoutEffect(() => {
|
|
17210
|
+
const element = contentRef.current;
|
|
17211
|
+
if (!element) return void 0;
|
|
17212
|
+
const measure = () => {
|
|
17213
|
+
var _a;
|
|
17214
|
+
const lastVisibleLine = collapsed && maxLines !== void 0 ? (_a = element.querySelector("code")) == null ? void 0 : _a.children[maxLines - 1] : void 0;
|
|
17215
|
+
const pre = element.firstElementChild;
|
|
17216
|
+
if (lastVisibleLine && pre) {
|
|
17217
|
+
const bottom = lastVisibleLine.getBoundingClientRect().bottom - element.getBoundingClientRect().top + element.scrollTop + parseFloat(getComputedStyle(pre).paddingBottom) + scrollbarHeight(element);
|
|
17218
|
+
setCollapsedHeight(Math.ceil(bottom));
|
|
17219
|
+
} else {
|
|
17220
|
+
setCollapsedHeight(void 0);
|
|
17221
|
+
}
|
|
17222
|
+
setOverflowing(
|
|
17223
|
+
element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight
|
|
17224
|
+
);
|
|
17225
|
+
};
|
|
17226
|
+
measure();
|
|
17227
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
17228
|
+
const observer = new ResizeObserver(measure);
|
|
17229
|
+
observer.observe(element);
|
|
17230
|
+
const codeElement = element.querySelector("code");
|
|
17231
|
+
if (codeElement) observer.observe(codeElement);
|
|
17232
|
+
return () => observer.disconnect();
|
|
17233
|
+
}, [text2, collapsed, maxLines, wrap, showLineNumbers, size2]);
|
|
17234
|
+
const labelSource = typeof title === "string" ? title : language;
|
|
17235
|
+
const label2 = labelSource ? `${labelSource} code block` : "Code block";
|
|
17236
|
+
const rootStyle = {
|
|
17237
|
+
"--code-block-max-lines": maxLines,
|
|
17238
|
+
"--code-block-collapsed-h": collapsed && collapsedHeight !== void 0 ? `${String(collapsedHeight)}px` : void 0,
|
|
17239
|
+
"--code-block-gutter": `${String(Math.max(lastLineNumber, 1)).length}ch`,
|
|
17240
|
+
...style
|
|
17241
|
+
};
|
|
17242
|
+
const copyButton = copyable ? /* @__PURE__ */ jsx(
|
|
17243
|
+
IconButton,
|
|
17244
|
+
{
|
|
17245
|
+
...dsPart("copy"),
|
|
17246
|
+
iconName: copied ? "check" : "copy",
|
|
17247
|
+
altText: copied ? "Copied" : copyLabel,
|
|
17248
|
+
variant: tone === "inverse" ? "primary" : "ghost",
|
|
17249
|
+
size: "sm",
|
|
17250
|
+
onClick: () => {
|
|
17251
|
+
void copy(text2);
|
|
17252
|
+
}
|
|
17253
|
+
}
|
|
17254
|
+
) : null;
|
|
17255
|
+
return /* @__PURE__ */ jsxs(
|
|
16951
17256
|
Box,
|
|
16952
17257
|
{
|
|
16953
|
-
...dsComponent("
|
|
16954
|
-
|
|
16955
|
-
|
|
17258
|
+
...dsComponent("CodeBlock"),
|
|
17259
|
+
className: cx(classes.root, className),
|
|
17260
|
+
"data-language": language,
|
|
17261
|
+
style: rootStyle,
|
|
16956
17262
|
...otherProps,
|
|
16957
|
-
children:
|
|
17263
|
+
children: [
|
|
17264
|
+
/* @__PURE__ */ jsx(Box, { as: "span", id: labelId, srOnly: true, children: label2 }),
|
|
17265
|
+
title !== void 0 && /* @__PURE__ */ jsxs(Box, { className: classes.header, children: [
|
|
17266
|
+
/* @__PURE__ */ jsx(Box, { className: classes.title, children: title }),
|
|
17267
|
+
copyButton && /* @__PURE__ */ jsx(Box, { className: classes.actions, children: copyButton })
|
|
17268
|
+
] }),
|
|
17269
|
+
floatingCopy && /* @__PURE__ */ jsx(Box, { className: classes.floatingActions, children: copyButton }),
|
|
17270
|
+
/* @__PURE__ */ jsx(
|
|
17271
|
+
Box,
|
|
17272
|
+
{
|
|
17273
|
+
ref: contentRef,
|
|
17274
|
+
id: contentId,
|
|
17275
|
+
className: classes.content,
|
|
17276
|
+
...overflowing && {
|
|
17277
|
+
tabIndex: 0,
|
|
17278
|
+
role: "region",
|
|
17279
|
+
"aria-labelledby": labelId
|
|
17280
|
+
},
|
|
17281
|
+
children: /* @__PURE__ */ jsx(Box, { as: "pre", className: classes.pre, children: /* @__PURE__ */ jsx(
|
|
17282
|
+
Box,
|
|
17283
|
+
{
|
|
17284
|
+
as: "code",
|
|
17285
|
+
className: cx(classes.code, language && `language-${language}`),
|
|
17286
|
+
children: lines.map((line, index2) => /* @__PURE__ */ jsxs(
|
|
17287
|
+
Box,
|
|
17288
|
+
{
|
|
17289
|
+
as: "span",
|
|
17290
|
+
className: classes.line,
|
|
17291
|
+
children: [
|
|
17292
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
17293
|
+
Box,
|
|
17294
|
+
{
|
|
17295
|
+
as: "span",
|
|
17296
|
+
"aria-hidden": "true",
|
|
17297
|
+
className: classes.lineNumber,
|
|
17298
|
+
"data-line": lineStart + index2
|
|
17299
|
+
}
|
|
17300
|
+
),
|
|
17301
|
+
line
|
|
17302
|
+
]
|
|
17303
|
+
},
|
|
17304
|
+
index2
|
|
17305
|
+
))
|
|
17306
|
+
}
|
|
17307
|
+
) })
|
|
17308
|
+
}
|
|
17309
|
+
),
|
|
17310
|
+
canCollapse && /* @__PURE__ */ jsxs(
|
|
17311
|
+
Box,
|
|
17312
|
+
{
|
|
17313
|
+
as: "button",
|
|
17314
|
+
type: "button",
|
|
17315
|
+
...dsPart("expand"),
|
|
17316
|
+
className: classes.expand,
|
|
17317
|
+
"aria-expanded": expanded,
|
|
17318
|
+
"aria-controls": contentId,
|
|
17319
|
+
onClick: () => setExpanded(!expanded),
|
|
17320
|
+
children: [
|
|
17321
|
+
/* @__PURE__ */ jsx(
|
|
17322
|
+
Icon,
|
|
17323
|
+
{
|
|
17324
|
+
name: expanded ? "collapse-vertical" : "expand-vertical",
|
|
17325
|
+
size: "16",
|
|
17326
|
+
fill: "current",
|
|
17327
|
+
"aria-hidden": "true"
|
|
17328
|
+
}
|
|
17329
|
+
),
|
|
17330
|
+
expanded ? "Show less" : `Show all ${lineCount} lines`
|
|
17331
|
+
]
|
|
17332
|
+
}
|
|
17333
|
+
),
|
|
17334
|
+
/* @__PURE__ */ jsx(Box, { as: "span", role: "status", "aria-live": "polite", srOnly: true, children: copied ? "Copied" : failed ? "Copy failed" : "" })
|
|
17335
|
+
]
|
|
16958
17336
|
}
|
|
16959
17337
|
);
|
|
16960
17338
|
};
|
|
@@ -21513,6 +21891,216 @@ const DateTimeRangePicker = (props) => {
|
|
|
21513
21891
|
}
|
|
21514
21892
|
);
|
|
21515
21893
|
};
|
|
21894
|
+
const DrawerContext = createContext(null);
|
|
21895
|
+
const useDrawerContext = () => {
|
|
21896
|
+
const context2 = useContext(DrawerContext);
|
|
21897
|
+
if (!context2) {
|
|
21898
|
+
throw new Error("Drawer components must be used within a <Drawer>");
|
|
21899
|
+
}
|
|
21900
|
+
return context2;
|
|
21901
|
+
};
|
|
21902
|
+
const DRAWER_MOTION_MS = 200;
|
|
21903
|
+
const drawerPhaseReducer = (phase, action) => {
|
|
21904
|
+
switch (action.type) {
|
|
21905
|
+
case "open":
|
|
21906
|
+
return "open";
|
|
21907
|
+
case "startClosing":
|
|
21908
|
+
return phase === "closed" ? phase : "closing";
|
|
21909
|
+
case "finishClosing":
|
|
21910
|
+
return "closed";
|
|
21911
|
+
default:
|
|
21912
|
+
return phase;
|
|
21913
|
+
}
|
|
21914
|
+
};
|
|
21915
|
+
const prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
21916
|
+
const Drawer = (props) => {
|
|
21917
|
+
const {
|
|
21918
|
+
open,
|
|
21919
|
+
onOpenChange,
|
|
21920
|
+
modal: modal2 = true,
|
|
21921
|
+
side = "right",
|
|
21922
|
+
size: size2 = "md",
|
|
21923
|
+
preventOutsideClose = false,
|
|
21924
|
+
initialFocus,
|
|
21925
|
+
returnFocus = true,
|
|
21926
|
+
children,
|
|
21927
|
+
id,
|
|
21928
|
+
ref,
|
|
21929
|
+
onKeyDown,
|
|
21930
|
+
onAnimationEnd,
|
|
21931
|
+
...rest
|
|
21932
|
+
} = props;
|
|
21933
|
+
const [className, otherProps] = splitProps(rest);
|
|
21934
|
+
const classes = drawer({ side, size: size2 });
|
|
21935
|
+
const [phase, dispatch] = useReducer(
|
|
21936
|
+
drawerPhaseReducer,
|
|
21937
|
+
open ? "open" : "closed"
|
|
21938
|
+
);
|
|
21939
|
+
const panelRef = useRef(null);
|
|
21940
|
+
const { refs, context: context2 } = useOverlayFloating({
|
|
21941
|
+
open,
|
|
21942
|
+
onOpenChange,
|
|
21943
|
+
strategy: "fixed",
|
|
21944
|
+
middleware: []
|
|
21945
|
+
});
|
|
21946
|
+
const dismiss = useDismiss(context2, {
|
|
21947
|
+
escapeKey: modal2,
|
|
21948
|
+
outsidePress: modal2 && !preventOutsideClose
|
|
21949
|
+
});
|
|
21950
|
+
const { getFloatingProps } = useInteractions([dismiss]);
|
|
21951
|
+
useEffect(() => {
|
|
21952
|
+
if (open) {
|
|
21953
|
+
dispatch({ type: "open" });
|
|
21954
|
+
return;
|
|
21955
|
+
}
|
|
21956
|
+
dispatch({ type: "startClosing" });
|
|
21957
|
+
const timeout = setTimeout(
|
|
21958
|
+
() => dispatch({ type: "finishClosing" }),
|
|
21959
|
+
prefersReducedMotion() ? 0 : DRAWER_MOTION_MS
|
|
21960
|
+
);
|
|
21961
|
+
return () => clearTimeout(timeout);
|
|
21962
|
+
}, [open]);
|
|
21963
|
+
const setPanelRef = useCallback(
|
|
21964
|
+
(node) => {
|
|
21965
|
+
panelRef.current = node;
|
|
21966
|
+
refs.setFloating(node);
|
|
21967
|
+
},
|
|
21968
|
+
[refs]
|
|
21969
|
+
);
|
|
21970
|
+
const mergedPanelRef = useMergeRefs([setPanelRef, ref]);
|
|
21971
|
+
const onClose = useCallback(() => {
|
|
21972
|
+
if (open) {
|
|
21973
|
+
onOpenChange(false);
|
|
21974
|
+
}
|
|
21975
|
+
}, [open, onOpenChange]);
|
|
21976
|
+
const handleKeyDown = (event) => {
|
|
21977
|
+
var _a;
|
|
21978
|
+
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
21979
|
+
if (modal2 || event.key !== "Escape" || event.defaultPrevented) {
|
|
21980
|
+
return;
|
|
21981
|
+
}
|
|
21982
|
+
if (event.nativeEvent.isComposing) {
|
|
21983
|
+
return;
|
|
21984
|
+
}
|
|
21985
|
+
if (!((_a = panelRef.current) == null ? void 0 : _a.contains(event.target))) {
|
|
21986
|
+
return;
|
|
21987
|
+
}
|
|
21988
|
+
event.stopPropagation();
|
|
21989
|
+
onClose();
|
|
21990
|
+
};
|
|
21991
|
+
const contextValue = useMemo(
|
|
21992
|
+
() => ({ open: phase === "open", onClose, modal: modal2 }),
|
|
21993
|
+
[modal2, onClose, phase]
|
|
21994
|
+
);
|
|
21995
|
+
if (phase === "closed") {
|
|
21996
|
+
return null;
|
|
21997
|
+
}
|
|
21998
|
+
const dataState = phase === "closing" ? "closing" : "open";
|
|
21999
|
+
return /* @__PURE__ */ jsx(FloatingLayerContext.Provider, { value: "modalFloating", children: /* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsxs(DsChainPortalRoot, { children: [
|
|
22000
|
+
modal2 && /* @__PURE__ */ jsx(
|
|
22001
|
+
FloatingOverlay,
|
|
22002
|
+
{
|
|
22003
|
+
lockScroll: true,
|
|
22004
|
+
className: classes.overlay,
|
|
22005
|
+
"data-state": dataState,
|
|
22006
|
+
"aria-hidden": "true"
|
|
22007
|
+
}
|
|
22008
|
+
),
|
|
22009
|
+
/* @__PURE__ */ jsx(
|
|
22010
|
+
FloatingFocusManager,
|
|
22011
|
+
{
|
|
22012
|
+
context: context2,
|
|
22013
|
+
modal: modal2,
|
|
22014
|
+
initialFocus: initialFocus ?? (modal2 ? 0 : panelRef),
|
|
22015
|
+
returnFocus,
|
|
22016
|
+
closeOnFocusOut: false,
|
|
22017
|
+
children: /* @__PURE__ */ jsx(
|
|
22018
|
+
Box,
|
|
22019
|
+
{
|
|
22020
|
+
...dsComponent("Drawer"),
|
|
22021
|
+
ref: mergedPanelRef,
|
|
22022
|
+
className: cx(classes.container, className),
|
|
22023
|
+
"data-state": dataState,
|
|
22024
|
+
"data-side": side,
|
|
22025
|
+
id,
|
|
22026
|
+
role: "dialog",
|
|
22027
|
+
"aria-modal": modal2 ? "true" : void 0,
|
|
22028
|
+
...getFloatingProps({
|
|
22029
|
+
// Consumer props go through Floating UI so its handlers
|
|
22030
|
+
// merge with them instead of being overwritten.
|
|
22031
|
+
...otherProps,
|
|
22032
|
+
onKeyDown: handleKeyDown,
|
|
22033
|
+
onAnimationEnd: (event) => {
|
|
22034
|
+
onAnimationEnd == null ? void 0 : onAnimationEnd(event);
|
|
22035
|
+
if (phase === "closing" && event.target === event.currentTarget) {
|
|
22036
|
+
dispatch({ type: "finishClosing" });
|
|
22037
|
+
}
|
|
22038
|
+
}
|
|
22039
|
+
}),
|
|
22040
|
+
children
|
|
22041
|
+
}
|
|
22042
|
+
)
|
|
22043
|
+
}
|
|
22044
|
+
)
|
|
22045
|
+
] }) }) }) });
|
|
22046
|
+
};
|
|
22047
|
+
const Heading = (props) => {
|
|
22048
|
+
const { level = "h2", allCaps, children, ...rest } = props;
|
|
22049
|
+
const [className, otherProps] = splitProps(rest);
|
|
22050
|
+
return /* @__PURE__ */ jsx(
|
|
22051
|
+
Text,
|
|
22052
|
+
{
|
|
22053
|
+
...dsComponent("Heading"),
|
|
22054
|
+
as: level,
|
|
22055
|
+
className: cx(heading({ level, allCaps }), className),
|
|
22056
|
+
...otherProps,
|
|
22057
|
+
children
|
|
22058
|
+
}
|
|
22059
|
+
);
|
|
22060
|
+
};
|
|
22061
|
+
const DrawerHeader = (props) => {
|
|
22062
|
+
const { title, titleId, showCloseButton = true, children, ...rest } = props;
|
|
22063
|
+
const [className, otherProps] = splitProps(rest);
|
|
22064
|
+
const classes = drawer();
|
|
22065
|
+
const { onClose } = useDrawerContext();
|
|
22066
|
+
const isSm = useMediaQuery("sm");
|
|
22067
|
+
return /* @__PURE__ */ jsx(Box, { className: cx(classes.header, className), ...otherProps, children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22068
|
+
title && /* @__PURE__ */ jsx(
|
|
22069
|
+
Heading,
|
|
22070
|
+
{
|
|
22071
|
+
id: titleId,
|
|
22072
|
+
level: "h3",
|
|
22073
|
+
textStyle: { base: "heading.sm", sm: "heading.xs" },
|
|
22074
|
+
className: classes.title,
|
|
22075
|
+
children: title
|
|
22076
|
+
}
|
|
22077
|
+
),
|
|
22078
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
22079
|
+
IconButton,
|
|
22080
|
+
{
|
|
22081
|
+
variant: "ghost",
|
|
22082
|
+
size: isSm ? "md" : "lg",
|
|
22083
|
+
onClick: onClose,
|
|
22084
|
+
altText: "Close drawer",
|
|
22085
|
+
"aria-label": "Close drawer",
|
|
22086
|
+
className: classes.closeButton,
|
|
22087
|
+
iconName: "x"
|
|
22088
|
+
}
|
|
22089
|
+
)
|
|
22090
|
+
] }) });
|
|
22091
|
+
};
|
|
22092
|
+
const DrawerBody = (props) => {
|
|
22093
|
+
const { children, scrollable = true, ...rest } = props;
|
|
22094
|
+
const [className, otherProps] = splitProps(rest);
|
|
22095
|
+
const classes = drawer({ scrollable });
|
|
22096
|
+
return /* @__PURE__ */ jsx(Box, { className: cx(classes.body, className), ...otherProps, children });
|
|
22097
|
+
};
|
|
22098
|
+
const DrawerFooter = (props) => {
|
|
22099
|
+
const { children, ...rest } = props;
|
|
22100
|
+
const [className, otherProps] = splitProps(rest);
|
|
22101
|
+
const classes = drawer();
|
|
22102
|
+
return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
|
|
22103
|
+
};
|
|
21516
22104
|
const Required = () => {
|
|
21517
22105
|
return /* @__PURE__ */ jsx(Text, { color: "text.danger", fontSize: "inherit", lineHeight: "tight", children: "*" });
|
|
21518
22106
|
};
|
|
@@ -21599,20 +22187,6 @@ const FormField = (props) => {
|
|
|
21599
22187
|
}
|
|
21600
22188
|
);
|
|
21601
22189
|
};
|
|
21602
|
-
const Heading = (props) => {
|
|
21603
|
-
const { level = "h2", allCaps, children, ...rest } = props;
|
|
21604
|
-
const [className, otherProps] = splitProps(rest);
|
|
21605
|
-
return /* @__PURE__ */ jsx(
|
|
21606
|
-
Text,
|
|
21607
|
-
{
|
|
21608
|
-
...dsComponent("Heading"),
|
|
21609
|
-
as: level,
|
|
21610
|
-
className: cx(heading({ level, allCaps }), className),
|
|
21611
|
-
...otherProps,
|
|
21612
|
-
children
|
|
21613
|
-
}
|
|
21614
|
-
);
|
|
21615
|
-
};
|
|
21616
22190
|
const toneIconNames$2 = {
|
|
21617
22191
|
info: "info",
|
|
21618
22192
|
success: "success",
|
|
@@ -22272,10 +22846,6 @@ const RadioInput = (props) => {
|
|
|
22272
22846
|
}
|
|
22273
22847
|
);
|
|
22274
22848
|
};
|
|
22275
|
-
const DS_PART_ATTRIBUTE = "data-ds-part";
|
|
22276
|
-
const dsPart = (part) => ({
|
|
22277
|
-
[DS_PART_ATTRIBUTE]: part
|
|
22278
|
-
});
|
|
22279
22849
|
const AutocompleteListbox = (props) => {
|
|
22280
22850
|
const {
|
|
22281
22851
|
activeIndex,
|
|
@@ -24366,6 +24936,7 @@ export {
|
|
|
24366
24936
|
Chip,
|
|
24367
24937
|
ChipGroup,
|
|
24368
24938
|
Code,
|
|
24939
|
+
CodeBlock,
|
|
24369
24940
|
ConfirmationModal,
|
|
24370
24941
|
DateInput,
|
|
24371
24942
|
DateMenu,
|
|
@@ -24378,6 +24949,10 @@ export {
|
|
|
24378
24949
|
DateTimePicker,
|
|
24379
24950
|
DateTimeRangePicker,
|
|
24380
24951
|
Divider,
|
|
24952
|
+
Drawer,
|
|
24953
|
+
DrawerBody,
|
|
24954
|
+
DrawerFooter,
|
|
24955
|
+
DrawerHeader,
|
|
24381
24956
|
DsChainScope,
|
|
24382
24957
|
FormField,
|
|
24383
24958
|
Heading,
|
|
@@ -24404,7 +24979,6 @@ export {
|
|
|
24404
24979
|
ModalWrapper,
|
|
24405
24980
|
Option,
|
|
24406
24981
|
PageBanner,
|
|
24407
|
-
Pre,
|
|
24408
24982
|
Radio,
|
|
24409
24983
|
RadioGroup,
|
|
24410
24984
|
RadioInput,
|
|
@@ -24440,7 +25014,9 @@ export {
|
|
|
24440
25014
|
isItemMatch,
|
|
24441
25015
|
splitProps,
|
|
24442
25016
|
useChipGroup,
|
|
25017
|
+
useClipboard,
|
|
24443
25018
|
useContainerQuery,
|
|
25019
|
+
useDrawerContext,
|
|
24444
25020
|
useForm2 as useForm,
|
|
24445
25021
|
useIconConfig,
|
|
24446
25022
|
useListContext,
|