@zazz-ui/core 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/AUTHORING.md +5 -3
  2. package/CHANGELOG.md +38 -0
  3. package/README.md +3 -3
  4. package/dist/csp-D72qtdXZ.js +1 -0
  5. package/dist/sri.json +54 -49
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +312 -24
  9. package/editor/zazz.language-data.json +9 -9
  10. package/editor/zazz.lint-data.json +2028 -0
  11. package/package.json +1 -1
  12. package/src/base/_defaults.css +367 -0
  13. package/src/base/_layers.css +6 -2
  14. package/src/base/_properties-2xl.css +8 -2
  15. package/src/base/_properties-active.css +12 -0
  16. package/src/base/_properties-checked.css +12 -0
  17. package/src/base/_properties-current.css +12 -0
  18. package/src/base/_properties-disabled.css +12 -0
  19. package/src/base/_properties-focus-visible.css +12 -0
  20. package/src/base/_properties-focus-within.css +12 -0
  21. package/src/base/_properties-hover.css +12 -0
  22. package/src/base/_properties-lg.css +8 -2
  23. package/src/base/_properties-md.css +8 -2
  24. package/src/base/_properties-open.css +12 -0
  25. package/src/base/_properties-sm.css +8 -2
  26. package/src/base/_properties-starting.css +6 -0
  27. package/src/base/_properties-stuck.css +6 -0
  28. package/src/base/_properties-xl.css +8 -2
  29. package/src/base/_properties.css +12 -3
  30. package/src/base/_utilities-box.css +0 -15
  31. package/src/base/_utilities-effects.css +0 -15
  32. package/src/base/_utilities-flow.css +79 -68
  33. package/src/base/_utilities-grid.css +20 -32
  34. package/src/base/_utilities-sizing.css +0 -3
  35. package/src/base/_utilities-spacing.css +36 -11
  36. package/src/base/_utilities-tier-2xl.css +4 -1
  37. package/src/base/_utilities-tier-active.css +6 -0
  38. package/src/base/_utilities-tier-checked.css +6 -0
  39. package/src/base/_utilities-tier-current.css +6 -0
  40. package/src/base/_utilities-tier-disabled.css +6 -0
  41. package/src/base/_utilities-tier-focus-visible.css +6 -0
  42. package/src/base/_utilities-tier-focus-within.css +6 -0
  43. package/src/base/_utilities-tier-hover.css +6 -0
  44. package/src/base/_utilities-tier-lg.css +4 -1
  45. package/src/base/_utilities-tier-md.css +4 -1
  46. package/src/base/_utilities-tier-open.css +6 -0
  47. package/src/base/_utilities-tier-sm.css +4 -1
  48. package/src/base/_utilities-tier-starting.css +3 -0
  49. package/src/base/_utilities-tier-stuck.css +3 -0
  50. package/src/base/_utilities-tier-xl.css +4 -1
  51. package/src/base/_utilities-typography.css +0 -9
  52. package/src/base/csp.d.ts +19 -0
  53. package/src/base/csp.d.ts.map +1 -0
  54. package/src/base/csp.js +131 -0
  55. package/src/base/csp.ts +137 -0
  56. package/src/base/declarations.d.ts +36 -0
  57. package/src/base/declarations.d.ts.map +1 -0
  58. package/src/base/declarations.js +70 -0
  59. package/src/base/declarations.ts +97 -0
  60. package/src/base/kit-styling.d.ts +11 -0
  61. package/src/base/kit-styling.d.ts.map +1 -0
  62. package/src/base/kit-styling.js +467 -0
  63. package/src/base/kit-styling.ts +470 -0
  64. package/src/base/style-format.d.ts +3 -22
  65. package/src/base/style-format.d.ts.map +1 -1
  66. package/src/base/style-format.js +4 -62
  67. package/src/base/style-format.ts +4 -71
  68. package/src/base/utilities.d.ts +14 -6
  69. package/src/base/utilities.d.ts.map +1 -1
  70. package/src/base/utilities.js +81 -29
  71. package/src/base/utilities.ts +92 -38
  72. package/src/head.d.ts +6 -0
  73. package/src/head.d.ts.map +1 -1
  74. package/src/head.js +21 -14
  75. package/src/head.ts +38 -11
  76. package/src/index.css +1 -0
  77. package/src/index.js +22 -0
  78. package/src/index.ts +19 -0
  79. package/src/manifest.d.ts +21 -1
  80. package/src/manifest.d.ts.map +1 -1
  81. package/src/manifest.js +12 -2
  82. package/src/manifest.ts +27 -2
  83. package/src/primitives/debug/audit-core.d.ts +9 -1
  84. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  85. package/src/primitives/debug/audit-core.js +58 -8
  86. package/src/primitives/debug/audit-core.ts +84 -7
  87. package/src/primitives/debug/debug.d.ts +0 -15
  88. package/src/primitives/debug/debug.d.ts.map +1 -1
  89. package/src/primitives/debug/debug.js +11 -2
  90. package/src/primitives/debug/debug.ts +12 -1
  91. package/src/primitives/prose/prose.html +3 -3
  92. package/src/primitives/table/table-size-sm.html +12 -12
  93. package/src/primitives/utilities/aspect-ratio.html +1 -0
  94. package/src/primitives/utilities/margin-auto.html +1 -1
  95. package/src/primitives/utilities/overflow.html +5 -6
  96. package/src/primitives/utilities/position.html +1 -1
  97. package/src/primitives/utilities/width.html +2 -1
