@ndla/preset-panda 0.0.53 → 0.0.55

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 (51) hide show
  1. package/README.md +148 -0
  2. package/es/animations.js +111 -223
  3. package/es/animations.js.map +1 -0
  4. package/es/boxShadows.js +33 -37
  5. package/es/boxShadows.js.map +1 -0
  6. package/es/colors.js +132 -346
  7. package/es/colors.js.map +1 -0
  8. package/es/conditions.js +16 -12
  9. package/es/conditions.js.map +1 -0
  10. package/es/globalCss.js +149 -226
  11. package/es/globalCss.js.map +1 -0
  12. package/es/index.js +43 -45
  13. package/es/index.js.map +1 -0
  14. package/es/plugins/forwardCssPropPlugin.js +39 -46
  15. package/es/plugins/forwardCssPropPlugin.js.map +1 -0
  16. package/es/radii.js +14 -28
  17. package/es/radii.js.map +1 -0
  18. package/es/semanticTokens.js +233 -549
  19. package/es/semanticTokens.js.map +1 -0
  20. package/es/spacing.js +50 -136
  21. package/es/spacing.js.map +1 -0
  22. package/es/typography.js +200 -274
  23. package/es/typography.js.map +1 -0
  24. package/es/zIndex.js +22 -52
  25. package/es/zIndex.js.map +1 -0
  26. package/lib/_virtual/rolldown_runtime.js +30 -0
  27. package/lib/animations.js +115 -229
  28. package/lib/animations.js.map +1 -0
  29. package/lib/boxShadows.js +32 -41
  30. package/lib/boxShadows.js.map +1 -0
  31. package/lib/colors.js +131 -350
  32. package/lib/colors.js.map +1 -0
  33. package/lib/conditions.js +16 -17
  34. package/lib/conditions.js.map +1 -0
  35. package/lib/globalCss.js +148 -230
  36. package/lib/globalCss.js.map +1 -0
  37. package/lib/index.js +47 -58
  38. package/lib/index.js.map +1 -0
  39. package/lib/plugins/forwardCssPropPlugin.js +37 -51
  40. package/lib/plugins/forwardCssPropPlugin.js.map +1 -0
  41. package/lib/radii.js +13 -32
  42. package/lib/radii.js.map +1 -0
  43. package/lib/semanticTokens.js +232 -553
  44. package/lib/semanticTokens.js.map +1 -0
  45. package/lib/spacing.js +49 -140
  46. package/lib/spacing.js.map +1 -0
  47. package/lib/typography.js +205 -280
  48. package/lib/typography.js.map +1 -0
  49. package/lib/zIndex.js +21 -56
  50. package/lib/zIndex.js.map +1 -0
  51. package/package.json +6 -5
package/lib/globalCss.js CHANGED
@@ -1,233 +1,151 @@
1
- "use strict";
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
2
+ const __pandacss_dev = require_rolldown_runtime.__toESM(require("@pandacss/dev"));
2
3
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
4
+ //#region src/globalCss.ts
5
+ const globalCss = (0, __pandacss_dev.defineGlobalStyles)({
6
+ ":root": {
7
+ "--global-font-body": "fonts.sans",
8
+ "--global-font-mono": "fonts.code"
9
+ },
10
+ html: {
11
+ minHeight: "100%",
12
+ fontFeatureSettings: "'ss03' on, 'liga' off, 'clig' off",
13
+ "& h1, h2, h3, h4, h5, h6": { textWrap: "unset" }
14
+ },
15
+ body: {
16
+ background: "background.default",
17
+ color: "text.default"
18
+ },
19
+ "a, summary,[tabindex]:not([tabindex='-1'])": {
20
+ outline: "none",
21
+ _focusVisible: {
22
+ outline: "3px",
23
+ borderRadius: "xsmall",
24
+ outlineColor: "stroke.default",
25
+ outlineOffset: "3px",
26
+ outlineStyle: "solid"
27
+ }
28
+ },
29
+ code: {
30
+ background: "background.subtle",
31
+ whiteSpace: "pre-wrap"
32
+ },
33
+ "iframe#launcher": { display: "none" },
34
+ ".ndla-article": {
35
+ h1: { textStyle: "heading.medium" },
36
+ h2: { textStyle: "heading.small" },
37
+ h3: { textStyle: "title.medium" },
38
+ "h4, h5, h6": { textStyle: "title.small" },
39
+ "& p[data-align=\"center\"]": { textAlign: "center" },
40
+ blockquote: {
41
+ textStyle: "body.medium",
42
+ fontFamily: "serif"
43
+ },
44
+ "& p:has(span[dir=\"rtl\"])": { direction: "rtl" },
45
+ textStyle: "body.article",
46
+ width: "100%",
47
+ "& details, :not(li) > blockquote, [data-embed-type=\"expandable-box\"], [data-embed-type=\"framed-content\"], [data-embed-type=\"factbox\"], table, [data-embed-type=\"related-content-list\"], [data-embed-type=\"link-block-list\"], [data-embed-type=\"pitch\"], [data-embed-type=\"campaign-block\"], [data-embed-type=\"key-figure\"], [data-embed-type=\"grid\"], [data-embed-type=\"contact-block\"], [data-embed-type=\"file-list\"], [data-embed-type=\"uu-disclaimer\"]": {
48
+ marginBlockStart: "xxlarge",
49
+ marginBlockEnd: "xxlarge",
50
+ tabletDown: {
51
+ marginBlockStart: "xlarge",
52
+ marginBlockEnd: "xlarge"
53
+ }
54
+ },
55
+ "& section:not([class]), section:not([class]) > div:not([class]), [data-embed-type=\"framed-content\"], [data-embed-type=\"grid\"] > div, [data-embed-type=\"grid-parallax\"] > div, [data-embed-type=\"factbox\"] > div, [data-embed-type=\"copyright\"] > [data-copyright-content], [data-embed-type=\"uu-disclaimer\"] > [data-uu-content], [data-embed-wrapper], details, [data-embed-type=\"expandable-box\"], blockquote": {
56
+ "& > :is(h2, [data-embed-type=\"copy-heading\"])": {
57
+ marginBlockStart: "xlarge",
58
+ marginBlockEnd: "small",
59
+ tabletDown: { marginBlockStart: "large" }
60
+ },
61
+ "& > h3": {
62
+ marginBlockStart: "large",
63
+ marginBlockEnd: "xsmall",
64
+ tabletDown: { marginBlockStart: "medium" }
65
+ },
66
+ "& > :is(h4, h5, h6)": {
67
+ marginBlockStart: "medium",
68
+ marginBlockEnd: "xsmall",
69
+ tabletDown: { marginBlockStart: "small" }
70
+ },
71
+ "& > :is(figure)": {
72
+ marginBlockStart: "xxlarge",
73
+ marginBlockEnd: "xxlarge",
74
+ tabletDown: { marginBlockStart: "xlarge" }
75
+ },
76
+ "& > :is(p, ul, ol, dl, [data-embed-type=\"speech\"])": {
77
+ marginBlockStart: "xsmall",
78
+ marginBlockEnd: "xsmall"
79
+ },
80
+ "& > :is([data-embed-type=\"ordered-list\"])": { marginInlineStart: "xlarge!" }
81
+ },
82
+ "& [data-embed-type=\"framed-content\"], [data-embed-type=\"grid\"] > div, [data-embed-type=\"grid-parallax\"] > div, [data-embed-type=\"factbox\"] > div, [data-embed-type=\"copyright\"] > [data-copyright-content], [data-embed-type=\"uu-disclaimer\"] > [data-uu-content], details, blockquote": {
83
+ "& > :first-child": { marginBlockStart: "0" },
84
+ "& > :last-child": { marginBlockEnd: "0" }
85
+ },
86
+ "& section:not([class]), section:not([class]) > div:not([class])": {
87
+ "& > :first-child": {
88
+ marginBlockStart: "xxlarge",
89
+ tabletDown: { marginBlockStart: "xlarge" }
90
+ },
91
+ "& > :last-child": {
92
+ marginBlockEnd: "xxlarge",
93
+ tabletDown: { marginBlockStart: "xlarge" }
94
+ }
95
+ }
96
+ },
97
+ "a:not([class]):not([data-unstyled]), a[class=\"\"]:not([data-unstyled])": {
98
+ color: "text.link",
99
+ textDecoration: "underline",
100
+ _hover: { textDecoration: "none" },
101
+ _visited: { color: "text.linkVisited" }
102
+ },
103
+ ".codeblock": {
104
+ border: "1px solid",
105
+ borderColor: "stroke.subtle",
106
+ borderLeft: "4px solid",
107
+ borderLeftColor: "stroke.default",
108
+ borderRadius: "xsmall",
109
+ boxSizing: "border-box",
110
+ overflowX: "auto",
111
+ textStyle: "label.medium",
112
+ fontFamily: "code",
113
+ display: "block",
114
+ whiteSpace: "pre",
115
+ "& .linenumber": {
116
+ display: "inline-block",
117
+ paddingBlock: "0",
118
+ paddingInline: "small",
119
+ borderRight: "1px solid",
120
+ borderColor: "stroke.subtle",
121
+ width: "xxlarge",
122
+ textAlign: "right",
123
+ marginInlineEnd: "xsmall"
124
+ },
125
+ "& :nth-child(1 of .linenumber)": { paddingBlockStart: "xsmall" },
126
+ "& :nth-last-child(1 of .linenumber)": { paddingBlockEnd: "xsmall" },
127
+ "& .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata": { color: "#7d8b99" },
128
+ "& .token.punctuation": { color: "#5f6364" },
129
+ "& .token.property, .token.tag, .token.boolean, .token.number, .token.function-name, .token.constant, .token.symbol, .token.deleted": { color: "#c92c2c" },
130
+ "& .token.selector, .token.attr-name, .token.string, .token.char, .token.function, .token.builtin, .token.inserted": { color: "#2f9c0a" },
131
+ "& .token.operator, .token.entity, .token.url, .token.variable": {
132
+ color: "#a67f59",
133
+ background: "rgba(255, 255, 255, 0.5)"
134
+ },
135
+ "& .token.atrule, .token.attr-value, .token.keyword, .token.class-name": { color: "#1990b8" },
136
+ "& .token.regex, .token.important": { color: "#e90" },
137
+ "& .language-css .token.string, .style .token.string": {
138
+ color: "#a67f59",
139
+ background: "rgba(255, 255, 255, 0.5)"
140
+ },
141
+ "& .token.important": { fontWeight: "normal" },
142
+ "& .token.bold": { fontWeight: "bold" },
143
+ "& .token.italic": { fontStyle: "italic" },
144
+ "& .token.entity": { cursor: "help" },
145
+ "& .token.namespace": { opacity: "0.7" }
146
+ }
5
147
  });
