@unocss/preset-attributify 0.45.12 → 0.45.15

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/README.md CHANGED
@@ -186,6 +186,18 @@ declare global {
186
186
  }
187
187
  ```
188
188
 
189
+ ### Astro
190
+
191
+ ```ts
192
+ import type { AttributifyAttributes } from '@unocss/preset-attributify'
193
+
194
+ declare global {
195
+ namespace astroHTML.JSX {
196
+ interface HTMLAttributes extends AttributifyAttributes { }
197
+ }
198
+ }
199
+ ```
200
+
189
201
  ### Attributify with Prefix
190
202
 
191
203
  ```ts
package/dist/index.d.ts CHANGED
@@ -50,12 +50,23 @@ declare const extractorAttributify: (options?: AttributifyOptions) => Extractor;
50
50
  declare const variantsRE: RegExp;
51
51
  declare const variantAttributify: (options?: AttributifyOptions) => VariantObject;
52
52
 
53
- declare type UtilityNames = 'align' | 'animate' | 'backdrop' | 'bg' | 'blend' | 'border' | 'box' | 'container' | 'content' | 'cursor' | 'display' | 'divide' | 'filter' | 'flex' | 'font' | 'gap' | 'gradient' | 'grid' | 'h' | 'icon' | 'justify' | 'list' | 'm' | 'opacity' | 'order' | 'outline' | 'overflow' | 'p' | 'place' | 'pos' | 'ring' | 'select' | 'shadow' | 'space' | 'table' | 'text' | 'transform' | 'transition' | 'underline' | 'w' | 'z';
54
- declare type VariantNames = 'active' | 'after' | 'all' | 'before' | 'child' | 'dark' | 'enabled' | 'first' | 'focus' | 'hover' | 'last' | 'lg' | 'light' | 'md' | 'root' | 'sm' | 'xl' | 'xxl';
55
- declare type AttributifyNames<Prefix extends string = ''> = `${Prefix}${UtilityNames}` | `${Prefix}${VariantNames}` | `${Prefix}${VariantNames}:${UtilityNames}`;
53
+ declare type TwoStringsCompositionPrefix = 'm' | 'p';
54
+ declare type TwoStringsCompositionSuffix = 'r' | 'b' | 'l' | 't' | 'a';
55
+ /** Some words can compose with two strings to become a complete unocss rule such as ha, mr, mb */
56
+ declare type TwoStringsComposition = `${TwoStringsCompositionPrefix}${TwoStringsCompositionSuffix}` | 'ha' | 'wa';
57
+ /** Some words can be a complete unocss rule by itself */
58
+ declare type SpecialSingleWord = 'container' | 'flex' | 'block' | 'inline' | 'block' | 'table' | 'isolate' | 'absolute' | 'relative' | 'fixed' | 'sticky' | 'static' | 'visible' | 'invisible' | 'grow' | 'shrink' | 'antialiased' | 'italic' | 'ordinal' | 'overline' | 'underline' | 'uppercase' | 'lowercase' | 'capitalize' | 'truncate' | 'border' | 'rounded' | 'outline' | 'ring' | 'shadow' | 'blur' | 'grayscale' | 'invert' | 'sepia' | 'transition' | 'resize' | 'transform' | 'filter';
59
+ declare type StringNumberCompositionPrefix = 'op' | 'opacity' | 'fw' | 'p' | 'm' | 'w' | 'h' | 'z';
60
+ /** Some words can be a complete unocss rule by compose a string and a number, such as op80, fw300, p2, p10px */
61
+ declare type StringNumberComposition = `${StringNumberCompositionPrefix}${number}${'px' | ''}`;
62
+ declare type PseudoPrefix = 'active' | 'before' | 'after' | 'dark' | 'light' | 'first' | 'last' | 'focus' | 'hover' | 'link' | 'root' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'enabled' | 'disabled' | 'all' | 'children';
63
+ /** Some words can be used to separate utilities, such as font="mono light", text="sm white" */
64
+ declare type SeparateEnabled = 'align' | 'animate' | 'backdrop' | 'bg' | 'blend' | 'border' | 'box' | 'container' | 'content' | 'cursor' | 'display' | 'divide' | 'filter' | 'flex' | 'font' | 'gap' | 'gradient' | 'grid' | 'h' | 'icon' | 'justify' | 'list' | 'm' | 'opacity' | 'order' | 'outline' | 'overflow' | 'p' | 'place' | 'pos' | 'ring' | 'select' | 'shadow' | 'space' | 'table' | 'text' | 'transform' | 'transition' | 'underline' | 'w' | 'z' | PseudoPrefix;
65
+ declare type BasicAttributes = StringNumberComposition | SpecialSingleWord | TwoStringsComposition | SeparateEnabled;
66
+ declare type AttributifyNames<Prefix extends string = ''> = `${Prefix}${BasicAttributes}` | `${Prefix}${PseudoPrefix}:${BasicAttributes}`;
56
67
  interface AttributifyAttributes extends Partial<Record<AttributifyNames, string | boolean>> {
57
68
  }
58
69
 
59
70
  declare const preset: (options?: AttributifyOptions) => Preset;
60
71
 
61
- export { AttributifyAttributes, AttributifyNames, AttributifyOptions, UtilityNames, VariantNames, autocompleteExtractorAttributify, preset as default, defaultIgnoreAttributes, extractorAttributify, variantAttributify, variantsRE };
72
+ export { AttributifyAttributes, AttributifyNames, AttributifyOptions, BasicAttributes, PseudoPrefix, SeparateEnabled, SpecialSingleWord, StringNumberComposition, StringNumberCompositionPrefix, TwoStringsComposition, TwoStringsCompositionPrefix, TwoStringsCompositionSuffix, autocompleteExtractorAttributify, preset as default, defaultIgnoreAttributes, extractorAttributify, variantAttributify, variantsRE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-attributify",
3
- "version": "0.45.12",
3
+ "version": "0.45.15",
4
4
  "description": "Attributify preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@unocss/core": "0.45.12"
36
+ "@unocss/core": "0.45.15"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild",