@sitecore/sc-contenthub-blok 0.0.23 → 0.0.25

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.
Files changed (117) hide show
  1. package/dist/Components/BlokButton/BlokButton.js +1 -1
  2. package/dist/Components/BlokButton/BlokButton.js.map +1 -1
  3. package/dist/Components/BlokButtonSelect/BlokButtonSelect.d.ts +7 -0
  4. package/dist/Components/BlokButtonSelect/BlokButtonSelect.js +184 -0
  5. package/dist/Components/BlokButtonSelect/BlokButtonSelect.js.map +1 -0
  6. package/dist/Components/BlokButtonSelect/BlokButtonSelect.spec.d.ts +1 -0
  7. package/dist/Components/BlokButtonSelect/BlokButtonSelect.spec.js +58 -0
  8. package/dist/Components/BlokButtonSelect/BlokButtonSelect.spec.js.map +1 -0
  9. package/dist/Components/BlokButtonSelect/BlokButtonSelect.stories.d.ts +8 -0
  10. package/dist/Components/BlokButtonSelect/BlokButtonSelect.stories.js +59 -0
  11. package/dist/Components/BlokButtonSelect/BlokButtonSelect.stories.js.map +1 -0
  12. package/dist/Components/BlokSearchBox/BlokSearchBox.d.ts +106 -0
  13. package/dist/Components/BlokSearchBox/BlokSearchBox.js +316 -0
  14. package/dist/Components/BlokSearchBox/BlokSearchBox.js.map +1 -0
  15. package/dist/Components/BlokSearchBox/BlokSearchBox.spec.d.ts +1 -0
  16. package/dist/Components/BlokSearchBox/BlokSearchBox.spec.js +88 -0
  17. package/dist/Components/BlokSearchBox/BlokSearchBox.spec.js.map +1 -0
  18. package/dist/Components/BlokSearchBox/BlokSearchBox.stories.d.ts +9 -0
  19. package/dist/Components/BlokSearchBox/BlokSearchBox.stories.js +38 -0
  20. package/dist/Components/BlokSearchBox/BlokSearchBox.stories.js.map +1 -0
  21. package/dist/Components/BlokSelect/BlokSelect.d.ts +99 -0
  22. package/dist/Components/BlokSelect/BlokSelect.js +247 -0
  23. package/dist/Components/BlokSelect/BlokSelect.js.map +1 -0
  24. package/dist/Components/BlokSelect/BlokSelect.spec.d.ts +1 -0
  25. package/dist/Components/BlokSelect/BlokSelect.spec.js +54 -0
  26. package/dist/Components/BlokSelect/BlokSelect.spec.js.map +1 -0
  27. package/dist/Components/BlokSelect/BlokSelect.stories.d.ts +8 -0
  28. package/dist/Components/BlokSelect/BlokSelect.stories.js +59 -0
  29. package/dist/Components/BlokSelect/BlokSelect.stories.js.map +1 -0
  30. package/dist/Components/index.d.ts +3 -0
  31. package/dist/Components/index.js +3 -0
  32. package/dist/Components/index.js.map +1 -1
  33. package/dist/Foundations/utils.d.ts +28 -0
  34. package/dist/Foundations/utils.js +21 -1
  35. package/dist/Foundations/utils.js.map +1 -1
  36. package/dist/customHooks/useIsMounted.d.ts +7 -0
  37. package/dist/customHooks/useIsMounted.js +19 -0
  38. package/dist/customHooks/useIsMounted.js.map +1 -0
  39. package/esm/Components/BlokButton/BlokButton.js +1 -1
  40. package/esm/Components/BlokButton/BlokButton.js.map +1 -1
  41. package/esm/Components/BlokButtonSelect/BlokButtonSelect.js +179 -0
  42. package/esm/Components/BlokButtonSelect/BlokButtonSelect.js.map +1 -0
  43. package/esm/Components/BlokSearchBox/BlokSearchBox.js +312 -0
  44. package/esm/Components/BlokSearchBox/BlokSearchBox.js.map +1 -0
  45. package/esm/Components/BlokSelect/BlokSelect.js +242 -0
  46. package/esm/Components/BlokSelect/BlokSelect.js.map +1 -0
  47. package/esm/Components/index.js +3 -0
  48. package/esm/Components/index.js.map +1 -1
  49. package/esm/Foundations/utils.js +18 -0
  50. package/esm/Foundations/utils.js.map +1 -1
  51. package/esm/customHooks/useIsMounted.js +17 -0
  52. package/esm/customHooks/useIsMounted.js.map +1 -0
  53. package/node_modules/@emotion/cache/node_modules/stylis/LICENSE +21 -0
  54. package/node_modules/@emotion/cache/node_modules/stylis/README.md +161 -0
  55. package/node_modules/@emotion/cache/node_modules/stylis/dist/stylis.mjs +2 -0
  56. package/node_modules/@emotion/cache/node_modules/stylis/dist/stylis.mjs.map +1 -0
  57. package/node_modules/@emotion/cache/node_modules/stylis/dist/umd/package.json +1 -0
  58. package/node_modules/@emotion/cache/node_modules/stylis/dist/umd/stylis.js +2 -0
  59. package/node_modules/@emotion/cache/node_modules/stylis/dist/umd/stylis.js.map +1 -0
  60. package/node_modules/@emotion/cache/node_modules/stylis/index.js +7 -0
  61. package/node_modules/@emotion/cache/node_modules/stylis/package.json +167 -0
  62. package/node_modules/@emotion/cache/node_modules/stylis/src/Enum.js +21 -0
  63. package/node_modules/@emotion/cache/node_modules/stylis/src/Middleware.js +108 -0
  64. package/node_modules/@emotion/cache/node_modules/stylis/src/Parser.js +191 -0
  65. package/node_modules/@emotion/cache/node_modules/stylis/src/Prefixer.js +145 -0
  66. package/node_modules/@emotion/cache/node_modules/stylis/src/Serializer.js +36 -0
  67. package/node_modules/@emotion/cache/node_modules/stylis/src/Tokenizer.js +246 -0
  68. package/node_modules/@emotion/cache/node_modules/stylis/src/Utility.js +115 -0
  69. package/node_modules/@emotion/css-prettifier/node_modules/stylis/LICENSE +21 -0
  70. package/node_modules/@emotion/css-prettifier/node_modules/stylis/README.md +161 -0
  71. package/node_modules/@emotion/css-prettifier/node_modules/stylis/dist/stylis.mjs +2 -0
  72. package/node_modules/@emotion/css-prettifier/node_modules/stylis/dist/stylis.mjs.map +1 -0
  73. package/node_modules/@emotion/css-prettifier/node_modules/stylis/dist/umd/package.json +1 -0
  74. package/node_modules/@emotion/css-prettifier/node_modules/stylis/dist/umd/stylis.js +2 -0
  75. package/node_modules/@emotion/css-prettifier/node_modules/stylis/dist/umd/stylis.js.map +1 -0
  76. package/node_modules/@emotion/css-prettifier/node_modules/stylis/index.js +7 -0
  77. package/node_modules/@emotion/css-prettifier/node_modules/stylis/package.json +167 -0
  78. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Enum.js +21 -0
  79. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Middleware.js +108 -0
  80. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Parser.js +191 -0
  81. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Prefixer.js +145 -0
  82. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Serializer.js +36 -0
  83. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Tokenizer.js +246 -0
  84. package/node_modules/@emotion/css-prettifier/node_modules/stylis/src/Utility.js +115 -0
  85. package/node_modules/@emotion/jest/node_modules/stylis/LICENSE +21 -0
  86. package/node_modules/@emotion/jest/node_modules/stylis/README.md +161 -0
  87. package/node_modules/@emotion/jest/node_modules/stylis/dist/stylis.mjs +2 -0
  88. package/node_modules/@emotion/jest/node_modules/stylis/dist/stylis.mjs.map +1 -0
  89. package/node_modules/@emotion/jest/node_modules/stylis/dist/umd/package.json +1 -0
  90. package/node_modules/@emotion/jest/node_modules/stylis/dist/umd/stylis.js +2 -0
  91. package/node_modules/@emotion/jest/node_modules/stylis/dist/umd/stylis.js.map +1 -0
  92. package/node_modules/@emotion/jest/node_modules/stylis/index.js +7 -0
  93. package/node_modules/@emotion/jest/node_modules/stylis/package.json +167 -0
  94. package/node_modules/@emotion/jest/node_modules/stylis/src/Enum.js +21 -0
  95. package/node_modules/@emotion/jest/node_modules/stylis/src/Middleware.js +108 -0
  96. package/node_modules/@emotion/jest/node_modules/stylis/src/Parser.js +191 -0
  97. package/node_modules/@emotion/jest/node_modules/stylis/src/Prefixer.js +145 -0
  98. package/node_modules/@emotion/jest/node_modules/stylis/src/Serializer.js +36 -0
  99. package/node_modules/@emotion/jest/node_modules/stylis/src/Tokenizer.js +246 -0
  100. package/node_modules/@emotion/jest/node_modules/stylis/src/Utility.js +115 -0
  101. package/package.json +6 -2
  102. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/LICENSE +0 -0
  103. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/README.md +0 -0
  104. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/dist/stylis.mjs +0 -0
  105. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/dist/stylis.mjs.map +0 -0
  106. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/dist/umd/package.json +0 -0
  107. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/dist/umd/stylis.js +0 -0
  108. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/dist/umd/stylis.js.map +0 -0
  109. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/index.js +0 -0
  110. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/package.json +0 -0
  111. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Enum.js +0 -0
  112. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Middleware.js +0 -0
  113. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Parser.js +0 -0
  114. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Prefixer.js +0 -0
  115. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Serializer.js +0 -0
  116. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Tokenizer.js +0 -0
  117. /package/node_modules/{stylis → @emotion/babel-plugin/node_modules/stylis}/src/Utility.js +0 -0