6
- exports.globalCss = void 0;
7
- var _dev = require("@pandacss/dev");
8
- /**
9
- * Copyright (c) 2024-present, NDLA.
10
- *
11
- * This source code is licensed under the GPLv3 license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- *
14
- */
15
148
 
16
- const globalCss = exports.globalCss = (0, _dev.defineGlobalStyles)({
17
- ":root": {
18
- // Applied to html in preflight (css reset)
19
- "--global-font-body": "fonts.sans",
20
- // Code, kbd, pre, samp
21
- "--global-font-mono": "fonts.code"
22
- },
23
- html: {
24
- minHeight: "100%",
25
- fontFeatureSettings: "'ss03' on, 'liga' off, 'clig' off",
26
- // this is included in the css reset we use. We don't want it.
27
- "& h1, h2, h3, h4, h5, h6": {
28
- textWrap: "unset"
29
- }
30
- },
31
- body: {
32
- background: "background.default",
33
- color: "text.default"
34
- },
35
- "a, summary,[tabindex]:not([tabindex='-1'])": {
36
- outline: "none",
37
- _focusVisible: {
38
- outline: "3px",
39
- borderRadius: "xsmall",
40
- outlineColor: "stroke.default",
41
- outlineOffset: "3px",
42
- outlineStyle: "solid"
43
- }
44
- },
45
- code: {
46
- background: "background.subtle",
47
- whiteSpace: "pre-wrap"
48
- },
49
- /* Hide default zendesk launcher so that we can provide our own. */
50
- "iframe#launcher": {
51
- display: "none"
52
- },
53
- // For future readers: Life here would be much simpler if we could use flex.
54
- // However, our usage of float within the article content forces us to use margins.
55
- ".ndla-article": {
56
- h1: {
57
- textStyle: "heading.medium"
58
- },
59
- h2: {
60
- textStyle: "heading.small"
61
- },
62
- h3: {
63
- textStyle: "title.medium"
64
- },
65
- "h4, h5, h6": {
66
- textStyle: "title.small"
67
- },
68
- '& p[data-align="center"]': {
69
- textAlign: "center"
70
- },
71
- // TODO: This is not an actual text style. Should it be?
72
- blockquote: {
73
- textStyle: "body.medium",
74
- fontFamily: "serif"
75
- },
76
- '& p:has(span[dir="rtl"])': {
77
- direction: "rtl"
78
- },
79
- textStyle: "body.article",
80
- width: "100%",
81
- // Non-figure block elements that should have margin above and below.
82
- '& details, :not(li) > blockquote, [data-embed-type="expandable-box"], [data-embed-type="framed-content"], [data-embed-type="factbox"], table, [data-embed-type="related-content-list"], [data-embed-type="link-block-list"], [data-embed-type="pitch"], [data-embed-type="campaign-block"], [data-embed-type="key-figure"], [data-embed-type="grid"], [data-embed-type="contact-block"], [data-embed-type="file-list"], [data-embed-type="uu-disclaimer"]': {
83
- marginBlockStart: "xxlarge",
84
- marginBlockEnd: "xxlarge",
85
- tabletDown: {
86
- marginBlockStart: "xlarge",
87
- marginBlockEnd: "xlarge"
88
- }
89
- },
90
- // Article content is usually wrapped in a section. The rest of the elements in this list contains other elements, and should add margin to them no matter where they are placed in the DOM.
91
- '& section:not([class]), section:not([class]) > div:not([class]), [data-embed-type="framed-content"], [data-embed-type="grid"] > div, [data-embed-type="grid-parallax"] > div, [data-embed-type="factbox"] > div, [data-embed-type="copyright"] > [data-copyright-content], [data-embed-type="uu-disclaimer"] > [data-uu-content], [data-embed-wrapper], details, [data-embed-type="expandable-box"], blockquote': {
92
- '& > :is(h2, [data-embed-type="copy-heading"])': {
93
- marginBlockStart: "xlarge",
94
- marginBlockEnd: "small",
95
- tabletDown: {
96
- marginBlockStart: "large"
97
- }
98
- },
99
- "& > h3": {
100
- marginBlockStart: "large",
101
- marginBlockEnd: "xsmall",
102
- tabletDown: {
103
- marginBlockStart: "medium"
104
- }
105
- },
106
- "& > :is(h4, h5, h6)": {
107
- marginBlockStart: "medium",
108
- marginBlockEnd: "xsmall",
109
- tabletDown: {
110
- marginBlockStart: "small"
111
- }
112
- },
113
- "& > :is(figure)": {
114
- marginBlockStart: "xxlarge",
115
- marginBlockEnd: "xxlarge",
116
- tabletDown: {
117
- marginBlockStart: "xlarge"
118
- }
119
- },
120
- '& > :is(p, ul, ol, dl, [data-embed-type="speech"])': {
121
- marginBlockStart: "xsmall",
122
- marginBlockEnd: "xsmall"
123
- },
124
- '& > :is([data-embed-type="ordered-list"])': {
125
- marginInlineStart: "xlarge!"
126
- }
127
- },
128
- '& [data-embed-type="framed-content"], [data-embed-type="grid"] > div, [data-embed-type="grid-parallax"] > div, [data-embed-type="factbox"] > div, [data-embed-type="copyright"] > [data-copyright-content], [data-embed-type="uu-disclaimer"] > [data-uu-content], details, blockquote': {
129
- "& > :first-child": {
130
- marginBlockStart: "0"
131
- },
132
- "& > :last-child": {
133
- marginBlockEnd: "0"
134
- }
135
- },
136
- "& section:not([class]), section:not([class]) > div:not([class])": {
137
- "& > :first-child": {
138
- marginBlockStart: "xxlarge",
139
- tabletDown: {
140
- marginBlockStart: "xlarge"
141
- }
142
- },
143
- "& > :last-child": {
144
- marginBlockEnd: "xxlarge",
145
- tabletDown: {
146
- marginBlockStart: "xlarge"
147
- }
148
- }
149
- }
150
- },
151
- // Adds default link styling to links without classes
152
- 'a:not([class]):not([data-unstyled]), a[class=""]:not([data-unstyled])': {
153
- color: "text.link",
154
- textDecoration: "underline",
155
- _hover: {
156
- textDecoration: "none"
157
- },
158
- _visited: {
159
- color: "text.linkVisited"
160
- }
161
- },
162
- ".codeblock": {
163
- border: "1px solid",
164
- borderColor: "stroke.subtle",
165
- borderLeft: "4px solid",
166
- borderLeftColor: "stroke.default",
167
- borderRadius: "xsmall",
168
- boxSizing: "border-box",
169
- overflowX: "auto",
170
- textStyle: "label.medium",
171
- fontFamily: "code",
172
- display: "block",
173
- whiteSpace: "pre",
174
- "& .linenumber": {
175
- display: "inline-block",
176
- paddingBlock: "0",
177
- paddingInline: "small",
178
- borderRight: "1px solid",
179
- borderColor: "stroke.subtle",
180
- width: "xxlarge",
181
- textAlign: "right",
182
- marginInlineEnd: "xsmall"
183
- },
184
- "& :nth-child(1 of .linenumber)": {
185
- paddingBlockStart: "xsmall"
186
- },
187
- "& :nth-last-child(1 of .linenumber)": {
188
- paddingBlockEnd: "xsmall"
189
- },
190
- // The remaining css is copied from the coy theme in prismjs. A lot of css is omitted due to styling clashes
191
- "& .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata": {
192
- color: "#7d8b99"
193
- },
194
- "& .token.punctuation": {
195
- color: "#5f6364"
196
- },
197
- "& .token.property, .token.tag, .token.boolean, .token.number, .token.function-name, .token.constant, .token.symbol, .token.deleted": {
198
- color: "#c92c2c"
199
- },
200
- "& .token.selector, .token.attr-name, .token.string, .token.char, .token.function, .token.builtin, .token.inserted": {
201
- color: "#2f9c0a"
202
- },
203
- "& .token.operator, .token.entity, .token.url, .token.variable": {
204
- color: "#a67f59",
205
- background: "rgba(255, 255, 255, 0.5)"
206
- },
207
- "& .token.atrule, .token.attr-value, .token.keyword, .token.class-name": {
208
- color: "#1990b8"
209
- },
210
- "& .token.regex, .token.important": {
211
- color: "#e90"
212
- },
213
- "& .language-css .token.string, .style .token.string": {
214
- color: "#a67f59",
215
- background: "rgba(255, 255, 255, 0.5)"
216
- },
217
- "& .token.important": {
218
- fontWeight: "normal"
219
- },
220
- "& .token.bold": {
221
- fontWeight: "bold"
222
- },
223
- "& .token.italic": {
224
- fontStyle: "italic"
225
- },
226
- "& .token.entity": {
227
- cursor: "help"
228
- },
229
- "& .token.namespace": {
230
- opacity: "0.7"
231
- }
232
- }
233
- });
149
+ //#endregion
150
+ exports.globalCss = globalCss;
151
+ //# sourceMappingURL=globalCss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalCss.js","names":[],"sources":["../src/globalCss.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { defineGlobalStyles } from \"@pandacss/dev\";\n\nexport const globalCss = defineGlobalStyles({\n \":root\": {\n // Applied to html in preflight (css reset)\n \"--global-font-body\": \"fonts.sans\",\n // Code, kbd, pre, samp\n \"--global-font-mono\": \"fonts.code\",\n },\n html: {\n minHeight: \"100%\",\n fontFeatureSettings: \"'ss03' on, 'liga' off, 'clig' off\",\n // this is included in the css reset we use. We don't want it.\n \"& h1, h2, h3, h4, h5, h6\": {\n textWrap: \"unset\",\n },\n },\n body: {\n background: \"background.default\",\n color: \"text.default\",\n },\n \"a, summary,[tabindex]:not([tabindex='-1'])\": {\n outline: \"none\",\n _focusVisible: {\n outline: \"3px\",\n borderRadius: \"xsmall\",\n outlineColor: \"stroke.default\",\n outlineOffset: \"3px\",\n outlineStyle: \"solid\",\n },\n },\n code: {\n background: \"background.subtle\",\n whiteSpace: \"pre-wrap\",\n },\n /* Hide default zendesk launcher so that we can provide our own. */\n \"iframe#launcher\": {\n display: \"none\",\n },\n // For future readers: Life here would be much simpler if we could use flex.\n // However, our usage of float within the article content forces us to use margins.\n \".ndla-article\": {\n h1: {\n textStyle: \"heading.medium\",\n },\n h2: {\n textStyle: \"heading.small\",\n },\n h3: {\n textStyle: \"title.medium\",\n },\n \"h4, h5, h6\": {\n textStyle: \"title.small\",\n },\n '& p[data-align=\"center\"]': {\n textAlign: \"center\",\n },\n // TODO: This is not an actual text style. Should it be?\n blockquote: {\n textStyle: \"body.medium\",\n fontFamily: \"serif\",\n },\n '& p:has(span[dir=\"rtl\"])': {\n direction: \"rtl\",\n },\n textStyle: \"body.article\",\n width: \"100%\",\n\n // Non-figure block elements that should have margin above and below.\n '& details, :not(li) > blockquote, [data-embed-type=\"expandable-box\"], [data-embed-type=\"framed-content\"], [data-embed-type=\"factbox\"], table, [data-embed-type=\"related-content-list\"], [data-embed-type=\"link-block-list\"], [data-embed-type=\"pitch\"], [data-embed-type=\"campaign-block\"], [data-embed-type=\"key-figure\"], [data-embed-type=\"grid\"], [data-embed-type=\"contact-block\"], [data-embed-type=\"file-list\"], [data-embed-type=\"uu-disclaimer\"]':\n {\n marginBlockStart: \"xxlarge\",\n marginBlockEnd: \"xxlarge\",\n tabletDown: {\n marginBlockStart: \"xlarge\",\n marginBlockEnd: \"xlarge\",\n },\n },\n\n // Article content is usually wrapped in a section. The rest of the elements in this list contains other elements, and should add margin to them no matter where they are placed in the DOM.\n '& section:not([class]), section:not([class]) > div:not([class]), [data-embed-type=\"framed-content\"], [data-embed-type=\"grid\"] > div, [data-embed-type=\"grid-parallax\"] > div, [data-embed-type=\"factbox\"] > div, [data-embed-type=\"copyright\"] > [data-copyright-content], [data-embed-type=\"uu-disclaimer\"] > [data-uu-content], [data-embed-wrapper], details, [data-embed-type=\"expandable-box\"], blockquote':\n {\n '& > :is(h2, [data-embed-type=\"copy-heading\"])': {\n marginBlockStart: \"xlarge\",\n marginBlockEnd: \"small\",\n tabletDown: {\n marginBlockStart: \"large\",\n },\n },\n \"& > h3\": {\n marginBlockStart: \"large\",\n marginBlockEnd: \"xsmall\",\n tabletDown: {\n marginBlockStart: \"medium\",\n },\n },\n \"& > :is(h4, h5, h6)\": {\n marginBlockStart: \"medium\",\n marginBlockEnd: \"xsmall\",\n tabletDown: {\n marginBlockStart: \"small\",\n },\n },\n \"& > :is(figure)\": {\n marginBlockStart: \"xxlarge\",\n marginBlockEnd: \"xxlarge\",\n tabletDown: {\n marginBlockStart: \"xlarge\",\n },\n },\n '& > :is(p, ul, ol, dl, [data-embed-type=\"speech\"])': {\n marginBlockStart: \"xsmall\",\n marginBlockEnd: \"xsmall\",\n },\n '& > :is([data-embed-type=\"ordered-list\"])': {\n marginInlineStart: \"xlarge!\",\n },\n },\n '& [data-embed-type=\"framed-content\"], [data-embed-type=\"grid\"] > div, [data-embed-type=\"grid-parallax\"] > div, [data-embed-type=\"factbox\"] > div, [data-embed-type=\"copyright\"] > [data-copyright-content], [data-embed-type=\"uu-disclaimer\"] > [data-uu-content], details, blockquote':\n {\n \"& > :first-child\": {\n marginBlockStart: \"0\",\n },\n \"& > :last-child\": {\n marginBlockEnd: \"0\",\n },\n },\n \"& section:not([class]), section:not([class]) > div:not([class])\": {\n \"& > :first-child\": {\n marginBlockStart: \"xxlarge\",\n tabletDown: {\n marginBlockStart: \"xlarge\",\n },\n },\n \"& > :last-child\": {\n marginBlockEnd: \"xxlarge\",\n tabletDown: {\n marginBlockStart: \"xlarge\",\n },\n },\n },\n },\n // Adds default link styling to links without classes\n 'a:not([class]):not([data-unstyled]), a[class=\"\"]:not([data-unstyled])': {\n color: \"text.link\",\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n _visited: {\n color: \"text.linkVisited\",\n },\n },\n \".codeblock\": {\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n borderLeft: \"4px solid\",\n borderLeftColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n boxSizing: \"border-box\",\n overflowX: \"auto\",\n textStyle: \"label.medium\",\n fontFamily: \"code\",\n display: \"block\",\n whiteSpace: \"pre\",\n \"& .linenumber\": {\n display: \"inline-block\",\n paddingBlock: \"0\",\n paddingInline: \"small\",\n borderRight: \"1px solid\",\n borderColor: \"stroke.subtle\",\n width: \"xxlarge\",\n textAlign: \"right\",\n marginInlineEnd: \"xsmall\",\n },\n \"& :nth-child(1 of .linenumber)\": {\n paddingBlockStart: \"xsmall\",\n },\n \"& :nth-last-child(1 of .linenumber)\": {\n paddingBlockEnd: \"xsmall\",\n },\n // The remaining css is copied from the coy theme in prismjs. A lot of css is omitted due to styling clashes. TODO: Consider moving this\n \"& .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata\": {\n color: \"#7d8b99\",\n },\n \"& .token.punctuation\": {\n color: \"#5f6364\",\n },\n \"& .token.property, .token.tag, .token.boolean, .token.number, .token.function-name, .token.constant, .token.symbol, .token.deleted\":\n {\n color: \"#c92c2c\",\n },\n \"& .token.selector, .token.attr-name, .token.string, .token.char, .token.function, .token.builtin, .token.inserted\":\n {\n color: \"#2f9c0a\",\n },\n \"& .token.operator, .token.entity, .token.url, .token.variable\": {\n color: \"#a67f59\",\n background: \"rgba(255, 255, 255, 0.5)\",\n },\n \"& .token.atrule, .token.attr-value, .token.keyword, .token.class-name\": {\n color: \"#1990b8\",\n },\n \"& .token.regex, .token.important\": {\n color: \"#e90\",\n },\n \"& .language-css .token.string, .style .token.string\": {\n color: \"#a67f59\",\n background: \"rgba(255, 255, 255, 0.5)\",\n },\n \"& .token.important\": {\n fontWeight: \"normal\",\n },\n \"& .token.bold\": {\n fontWeight: \"bold\",\n },\n \"& .token.italic\": {\n fontStyle: \"italic\",\n },\n \"& .token.entity\": {\n cursor: \"help\",\n },\n \"& .token.namespace\": {\n opacity: \"0.7\",\n },\n },\n});\n"],"mappings":";;;;AAUA,MAAa,YAAY,uCAAmB;CAC1C,SAAS;EAEP,sBAAsB;EAEtB,sBAAsB;CACvB;CACD,MAAM;EACJ,WAAW;EACX,qBAAqB;EAErB,4BAA4B,EAC1B,UAAU,QACX;CACF;CACD,MAAM;EACJ,YAAY;EACZ,OAAO;CACR;CACD,8CAA8C;EAC5C,SAAS;EACT,eAAe;GACb,SAAS;GACT,cAAc;GACd,cAAc;GACd,eAAe;GACf,cAAc;EACf;CACF;CACD,MAAM;EACJ,YAAY;EACZ,YAAY;CACb;CAED,mBAAmB,EACjB,SAAS,OACV;CAGD,iBAAiB;EACf,IAAI,EACF,WAAW,iBACZ;EACD,IAAI,EACF,WAAW,gBACZ;EACD,IAAI,EACF,WAAW,eACZ;EACD,cAAc,EACZ,WAAW,cACZ;EACD,8BAA4B,EAC1B,WAAW,SACZ;EAED,YAAY;GACV,WAAW;GACX,YAAY;EACb;EACD,8BAA4B,EAC1B,WAAW,MACZ;EACD,WAAW;EACX,OAAO;EAGP,qdACE;GACE,kBAAkB;GAClB,gBAAgB;GAChB,YAAY;IACV,kBAAkB;IAClB,gBAAgB;GACjB;EACF;EAGH,iaACE;GACE,mDAAiD;IAC/C,kBAAkB;IAClB,gBAAgB;IAChB,YAAY,EACV,kBAAkB,QACnB;GACF;GACD,UAAU;IACR,kBAAkB;IAClB,gBAAgB;IAChB,YAAY,EACV,kBAAkB,SACnB;GACF;GACD,uBAAuB;IACrB,kBAAkB;IAClB,gBAAgB;IAChB,YAAY,EACV,kBAAkB,QACnB;GACF;GACD,mBAAmB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,YAAY,EACV,kBAAkB,SACnB;GACF;GACD,wDAAsD;IACpD,kBAAkB;IAClB,gBAAgB;GACjB;GACD,+CAA6C,EAC3C,mBAAmB,UACpB;EACF;EACH,sSACE;GACE,oBAAoB,EAClB,kBAAkB,IACnB;GACD,mBAAmB,EACjB,gBAAgB,IACjB;EACF;EACH,mEAAmE;GACjE,oBAAoB;IAClB,kBAAkB;IAClB,YAAY,EACV,kBAAkB,SACnB;GACF;GACD,mBAAmB;IACjB,gBAAgB;IAChB,YAAY,EACV,kBAAkB,SACnB;GACF;EACF;CACF;CAED,2EAAyE;EACvE,OAAO;EACP,gBAAgB;EAChB,QAAQ,EACN,gBAAgB,OACjB;EACD,UAAU,EACR,OAAO,mBACR;CACF;CACD,cAAc;EACZ,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,iBAAiB;EACjB,cAAc;EACd,WAAW;EACX,WAAW;EACX,WAAW;EACX,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,iBAAiB;GACf,SAAS;GACT,cAAc;GACd,eAAe;GACf,aAAa;GACb,aAAa;GACb,OAAO;GACP,WAAW;GACX,iBAAiB;EAClB;EACD,kCAAkC,EAChC,mBAAmB,SACpB;EACD,uCAAuC,EACrC,iBAAiB,SAClB;EAED,uFAAuF,EACrF,OAAO,UACR;EACD,wBAAwB,EACtB,OAAO,UACR;EACD,sIACE,EACE,OAAO,UACR;EACH,qHACE,EACE,OAAO,UACR;EACH,iEAAiE;GAC/D,OAAO;GACP,YAAY;EACb;EACD,yEAAyE,EACvE,OAAO,UACR;EACD,oCAAoC,EAClC,OAAO,OACR;EACD,uDAAuD;GACrD,OAAO;GACP,YAAY;EACb;EACD,sBAAsB,EACpB,YAAY,SACb;EACD,iBAAiB,EACf,YAAY,OACb;EACD,mBAAmB,EACjB,WAAW,SACZ;EACD,mBAAmB,EACjB,QAAQ,OACT;EACD,sBAAsB,EACpB,SAAS,MACV;CACF;AACF,EAAC"}
package/lib/index.js CHANGED
@@ -1,61 +1,50 @@
1
- "use strict";
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
3
+ const require_animations = require('./animations.js');
4
+ const require_boxShadows = require('./boxShadows.js');
5
+ const require_colors = require('./colors.js');
6
+ const require_conditions = require('./conditions.js');
7
+ const require_globalCss = require('./globalCss.js');
8
+ const require_radii = require('./radii.js');
9
+ const require_semanticTokens = require('./semanticTokens.js');
10
+ const require_spacing = require('./spacing.js');
11
+ const require_typography = require('./typography.js');
12
+ const require_zIndex = require('./zIndex.js');
13
+ const require_forwardCssPropPlugin = require('./plugins/forwardCssPropPlugin.js');
14
+ const __pandacss_dev = require_rolldown_runtime.__toESM(require("@pandacss/dev"));
15
+ const __ndla_core = require_rolldown_runtime.__toESM(require("@ndla/core"));
2
16
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
17
+ //#region src/index.ts
18
+ const preset = (0, __pandacss_dev.definePreset)({
19
+ name: "ndla/panda",
20
+ globalCss: require_globalCss.globalCss,
21
+ conditions: require_conditions.conditions,
22
+ theme: {
23
+ breakpoints: __ndla_core.breakpoints,
24
+ textStyles: require_typography.textStyles,
25
+ keyframes: require_animations.keyframes,
26
+ tokens: {
27
+ colors: require_colors.colors,
28
+ easings: require_animations.easings,
29
+ durations: require_animations.durations,
30
+ radii: require_radii.radii,
31
+ spacing: require_spacing.spacing,
32
+ sizes: require_spacing.spacing,
33
+ lineHeights: require_typography.lineHeights,
34
+ fontWeights: require_typography.fontWeights,
35
+ fontSizes: require_typography.fontSizes,
36
+ fonts: require_typography.fonts,
37
+ animations: require_animations.animations,
38
+ shadows: require_boxShadows.boxShadows,
39
+ zIndex: require_zIndex.zIndex
40
+ },
41
+ semanticTokens: require_semanticTokens.semanticTokens,
42
+ containerSizes: __ndla_core.breakpoints
43
+ }
5
44
  });