@@ -0,0 +1,470 @@
1
+ // Generated by scripts/generate-utilities.ts from the kit's stylesheets — do not edit.
2
+
3
+ /** Every selector below, once (rule selectors without state pseudo-classes); the records index it. */
4
+ export const KIT_SELECTORS: readonly string[] = [
5
+ ":is([data-reveal], [data-reveal-each] > *)",
6
+ ":is([data-reveal]:not([data-gjs-type]), [data-reveal-each]:not([data-gjs-type]) > :not([data-gjs-type]))",
7
+ ':is([data-ui~="field-group"], [data-ui~="radio-group"])',
8
+ ':is([data-ui~="field-group"], [data-ui~="radio-group"]) > legend',
9
+ ':is([style*="--shadow-hue:"], [style*="--shadow-angle"])',
10
+ ":is(blockquote > cite)",
11
+ ":is(dl > dd)",
12
+ ':is(h1, [data-ui~="text-h1"])',
13
+ ':is(h2, [data-ui~="text-h2"])',
14
+ ':is(h3, [data-ui~="text-h3"])',
15
+ ':is(h4, [data-ui~="text-h4"])',
16
+ ':is(h5, [data-ui~="text-h5"])',
17
+ ':is(h6, [data-ui~="text-h6"])',
18
+ ":is(header, footer, section, article)",
19
+ ':is(input[type="checkbox"]:not([role="switch"]), input[type="checkbox"]:not([role="switch"]))',
20
+ ":is(progress, meter)",
21
+ ":is(sub, sup)",
22
+ ':is(ui-accordion, [data-ui~="accordion"])',
23
+ ':is(ui-accordion, [data-ui~="accordion"]) > details',
24
+ ':is(ui-accordion, [data-ui~="accordion"]) > details > summary',
25
+ ':is(ui-accordion, [data-ui~="accordion"]) summary > [data-accordion-slot="marker"]',
26
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="empty"]',
27
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="group"]',
28
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="group-label"]',
29
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="list"]',
30
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="panel"]',
31
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="panel"]:not([popover])',
32
+ ':is(ui-autocomplete, [data-ui~="autocomplete"]) input[role="combobox"]',
33
+ ':is(ui-button-group, [data-ui~="button-group"])',
34
+ ':is(ui-button-group, [data-ui~="button-group"]) > *',
35
+ ':is(ui-carousel, [data-ui~="carousel"])',
36
+ ':is(ui-carousel, [data-ui~="carousel"]) [data-carousel-slot~="container"]',
37
+ ':is(ui-carousel, [data-ui~="carousel"]) [data-carousel-slot~="slide"]',
38
+ ':is(ui-carousel, [data-ui~="carousel"]) [data-carousel-slot~="thumbs"] [data-carousel-slot~="slide"]',
39
+ ':is(ui-combobox, [data-ui~="combobox"])',
40
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"]',
41
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"] input',
42
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"]:has(> [data-combobox-slot~="tag"])',
43
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="empty"]',
44
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="group"]',
45
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="group-label"]',
46
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="list"]',
47
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"]',
48
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"]:not([popover])',
49
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]',
50
+ ':is(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="trigger"]',
51
+ ':is(ui-command, [data-ui~="command"]) > :is([popovertarget], [command])',
52
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="empty"]',
53
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="footer"]',
54
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="group"]',
55
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="group-label"]',
56
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="header"]',
57
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="header"] > [data-ui~="button"]',
58
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="input"]',
59
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="list"]',
60
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]',
61
+ ':is(ui-command, [data-ui~="command"]) [data-command-slot~="panel"][popover]',
62
+ ':is(ui-command, [data-ui~="command"]) dialog[data-command-slot~="panel"]',
63
+ ':is(ui-kbd-group, [data-ui~="kbd-group"])',
64
+ ':is(ui-layout, [data-ui~="layout"])',
65
+ ':is(ui-layout, [data-ui~="layout"]) > *',
66
+ ':is(ui-layout, [data-ui~="layout"]) > :is(ui-layout, [data-ui~="layout"])',
67
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="close"]',
68
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="counter"]',
69
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] :is(ui-carousel, [data-ui~="carousel"])',
70
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-dialog-slot~="content"]',
71
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="content"]',
72
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="slide"]',
73
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="slide"] img',
74
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="slide"][data-carousel-state~="in-view"][data-carousel-state~="snapped"] img',
75
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="thumb"]',
76
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="thumbs"]',
77
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] [data-lightbox-slot~="thumbs"] [data-carousel-slot~="container"]',
78
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="next"]',
79
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="prev"]',
80
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"]',
81
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] > [data-carousel-slot~="viewport"]',
82
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="content"]',
83
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="slide"]',
84
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="slide"] img',
85
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="thumbs"]',
86
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="thumbs"] [data-carousel-slot~="container"]',
87
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="stage"] [data-lightbox-slot~="thumbs"] [data-carousel-slot~="viewport"]',
88
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumb"] img',
89
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumb"][data-carousel-state~="active"] img',
90
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumb-content"]',
91
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumbs"]',
92
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumbs"] [data-carousel-slot~="container"]',
93
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumbs-next"]',
94
+ ':is(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="thumbs-prev"]',
95
+ ':is(ui-menu, [data-ui~="menu"])',
96
+ ':is(ui-menu, [data-ui~="menu"]) > :is([popovertarget], [interestfor])',
97
+ ':is(ui-menu, [data-ui~="menu"]) [data-menu-slot~="popover"]',
98
+ ':is(ui-multiselect, [data-ui~="multiselect"])',
99
+ ':is(ui-multiselect, [data-ui~="multiselect"]) [data-multiselect-slot~="icon"]',
100
+ ':is(ui-multiselect, [data-ui~="multiselect"]) [data-multiselect-slot~="option"]',
101
+ ':is(ui-multiselect, [data-ui~="multiselect"]) [data-multiselect-slot~="option"] input[type="checkbox"]',
102
+ ':is(ui-multiselect, [data-ui~="multiselect"]) [data-multiselect-slot~="panel"]',
103
+ ':is(ui-multiselect, [data-ui~="multiselect"]) [data-multiselect-slot~="trigger"]',
104
+ ':is(ui-multiselect, [data-ui~="multiselect"]) select[multiple][data-ui~="select"]:not([data-multiselect-state~="enhanced"])',
105
+ ':is(ui-otp, [data-ui~="otp"])',
106
+ ':is(ui-otp, [data-ui~="otp"]) [data-otp-slot~="cell"]',
107
+ ':is(ui-otp, [data-ui~="otp"]) [data-otp-slot~="input"]',
108
+ ':is(ui-otp, [data-ui~="otp"]) [data-otp-slot~="rail"]',
109
+ ':is(ui-otp[data-otp-ready], [data-ui~="otp"][data-otp-ready]) [data-otp-slot~="input"]',
110
+ ':is(ui-tabs, [data-ui~="tabs"])',
111
+ ':is(ui-tabs, [data-ui~="tabs"]) [data-tabs-slot~="indicator"]',
112
+ ':is(ui-tabs, [data-ui~="tabs"]) [data-tabs-slot~="list"]',
113
+ ':is(ui-tabs, [data-ui~="tabs"]) [data-tabs-slot~="list"] [data-tabs-slot~="label"]',
114
+ ':is(ui-tabs, [data-ui~="tabs"]) [data-tabs-slot~="list"] input[type="radio"]',
115
+ ':is(ui-tabs, [data-ui~="tabs"])[data-tabs-orientation="vertical"] [data-tabs-slot~="label"]',
116
+ ':is(ui-tabs, [data-ui~="tabs"])[data-tabs-orientation="vertical"] [data-tabs-slot~="list"]',
117
+ ':is(ui-toaster, [data-ui~="toaster"])',
118
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="action"]',
119
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="close"]',
120
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="content"]',
121
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="icon"]',
122
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="list"]',
123
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="toast"]',
124
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="toast"]:not([data-toaster-state~="visible"])',
125
+ ':is(ui-toaster, [data-ui~="toaster"]) [data-toaster-slot~="toast"][data-toaster-state~="removed"]',
126
+ ':is(ui-toaster, [data-ui~="toaster"]):not([data-toaster-state~="expanded"]) [data-toaster-slot~="toast"]:not([data-toaster-state~="front"], [data-toaster-state~="removed"]) > *',
127
+ ':is(ui-toggle-group, [data-ui~="toggle-group"])',
128
+ ':is(ui-toggle-group, [data-ui~="toggle-group"]) > *',
129
+ ':is(ui-tooltip, [data-ui~="tooltip"]) > :is([interestfor], [data-tooltip-slot~="trigger"])',
130
+ ':is(ui-tooltip, [data-ui~="tooltip"]) [data-tooltip-slot~="arrow"]',
131
+ ':is(ui-tooltip, [data-ui~="tooltip"]) [data-tooltip-slot~="content"]',
132
+ '[data-reveal-each] > :is([data-reveal-state~="in-view"], [data-gjs-type])',
133
+ '[data-reveal]:is([data-reveal-state~="in-view"], [data-gjs-type])',
134
+ '[data-ui~="badge"]',
135
+ '[data-ui~="badge"] > svg',
136
+ '[data-ui~="badge"]:is(button, a[href]):not([aria-disabled="true"])',
137
+ '[data-ui~="badge"][data-badge-size="icon"]',
138
+ '[data-ui~="button"]',
139
+ '[data-ui~="button"] > svg',
140
+ '[data-ui~="button"]:has(> :is(kbd, ui-kbd-group, [data-ui~="kbd-group"]))',
141
+ '[data-ui~="button"]:not([aria-disabled="true"])',
142
+ '[data-ui~="button"][data-button-size="icon"]',
143
+ '[data-ui~="button"][data-button-size="icon-sm"]',
144
+ '[data-ui~="button"][data-button-size="sm"]:has(> :is(kbd, ui-kbd-group, [data-ui~="kbd-group"]))',
145
+ '[data-ui~="callout"]',
146
+ '[data-ui~="card"]',
147
+ '[data-ui~="dialog"]',
148
+ '[data-ui~="dialog"] [data-dialog-slot~="body"]',
149
+ '[data-ui~="dialog"] [data-dialog-slot~="close"]',
150
+ '[data-ui~="dialog"] [data-dialog-slot~="close"] > svg',
151
+ '[data-ui~="dialog"] [data-dialog-slot~="content"]',
152
+ '[data-ui~="dialog"] [data-dialog-slot~="footer"]',
153
+ '[data-ui~="dialog"] [data-dialog-slot~="header"]',
154
+ '[data-ui~="dialog"][open]',
155
+ '[data-ui~="field"]',
156
+ '[data-ui~="field"] :is([data-field-slot~="hint"], [data-field-slot~="error"])',
157
+ '[data-ui~="field"] > :not([data-field-slot~="label"], [data-field-slot~="description"])',
158
+ '[data-ui~="field"] [data-field-slot~="description"]',
159
+ '[data-ui~="field"] [data-field-slot~="error"]',
160
+ '[data-ui~="field"] [data-field-slot~="hint"]',
161
+ '[data-ui~="field"] [data-field-slot~="label"]',
162
+ '[data-ui~="field"][data-field-orientation="horizontal"]',
163
+ '[data-ui~="field"][data-field-orientation="horizontal"] [data-field-slot~="label"]',
164
+ '[data-ui~="input"]',
165
+ '[data-ui~="input-group"]',
166
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"]',
167
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"]:not([data-input-group-align])',
168
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"][data-input-group-align="block-end"]',
169
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"][data-input-group-align="block-start"]',
170
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"][data-input-group-align="inline-end"]',
171
+ '[data-ui~="input-group"] [data-input-group-slot~="addon"][data-input-group-align="inline-start"]',
172
+ '[data-ui~="input-group"] [data-input-group-slot~="text"]',
173
+ '[data-ui~="input-group"] [data-ui~="button"]',
174
+ '[data-ui~="input-group"] [data-ui~="input"]',
175
+ '[data-ui~="input-group"] [data-ui~="textarea"]',
176
+ '[data-ui~="input-group"]:not(:has([data-input-group-slot~="addon"]:not([data-input-group-align]), [data-input-group-slot~="addon"][data-input-group-align="inline-start"])) [data-ui~="input"]',
177
+ '[data-ui~="input-group"]:not(:has([data-input-group-slot~="addon"][data-input-group-align="inline-end"])) [data-ui~="input"]',
178
+ '[data-ui~="meter"]',
179
+ '[data-ui~="mobile-menu"] [data-mobile-menu-slot~="body"]',
180
+ '[data-ui~="mobile-menu"] [data-mobile-menu-slot~="body"] :is(ui-accordion, [data-ui~="accordion"]) :is(ui-accordion, [data-ui~="accordion"])',
181
+ '[data-ui~="mobile-menu"] [data-mobile-menu-slot~="footer"]',
182
+ '[data-ui~="mobile-menu"] [data-mobile-menu-slot~="header"]',
183
+ '[data-ui~="mobile-menu"] [data-mobile-menu-slot~="viewport"]',
184
+ '[data-ui~="mobile-menu"][data-mobile-menu-animation="slide-right"][open] [data-mobile-menu-slot~="viewport"]',
185
+ '[data-ui~="navigation-menu"]',
186
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="item"]',
187
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="link"]',
188
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="list"]',
189
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="popover"]',
190
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="popover"][data-navigation-menu-size="container"]',
191
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="popover"][data-navigation-menu-size="root"]',
192
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="popover"][data-navigation-menu-size="screen"]',
193
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="popover"][data-navigation-menu-variant="submenu"]',
194
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="submenu"]',
195
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="submenu-trigger"]',
196
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="submenu-trigger"] > svg',
197
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="trigger"]',
198
+ '[data-ui~="navigation-menu"] [data-navigation-menu-slot~="viewport"]',
199
+ '[data-ui~="password-group"]',
200
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"]',
201
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"]:not([data-password-group-align])',
202
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"][data-password-group-align="block-end"]',
203
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"][data-password-group-align="block-start"]',
204
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"][data-password-group-align="inline-end"]',
205
+ '[data-ui~="password-group"] [data-password-group-slot~="addon"][data-password-group-align="inline-start"]',
206
+ '[data-ui~="password-group"] [data-password-group-slot~="text"]',
207
+ '[data-ui~="password-group"] [data-ui~="button"]',
208
+ '[data-ui~="password-group"] [data-ui~="input"]',
209
+ '[data-ui~="password-group"] [data-ui~="textarea"]',
210
+ '[data-ui~="password-group"]:not(:has([data-password-group-slot~="addon"]:not([data-password-group-align]), [data-password-group-slot~="addon"][data-password-group-align="inline-start"])) [data-ui~="input"]',
211
+ '[data-ui~="password-group"]:not(:has([data-password-group-slot~="addon"][data-password-group-align="inline-end"])) [data-ui~="input"]',
212
+ '[data-ui~="pile"]',
213
+ '[data-ui~="pile"] > *',
214
+ '[data-ui~="progress"]',
215
+ '[data-ui~="radio"]',
216
+ '[data-ui~="select"]',
217
+ '[data-ui~="select"] > button',
218
+ '[data-ui~="select"] > button > svg',
219
+ '[data-ui~="select"] option',
220
+ '[data-ui~="select"] option > svg',
221
+ '[data-ui~="select"] selectedcontent',
222
+ '[data-ui~="select"] selectedcontent > svg',
223
+ '[data-ui~="separator"]',
224
+ '[data-ui~="separator"][data-separator-orientation="vertical"]',
225
+ '[data-ui~="sr-only"]',
226
+ '[data-ui~="table"]',
227
+ '[data-ui~="table"] :is(th, td)',
228
+ '[data-ui~="table"] caption',
229
+ '[data-ui~="table"] tbody tr[data-table-state~="selected"] > :is(th, td)',
230
+ '[data-ui~="table"] tfoot',
231
+ '[data-ui~="table"] thead th',
232
+ '[data-ui~="table"][data-table-variant="alternating"] tbody tr',
233
+ '[data-ui~="text-display"]',
234
+ '[data-ui~="text-link"]',
235
+ '[data-ui~="textarea"]',
236
+ '[data-ui~="toggle"]',
237
+ '[data-ui~="toggle"] > input:is([type="checkbox"], [type="radio"])',
238
+ '[data-ui~="toggle"] > svg',
239
+ '[data-ui~="toggle"]:has(> input)',
240
+ '[data-ui~="toggle"]:has(> input):not(:has(> input))',
241
+ '[data-ui~="toggle"]:not(:has(> input))',
242
+ '[data-ui~="toggle"][data-toggle-size="icon"]',
243
+ '[data-ui~="toggle"][data-toggle-size="icon-sm"]',
244
+ "[popover]",
245
+ 'a[href]:not([data-ui~="button"])',
246
+ "abbr[title]",
247
+ "blockquote",
248
+ "body",
249
+ "button",
250
+ "code",
251
+ "dialog",
252
+ "dialog[open]",
253
+ "figure:has(img, video)",
254
+ "hr",
255
+ 'hr[data-orientation="vertical"]',
256
+ "html",
257
+ 'input[role="switch"]',
258
+ 'input[type="checkbox"]:not([role="switch"])',
259
+ 'input[type="range"]',
260
+ "kbd",
261
+ 'label:has(> input[role="switch"])',
262
+ "main",
263
+ "ol",
264
+ "select:is([multiple], [size]) optgroup option",
265
+ "ul",
266
+ ];
267
+
268
+ /** For each utility, the elements the kit reads it on through its own chain: a tier alone works there. */
269
+ export const TIER_READS: Readonly<Record<string, readonly number[]>> = {
270
+ band: [60],
271
+ bg: [
272
+ 2, 14, 28, 35, 122, 126, 129, 131, 133, 136, 140, 141, 142, 159, 160, 173, 194, 209, 210, 211,
273
+ 218, 221, 230, 231, 234, 235, 236, 252, 253, 255,
274
+ ],
275
+ "border-color": [
276
+ 14, 35, 126, 129, 131, 133, 136, 140, 141, 159, 160, 194, 210, 211, 230, 231, 234, 235, 236,
277
+ 239, 253,
278
+ ],
279
+ "border-style": [35, 129, 133, 140, 141, 159, 210, 211, 230, 231, 253],
280
+ "border-width": [35, 129, 133, 140, 141, 159, 210, 211, 230, 231, 253],
281
+ cursor: [160, 194],
282
+ display: [2, 150, 157, 160, 194],
283
+ "flex-wrap": [35, 160, 194],
284
+ "font-family": [126, 129, 133, 221, 231, 255],
285
+ "font-size": [35, 126, 129, 133, 159, 211, 221, 230, 231, 255],
286
+ "font-weight": [126, 129, 133, 231],
287
+ gap: [2, 31, 35, 58, 90, 126, 129, 133, 140, 141, 150, 157, 160, 194, 231, 255],
288
+ h: [35, 129, 142, 159, 173, 209, 211, 252],
289
+ items: [35, 157, 160, 194],
290
+ justify: [157],
291
+ leading: [35, 126, 129, 133, 159, 211, 230, 231, 255],
292
+ m: [2],
293
+ "max-h": [25, 230],
294
+ "max-w": [126, 239],
295
+ "min-h": [35, 133, 160, 194, 230, 231, 255],
296
+ "min-w": [35, 55, 92, 93, 159, 211, 230, 239, 255],
297
+ mx: [126, 239],
298
+ my: [126, 239],
299
+ p: [2, 140, 141, 160, 194, 230, 239],
300
+ pl: [35, 159, 211],
301
+ pr: [35, 159, 211],
302
+ px: [126, 129, 133, 231, 255],
303
+ py: [35, 126, 255],
304
+ "ring-color": [129, 133, 231],
305
+ rounded: [
306
+ 2, 28, 35, 122, 126, 129, 133, 140, 141, 142, 159, 160, 173, 194, 209, 210, 211, 230, 231, 239,
307
+ 252, 253, 255,
308
+ ],
309
+ self: [150],
310
+ shadow: [
311
+ 19, 25, 35, 92, 126, 129, 133, 140, 141, 142, 159, 160, 194, 210, 211, 230, 231, 239, 252, 253,
312
+ ],
313
+ "shadow-angle": [4, 251],
314
+ size: [210, 253],
315
+ "template-cols": [150],
316
+ text: [
317
+ 35, 126, 129, 131, 133, 136, 140, 141, 142, 159, 160, 194, 211, 221, 230, 231, 234, 235, 236,
318
+ 255,
319
+ ],
320
+ w: [35, 93, 142, 150, 159, 160, 173, 194, 209, 211, 230, 252],
321
+ };
322
+
323
+ /**
324
+ * For each tier-only utility (a no-base one, or the box-shadow composite's),
325
+ * the elements the kit sets its property on above `@layer defaults`: they keep
326
+ * their own value, and a tier alone applies there only through `TIER_READS`.
327
+ */
328
+ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
329
+ "anchor-name": [27, 35, 46, 91, 98, 124, 142, 180, 183, 190, 192],
330
+ aspect: [77, 79, 132, 137, 138, 237, 238],
331
+ band: [60, 152, 153, 156],
332
+ basis: [
333
+ 17, 18, 32, 33, 36, 52, 53, 70, 82, 115, 163, 164, 169, 170, 191, 197, 198, 203, 204, 212, 257,
334
+ ],
335
+ bg: [
336
+ 2, 14, 15, 28, 35, 36, 53, 76, 78, 94, 95, 101, 104, 106, 107, 108, 112, 118, 122, 125, 126,
337
+ 129, 133, 140, 141, 142, 147, 159, 160, 169, 170, 173, 176, 177, 194, 203, 204, 209, 210, 211,
338
+ 214, 218, 221, 224, 225, 227, 230, 231, 239, 243, 245, 249, 250, 251, 252, 253, 255,
339
+ ],
340
+ "col-end": [60, 151, 152, 153, 156, 208],
341
+ "col-span": [60, 152, 153, 156],
342
+ "col-start": [60, 151, 152, 153, 156, 208],
343
+ flex: [
344
+ 17, 18, 32, 33, 36, 44, 45, 52, 53, 70, 82, 88, 89, 94, 113, 114, 115, 116, 129, 133, 147, 161,
345
+ 163, 164, 168, 169, 170, 191, 195, 197, 198, 202, 203, 204, 210, 212, 213, 215, 217, 218, 231,
346
+ 249, 252, 253, 257,
347
+ ],
348
+ "flex-wrap": [35, 160, 176, 194],
349
+ gap: [
350
+ 2, 22, 24, 31, 34, 35, 39, 41, 48, 49, 54, 58, 59, 75, 80, 87, 90, 95, 97, 103, 105, 107, 115,
351
+ 118, 126, 129, 133, 140, 141, 147, 150, 160, 161, 167, 176, 183, 190, 193, 194, 195, 201, 211,
352
+ 212, 214, 231, 248, 255,
353
+ ],
354
+ "gap-x": [
355
+ 2, 22, 24, 31, 34, 35, 39, 41, 48, 49, 54, 58, 59, 75, 80, 87, 90, 95, 97, 103, 105, 107, 115,
356
+ 118, 126, 129, 133, 140, 141, 147, 150, 160, 161, 167, 176, 183, 190, 193, 194, 195, 201, 211,
357
+ 212, 214, 231, 248, 255,
358
+ ],
359
+ "gap-y": [
360
+ 2, 22, 24, 31, 34, 35, 39, 41, 48, 49, 54, 58, 75, 80, 87, 90, 95, 97, 103, 105, 107, 115, 118,
361
+ 126, 129, 140, 141, 147, 150, 160, 161, 167, 176, 183, 190, 193, 194, 195, 201, 211, 212, 214,
362
+ 248, 255,
363
+ ],
364
+ "grid-cols": [59, 61, 150, 193],
365
+ "grid-rows": [64, 65, 146, 149, 178],
366
+ items: [
367
+ 19, 20, 28, 35, 44, 45, 48, 51, 58, 59, 66, 67, 78, 80, 95, 101, 103, 105, 107, 108, 111, 118,
368
+ 122, 126, 129, 130, 133, 134, 145, 157, 160, 161, 163, 164, 167, 177, 178, 183, 190, 193, 194,
369
+ 195, 197, 198, 201, 207, 210, 211, 212, 214, 216, 231, 233, 253, 255,
370
+ ],
371
+ justify: [
372
+ 19, 20, 66, 67, 72, 78, 81, 108, 110, 129, 130, 133, 134, 145, 147, 157, 161, 177, 190, 195,
373
+ 211, 231, 233, 255,
374
+ ],
375
+ opacity: [
376
+ 0, 1, 44, 63, 68, 69, 79, 83, 84, 104, 109, 112, 118, 119, 120, 121, 126, 127, 128, 154, 155,
377
+ 179, 232, 239, 246, 247, 254, 256,
378
+ ],
379
+ order: [23, 40, 50, 162, 163, 164, 165, 166, 196, 197, 198, 199, 200],
380
+ p: [
381
+ 2, 3, 5, 6, 21, 24, 35, 37, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 71, 72, 78, 95, 99, 107,
382
+ 108, 112, 117, 118, 126, 129, 130, 132, 133, 134, 135, 137, 138, 139, 140, 141, 143, 145, 147,
383
+ 148, 159, 160, 161, 163, 164, 167, 169, 170, 171, 172, 174, 175, 176, 177, 182, 190, 194, 195,
384
+ 197, 198, 201, 203, 204, 205, 206, 211, 214, 220, 222, 223, 226, 230, 231, 233, 237, 238, 239,
385
+ 242, 245, 255, 258, 259, 260,
386
+ ],
387
+ pb: [
388
+ 2, 3, 21, 24, 35, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 71, 72, 99, 107, 112, 117, 118, 126,
389
+ 130, 132, 134, 137, 138, 140, 141, 143, 145, 147, 160, 163, 164, 170, 174, 176, 177, 182, 190,
390
+ 194, 197, 198, 204, 220, 222, 223, 226, 230, 233, 237, 238, 239, 245, 255,
391
+ ],
392
+ pl: [
393
+ 2, 3, 5, 6, 21, 24, 35, 37, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 78, 95, 107, 108, 112, 117,
394
+ 118, 126, 129, 130, 132, 133, 134, 135, 137, 138, 139, 140, 141, 143, 145, 147, 148, 159, 160,
395
+ 161, 167, 169, 170, 171, 174, 175, 176, 177, 182, 190, 194, 195, 201, 203, 204, 205, 211, 214,
396
+ 220, 222, 223, 230, 231, 233, 237, 238, 239, 242, 245, 255, 258, 259, 260,
397
+ ],
398
+ "place-content": [
399
+ 19, 20, 66, 67, 72, 78, 81, 108, 110, 129, 130, 133, 134, 145, 147, 157, 161, 177, 190, 195,
400
+ 211, 231, 233, 239, 255,
401
+ ],
402
+ "place-items": [
403
+ 19, 20, 28, 35, 44, 45, 48, 51, 58, 59, 66, 67, 78, 80, 95, 101, 103, 105, 107, 108, 111, 118,
404
+ 122, 126, 129, 130, 133, 134, 145, 157, 160, 161, 163, 164, 167, 177, 178, 183, 190, 193, 194,
405
+ 195, 197, 198, 201, 207, 210, 211, 212, 214, 216, 231, 233, 253, 255,
406
+ ],
407
+ position: [
408
+ 13, 16, 28, 29, 30, 62, 63, 73, 74, 75, 77, 85, 86, 96, 100, 104, 106, 107, 108, 109, 112, 118,
409
+ 122, 123, 125, 144, 146, 147, 176, 177, 178, 180, 181, 189, 210, 220, 231, 232, 239, 243, 246,
410
+ 253, 256, 257,
411
+ ],
412
+ "position-anchor": [25, 42, 56, 92, 97, 106, 126, 184, 185, 186, 187, 188],
413
+ "position-area": [112, 239],
414
+ pr: [
415
+ 2, 3, 21, 24, 35, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 95, 107, 108, 112, 117, 118, 126, 129,
416
+ 130, 132, 133, 134, 135, 137, 138, 139, 140, 141, 143, 145, 147, 148, 159, 160, 161, 167, 169,
417
+ 170, 172, 174, 176, 177, 182, 190, 194, 195, 201, 203, 204, 206, 211, 214, 220, 222, 223, 230,
418
+ 231, 233, 237, 238, 239, 245, 255,
419
+ ],
420
+ pt: [
421
+ 2, 3, 21, 24, 35, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 71, 72, 99, 107, 112, 117, 118, 126,
422
+ 130, 132, 134, 137, 138, 140, 141, 143, 145, 147, 148, 160, 163, 164, 170, 174, 176, 177, 182,
423
+ 190, 194, 197, 198, 204, 220, 222, 223, 226, 230, 233, 237, 238, 239, 245, 255,
424
+ ],
425
+ px: [
426
+ 2, 3, 5, 6, 21, 24, 35, 37, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 78, 95, 107, 108, 112, 117,
427
+ 118, 126, 129, 130, 132, 133, 134, 135, 137, 138, 139, 140, 141, 143, 145, 147, 148, 159, 160,
428
+ 161, 167, 169, 170, 171, 172, 174, 175, 176, 177, 182, 190, 194, 195, 201, 203, 204, 205, 206,
429
+ 211, 214, 220, 222, 223, 230, 231, 233, 237, 238, 239, 242, 245, 255, 258, 259, 260,
430
+ ],
431
+ py: [
432
+ 2, 3, 21, 24, 35, 38, 41, 47, 48, 50, 53, 54, 56, 57, 67, 71, 72, 99, 107, 112, 117, 118, 126,
433
+ 130, 132, 134, 137, 138, 140, 141, 143, 145, 147, 148, 160, 163, 164, 170, 174, 176, 177, 182,
434
+ 190, 194, 197, 198, 204, 220, 222, 223, 226, 230, 233, 237, 238, 239, 245, 255,
435
+ ],
436
+ ring: [
437
+ 19, 25, 26, 35, 42, 43, 55, 92, 97, 104, 106, 108, 112, 118, 126, 129, 133, 140, 141, 142, 159,
438
+ 160, 169, 170, 194, 210, 211, 214, 230, 231, 239, 246, 252, 253,
439
+ ],
440
+ "ring-color": [
441
+ 19, 25, 26, 35, 42, 43, 55, 92, 97, 104, 106, 108, 112, 118, 126, 129, 133, 140, 141, 142, 159,
442
+ 160, 169, 170, 194, 210, 211, 214, 230, 231, 239, 246, 252, 253,
443
+ ],
444
+ "ring-offset": [
445
+ 19, 25, 26, 35, 42, 43, 55, 92, 97, 104, 106, 108, 112, 118, 126, 129, 133, 140, 141, 142, 159,
446
+ 160, 169, 170, 194, 210, 211, 214, 230, 231, 239, 246, 252, 253,
447
+ ],
448
+ "ring-offset-color": [
449
+ 19, 25, 26, 35, 42, 43, 55, 92, 97, 104, 106, 108, 112, 118, 126, 129, 133, 140, 141, 142, 159,
450
+ 160, 169, 170, 194, 210, 211, 214, 230, 231, 239, 246, 252, 253,
451
+ ],
452
+ "row-end": [151, 152, 153, 156, 208],
453
+ "row-span": [152, 153, 156],
454
+ "row-start": [151, 152, 153, 156, 208],
455
+ self: [146, 147, 150, 156, 158, 219],
456
+ shadow: [
457
+ 19, 25, 26, 35, 42, 43, 55, 92, 97, 104, 106, 108, 112, 118, 126, 129, 133, 140, 141, 142, 159,
458
+ 160, 169, 170, 194, 210, 211, 214, 230, 231, 239, 246, 252, 253,
459
+ ],
460
+ shrink: [
461
+ 17, 18, 32, 33, 36, 44, 45, 52, 53, 70, 82, 88, 89, 94, 113, 114, 115, 116, 129, 133, 147, 161,
462
+ 168, 169, 170, 191, 195, 202, 203, 204, 210, 212, 213, 215, 217, 218, 231, 249, 252, 253, 257,
463
+ ],
464
+ "template-cols": [59, 61, 150, 193],
465
+ "template-rows": [64, 65, 146, 149, 178],
466
+ "text-align": [102, 110, 156, 190, 211, 221, 222, 244],
467
+ "text-decoration": [129, 133, 182, 229, 231, 240, 241],
468
+ "text-wrap": [7, 8, 9, 10, 11, 12, 108, 126, 228, 243],
469
+ translate: [63, 154, 155],
470
+ };
@@ -1,25 +1,6 @@
1
- /** `[start, end)` offsets into a style value. */
2
- export type Range = [number, number];
3
- /** One declaration of a style value, with its parts' offsets (all trimmed). */
4
- export interface ScannedDeclaration {
5
- /** The whole declaration. */
6
- span: Range;
7
- /** The name; a declaration still being typed (`--p`) is all name. */
8
- name: string;
9
- nameSpan: Range;
10
- /** Offset of the colon, or -1 when there is none yet. */
11
- colon: number;
12
- value: string;
13
- /** Empty (`[colon + 1, colon + 1]`) when nothing follows the colon. */
14
- valueSpan: Range;
15
- }
16
- /**
17
- * Scans a style value into declarations, splitting on top-level `;` (not inside
18
- * parentheses or quotes). Empty segments are skipped.
19
- */
20
- export declare function scanDeclarations(value: string): ScannedDeclaration[];
21
- /** Splits a style value on top-level `;`, ignoring ones inside parentheses or quotes. */
22
- export declare function splitDeclarations(value: string): string[];
1
+ import { scanDeclarations, splitDeclarations } from "./declarations.ts";
2
+ export { scanDeclarations, splitDeclarations };
3
+ export type { Range, ScannedDeclaration } from "./declarations.ts";
23
4
  /** `--px :6` → `--px: 6`. A declaration without a colon is kept as written. */