@@ -0,0 +1,242 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { css, cx } from "@emotion/css";
3
+ import { useCallback, useEffect, useMemo, useState } from "react";
4
+ import useIsMounted from "../../customHooks/useIsMounted";
5
+ import { blackAlpha, inputMaxWidth, whiteAlpha } from "../../Foundations";
6
+ import { getEmptyImmutableArray, isFunction, isLTR, isRTL, } from "../../Foundations/utils";
7
+ import { BlokIcon } from "../BlokIcon/BlokIcon";
8
+ import { BlokSearchBox } from "../BlokSearchBox/BlokSearchBox";
9
+ import { ListItemText, MenuItem, Select, Tooltip, Typography, } from "../CoreComponents";
10
+ const classes = {
11
+ dropDownAutoWidth: css({
12
+ width: "auto",
13
+ }),
14
+ dropdownFullWidth: css({
15
+ width: `${inputMaxWidth}px`,
16
+ display: "block",
17
+ maxWidth: "100%",
18
+ "& .MuiSelect-select": {
19
+ maxWidth: "calc(100% - 2.5rem)",
20
+ },
21
+ }),
22
+ select: css({
23
+ backgroundColor: "transparent !important ",
24
+ maxWidth: "calc(100% - 40px)",
25
+ display: "flex",
26
+ alignItems: "center",
27
+ }),
28
+ selectIcon: css({
29
+ color: blackAlpha[900],
30
+ top: "50%",
31
+ transform: "translateY(-50%)",
32
+ right: isLTR ? "7px !important" : "auto",
33
+ left: isRTL ? "7px !important" : "auto",
34
+ position: "absolute",
35
+ pointerEvents: "none",
36
+ cursor: "pointer",
37
+ svg: css({
38
+ width: "22px !important",
39
+ height: "22px !important",
40
+ verticalAlign: "middle",
41
+ marginInlineStart: "calc(0.375rem * -1)!important",
42
+ marginInlineEnd: "calc(0.375rem * -1)!important",
43
+ padding: "0.125rem !important",
44
+ }),
45
+ }),
46
+ checkBox: css({
47
+ marginLeft: -"8px",
48
+ }),
49
+ noneLabel: css({
50
+ color: blackAlpha["800"],
51
+ }),
52
+ noneLabelOnDark: css({
53
+ color: whiteAlpha["800"],
54
+ }),
55
+ transparentDropdownButton: css({
56
+ backgroundColor: "transparent",
57
+ }),
58
+ searchBoxWithButton: css({ margin: "0 0.5rem 0.5rem 0.5rem" }),
59
+ dropdownItemIconMenu: css({
60
+ marginRight: isLTR ? "24px" : 0,
61
+ marginLeft: isRTL ? "24px" : 0,
62
+ color: blackAlpha[600],
63
+ }),
64
+ dropdownItemIcon: css({
65
+ color: blackAlpha[600],
66
+ }),
67
+ hidden: css({
68
+ display: "none",
69
+ }),
70
+ lightText: css({ color: blackAlpha["500"] }),
71
+ iconLabel: css({ marginLeft: "8px", verticalAlign: "middle" }),
72
+ };
73
+ const dropdownClasses = {
74
+ select: classes.select,
75
+ };
76
+ const customDropdownIcon = () => (_jsx(BlokIcon, { icon: "chevron-down", classes: [classes.selectIcon] }));
77
+ function BlokSelect({ id, options = getEmptyImmutableArray(), onChange: onChange_, value, labelMapper = (item) => item, valueMapper = (item) => item, returnValue, placeholder = "Select an option", emptyValueSelectable = false, className, isReadOnly, searchBoxMinAmountOfItems = 8, tooltip = "", showIconAndText = false, hideItemIcons = false, isFullWidth = false, accessibilityId, maxHeight = 250, itemsToDisable = getEmptyImmutableArray(), openMenuByDefault = false, showEmptyDropdown = false, noneLabel = "None", noResultsText = "No results found", }) {
78
+ const [filteredOptions, setFilteredOptions] = useState(options);
79
+ const [searchFilter, setSearchFilter] = useState("");
80
+ const searchBoxRef = useCallback((node) => {
81
+ if (node) {
82
+ node.focus();
83
+ }
84
+ }, []);
85
+ const [isMenuVisible, setIsMenuVisible] = useState(openMenuByDefault);
86
+ const [toolTipIsShown, setToolTipIsShown] = useState(false);
87
+ const isMountedRef = useIsMounted();
88
+ // When clicking the clear button on the searchbox clear search value and set the list back to the original values.
89
+ const onClearSearch = useCallback(() => {
90
+ setFilteredOptions(options);
91
+ setSearchFilter("");
92
+ }, [options]);
93
+ // When selecting a value in the dropdown.
94
+ const onChange = useCallback(async (event) => {
95
+ onClearSearch();
96
+ const key = event.target.value;
97
+ const newValue = options?.find((item) => valueMapper(item) === key);
98
+ if (isFunction(onChange_)) {
99
+ if (newValue) {
100
+ if (isFunction(returnValue)) {
101
+ await onChange_(returnValue(newValue));
102
+ }
103
+ else {
104
+ await onChange_(newValue);
105
+ }
106
+ }
107
+ if (newValue == null) {
108
+ if (emptyValueSelectable) {
109
+ await onChange_(newValue);
110
+ }
111
+ }
112
+ }
113
+ if (isMountedRef.current) {
114
+ // Hide the menu.
115
+ setIsMenuVisible(false);
116
+ }
117
+ }, [
118
+ emptyValueSelectable,
119
+ isMountedRef,
120
+ valueMapper,
121
+ onChange_,
122
+ onClearSearch,
123
+ options,
124
+ returnValue,
125
+ ]);
126
+ // When clicking the enter key in the search box select the first value in the list and close the menu.
127
+ const onEnterPress = useCallback(async () => {
128
+ if (filteredOptions.length) {
129
+ // Grab the first value in the filtered options list.
130
+ const valueToSelect = filteredOptions[0];
131
+ if (isFunction(returnValue)) {
132
+ await onChange_(returnValue(valueToSelect));
133
+ }
134
+ else {
135
+ await onChange_(valueToSelect);
136
+ }
137
+ if (isMountedRef.current) {
138
+ // Restore the filtered options to the options.
139
+ setFilteredOptions(options);
140
+ // Hide the menu.
141
+ setIsMenuVisible(false);
142
+ }
143
+ }
144
+ }, [filteredOptions, isMountedRef, onChange_, options, returnValue]);
145
+ useEffect(() => {
146
+ if (!options.length) {
147
+ return;
148
+ }
149
+ if (searchFilter !== "") {
150
+ setFilteredOptions(options.filter((option) => labelMapper(option)
151
+ .toLocaleLowerCase()
152
+ .includes(searchFilter.toLocaleLowerCase())));
153
+ }
154
+ else {
155
+ setFilteredOptions(options);
156
+ }
157
+ }, [labelMapper, options, searchFilter]);
158
+ const hideToolTip = useCallback(() => setToolTipIsShown(false), []);
159
+ const showToolTip = useCallback(() => setToolTipIsShown(true), []);
160
+ const renderValue = useCallback((selected) => {
161
+ const selectedItem = options.find((item) => valueMapper(item) === selected);
162
+ if (!selectedItem) {
163
+ return _jsx("span", { children: placeholder ?? noneLabel });
164
+ }
165
+ /** This can maybe be refined in the future this way we show the selected icon on the search template dropdown. */
166
+ if (Object.prototype.hasOwnProperty.call(selectedItem, "icon")) {
167
+ return (_jsxs(_Fragment, { children: [_jsx(BlokIcon, { icon: selectedItem.icon, classes: [classes.dropdownItemIcon] }), showIconAndText && (_jsx("span", { className: classes.iconLabel, children: labelMapper(selectedItem) }))] }));
168
+ }
169
+ return labelMapper(selectedItem);
170
+ }, [
171
+ options,
172
+ labelMapper,
173
+ valueMapper,
174
+ placeholder,
175
+ noneLabel,
176
+ showIconAndText,
177
+ ]);
178
+ const onOpen = useCallback(() => {
179
+ setIsMenuVisible(true);
180
+ hideToolTip();
181
+ }, [hideToolTip]);
182
+ const filteredItems = useMemo(() => {
183
+ return filteredOptions?.map((option, index) => {
184
+ return (option && (_jsxs(MenuItem, { value: valueMapper(option), onKeyDown: (e) => {
185
+ if (e.key === "Escape") {
186
+ setIsMenuVisible(false);
187
+ setSearchFilter("");
188
+ }
189
+ }, disabled: itemsToDisable.some((item) => valueMapper(option) === valueMapper(item)), children: [Object.prototype.hasOwnProperty.call(option, "icon") &&
190
+ !hideItemIcons && (_jsx(BlokIcon, { icon: option.icon, classes: [classes.dropdownItemIconMenu] })), _jsx(ListItemText, { primary: labelMapper(option) })] }, `${valueMapper(option)}-${index}`)));
191
+ });
192
+ }, [
193
+ filteredOptions,
194
+ hideItemIcons,
195
+ itemsToDisable,
196
+ valueMapper,
197
+ labelMapper,
198
+ ]);
199
+ const searchBox = useMemo(() => options.length > searchBoxMinAmountOfItems && (_jsx(BlokSearchBox, { onSearch: setSearchFilter, onClearSearch: onClearSearch, value: searchFilter, ref: searchBoxRef, onEnterPress: onEnterPress, isInsideDropdown: true, hasGutterBottom: false })), [
200
+ onClearSearch,
201
+ onEnterPress,
202
+ options.length,
203
+ searchBoxMinAmountOfItems,
204
+ searchBoxRef,
205
+ searchFilter,
206
+ ]);
207
+ const menuCloseHandler = useCallback(() => {
208
+ setIsMenuVisible(false);
209
+ setSearchFilter("");
210
+ }, []);
211
+ const menuProps = useMemo(() => ({
212
+ anchorOrigin: {
213
+ vertical: "bottom",
214
+ horizontal: "center",
215
+ },
216
+ slotProps: {
217
+ paper: {
218
+ style: {
219
+ maxHeight,
220
+ },
221
+ },
222
+ },
223
+ autoFocus: options.length < searchBoxMinAmountOfItems,
224
+ }), [maxHeight, options.length, searchBoxMinAmountOfItems]);
225
+ if (!options.length && !showEmptyDropdown) {
226
+ return null;
227
+ }
228
+ const selectedValue = (value && valueMapper(value)) || "";
229
+ return (_jsx(_Fragment, { children: isReadOnly ? (_jsx("div", { "data-testid": id, children: _jsx(Typography, { variant: "body1", children: typeof value === "object"
230
+ ? labelMapper(value)
231
+ : (value ?? "") }) })) : (_jsx(Tooltip, { title: toolTipIsShown ? tooltip : "", children: _jsxs(Select, { "data-testid": id, onChange: onChange, className: cx(className, isFullWidth
232
+ ? classes.dropdownFullWidth
233
+ : classes.dropDownAutoWidth), classes: dropdownClasses, value: filteredOptions.some((option) => valueMapper(option) === selectedValue)
234
+ ? selectedValue
235
+ : searchFilter, open: isMenuVisible, displayEmpty: true, onMouseEnter: showToolTip, onMouseLeave: hideToolTip, onOpen: onOpen, onClose: menuCloseHandler, renderValue: renderValue, labelId: `label-${accessibilityId}`, onKeyDown: (e) => {
236
+ e.stopPropagation();
237
+ }, variant: "filled", MenuProps: menuProps, IconComponent: customDropdownIcon, children: [searchBox, value === null && (_jsx(MenuItem, { value: undefined, className: classes.hidden, children: _jsx("em", { className: classes.lightText, children: placeholder }) })), emptyValueSelectable && searchFilter === "" && (
238
+ // We need to set the value to null so that it is picked up correctly.
239
+ _jsx(MenuItem, { value: null, children: _jsx("em", { children: noneLabel }) })), !filteredOptions.length && noResultsText, filteredItems] }) })) }));
240
+ }
241
+ export { BlokSelect };
242
+ //# sourceMappingURL=BlokSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlokSelect.js","sourceRoot":"","sources":["../../../src/Components/BlokSelect/BlokSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAgB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,KAAK,EACL,KAAK,GAEN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,QAAQ,EAER,MAAM,EAE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AE,CAAC,CAAC,EAAE,EAAE;oBACf,CAAC,CAAC,eAAe,EAAE,CAAC;gBACtB,CAAC,EACD,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,kBAAkB,aAEhC,SAAS,EACT,KAAK,KAAK,IAAI,IAAI,CACjB,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,YACnD,aAAI,SAAS,EAAE,OAAO,CAAC,SAAS,YAAG,WAAW,GAAM,GAC3C,CACZ,EACA,oBAAoB,IAAI,YAAY,KAAK,EAAE,IAAI;oBAC9C,sEAAsE;oBACtE,KAAC,QAAQ,IAAC,KAAK,EAAE,IAA4B,YAC3C,uBAAK,SAAS,GAAM,GACX,CACZ,EACA,CAAC,eAAe,CAAC,MAAM,IAAI,aAAa,EACxC,aAAa,IACP,GACD,CACX,GACA,CACJ,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,11 +1,14 @@
1
1
  export * from "./BlokAlert/BlokAlert";