6
- exports.default = void 0;
7
- Object.defineProperty(exports, "forwardCssPropPlugin", {
8
- enumerable: true,
9
- get: function () {
10
- return _forwardCssPropPlugin.forwardCssPropPlugin;
11
- }
12
- });
13
- var _dev = require("@pandacss/dev");
14
- var _core = require("@ndla/core");
15
- var _animations = require("./animations");
16
- var _boxShadows = require("./boxShadows");
17
- var _colors = require("./colors");
18
- var _conditions = require("./conditions");
19
- var _globalCss = require("./globalCss");
20
- var _radii = require("./radii");
21
- var _semanticTokens = require("./semanticTokens");
22
- var _spacing = require("./spacing");
23
- var _typography = require("./typography");
24
- var _zIndex = require("./zIndex");
25
- var _forwardCssPropPlugin = require("./plugins/forwardCssPropPlugin");
26
- /**
27
- * Copyright (c) 2024-present, NDLA.
28
- *
29
- * This source code is licensed under the GPLv3 license found in the
30
- * LICENSE file in the root directory of this source tree.
31
- *
32
- */
45
+ var src_default = preset;
33
46
 
34
- const preset = (0, _dev.definePreset)({
35
- name: "ndla/panda",
36
- globalCss: _globalCss.globalCss,
37
- conditions: _conditions.conditions,
38
- theme: {
39
- breakpoints: _core.breakpoints,
40
- textStyles: _typography.textStyles,
41
- keyframes: _animations.keyframes,
42
- tokens: {
43
- colors: _colors.colors,
44
- easings: _animations.easings,
45
- durations: _animations.durations,
46
- radii: _radii.radii,
47
- spacing: _spacing.spacing,
48
- sizes: _spacing.spacing,
49
- lineHeights: _typography.lineHeights,
50
- fontWeights: _typography.fontWeights,
51
- fontSizes: _typography.fontSizes,
52
- fonts: _typography.fonts,
53
- animations: _animations.animations,
54
- shadows: _boxShadows.boxShadows,
55
- zIndex: _zIndex.zIndex
56
- },
57
- semanticTokens: _semanticTokens.semanticTokens,
58
- containerSizes: _core.breakpoints
59
- }
60
- });
61
- var _default = exports.default = preset;
47
+ //#endregion
48
+ exports.default = src_default;
49
+ exports.forwardCssPropPlugin = require_forwardCssPropPlugin.forwardCssPropPlugin;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["globalCss","conditions","breakpoints","textStyles","keyframes","colors","easings","durations","radii","spacing","lineHeights","fontWeights","fontSizes","fonts","animations","boxShadows","zIndex","semanticTokens"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { definePreset } from \"@pandacss/dev\";\nimport { breakpoints } from \"@ndla/core\";\nimport { animations, durations, easings, keyframes } from \"./animations\";\nimport { boxShadows } from \"./boxShadows\";\nimport { colors } from \"./colors\";\nimport { conditions } from \"./conditions\";\nimport { globalCss } from \"./globalCss\";\nimport { radii } from \"./radii\";\nimport { semanticTokens } from \"./semanticTokens\";\nimport { spacing } from \"./spacing\";\nimport { fontWeights, textStyles, fonts, fontSizes, lineHeights } from \"./typography\";\nimport { zIndex } from \"./zIndex\";\n\nconst preset = definePreset({\n name: \"ndla/panda\",\n globalCss: globalCss,\n conditions: conditions,\n theme: {\n breakpoints: breakpoints,\n textStyles: textStyles,\n keyframes: keyframes,\n tokens: {\n colors: colors,\n easings: easings,\n durations: durations,\n radii: radii,\n spacing: spacing,\n sizes: spacing,\n lineHeights: lineHeights,\n fontWeights: fontWeights,\n fontSizes: fontSizes,\n fonts: fonts,\n animations: animations,\n shadows: boxShadows,\n zIndex: zIndex,\n },\n semanticTokens: semanticTokens,\n containerSizes: breakpoints,\n },\n});\n\nexport { forwardCssPropPlugin } from \"./plugins/forwardCssPropPlugin\";\n\nexport default preset;\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAAM,SAAS,iCAAa;CAC1B,MAAM;CACN,WAAWA;CACX,YAAYC;CACZ,OAAO;EACL,aAAaC;EACb,YAAYC;EACZ,WAAWC;EACX,QAAQ;GACN,QAAQC;GACR,SAASC;GACT,WAAWC;GACX,OAAOC;GACP,SAASC;GACT,OAAOA;GACP,aAAaC;GACb,aAAaC;GACb,WAAWC;GACX,OAAOC;GACP,YAAYC;GACZ,SAASC;GACT,QAAQC;EACT;EACD,gBAAgBC;EAChB,gBAAgBf;CACjB;AACF,EAAC;AAIF,kBAAe"}
@@ -1,63 +1,46 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.transformStyledFn = exports.forwardCssPropPlugin = void 0;
7
- /**
8
- * Copyright (c) 2024-present, NDLA.
9
- *
10
- * This source code is licensed under the GPLv3 license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- *
13
- */
14
1
 