24
5
  export declare function normalize(declaration: string): string;
25
6
  /** Declarations in cascade order (a stable sort). */
@@ -1 +1 @@
1
- {"version":3,"file":"style-format.d.ts","sourceRoot":"","sources":["style-format.ts"],"names":[],"mappings":"AAgCA,iDAAiD;AACjD,MAAM,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC;IAChB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,SAAS,EAAE,KAAK,CAAC;CAClB;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAsCpE;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEzD;AAsBD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIrD;AA8BD,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGlE;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM1E"}
1
+ {"version":3,"file":"style-format.d.ts","sourceRoot":"","sources":["style-format.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;AAC/C,YAAY,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAsBnE,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIrD;AA8BD,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGlE;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM1E"}
@@ -18,68 +18,10 @@
18
18
  * keeps its winner and raw shorthands keep their place before longhands.
19
19
  */
20
20
  import { BREAKPOINTS, PSEUDO_ONLY, PSEUDO_SIDES, STATES, UTILITIES, parseUtilityName, } from "./utilities.js";
21
- /** Trims `[start, end)` of `text` to its non-whitespace extent. */
22
- function trimRange(text, start, end) {
23
- while (start < end && /\s/.test(text[start]))
24
- start++;
25
- while (end > start && /\s/.test(text[end - 1]))
26
- end--;
27
- return [start, end];
28
- }
29
- /**
30
- * Scans a style value into declarations, splitting on top-level `;` (not inside
31
- * parentheses or quotes). Empty segments are skipped.
32
- */
33
- export function scanDeclarations(value) {
34
- const found = [];
35
- const push = (from, to) => {
36
- const span = trimRange(value, from, to);
37
- if (span[0] === span[1])
38
- return;
39
- const colon = value.indexOf(":", span[0]);
40
- const hasColon = colon !== -1 && colon < span[1];
41
- const nameSpan = hasColon ? trimRange(value, span[0], colon) : span;
42
- const valueSpan = hasColon
43
- ? trimRange(value, colon + 1, span[1])
44
- : [span[1], span[1]];
45
- found.push({
46
- span,
47
- name: value.slice(...nameSpan),
48
- nameSpan,
49
- colon: hasColon ? colon : -1,
50
- value: value.slice(...valueSpan),
51
- valueSpan,
52
- });
53
- };
54
- let depth = 0;
55
- let quote = null;
56
- let start = 0;
57
- for (let i = 0; i < value.length; i++) {
58
- const ch = value[i];
59
- if (quote) {
60
- if (ch === "\\")
61
- i++;
62
- else if (ch === quote)
63
- quote = null;
64
- }
65
- else if (ch === '"' || ch === "'")
66
- quote = ch;
67
- else if (ch === "(")
68
- depth++;
69
- else if (ch === ")")
70
- depth = Math.max(0, depth - 1);
71
- else if (ch === ";" && depth === 0) {
72
- push(start, i);
73
- start = i + 1;
74
- }
75
- }
76
- push(start, value.length);
77
- return found;
78
- }
79
- /** Splits a style value on top-level `;`, ignoring ones inside parentheses or quotes. */
80
- export function splitDeclarations(value) {
81
- return scanDeclarations(value).map(({ span }) => value.slice(...span));
82
- }
21
+ // --- Declarations ---
22
+ // the parser lives in declarations.ts (no imports) so the CSP fallback can share it
23
+ import { scanDeclarations, splitDeclarations } from "./declarations.js";
24
+ export { scanDeclarations, splitDeclarations };
83
25
  /** Collapses whitespace runs to one space, outside quotes. */
84
26
  function collapse(text) {
85
27
  let out = "";