2
2
  export * from "./BlokBadge/BlokBadge";
3
3
  export * from "./BlokButton/BlokButton";
4
+ export * from "./BlokButtonSelect/BlokButtonSelect";
4
5
  export * from "./BlokIcon/BlokIcon";
5
6
  export * from "./BlokIcon/BlokIconContext";
6
7
  export * from "./BlokIconButton/BlokIconButton";
7
8
  export * from "./BlokLabeledIcon/BlokLabeledIcon";
8
9
  export * from "./BlokLink/BlokLink";
10
+ export * from "./BlokSearchBox/BlokSearchBox";
11
+ export * from "./BlokSelect/BlokSelect";
9
12
  export * from "./BlokTag/BlokTag";
10
13
  export * from "./BlokTooltip/BlokTooltip";
11
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
@@ -32,4 +32,22 @@ export const isFunction = (f) => {
32
32
  export const copyToClipboard = async (text) => {
33
33
  await navigator.clipboard.writeText(text);
34
34
  };
35
+ export const EMPTY_IMMUTABLE_ARRAY = Object.freeze([]);
36
+ /**
37
+ * Helper function returning an empty immutable array.
38
+ * This can for example be used as a default value for array props when so desired.
39
+ * Note: Errors will be thrown at runtime when code tries to modify the returned array.
40
+ * @returns An empty immutable array
41
+ */
42
+ export const getEmptyImmutableArray = () => EMPTY_IMMUTABLE_ARRAY;
43
+ export const EMPTY_IMMUTABLE_OBJECT = Object.freeze({});
44
+ /**
45
+ * Helper function returning an empty immutable object.
46
+ * This can for example be used as a default value for object props when so desired.
47
+ * Note: Errors will be thrown at runtime when code tries to modify the returned object.
48
+ * @returns An empty immutable array
49
+ */
50
+ export const getEmptyImmutableObject = () => EMPTY_IMMUTABLE_OBJECT;
51
+ export const isLTR = document?.dir ? document.dir === "ltr" : true;
52
+ export const isRTL = !isLTR;
35
53
  //# sourceMappingURL=utils.js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AAM,CAAC,MAAM,uBAAuB,GAAG,GAEnB,EAAE,CAAC,sBAAmD,CAAC;AAI3E,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACnE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { useEffect, useRef } from "react";
2
+ /**
3
+ * Returns a RefObject to check if the component is mounted.
4
+ * @returns An object with readonly current property to check the mounted state.
5
+ */
6
+ const useIsMounted = () => {
7
+ const isMounted = useRef(false);
8
+ useEffect(() => {
9
+ isMounted.current = true;
10
+ return () => {
11
+ isMounted.current = false;
12
+ };
13
+ }, []);
14
+ return isMounted;
15
+ };
16
+ export default useIsMounted;
17
+ //# sourceMappingURL=useIsMounted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsMounted.js","sourceRoot":"","sources":["../../src/customHooks/useIsMounted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD;;;GAGG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEhC,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAEzB,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016-present Sultan Tarimo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,161 @@
1
+ # STYLIS
2
+
3
+ [![stylis](https://stylis.js.org/assets/logo.svg)](https://github.com/thysultan/stylis.js)
4
+
5
+ A Light–weight CSS Preprocessor.
6
+
7
+ [![Coverage](https://coveralls.io/repos/github/thysultan/stylis.js/badge.svg?branch=master)](https://coveralls.io/github/thysultan/stylis.js)
8
+ [![Size](https://badgen.net/bundlephobia/minzip/stylis)](https://bundlephobia.com/result?p=stylis)
9
+ [![Licence](https://badgen.net/badge/license/MIT/blue)](https://github.com/thysultan/stylis.js/blob/master/LICENSE)
10
+ [![NPM](https://badgen.net/npm/v/dyo)](https://www.npmjs.com/package/stylis)
11
+
12
+ ## Installation
13
+
14
+ * Use a Direct Download: `<script src=stylis.js></script>`
15
+ * Use a CDN: `<script src=unpkg.com/stylis></script>`
16
+ * Use NPM: `npm install stylis --save`
17
+
18
+ ## Features
19
+
20
+ - nesting `a { &:hover {} }`
21
+ - selector namespacing
22
+ - vendor prefixing (flex-box, etc...)
23
+ - minification
24
+ - esm module compatible
25
+ - tree-shaking-able
26
+
27
+ ## Abstract Syntax Structure
28
+
29
+ ```js
30
+ const declaration = {
31
+ value: 'color:red;',
32
+ type: 'decl',
33
+ props: 'color',
34
+ children: 'red',
35
+ line: 1, column: 1
36
+ }
37
+
38
+ const comment = {
39
+ value: '/*@noflip*/',
40
+ type: 'comm',
41
+ props: '/',
42
+ children: '@noflip',
43
+ line: 1, column: 1
44
+ }
45
+
46
+ const ruleset = {
47
+ value: 'h1,h2',
48
+ type: 'rule',
49
+ props: ['h1', 'h2'],
50
+ children: [/* ... */],
51
+ line: 1, column: 1
52
+ }
53
+
54
+ const atruleset = {
55
+ value: '@media (max-width:100), (min-width:100)',
56
+ type: '@media',
57
+ props: ['(max-width:100)', '(min-width:100)'],
58
+ children: [/* ... */],
59
+ line: 1, column: 1
60
+ }
61
+ ```
62
+
63
+ ## Example:
64
+
65
+ ```js
66
+ import {compile, serialize, stringify} from 'stylis'
67
+
68
+ serialize(compile(`h1{all:unset}`), stringify)
69
+ ```
70
+
71
+ ### Compile
72
+
73
+ ```js
74
+ compile('h1{all:unset}') === [{value: 'h1', type: 'rule', props: ['h1'], children: [/* ... */]}]
75
+ compile('--foo:unset;') === [{value: '--foo:unset;', type: 'decl', props: '--foo', children: 'unset'}]
76
+ ```
77
+
78
+ ### Tokenize
79
+
80
+ ```js
81
+ tokenize('h1 h2 h3 [h4 h5] fn(args) "a b c"') === ['h1', 'h2', 'h3', '[h4 h5]', 'fn', '(args)', '"a b c"']
82
+ ```
83
+
84
+ ### Serialize
85
+
86
+ ```js
87
+ serialize(compile('h1{all:unset}'), stringify)
88
+ ```
89
+
90
+ ### Vendor Prefixing
91
+
92
+ ```js
93
+ import {compile, serialize, stringify, middleware, prefixer } from 'stylis';
94
+
95
+ serialize(compile('div{display:flex;}'), middleware([prefixer, stringify]))
96
+ ```
97
+
98
+
99
+ ## Middleware
100
+
101
+ The middleware helper is a convenient helper utility, that for all intents and purposes you can do without if you intend to implement your own traversal logic. The `stringify` middleware is one such middleware that can be used in conjunction with it.
102
+
103
+ Elements passed to middlewares have a `root` property that is the immediate root/parent of the current element **in the compiled output**, so it references the parent in the already expanded CSS-like structure. Elements have also `parent` property that is the immediate parent of the current element **from the input structure** (structure representing the input string).
104
+
105
+ ### Traversal
106
+
107
+ ```js
108
+ serialize(compile('h1{all:unset}'), middleware([(element, index, children) => {
109
+ assert(children === element.root.children && children[index] === element.children)
110
+ }, stringify])) === 'h1{all:unset;}'
111
+ ```
112
+
113
+ The abstract syntax tree also includes an additional `return` property for more niche uses.
114
+
115
+ ### Prefixing
116
+
117
+ ```js
118
+ serialize(compile('h1{all:unset}'), middleware([(element, index, children, callback) => {
119
+ if (element.type === 'decl' && element.props === 'all' && element.children === 'unset')
120
+ element.return = 'color:red;' + element.value
121
+ }, stringify])) === 'h1{color:red;all:unset;}'
122
+ ```
123
+
124
+ ```js
125
+ serialize(compile('h1{all:unset}'), middleware([(element, index, children, callback) => {
126
+ if (element.type === 'rule' && element.props.indexOf('h1') > -1)
127
+ return serialize([{...element, props: ['h2', 'h3']}], callback)
128
+ }, stringify])) === 'h2,h3{all:unset;}h1{all:unset;}'
129
+ ```
130
+
131
+ ### Reading
132
+
133
+ ```js
134
+ serialize(compile('h1{all:unset}'), middleware([stringify, (element, index, children) => {
135
+ assert(element.return === 'h1{all:unset;}')
136
+ }])) === 'h1{all:unset;color:red;}'
137
+ ```
138
+
139
+ The middlewares in [src/Middleware.js](src/Middleware.js) dive into tangible examples of how you might implement a middleware, alternatively you could also create your own middleware system as `compile` returns all the nessessary structure to fork from.
140
+
141
+ ## Variables
142
+
143
+ CSS variables are supported but a note should be made about the exotic use of css variables. The css spec mentions the following
144
+
145
+ >The allowed syntax for custom properties is extremely permissive. The <declaration-value> production matches any sequence of one or more tokens, so long as the sequence does not contain <bad-string-token>, <bad-url-token>, unmatched <)-token>, <]-token>, or <}-token>, or top-level <semicolon-token> tokens or <delim-token> tokens with a value of "!".
146
+
147
+ That is to say css variables according to the spec allows: `--foo: if(x > 5) this.width = 10;` and while this value is obviously useless as a variable, and would be invalid in any normal property, it still might be read and acted on by JavaScript and this is supported by Stylis, however things become slightly undefined when we start to include the `{` and `}` productions in our use of exotic css variables.
148
+
149
+ For example consider the following: `--foo: {};`
150
+
151
+ While this is valid CSS and supported. It is unclear what should happen when the rule collides with the implicit block termination rule that allows i.e `h1{color:red}`(notice the omitted semicolon) to also be a valid CSS production. This results in the following contradiction in: `h1{--example: {}` is it to be treated as `h1{--foo:{;}` or `h1{--foo:{}` the later of which is an unterminated block or in the following: `h1{--foo:{} h1{color:red;}` should it be `h1 {--foo:{}h1{color:red;};` where `{}h1{color:red;` is part of the css variable `--foo` and not a new rule or should it be something else?
152
+
153
+ Nevertheless Stylis still supports the exotic forms highlighted in the spec, however you should consider it as a general rule to delimit such exotic uses of variables in strings or parentheses i.e: `h1{--foo:'{'}` or `h1{--foo:({)}`.
154
+
155
+ ## Benchmark
156
+
157
+ Stylis is at-least 2X faster than its predecesor.
158
+
159
+ ### License
160
+
161
+ Stylis is [MIT licensed](./LICENSE).
@@ -0,0 +1,2 @@
1
+ var e="-ms-";var r="-moz-";var a="-webkit-";var n="comm";var c="rule";var s="decl";var t="@page";var u="@media";var i="@import";var f="@charset";var o="@viewport";var l="@supports";var v="@document";var p="@namespace";var h="@keyframes";var b="@font-face";var w="@counter-style";var d="@font-feature-values";var $="@layer";var g=Math.abs;var k=String.fromCharCode;var m=Object.assign;function x(e,r){return O(e,0)^45?(((r<<2^O(e,0))<<2^O(e,1))<<2^O(e,2))<<2^O(e,3):0}function y(e){return e.trim()}function j(e,r){return(e=r.exec(e))?e[0]:e}function z(e,r,a){return e.replace(r,a)}function C(e,r){return e.indexOf(r)}function O(e,r){return e.charCodeAt(r)|0}function A(e,r,a){return e.slice(r,a)}function M(e){return e.length}function S(e){return e.length}function q(e,r){return r.push(e),e}function B(e,r){return e.map(r).join("")}var D=1;var E=1;var F=0;var G=0;var H=0;var I="";function J(e,r,a,n,c,s,t){return{value:e,root:r,parent:a,type:n,props:c,children:s,line:D,column:E,length:t,return:""}}function K(e,r){return m(J("",null,null,"",null,null,0),e,{length:-e.length},r)}function L(){return H}function N(){H=G>0?O(I,--G):0;if(E--,H===10)E=1,D--;return H}function P(){H=G<F?O(I,G++):0;if(E++,H===10)E=1,D++;return H}function Q(){return O(I,G)}function R(){return G}function T(e,r){return A(I,e,r)}function U(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function V(e){return D=E=1,F=M(I=e),G=0,[]}function W(e){return I="",e}function X(e){return y(T(G-1,re(e===91?e+2:e===40?e+1:e)))}function Y(e){return W(_(V(e)))}function Z(e){while(H=Q())if(H<33)P();else break;return U(e)>2||U(H)>3?"":" "}function _(e){while(P())switch(U(H)){case 0:q(ne(G-1),e);break;case 2:q(X(H),e);break;default:q(k(H),e)}return e}function ee(e,r){while(--r&&P())if(H<48||H>102||H>57&&H<65||H>70&&H<97)break;return T(e,R()+(r<6&&Q()==32&&P()==32))}function re(e){while(P())switch(H){case e:return G;case 34:case 39:if(e!==34&&e!==39)re(H);break;case 40:if(e===41)re(e);break;case 92:P();break}return G}function ae(e,r){while(P())if(e+H===47+10)break;else if(e+H===42+42&&Q()===47)break;return"/*"+T(r,G-1)+"*"+k(e===47?e:P())}function ne(e){while(!U(Q()))P();return T(e,G)}function ce(e){return W(se("",null,null,null,[""],e=V(e),0,[0],e))}function se(e,r,a,n,c,s,t,u,i){var f=0;var o=0;var l=t;var v=0;var p=0;var h=0;var b=1;var w=1;var d=1;var $=0;var g="";var m=c;var x=s;var y=n;var j=g;while(w)switch(h=$,$=P()){case 40:if(h!=108&&O(j,l-1)==58){if(C(j+=z(X($),"&","&\f"),"&\f")!=-1)d=-1;break}case 34:case 39:case 91:j+=X($);break;case 9:case 10:case 13:case 32:j+=Z(h);break;case 92:j+=ee(R()-1,7);continue;case 47:switch(Q()){case 42:case 47:q(ue(ae(P(),R()),r,a),i);break;default:j+="/"}break;case 123*b:u[f++]=M(j)*d;case 125*b:case 59:case 0:switch($){case 0:case 125:w=0;case 59+o:if(d==-1)j=z(j,/\f/g,"");if(p>0&&M(j)-l)q(p>32?ie(j+";",n,a,l-1):ie(z(j," ","")+";",n,a,l-2),i);break;case 59:j+=";";default:q(y=te(j,r,a,f,o,c,u,g,m=[],x=[],l),s);if($===123)if(o===0)se(j,r,y,y,m,s,l,u,x);else switch(v===99&&O(j,3)===110?100:v){case 100:case 108:case 109:case 115:se(e,y,y,n&&q(te(e,y,y,0,0,c,u,g,c,m=[],l),x),c,x,l,u,n?m:x);break;default:se(j,y,y,y,[""],x,0,u,x)}}f=o=p=0,b=d=1,g=j="",l=t;break;case 58:l=1+M(j),p=h;default:if(b<1)if($==123)--b;else if($==125&&b++==0&&N()==125)continue;switch(j+=k($),$*b){case 38:d=o>0?1:(j+="\f",-1);break;case 44:u[f++]=(M(j)-1)*d,d=1;break;case 64:if(Q()===45)j+=X(P());v=Q(),o=l=M(g=j+=ne(R())),$++;break;case 45:if(h===45&&M(j)==2)b=0}}return s}function te(e,r,a,n,s,t,u,i,f,o,l){var v=s-1;var p=s===0?t:[""];var h=S(p);for(var b=0,w=0,d=0;b<n;++b)for(var $=0,k=A(e,v+1,v=g(w=u[b])),m=e;$<h;++$)if(m=y(w>0?p[$]+" "+k:z(k,/&\f/g,p[$])))f[d++]=m;return J(e,r,a,s===0?c:i,f,o,l)}function ue(e,r,a){return J(e,r,a,n,k(L()),A(e,2,-2),0)}function ie(e,r,a,n){return J(e,r,a,s,A(e,0,n),A(e,n+1,-1),n)}function fe(n,c,s){switch(x(n,c)){case 5103:return a+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+n+n;case 4789:return r+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return a+n+r+n+e+n+n;case 5936:switch(O(n,c+11)){case 114:return a+n+e+z(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return a+n+e+z(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return a+n+e+z(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return a+n+e+n+n;case 6165:return a+n+e+"flex-"+n+n;case 5187:return a+n+z(n,/(\w+).+(:[^]+)/,a+"box-$1$2"+e+"flex-$1$2")+n;case 5443:return a+n+e+"flex-item-"+z(n,/flex-|-self/g,"")+(!j(n,/flex-|baseline/)?e+"grid-row-"+z(n,/flex-|-self/g,""):"")+n;case 4675:return a+n+e+"flex-line-pack"+z(n,/align-content|flex-|-self/g,"")+n;case 5548:return a+n+e+z(n,"shrink","negative")+n;case 5292:return a+n+e+z(n,"basis","preferred-size")+n;case 6060:return a+"box-"+z(n,"-grow","")+a+n+e+z(n,"grow","positive")+n;case 4554:return a+z(n,/([^-])(transform)/g,"$1"+a+"$2")+n;case 6187:return z(z(z(n,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),n,"")+n;case 5495:case 3959:return z(n,/(image-set\([^]*)/,a+"$1"+"$`$1");case 4968:return z(z(n,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+n+n;case 4200:if(!j(n,/flex-|baseline/))return e+"grid-column-align"+A(n,c)+n;break;case 2592:case 3360:return e+z(n,"template-","")+n;case 4384:case 3616:if(s&&s.some((function(e,r){return c=r,j(e.props,/grid-\w+-end/)}))){return~C(n+(s=s[c].value),"span")?n:e+z(n,"-start","")+n+e+"grid-row-span:"+(~C(s,"span")?j(s,/\d+/):+j(s,/\d+/)-+j(n,/\d+/))+";"}return e+z(n,"-start","")+n;case 4896:case 4128:return s&&s.some((function(e){return j(e.props,/grid-\w+-start/)}))?n:e+z(z(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return z(n,/(.+)-inline(.+)/,a+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(M(n)-1-c>6)switch(O(n,c+1)){case 109:if(O(n,c+4)!==45)break;case 102:return z(n,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3"+"$1"+r+(O(n,c+3)==108?"$3":"$2-$3"))+n;case 115:return~C(n,"stretch")?fe(z(n,"stretch","fill-available"),c,s)+n:n}break;case 5152:case 5920:return z(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(r,a,c,s,t,u,i){return e+a+":"+c+i+(s?e+a+"-span:"+(t?u:+u-+c)+i:"")+n}));case 4949:if(O(n,c+6)===121)return z(n,":",":"+a)+n;break;case 6444:switch(O(n,O(n,14)===45?18:11)){case 120:return z(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+a+(O(n,14)===45?"inline-":"")+"box$3"+"$1"+a+"$2$3"+"$1"+e+"$2box$3")+n;case 100:return z(n,":",":"+e)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return z(n,"scroll-","scroll-snap-")+n}return n}function oe(e,r){var a="";var n=S(e);for(var c=0;c<n;c++)a+=r(e[c],c,e,r)||"";return a}function le(e,r,a,t){switch(e.type){case $:if(e.children.length)break;case i:case s:return e.return=e.return||e.value;case n:return"";case h:return e.return=e.value+"{"+oe(e.children,t)+"}";case c:e.value=e.props.join(",")}return M(a=oe(e.children,t))?e.return=e.value+"{"+a+"}":""}function ve(e){var r=S(e);return function(a,n,c,s){var t="";for(var u=0;u<r;u++)t+=e[u](a,n,c,s)||"";return t}}function pe(e){return function(r){if(!r.root)if(r=r.return)e(r)}}function he(n,t,u,i){if(n.length>-1)if(!n.return)switch(n.type){case s:n.return=fe(n.value,n.length,u);return;case h:return oe([K(n,{value:z(n.value,"@","@"+a)})],i);case c:if(n.length)return B(n.props,(function(c){switch(j(c,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return oe([K(n,{props:[z(c,/:(read-\w+)/,":"+r+"$1")]})],i);case"::placeholder":return oe([K(n,{props:[z(c,/:(plac\w+)/,":"+a+"input-$1")]}),K(n,{props:[z(c,/:(plac\w+)/,":"+r+"$1")]}),K(n,{props:[z(c,/:(plac\w+)/,e+"input-$1")]})],i)}return""}))}}function be(e){switch(e.type){case c:e.props=e.props.map((function(r){return B(Y(r),(function(r,a,n){switch(O(r,0)){case 12:return A(r,1,M(r));case 0:case 40:case 43:case 62:case 126:return r;case 58:if(n[++a]==="global")n[a]="",n[++a]="\f"+A(n[a],a=1,-1);case 32:return a===1?"":r;default:switch(a){case 0:e=r;return S(n)>1?"":r;case a=S(n)-1:case 2:return a===2?r+e+e:r+e;default:return r}}}))}))}}export{f as CHARSET,n as COMMENT,w as COUNTER_STYLE,s as DECLARATION,v as DOCUMENT,b as FONT_FACE,d as FONT_FEATURE_VALUES,i as IMPORT,h as KEYFRAMES,$ as LAYER,u as MEDIA,r as MOZ,e as MS,p as NAMESPACE,t as PAGE,c as RULESET,l as SUPPORTS,o as VIEWPORT,a as WEBKIT,g as abs,V as alloc,q as append,m as assign,R as caret,L as char,H as character,I as characters,O as charat,E as column,B as combine,ue as comment,ae as commenter,ce as compile,K as copy,W as dealloc,ie as declaration,X as delimit,re as delimiter,ee as escaping,k as from,x as hash,ne as identifier,C as indexof,F as length,D as line,j as match,ve as middleware,be as namespace,P as next,J as node,se as parse,Q as peek,G as position,fe as prefix,he as prefixer,N as prev,z as replace,te as ruleset,pe as rulesheet,oe as serialize,S as sizeof,T as slice,le as stringify,M as strlen,A as substr,U as token,Y as tokenize,_ as tokenizer,y as trim,Z as whitespace};
2
+ //# sourceMappingURL=stylis.mjs.map