2
+ //#region src/plugins/forwardCssPropPlugin.ts
15
3
  const supportedJsxFrameworks = ["react"];
16
4
  const forwardCssPropPlugin = () => {
17
- return {
18
- name: "forward-css-prop",
19
- hooks: {
20
- "config:resolved": args => {
21
- const jsxFramework = args.config.jsxFramework;
22
- if (!supportedJsxFrameworks.includes(jsxFramework)) {
23
- throw new Error(`[plugin:restrict-styled-props]: Unsupported jsxFramework: ${jsxFramework}. This Panda plugin only supports: ${supportedJsxFrameworks.join(", ")}`);
24
- }
25
- },
26
- "codegen:prepare": args => {
27
- return transformStyledFn(args);
28
- }
29
- }
30
- };
5
+ return {
6
+ name: "forward-css-prop",
7
+ hooks: {
8
+ "config:resolved": (args) => {
9
+ const jsxFramework = args.config.jsxFramework;
10
+ if (!supportedJsxFrameworks.includes(jsxFramework)) throw new Error(`[plugin:restrict-styled-props]: Unsupported jsxFramework: ${jsxFramework}. This Panda plugin only supports: ${supportedJsxFrameworks.join(", ")}`);
11
+ },
12
+ "codegen:prepare": (args) => {
13
+ return transformStyledFn(args);
14
+ }
15
+ }
16
+ };
31
17
  };
32
- exports.forwardCssPropPlugin = forwardCssPropPlugin;
33
- const transformStyledFn = args => {
34
- const factoryArtifact = args.artifacts.find(art => art.id === "jsx-factory");
35
- const factoryJs = factoryArtifact?.files.find(f => f.file.includes(".mjs") || f.file.includes(".js"));
36
- const jsxTypes = args.artifacts.find(art => art.id === "types-jsx")?.files.find(f => f.file.includes("jsx"));
37
- const systemTypes = args.artifacts.find(art => art.id === "types-gen-system")?.files.find(f => f.file.includes("system-types"));
38
- if (!factoryJs?.code || !jsxTypes?.code || !systemTypes?.code) {
39
- return args.artifacts;
40
- }
41
- const baseCode = "const __base__ = Dynamic.__base__ || Dynamic";
42
- factoryJs.code = factoryJs.code.replace(baseCode, `${baseCode}
18
+ const transformStyledFn = (args) => {
19
+ const factoryArtifact = args.artifacts.find((art) => art.id === "jsx-factory");
20
+ const factoryJs = factoryArtifact?.files.find((f) => f.file.includes(".mjs") || f.file.includes(".js"));
21
+ const jsxTypes = args.artifacts.find((art) => art.id === "types-jsx")?.files.find((f) => f.file.includes("jsx"));
22
+ const systemTypes = args.artifacts.find((art) => art.id === "types-gen-system")?.files.find((f) => f.file.includes("system-types"));
23
+ if (!factoryJs?.code || !jsxTypes?.code || !systemTypes?.code) return args.artifacts;
24
+ const baseCode = "const __base__ = Dynamic.__base__ || Dynamic";
25
+ factoryJs.code = factoryJs.code.replace(baseCode, `${baseCode}
43
26
  const contextConsume = options.baseComponent || Dynamic.__base__ || typeof Dynamic === "string"`);
44
- const propsCode = "const { as: Element = __base__, children, ...restProps } = props";
45
- factoryJs.code = factoryJs.code.replace(propsCode, `const { as: Element = __base__, consumeCss, children, ...restProps } = props
27
+ const propsCode = "const { as: Element = __base__, children, ...restProps } = props";
28
+ factoryJs.code = factoryJs.code.replace(propsCode, `const { as: Element = __base__, consumeCss, children, ...restProps } = props
46
29
 
47
30
  const consume = props.asChild
48
31
  ? consumeCss && (options.baseComponent || Dynamic.__baseComponent__)
49
32
  : consumeCss || contextConsume`);
50
- const cvaCode = "const cvaStyles = __cvaFn__.raw(variantProps)";
51
- factoryJs.code = factoryJs.code.replace(cvaCode, `${cvaCode}
33
+ const cvaCode = "const cvaStyles = __cvaFn__.raw(variantProps)";
34
+ factoryJs.code = factoryJs.code.replace(cvaCode, `${cvaCode}
52
35
  if(!consume) {
53
36
  return css.raw(cvaStyles, propStyles, cssStyles)
54
37
  }`);
55
- factoryJs.code = factoryJs.code.replace("className: classes()", `...(consume ? { className: classes() } : { css: classes(), consumeCss } )`);
56
- const styledComponentForwardPropDeclaration = `StyledComponent.__shouldForwardProps__ = shouldForwardProp`;
57
- factoryJs.code = factoryJs.code.replace(styledComponentForwardPropDeclaration, `${styledComponentForwardPropDeclaration}
38
+ factoryJs.code = factoryJs.code.replace("className: classes()", `...(consume ? { className: classes() } : { css: classes(), consumeCss } )`);
39
+ const styledComponentForwardPropDeclaration = `StyledComponent.__shouldForwardProps__ = shouldForwardProp`;
40
+ factoryJs.code = factoryJs.code.replace(styledComponentForwardPropDeclaration, `${styledComponentForwardPropDeclaration}
58
41
  StyledComponent.__baseComponent__ = options.baseComponent || Dynamic.__baseComponent__`);
59
- const shouldForwardPropCode = "shouldForwardProp?(prop: string, variantKeys: string[]): boolean";
60
- jsxTypes.code = jsxTypes.code.replace(shouldForwardPropCode, `${shouldForwardPropCode}
42
+ const shouldForwardPropCode = "shouldForwardProp?(prop: string, variantKeys: string[]): boolean";
43
+ jsxTypes.code = jsxTypes.code.replace(shouldForwardPropCode, `${shouldForwardPropCode}
61
44
  /**
62
45
  * Used when creating styled components from React components that do not support the css prop. If true, the css prop will be consumed and converted to \`className\`
63
46
  * @example
@@ -66,8 +49,8 @@ const transformStyledFn = args => {
66
49
  * const Button = styled(ark.button, { baseComponent: true })
67
50
  */
68
51
  baseComponent?: boolean`);
69
- const jsxStylePropsCode = "export type JsxStyleProps =";
70
- systemTypes.code = systemTypes.code.replace(jsxStylePropsCode, `${jsxStylePropsCode} {
52
+ const jsxStylePropsCode = "export type JsxStyleProps =";
53
+ systemTypes.code = systemTypes.code.replace(jsxStylePropsCode, `${jsxStylePropsCode} {
71
54
  /**
72
55
  * Tells a component to consume the \`css\` prop and turn it into a \`className\` prop. This is only used in conjunction with the \`baseComponent\` prop in the \`styled\` function to ensure that components that are \`asChild\`-ed onto non-panda components can consume their css before being merged with their child.
73
56
  * @example
@@ -83,6 +66,9 @@ const transformStyledFn = args => {
83
66
  */
84
67
  consumeCss?: boolean
85
68
  } & `);
86
- return args.artifacts;
69
+ return args.artifacts;
87
70
  };
88
- exports.transformStyledFn = transformStyledFn;
71
+
72
+ //#endregion
73
+ exports.forwardCssPropPlugin = forwardCssPropPlugin;
74
+ //# sourceMappingURL=forwardCssPropPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forwardCssPropPlugin.js","names":["args: CodegenPrepareHookArgs"],"sources":["../../src/plugins/forwardCssPropPlugin.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport type { CodegenPrepareHookArgs, PandaPlugin } from \"@pandacss/types\";\n\nconst supportedJsxFrameworks = [\"react\"];\n\nexport const forwardCssPropPlugin = (): PandaPlugin => {\n return {\n name: \"forward-css-prop\",\n hooks: {\n \"config:resolved\": (args) => {\n const jsxFramework = args.config.jsxFramework;\n if (!supportedJsxFrameworks.includes(jsxFramework as string)) {\n throw new Error(\n `[plugin:restrict-styled-props]: Unsupported jsxFramework: ${jsxFramework}. This Panda plugin only supports: ${supportedJsxFrameworks.join(\", \")}`,\n );\n }\n },\n \"codegen:prepare\": (args) => {\n return transformStyledFn(args);\n },\n },\n };\n};\n\nexport const transformStyledFn = (args: CodegenPrepareHookArgs) => {\n const factoryArtifact = args.artifacts.find((art) => art.id === \"jsx-factory\");\n const factoryJs = factoryArtifact?.files.find((f) => f.file.includes(\".mjs\") || f.file.includes(\".js\"));\n const jsxTypes = args.artifacts.find((art) => art.id === \"types-jsx\")?.files.find((f) => f.file.includes(\"jsx\"));\n const systemTypes = args.artifacts\n .find((art) => art.id === \"types-gen-system\")\n ?.files.find((f) => f.file.includes(\"system-types\"));\n\n if (!factoryJs?.code || !jsxTypes?.code || !systemTypes?.code) {\n return args.artifacts;\n }\n\n const baseCode = \"const __base__ = Dynamic.__base__ || Dynamic\";\n\n factoryJs.code = factoryJs.code.replace(\n baseCode,\n `${baseCode}\n const contextConsume = options.baseComponent || Dynamic.__base__ || typeof Dynamic === \"string\"`,\n );\n\n const propsCode = \"const { as: Element = __base__, children, ...restProps } = props\";\n\n factoryJs.code = factoryJs.code.replace(\n propsCode,\n `const { as: Element = __base__, consumeCss, children, ...restProps } = props\n\n const consume = props.asChild\n ? consumeCss && (options.baseComponent || Dynamic.__baseComponent__)\n : consumeCss || contextConsume`,\n );\n\n const cvaCode = \"const cvaStyles = __cvaFn__.raw(variantProps)\";\n\n factoryJs.code = factoryJs.code.replace(\n cvaCode,\n `${cvaCode}\n if(!consume) {\n return css.raw(cvaStyles, propStyles, cssStyles)\n }`,\n );\n\n factoryJs.code = factoryJs.code.replace(\n \"className: classes()\",\n `...(consume ? { className: classes() } : { css: classes(), consumeCss } )`,\n );\n\n const styledComponentForwardPropDeclaration = `StyledComponent.__shouldForwardProps__ = shouldForwardProp`;\n\n factoryJs.code = factoryJs.code.replace(\n styledComponentForwardPropDeclaration,\n `${styledComponentForwardPropDeclaration}\n StyledComponent.__baseComponent__ = options.baseComponent || Dynamic.__baseComponent__`,\n );\n\n const shouldForwardPropCode = \"shouldForwardProp?(prop: string, variantKeys: string[]): boolean\";\n\n jsxTypes.code = jsxTypes.code.replace(\n shouldForwardPropCode,\n `${shouldForwardPropCode}\n /**\n * Used when creating styled components from React components that do not support the css prop. If true, the css prop will be consumed and converted to \\`className\\` \n * @example\n * import { ark } from \"@ark-ui/react\"\n * import { styled } from \"@ndla/styled-system/jsx\"\n * const Button = styled(ark.button, { baseComponent: true })\n */\n baseComponent?: boolean`,\n );\n\n const jsxStylePropsCode = \"export type JsxStyleProps =\";\n\n systemTypes.code = systemTypes.code.replace(\n jsxStylePropsCode,\n `${jsxStylePropsCode} { \n /**\n * Tells a component to consume the \\`css\\` prop and turn it into a \\`className\\` prop. This is only used in conjunction with the \\`baseComponent\\` prop in the \\`styled\\` function to ensure that components that are \\`asChild\\`-ed onto non-panda components can consume their css before being merged with their child.\n * @example\n * import { ark } from \"@ark-ui/react\"\n * import { styled } from \"@ndla/styled-system/jsx\"\n * const Button = styled('button', { baseComponent: true })\n *\n * return (\n * <Button asChild consumeCss>\n * <div>Click me</div>\n * </Button>\n * )\n */\n consumeCss?: boolean \n } & `,\n );\n\n return args.artifacts;\n};\n"],"mappings":";;AAUA,MAAM,yBAAyB,CAAC,OAAQ;AAExC,MAAa,uBAAuB,MAAmB;AACrD,QAAO;EACL,MAAM;EACN,OAAO;GACL,mBAAmB,CAAC,SAAS;IAC3B,MAAM,eAAe,KAAK,OAAO;AACjC,SAAK,uBAAuB,SAAS,aAAuB,CAC1D,OAAM,IAAI,OACP,4DAA4D,aAAa,qCAAqC,uBAAuB,KAAK,KAAK,CAAC;GAGtJ;GACD,mBAAmB,CAAC,SAAS;AAC3B,WAAO,kBAAkB,KAAK;GAC/B;EACF;CACF;AACF;AAED,MAAa,oBAAoB,CAACA,SAAiC;CACjE,MAAM,kBAAkB,KAAK,UAAU,KAAK,CAAC,QAAQ,IAAI,OAAO,cAAc;CAC9E,MAAM,YAAY,iBAAiB,MAAM,KAAK,CAAC,MAAM,EAAE,KAAK,SAAS,OAAO,IAAI,EAAE,KAAK,SAAS,MAAM,CAAC;CACvG,MAAM,WAAW,KAAK,UAAU,KAAK,CAAC,QAAQ,IAAI,OAAO,YAAY,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM,CAAC;CAChH,MAAM,cAAc,KAAK,UACtB,KAAK,CAAC,QAAQ,IAAI,OAAO,mBAAmB,EAC3C,MAAM,KAAK,CAAC,MAAM,EAAE,KAAK,SAAS,eAAe,CAAC;AAEtD,MAAK,WAAW,SAAS,UAAU,SAAS,aAAa,KACvD,QAAO,KAAK;CAGd,MAAM,WAAW;AAEjB,WAAU,OAAO,UAAU,KAAK,QAC9B,WACC,EAAE,SAAS;mGAEb;CAED,MAAM,YAAY;AAElB,WAAU,OAAO,UAAU,KAAK,QAC9B,YACC;;;;sCAKF;CAED,MAAM,UAAU;AAEhB,WAAU,OAAO,UAAU,KAAK,QAC9B,UACC,EAAE,QAAQ;;;SAIZ;AAED,WAAU,OAAO,UAAU,KAAK,QAC9B,yBACC,2EACF;CAED,MAAM,yCAAyC;AAE/C,WAAU,OAAO,UAAU,KAAK,QAC9B,wCACC,EAAE,sCAAsC;0FAE1C;CAED,MAAM,wBAAwB;AAE9B,UAAS,OAAO,SAAS,KAAK,QAC5B,wBACC,EAAE,sBAAsB;;;;;;;;2BAS1B;CAED,MAAM,oBAAoB;AAE1B,aAAY,OAAO,YAAY,KAAK,QAClC,oBACC,EAAE,kBAAkB;;;;;;;;;;;;;;;QAgBtB;AAED,QAAO,KAAK;AACb"}