@kimdw-rtk/ui 0.0.8 → 0.0.9
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/_virtual/cjs.js +5 -0
- package/dist/_virtual/cssesc.js +5 -0
- package/dist/_virtual/jsx-runtime.js +5 -0
- package/dist/_virtual/jsx-runtime2.js +3 -0
- package/dist/_virtual/picocolors.js +5 -0
- package/dist/_virtual/picocolors2.js +3 -0
- package/dist/_virtual/react-jsx-runtime.development.js +3 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js +3 -0
- package/dist/components/Accordion/Accordion.css.js +8 -5
- package/dist/components/Accordion/Accordion.js +13 -8
- package/dist/components/Accordion/AccordionContent.css.js +7 -4
- package/dist/components/Accordion/AccordionContent.js +18 -16
- package/dist/components/Accordion/AccordionContext.js +5 -2
- package/dist/components/Accordion/AccordionTrigger.css.js +7 -4
- package/dist/components/Accordion/AccordionTrigger.js +9 -7
- package/dist/components/Alert/index.js +49 -5
- package/dist/components/Box/Box.css.js +6 -3
- package/dist/components/Box/index.js +13 -7
- package/dist/components/Button/Button.css.js +11 -8
- package/dist/components/Button/index.js +57 -11
- package/dist/components/Card/Card.css.js +9 -6
- package/dist/components/Card/Card.js +14 -7
- package/dist/components/Card/CardContent.css.js +6 -3
- package/dist/components/Card/CardContent.js +12 -6
- package/dist/components/Card/CardInteraction.css.js +5 -2
- package/dist/components/Card/CardInteraction.js +53 -8
- package/dist/components/Card/CardThumbnail.css.js +5 -2
- package/dist/components/Card/CardThumbnail.js +12 -6
- package/dist/components/Chip/Chip.css.js +9 -6
- package/dist/components/Chip/Chip.js +14 -7
- package/dist/components/Confirm/index.js +48 -5
- package/dist/components/Dialog/Dialog.css.js +7 -4
- package/dist/components/Dialog/Dialog.js +51 -7
- package/dist/components/Dialog/DialogContent.css.js +8 -5
- package/dist/components/Dialog/DialogContent.js +51 -7
- package/dist/components/Dialog/DialogFooter.js +50 -6
- package/dist/components/Dialog/DialogHeader.css.js +7 -4
- package/dist/components/Dialog/DialogHeader.js +52 -8
- package/dist/components/Navigation/NavigationAside.css.js +5 -2
- package/dist/components/Navigation/NavigationAside.js +12 -7
- package/dist/components/Navigation/NavigationBar.css.js +8 -5
- package/dist/components/Navigation/NavigationBar.js +14 -7
- package/dist/components/Navigation/NavigationContainer.css.js +5 -2
- package/dist/components/Navigation/NavigationContainer.js +12 -6
- package/dist/components/Navigation/NavigationDrawer.css.js +9 -6
- package/dist/components/Navigation/NavigationDrawer.js +52 -8
- package/dist/components/Navigation/NavigationItem.css.js +9 -5
- package/dist/components/Navigation/NavigationItem.js +12 -6
- package/dist/components/Navigation/NavigationLogo.css.js +5 -2
- package/dist/components/Navigation/NavigationLogo.js +12 -6
- package/dist/components/Navigation/NavigationMenu.css.js +8 -5
- package/dist/components/Navigation/NavigationMenu.js +14 -7
- package/dist/components/Range/Range.css.js +12 -9
- package/dist/components/Range/Range.js +17 -11
- package/dist/components/ScrollArea/ScrollArea.css.js +10 -7
- package/dist/components/ScrollArea/ScrollArea.js +16 -10
- package/dist/components/Select/Select.css.js +6 -3
- package/dist/components/Select/Select.js +18 -12
- package/dist/components/Select/SelectContext.js +5 -2
- package/dist/components/Select/SelectOption.css.js +6 -3
- package/dist/components/Select/SelectOption.js +8 -6
- package/dist/components/Select/SelectOptionList.css.js +7 -4
- package/dist/components/Select/SelectOptionList.js +12 -8
- package/dist/components/Select/SelectTrigger.css.js +9 -6
- package/dist/components/Select/SelectTrigger.js +14 -9
- package/dist/components/Skeleton/Skeleton.css.js +7 -4
- package/dist/components/Skeleton/index.js +12 -6
- package/dist/components/Table/Table.css.js +6 -3
- package/dist/components/Table/Table.js +14 -7
- package/dist/components/Table/TableBody.js +11 -5
- package/dist/components/Table/TableCell.css.js +8 -5
- package/dist/components/Table/TableCell.js +13 -7
- package/dist/components/Table/TableHead.css.js +6 -3
- package/dist/components/Table/TableHead.js +13 -7
- package/dist/components/Table/TableHeader.js +11 -5
- package/dist/components/Table/TableRow.css.js +5 -2
- package/dist/components/Table/TableRow.js +12 -6
- package/dist/components/Tabs/Tabs.js +12 -7
- package/dist/components/Tabs/TabsContent.js +12 -7
- package/dist/components/Tabs/TabsList.css.js +6 -3
- package/dist/components/Tabs/TabsList.js +12 -6
- package/dist/components/Tabs/TabsProvider.js +5 -3
- package/dist/components/Tabs/TabsTrigger.css.js +6 -3
- package/dist/components/Tabs/TabsTrigger.js +13 -8
- package/dist/components/TextField/TextField.css.js +9 -6
- package/dist/components/TextField/index.js +14 -7
- package/dist/components/Toast/Toast.css.js +9 -6
- package/dist/components/Toast/index.js +54 -9
- package/dist/components/Typography/Typography.css.js +5 -2
- package/dist/components/Typography/index.js +13 -8
- package/dist/contexts/UIProvider.js +52 -6
- package/dist/hooks/useDialog/index.js +52 -7
- package/dist/hooks/useMouseScroll/index.js +4 -2
- package/dist/hooks/usePointerSlider/index.js +5 -3
- package/dist/hooks/useRipple/index.js +24 -22
- package/dist/hooks/useRipple/ripple.css.js +8 -5
- package/dist/hooks/useToast/ToastContainer.css.js +5 -2
- package/dist/hooks/useToast/ToastContainer.js +7 -4
- package/dist/hooks/useToast/ToastProvider.js +53 -10
- package/dist/hooks/useToast/index.js +5 -2
- package/dist/index.js +79 -8
- package/dist/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +55 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/adapter/dist/vanilla-extract-css-adapter.esm.js +51 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/taggedTemplateLiteral-10998315.esm.js +12 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/transformCss-0dba36bf.esm.js +955 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.esm.js +390 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/fileScope/dist/vanilla-extract-css-fileScope.esm.js +20 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/functionSerializer/dist/vanilla-extract-css-functionSerializer.esm.js +11 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/injectStyles/dist/vanilla-extract-css-injectStyles.esm.js +22 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_private@1.0.9/node_modules/@vanilla-extract/private/dist/vanilla-extract-private.esm.js +37 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_recipes@0.5.7_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +111 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_recipes@0.5.7_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/recipes/dist/vanilla-extract-recipes.esm.js +43 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_sprinkles@1.6.5_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/sprinkles/dist/createSprinkles-74286718.esm.js +190 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_sprinkles@1.6.5_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/sprinkles/dist/vanilla-extract-sprinkles.esm.js +146 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +3 -0
- package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/parse.js +423 -0
- package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/types.js +28 -0
- package/dist/node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js +119 -0
- package/dist/node_modules/.pnpm/dedent@1.6.0_babel-plugin-macros@3.1.0/node_modules/dedent/dist/dedent.js +68 -0
- package/dist/node_modules/.pnpm/deep-object-diff@1.1.9/node_modules/deep-object-diff/mjs/diff.js +39 -0
- package/dist/node_modules/.pnpm/deep-object-diff@1.1.9/node_modules/deep-object-diff/mjs/utils.js +8 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +142 -0
- package/dist/node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js +1542 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js +45 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js +30 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/align-justify.js +18 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js +17 -0
- package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js +28 -0
- package/dist/node_modules/.pnpm/media-query-parser@2.0.2/node_modules/media-query-parser/dist/media-query-parser.esm.js +1385 -0
- package/dist/node_modules/.pnpm/modern-ahocorasick@1.1.0/node_modules/modern-ahocorasick/dist/index.js +101 -0
- package/dist/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +86 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +1325 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +24 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js +19 -0
- package/dist/styles/globalStyle.css.js +5 -2
- package/dist/styles/layers.css.js +6 -3
- package/dist/styles/overlay.css.js +7 -4
- package/dist/styles/sprinkles.css.js +16 -9
- package/dist/styles/sx.js +7 -2
- package/dist/themes/darkTheme.css.js +5 -2
- package/dist/themes/lightTheme.css.js +5 -2
- package/dist/themes/theme.css.js +7 -4
- package/dist/tokens/scale/color.js +5 -3
- package/dist/tokens/semantic/breakpoint.js +4 -6
- package/dist/tokens/semantic/color.js +3 -1
- package/dist/tokens/semantic/spacing.js +3 -1
- package/dist/tokens/semantic/typography.js +3 -1
- package/dist/utils/sprinklesUtils.js +8 -3
- package/dist/utils/styleUtils.css.js +10 -5
- package/package.json +8 -3
- package/dist/components/Accordion/Accordion.spec.js +0 -5
- package/dist/components/Accordion/index.js +0 -3
- package/dist/components/Box/Box.spec.js +0 -5
- package/dist/components/Button/Button.spec.js +0 -19
- package/dist/components/Card/Card.spec.js +0 -16
- package/dist/components/Card/index.js +0 -4
- package/dist/components/Chip/Chip.spec.js +0 -5
- package/dist/components/Chip/index.js +0 -1
- package/dist/components/Dialog/Dialog.spec.js +0 -16
- package/dist/components/Dialog/DialogFooter.css.js +0 -15
- package/dist/components/Dialog/index.js +0 -4
- package/dist/components/Navigation/Navigation.spec.js +0 -11
- package/dist/components/Navigation/index.js +0 -7
- package/dist/components/Range/Range.spec.js +0 -5
- package/dist/components/Range/index.js +0 -1
- package/dist/components/ScrollArea/ScrollArea.spec.js +0 -5
- package/dist/components/ScrollArea/index.js +0 -1
- package/dist/components/Select/Select.spec.js +0 -35
- package/dist/components/Select/index.js +0 -2
- package/dist/components/Skeleton/Skeleton.spec.js +0 -5
- package/dist/components/Table/Table.spec.js +0 -10
- package/dist/components/Table/index.js +0 -6
- package/dist/components/Tabs/Tabs.spec.js +0 -22
- package/dist/components/Tabs/index.js +0 -4
- package/dist/components/TextField/TextField.spec.js +0 -5
- package/dist/components/Toast/Toast.spec.js +0 -5
- package/dist/components/Typography/Typography.spec.js +0 -28
- package/dist/components/index.js +0 -18
- package/dist/contexts/index.js +0 -1
- package/dist/hooks/index.js +0 -5
- package/dist/hooks/useDialog/useDialog.spec.js +0 -53
- package/dist/styles/index.js +0 -4
- package/dist/tests/uiTest.js +0 -36
- package/dist/themes/index.js +0 -3
- package/dist/tokens/index.js +0 -5
- package/dist/types/index.js +0 -1
- package/dist/types/ui.types.js +0 -1
- package/dist/utils/index.js +0 -1
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.esm.js';
|
|
2
|
+
import { _ as _objectSpread2, d as dudupeAndJoinClassList, t as transformCss } from './transformCss-0dba36bf.esm.js';
|
|
3
|
+
import { setAdapterIfNotSet, appendCss, registerClassName, registerComposition, markCompositionUsed, getIdentOption } from '../adapter/dist/vanilla-extract-css-adapter.esm.js';
|
|
4
|
+
import murmur2 from '../../../../../@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js';
|
|
5
|
+
import { getFileScope, getAndIncrementRefCounter, hasFileScope } from '../fileScope/dist/vanilla-extract-css-fileScope.esm.js';
|
|
6
|
+
import { LRUCache } from '../../../../../lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js';
|
|
7
|
+
import { walkObject, get } from '../../../../../@vanilla-extract_private@1.0.9/node_modules/@vanilla-extract/private/dist/vanilla-extract-private.esm.js';
|
|
8
|
+
import cssescExports from '../../../../../../../_virtual/cssesc.js';
|
|
9
|
+
import diff from '../../../../../deep-object-diff@1.1.9/node_modules/deep-object-diff/mjs/diff.js';
|
|
10
|
+
import picocolorsExports from '../../../../../../../_virtual/picocolors.js';
|
|
11
|
+
import '../../../../../dedent@1.6.0_babel-plugin-macros@3.1.0/node_modules/dedent/dist/dedent.js';
|
|
12
|
+
import cjsExports from '../../../../../../../_virtual/cjs.js';
|
|
13
|
+
|
|
14
|
+
var localClassNames = new Set();
|
|
15
|
+
var composedClassLists = [];
|
|
16
|
+
var bufferedCSSObjs = [];
|
|
17
|
+
var browserRuntimeAdapter = {
|
|
18
|
+
appendCss: cssObj => {
|
|
19
|
+
bufferedCSSObjs.push(cssObj);
|
|
20
|
+
},
|
|
21
|
+
registerClassName: className => {
|
|
22
|
+
localClassNames.add(className);
|
|
23
|
+
},
|
|
24
|
+
registerComposition: composition => {
|
|
25
|
+
composedClassLists.push(composition);
|
|
26
|
+
},
|
|
27
|
+
markCompositionUsed: () => {},
|
|
28
|
+
onEndFileScope: fileScope => {
|
|
29
|
+
var css = transformCss({
|
|
30
|
+
localClassNames: Array.from(localClassNames),
|
|
31
|
+
composedClassLists,
|
|
32
|
+
cssObjs: bufferedCSSObjs
|
|
33
|
+
}).join('\n');
|
|
34
|
+
injectStyles({
|
|
35
|
+
fileScope,
|
|
36
|
+
css
|
|
37
|
+
});
|
|
38
|
+
bufferedCSSObjs = [];
|
|
39
|
+
},
|
|
40
|
+
getIdentOption: () => process.env.NODE_ENV === 'production' ? 'short' : 'debug'
|
|
41
|
+
};
|
|
42
|
+
if (typeof window !== 'undefined') {
|
|
43
|
+
setAdapterIfNotSet(browserRuntimeAdapter);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var getLastSlashBeforeIndex = (path, index) => {
|
|
47
|
+
var pathIndex = index - 1;
|
|
48
|
+
while (pathIndex >= 0) {
|
|
49
|
+
if (path[pathIndex] === '/') {
|
|
50
|
+
return pathIndex;
|
|
51
|
+
}
|
|
52
|
+
pathIndex--;
|
|
53
|
+
}
|
|
54
|
+
return -1;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Assumptions:
|
|
59
|
+
* - The path is always normalized to use posix file separators (/) (see `addFileScope`)
|
|
60
|
+
* - The path is always relative to the project root, i.e. there will never be a leading slash (see `addFileScope`)
|
|
61
|
+
* - As long as `.css` is there, we have a valid `.css.*` file path, because otherwise there wouldn't
|
|
62
|
+
* be a file scope to begin with
|
|
63
|
+
*
|
|
64
|
+
* The LRU cache we use can't cache undefined/null values, so we opt to return an empty string,
|
|
65
|
+
* rather than using a custom Symbol or something similar.
|
|
66
|
+
*/
|
|
67
|
+
var _getDebugFileName = path => {
|
|
68
|
+
var file;
|
|
69
|
+
var lastIndexOfDotCss = path.lastIndexOf('.css');
|
|
70
|
+
if (lastIndexOfDotCss === -1) {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
var lastSlashIndex = getLastSlashBeforeIndex(path, lastIndexOfDotCss);
|
|
74
|
+
file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);
|
|
75
|
+
|
|
76
|
+
// There are no slashes, therefore theres no directory to extract
|
|
77
|
+
if (lastSlashIndex === -1) {
|
|
78
|
+
return file;
|
|
79
|
+
}
|
|
80
|
+
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
|
|
81
|
+
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
|
|
82
|
+
// in which case dir will still be sliced starting at 0, which is what we want
|
|
83
|
+
var dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);
|
|
84
|
+
var debugFileName = file !== 'index' ? file : dir;
|
|
85
|
+
return debugFileName;
|
|
86
|
+
};
|
|
87
|
+
var memoizedGetDebugFileName = () => {
|
|
88
|
+
var cache = new LRUCache({
|
|
89
|
+
max: 500
|
|
90
|
+
});
|
|
91
|
+
return path => {
|
|
92
|
+
var cachedResult = cache.get(path);
|
|
93
|
+
if (cachedResult) {
|
|
94
|
+
return cachedResult;
|
|
95
|
+
}
|
|
96
|
+
var result = _getDebugFileName(path);
|
|
97
|
+
cache.set(path, result);
|
|
98
|
+
return result;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var getDebugFileName = memoizedGetDebugFileName();
|
|
102
|
+
|
|
103
|
+
function getDevPrefix(_ref) {
|
|
104
|
+
var {
|
|
105
|
+
debugId,
|
|
106
|
+
debugFileName
|
|
107
|
+
} = _ref;
|
|
108
|
+
var parts = debugId ? [debugId.replace(/\s/g, '_')] : [];
|
|
109
|
+
if (debugFileName) {
|
|
110
|
+
var {
|
|
111
|
+
filePath
|
|
112
|
+
} = getFileScope();
|
|
113
|
+
var _debugFileName = getDebugFileName(filePath);
|
|
114
|
+
|
|
115
|
+
// debugFileName could be an empty string
|
|
116
|
+
if (_debugFileName) {
|
|
117
|
+
parts.unshift(_debugFileName);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return parts.join('_');
|
|
121
|
+
}
|
|
122
|
+
function normalizeIdentifier(identifier) {
|
|
123
|
+
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier;
|
|
124
|
+
}
|
|
125
|
+
function generateIdentifier(arg) {
|
|
126
|
+
var identOption = getIdentOption();
|
|
127
|
+
var {
|
|
128
|
+
debugId,
|
|
129
|
+
debugFileName = true
|
|
130
|
+
} = _objectSpread2(_objectSpread2({}, typeof arg === 'string' ? {
|
|
131
|
+
debugId: arg
|
|
132
|
+
} : null), typeof arg === 'object' ? arg : null);
|
|
133
|
+
|
|
134
|
+
// Convert ref count to base 36 for optimal hash lengths
|
|
135
|
+
var refCount = getAndIncrementRefCounter().toString(36);
|
|
136
|
+
var {
|
|
137
|
+
filePath,
|
|
138
|
+
packageName
|
|
139
|
+
} = getFileScope();
|
|
140
|
+
var fileScopeHash = murmur2(packageName ? "".concat(packageName).concat(filePath) : filePath);
|
|
141
|
+
var identifier = "".concat(fileScopeHash).concat(refCount);
|
|
142
|
+
if (identOption === 'debug') {
|
|
143
|
+
var devPrefix = getDevPrefix({
|
|
144
|
+
debugId,
|
|
145
|
+
debugFileName
|
|
146
|
+
});
|
|
147
|
+
if (devPrefix) {
|
|
148
|
+
identifier = "".concat(devPrefix, "__").concat(identifier);
|
|
149
|
+
}
|
|
150
|
+
return normalizeIdentifier(identifier);
|
|
151
|
+
}
|
|
152
|
+
if (typeof identOption === 'function') {
|
|
153
|
+
identifier = identOption({
|
|
154
|
+
hash: identifier,
|
|
155
|
+
debugId,
|
|
156
|
+
filePath,
|
|
157
|
+
packageName
|
|
158
|
+
});
|
|
159
|
+
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) {
|
|
160
|
+
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\""));
|
|
161
|
+
}
|
|
162
|
+
return identifier;
|
|
163
|
+
}
|
|
164
|
+
return normalizeIdentifier(identifier);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var normaliseObject = obj => walkObject(obj, () => '');
|
|
168
|
+
function validateContract(contract, tokens) {
|
|
169
|
+
var theDiff = diff(normaliseObject(contract), normaliseObject(tokens));
|
|
170
|
+
var valid = Object.keys(theDiff).length === 0;
|
|
171
|
+
return {
|
|
172
|
+
valid,
|
|
173
|
+
diffString: valid ? '' : renderDiff(contract, theDiff)
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function diffLine(value, nesting, type) {
|
|
177
|
+
var whitespace = [...Array(nesting).keys()].map(() => ' ').join('');
|
|
178
|
+
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value);
|
|
179
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
180
|
+
if (type === '-') {
|
|
181
|
+
return picocolorsExports.red(line);
|
|
182
|
+
}
|
|
183
|
+
if (type === '+') {
|
|
184
|
+
return picocolorsExports.green(line);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return line;
|
|
188
|
+
}
|
|
189
|
+
function renderDiff(orig, diff) {
|
|
190
|
+
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
191
|
+
var lines = [];
|
|
192
|
+
if (nesting === 0) {
|
|
193
|
+
lines.push(diffLine('{', 0));
|
|
194
|
+
}
|
|
195
|
+
var innerNesting = nesting + 1;
|
|
196
|
+
var keys = Object.keys(diff).sort();
|
|
197
|
+
for (var key of keys) {
|
|
198
|
+
var value = diff[key];
|
|
199
|
+
if (!(key in orig)) {
|
|
200
|
+
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+'));
|
|
201
|
+
} else if (typeof value === 'object') {
|
|
202
|
+
lines.push(diffLine("".concat(key, ": {"), innerNesting));
|
|
203
|
+
lines.push(renderDiff(orig[key], diff[key], innerNesting));
|
|
204
|
+
lines.push(diffLine('}', innerNesting));
|
|
205
|
+
} else {
|
|
206
|
+
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-'));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (nesting === 0) {
|
|
210
|
+
lines.push(diffLine('}', 0));
|
|
211
|
+
}
|
|
212
|
+
return lines.join('\n');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
var buildPropertyRule = _ref => {
|
|
216
|
+
var {
|
|
217
|
+
syntax,
|
|
218
|
+
inherits,
|
|
219
|
+
initialValue
|
|
220
|
+
} = _ref;
|
|
221
|
+
return _objectSpread2({
|
|
222
|
+
syntax: "\"".concat(Array.isArray(syntax) ? syntax.join(' | ') : syntax, "\""),
|
|
223
|
+
inherits: inherits ? 'true' : 'false'
|
|
224
|
+
}, initialValue != null ? {
|
|
225
|
+
initialValue
|
|
226
|
+
} : {});
|
|
227
|
+
};
|
|
228
|
+
function createVar(debugIdOrDeclaration, debugId) {
|
|
229
|
+
var cssVarName = cssescExports(generateIdentifier({
|
|
230
|
+
debugId: typeof debugIdOrDeclaration === 'string' ? debugIdOrDeclaration : debugId,
|
|
231
|
+
debugFileName: false
|
|
232
|
+
}), {
|
|
233
|
+
isIdentifier: true
|
|
234
|
+
});
|
|
235
|
+
if (debugIdOrDeclaration && typeof debugIdOrDeclaration === 'object') {
|
|
236
|
+
appendCss({
|
|
237
|
+
type: 'property',
|
|
238
|
+
name: "--".concat(cssVarName),
|
|
239
|
+
rule: buildPropertyRule(debugIdOrDeclaration)
|
|
240
|
+
}, getFileScope());
|
|
241
|
+
}
|
|
242
|
+
return "var(--".concat(cssVarName, ")");
|
|
243
|
+
}
|
|
244
|
+
function assignVars(varContract, tokens) {
|
|
245
|
+
var varSetters = {};
|
|
246
|
+
var {
|
|
247
|
+
valid,
|
|
248
|
+
diffString
|
|
249
|
+
} = validateContract(varContract, tokens);
|
|
250
|
+
if (!valid) {
|
|
251
|
+
throw new Error("Tokens don't match contract.\n".concat(diffString));
|
|
252
|
+
}
|
|
253
|
+
walkObject(tokens, (value, path) => {
|
|
254
|
+
varSetters[get(varContract, path)] = String(value);
|
|
255
|
+
});
|
|
256
|
+
return varSetters;
|
|
257
|
+
}
|
|
258
|
+
function createThemeContract(tokens) {
|
|
259
|
+
return walkObject(tokens, (_value, path) => {
|
|
260
|
+
return createVar(path.join('-'));
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function composedStyle(rules, debugId) {
|
|
264
|
+
var className = generateIdentifier(debugId);
|
|
265
|
+
registerClassName(className, getFileScope());
|
|
266
|
+
var classList = [];
|
|
267
|
+
var styleRules = [];
|
|
268
|
+
for (var rule of rules) {
|
|
269
|
+
if (typeof rule === 'string') {
|
|
270
|
+
classList.push(rule);
|
|
271
|
+
} else {
|
|
272
|
+
styleRules.push(rule);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
var result = className;
|
|
276
|
+
if (classList.length > 0) {
|
|
277
|
+
result = "".concat(className, " ").concat(dudupeAndJoinClassList(classList));
|
|
278
|
+
registerComposition({
|
|
279
|
+
identifier: className,
|
|
280
|
+
classList: result
|
|
281
|
+
}, getFileScope());
|
|
282
|
+
if (styleRules.length > 0) {
|
|
283
|
+
// If there are styles attached to this composition then it is
|
|
284
|
+
// always used and should never be removed
|
|
285
|
+
markCompositionUsed(className);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (styleRules.length > 0) {
|
|
289
|
+
var _rule = cjsExports.all(styleRules, {
|
|
290
|
+
// Replace arrays rather than merging
|
|
291
|
+
arrayMerge: (_, sourceArray) => sourceArray
|
|
292
|
+
});
|
|
293
|
+
appendCss({
|
|
294
|
+
type: 'local',
|
|
295
|
+
selector: className,
|
|
296
|
+
rule: _rule
|
|
297
|
+
}, getFileScope());
|
|
298
|
+
}
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
301
|
+
function style(rule, debugId) {
|
|
302
|
+
if (Array.isArray(rule)) {
|
|
303
|
+
return composedStyle(rule, debugId);
|
|
304
|
+
}
|
|
305
|
+
var className = generateIdentifier(debugId);
|
|
306
|
+
registerClassName(className, getFileScope());
|
|
307
|
+
appendCss({
|
|
308
|
+
type: 'local',
|
|
309
|
+
selector: className,
|
|
310
|
+
rule
|
|
311
|
+
}, getFileScope());
|
|
312
|
+
return className;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array
|
|
317
|
+
*/
|
|
318
|
+
function composeStyles() {
|
|
319
|
+
var compose = hasFileScope() ? composedStyle : dudupeAndJoinClassList;
|
|
320
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
321
|
+
classNames[_key] = arguments[_key];
|
|
322
|
+
}
|
|
323
|
+
return compose(classNames);
|
|
324
|
+
}
|
|
325
|
+
function globalStyle(selector, rule) {
|
|
326
|
+
appendCss({
|
|
327
|
+
type: 'global',
|
|
328
|
+
selector,
|
|
329
|
+
rule
|
|
330
|
+
}, getFileScope());
|
|
331
|
+
}
|
|
332
|
+
function keyframes(rule, debugId) {
|
|
333
|
+
var name = cssescExports(generateIdentifier(debugId), {
|
|
334
|
+
isIdentifier: true
|
|
335
|
+
});
|
|
336
|
+
appendCss({
|
|
337
|
+
type: 'keyframes',
|
|
338
|
+
name,
|
|
339
|
+
rule
|
|
340
|
+
}, getFileScope());
|
|
341
|
+
return name;
|
|
342
|
+
}
|
|
343
|
+
function styleVariants() {
|
|
344
|
+
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') {
|
|
345
|
+
var _data = arguments.length <= 0 ? undefined : arguments[0];
|
|
346
|
+
var _mapData = arguments.length <= 1 ? undefined : arguments[1];
|
|
347
|
+
var _debugId = arguments.length <= 2 ? undefined : arguments[2];
|
|
348
|
+
var _classMap = {};
|
|
349
|
+
for (var _key2 in _data) {
|
|
350
|
+
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2);
|
|
351
|
+
}
|
|
352
|
+
return _classMap;
|
|
353
|
+
}
|
|
354
|
+
var styleMap = arguments.length <= 0 ? undefined : arguments[0];
|
|
355
|
+
var debugId = arguments.length <= 1 ? undefined : arguments[1];
|
|
356
|
+
var classMap = {};
|
|
357
|
+
for (var _key3 in styleMap) {
|
|
358
|
+
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3);
|
|
359
|
+
}
|
|
360
|
+
return classMap;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// createContainer is used for local scoping of CSS containers
|
|
364
|
+
// For now it is mostly just an alias of generateIdentifier
|
|
365
|
+
var createContainer = debugId => generateIdentifier(debugId);
|
|
366
|
+
|
|
367
|
+
var defaultLayerOptions = {};
|
|
368
|
+
var merge = (obj1, obj2) => _objectSpread2(_objectSpread2({}, obj1), obj2);
|
|
369
|
+
var getLayerArgs = function getLayerArgs() {
|
|
370
|
+
var options = defaultLayerOptions;
|
|
371
|
+
var debugId = arguments.length <= 0 ? undefined : arguments[0];
|
|
372
|
+
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') {
|
|
373
|
+
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]);
|
|
374
|
+
debugId = arguments.length <= 1 ? undefined : arguments[1];
|
|
375
|
+
}
|
|
376
|
+
return [options, debugId];
|
|
377
|
+
};
|
|
378
|
+
function globalLayer() {
|
|
379
|
+
var [options, name] = getLayerArgs(...arguments);
|
|
380
|
+
if (options.parent) {
|
|
381
|
+
name = "".concat(options.parent, ".").concat(name);
|
|
382
|
+
}
|
|
383
|
+
appendCss({
|
|
384
|
+
type: 'layer',
|
|
385
|
+
name
|
|
386
|
+
}, getFileScope());
|
|
387
|
+
return name;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export { assignVars, composeStyles, createContainer, createThemeContract, createVar, generateIdentifier, globalLayer, globalStyle, keyframes, style, styleVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-10998315.esm.js';
|
|
2
|
+
import dedent from '../../../../../../dedent@1.6.0_babel-plugin-macros@3.1.0/node_modules/dedent/dist/dedent.js';
|
|
3
|
+
|
|
4
|
+
var _templateObject;
|
|
5
|
+
var refCounter = 0;
|
|
6
|
+
var fileScopes = [];
|
|
7
|
+
function hasFileScope() {
|
|
8
|
+
return fileScopes.length > 0;
|
|
9
|
+
}
|
|
10
|
+
function getFileScope() {
|
|
11
|
+
if (fileScopes.length === 0) {
|
|
12
|
+
throw new Error(dedent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "]))));
|
|
13
|
+
}
|
|
14
|
+
return fileScopes[0];
|
|
15
|
+
}
|
|
16
|
+
function getAndIncrementRefCounter() {
|
|
17
|
+
return refCounter++;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { getAndIncrementRefCounter, getFileScope, hasFileScope };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function addFunctionSerializer(target, recipe) {
|
|
2
|
+
// TODO: Update to "__function_serializer__" in future.
|
|
3
|
+
// __recipe__ is the backwards compatible name
|
|
4
|
+
Object.defineProperty(target, '__recipe__', {
|
|
5
|
+
value: recipe,
|
|
6
|
+
writable: false
|
|
7
|
+
});
|
|
8
|
+
return target;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { addFunctionSerializer };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var stylesheets = {};
|
|
2
|
+
var injectStyles = _ref => {
|
|
3
|
+
var {
|
|
4
|
+
fileScope,
|
|
5
|
+
css
|
|
6
|
+
} = _ref;
|
|
7
|
+
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath;
|
|
8
|
+
var stylesheet = stylesheets[fileScopeId];
|
|
9
|
+
if (!stylesheet) {
|
|
10
|
+
var styleEl = document.createElement('style');
|
|
11
|
+
if (fileScope.packageName) {
|
|
12
|
+
styleEl.setAttribute('data-package', fileScope.packageName);
|
|
13
|
+
}
|
|
14
|
+
styleEl.setAttribute('data-file', fileScope.filePath);
|
|
15
|
+
styleEl.setAttribute('type', 'text/css');
|
|
16
|
+
stylesheet = stylesheets[fileScopeId] = styleEl;
|
|
17
|
+
document.head.appendChild(styleEl);
|
|
18
|
+
}
|
|
19
|
+
stylesheet.innerHTML = css;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { injectStyles };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function getVarName(variable) {
|
|
2
|
+
var matches = variable.match(/^var\((.*)\)$/);
|
|
3
|
+
if (matches) {
|
|
4
|
+
return matches[1];
|
|
5
|
+
}
|
|
6
|
+
return variable;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function get(obj, path) {
|
|
10
|
+
var result = obj;
|
|
11
|
+
for (var key of path) {
|
|
12
|
+
if (!(key in result)) {
|
|
13
|
+
throw new Error("Path ".concat(path.join(' -> '), " does not exist in object"));
|
|
14
|
+
}
|
|
15
|
+
result = result[key];
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function walkObject(obj, fn) {
|
|
21
|
+
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
22
|
+
var clone = {};
|
|
23
|
+
for (var key in obj) {
|
|
24
|
+
var _value = obj[key];
|
|
25
|
+
var currentPath = [...path, key];
|
|
26
|
+
if (typeof _value === 'string' || typeof _value === 'number' || _value == null) {
|
|
27
|
+
clone[key] = fn(_value, currentPath);
|
|
28
|
+
} else if (typeof _value === 'object' && !Array.isArray(_value)) {
|
|
29
|
+
clone[key] = walkObject(_value, fn, currentPath);
|
|
30
|
+
} else {
|
|
31
|
+
console.warn("Skipping invalid key \"".concat(currentPath.join('.'), "\". Should be a string, number, null or object. Received: \"").concat(Array.isArray(_value) ? 'Array' : typeof _value, "\""));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return clone;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { get, getVarName, walkObject };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
function toPrimitive(t, r) {
|
|
2
|
+
if ("object" != typeof t || !t) return t;
|
|
3
|
+
var e = t[Symbol.toPrimitive];
|
|
4
|
+
if (void 0 !== e) {
|
|
5
|
+
var i = e.call(t, r);
|
|
6
|
+
if ("object" != typeof i) return i;
|
|
7
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
8
|
+
}
|
|
9
|
+
return ("string" === r ? String : Number)(t);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function toPropertyKey(t) {
|
|
13
|
+
var i = toPrimitive(t, "string");
|
|
14
|
+
return "symbol" == typeof i ? i : String(i);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _defineProperty(obj, key, value) {
|
|
18
|
+
key = toPropertyKey(key);
|
|
19
|
+
if (key in obj) {
|
|
20
|
+
Object.defineProperty(obj, key, {
|
|
21
|
+
value: value,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
obj[key] = value;
|
|
28
|
+
}
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function ownKeys(e, r) {
|
|
33
|
+
var t = Object.keys(e);
|
|
34
|
+
if (Object.getOwnPropertySymbols) {
|
|
35
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
36
|
+
r && (o = o.filter(function (r) {
|
|
37
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
38
|
+
})), t.push.apply(t, o);
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
function _objectSpread2(e) {
|
|
43
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
44
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
45
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
46
|
+
_defineProperty(e, r, t[r]);
|
|
47
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
48
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function mapValues(input, fn) {
|
|
55
|
+
var result = {};
|
|
56
|
+
for (var _key in input) {
|
|
57
|
+
result[_key] = fn(input[_key], _key);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
63
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
64
|
+
var _selections$key;
|
|
65
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
71
|
+
var createRuntimeFn = config => {
|
|
72
|
+
var runtimeFn = options => {
|
|
73
|
+
var className = config.defaultClassName;
|
|
74
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
75
|
+
for (var variantName in selections) {
|
|
76
|
+
var _selections$variantNa;
|
|
77
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
78
|
+
if (variantSelection != null) {
|
|
79
|
+
var selection = variantSelection;
|
|
80
|
+
if (typeof selection === 'boolean') {
|
|
81
|
+
// @ts-expect-error
|
|
82
|
+
selection = selection === true ? 'true' : 'false';
|
|
83
|
+
}
|
|
84
|
+
var selectionClassName =
|
|
85
|
+
// @ts-expect-error
|
|
86
|
+
config.variantClassNames[variantName][selection];
|
|
87
|
+
if (selectionClassName) {
|
|
88
|
+
className += ' ' + selectionClassName;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
93
|
+
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
94
|
+
className += ' ' + compoundClassName;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return className;
|
|
98
|
+
};
|
|
99
|
+
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
100
|
+
runtimeFn.classNames = {
|
|
101
|
+
get base() {
|
|
102
|
+
return config.defaultClassName.split(' ')[0];
|
|
103
|
+
},
|
|
104
|
+
get variants() {
|
|
105
|
+
return mapValues(config.variantClassNames, classNames => mapValues(classNames, className => className.split(' ')[0]));
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return runtimeFn;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { createRuntimeFn as c, mapValues as m };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { addFunctionSerializer } from '../../../../../@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/functionSerializer/dist/vanilla-extract-css-functionSerializer.esm.js';
|
|
2
|
+
import { style, styleVariants } from '../../../../../@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.esm.js';
|
|
3
|
+
import { m as mapValues, c as createRuntimeFn } from './createRuntimeFn-62c9670f.esm.js';
|
|
4
|
+
|
|
5
|
+
function recipe(options, debugId) {
|
|
6
|
+
var {
|
|
7
|
+
variants = {},
|
|
8
|
+
defaultVariants = {},
|
|
9
|
+
compoundVariants = [],
|
|
10
|
+
base
|
|
11
|
+
} = options;
|
|
12
|
+
var defaultClassName;
|
|
13
|
+
if (!base || typeof base === 'string') {
|
|
14
|
+
var baseClassName = style({});
|
|
15
|
+
defaultClassName = base ? "".concat(baseClassName, " ").concat(base) : baseClassName;
|
|
16
|
+
} else {
|
|
17
|
+
defaultClassName = style(base, debugId);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error
|
|
21
|
+
var variantClassNames = mapValues(variants, (variantGroup, variantGroupName) => styleVariants(variantGroup, styleRule => typeof styleRule === 'string' ? [styleRule] : styleRule, variantGroupName));
|
|
22
|
+
var compounds = [];
|
|
23
|
+
for (var {
|
|
24
|
+
style: theStyle,
|
|
25
|
+
variants: _variants
|
|
26
|
+
} of compoundVariants) {
|
|
27
|
+
compounds.push([_variants, typeof theStyle === 'string' ? theStyle : style(theStyle, "".concat(debugId, "_compound_").concat(compounds.length))]);
|
|
28
|
+
}
|
|
29
|
+
var config = {
|
|
30
|
+
defaultClassName,
|
|
31
|
+
variantClassNames,
|
|
32
|
+
defaultVariants,
|
|
33
|
+
compoundVariants: compounds
|
|
34
|
+
};
|
|
35
|
+
return addFunctionSerializer(createRuntimeFn(config), {
|
|
36
|
+
importPath: '@vanilla-extract/recipes/createRuntimeFn',
|
|
37
|
+
importName: 'createRuntimeFn',
|
|
38
|
+
// @ts-expect-error
|
|
39
|
+
args: [config]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { recipe };
|