rei-kit 3.5.0 → 3.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.
- package/README.md +5 -5
- package/dist/app.js +1 -1
- package/dist/check.js +42 -0
- package/dist/check.js.map +1 -1
- package/dist/components/BaseInput.vue.d.ts +19 -0
- package/dist/components/BaseSelect.vue.d.ts +14 -0
- package/dist/components/BaseTextarea.vue.d.ts +14 -0
- package/dist/components/PasswordInput.vue.d.ts +14 -0
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/{use-announce-BGZnV78W.js → use-announce-B8Ln-LsE.js} +7 -5
- package/dist/use-announce-B8Ln-LsE.js.map +1 -0
- package/package.json +1 -1
- package/dist/use-announce-BGZnV78W.js.map +0 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ demonstrates both, including the one that does not work.
|
|
|
66
66
|
|
|
67
67
|
### 2. The smallest of six, measured, with the trade stated
|
|
68
68
|
|
|
69
|
-
At ten components — a real screen — **31.
|
|
69
|
+
At ten components — a real screen — **31.8 KB against 104 to 195** for the
|
|
70
70
|
five kits measured beside it. The gap is not the total, it is the slope:
|
|
71
71
|
seven components past the first three cost this kit 5 KB and cost them 60 to
|
|
72
72
|
125, because the stylesheet here is flat and theirs is inside the JavaScript.
|
|
@@ -165,7 +165,7 @@ app, and the case *least* favourable to this kit:
|
|
|
165
165
|
|
|
166
166
|
| Kit | JS | CSS | Total |
|
|
167
167
|
| -------------------- | ---------: | ----------: | ----------: |
|
|
168
|
-
| **rei-kit 3.
|
|
168
|
+
| **rei-kit 3.7.0** | **3.7 KB** | **23.1 KB** | **26.8 KB** |
|
|
169
169
|
| element-plus 2.14.6 | 27.3 KB | 6.0 KB | 33.3 KB |
|
|
170
170
|
| naive-ui 2.45.3 | 51.2 KB | — | 51.2 KB |
|
|
171
171
|
| primevue 5.0.1 | 53.6 KB | — | 53.6 KB |
|
|
@@ -177,7 +177,7 @@ a data table, a tooltip and a card. A screen rather than a demo:
|
|
|
177
177
|
|
|
178
178
|
| Kit | JS | CSS | Total |
|
|
179
179
|
| -------------------- | ---------: | ----------: | -----------: |
|
|
180
|
-
| **rei-kit 3.
|
|
180
|
+
| **rei-kit 3.7.0** | **8.6 KB** | **23.1 KB** | **31.8 KB** |
|
|
181
181
|
| element-plus 2.14.6 | 90.1 KB | 14.0 KB | 104.1 KB |
|
|
182
182
|
| naive-ui 2.45.3 | 132.4 KB | — | 132.4 KB |
|
|
183
183
|
| primevue 5.0.1 | 135.8 KB | — | 135.8 KB |
|
|
@@ -185,7 +185,7 @@ a data table, a tooltip and a card. A screen rather than a demo:
|
|
|
185
185
|
| ant-design-vue 4.2.6 | 195.4 KB | — | 195.4 KB |
|
|
186
186
|
|
|
187
187
|
**The slope is the point, not the total.** Seven more components cost this kit
|
|
188
|
-
**
|
|
188
|
+
**5.0 KB**, because the stylesheet does not move and only the JavaScript grows.
|
|
189
189
|
The kits that put their styles in the JavaScript have no flat part at all, so
|
|
190
190
|
the same seven cost them **60 to 125 KB**. A quarter smaller at three
|
|
191
191
|
components; **3.3× smaller at ten**.
|
|
@@ -234,7 +234,7 @@ Each claim here is enforced by something that fails, not by a promise.
|
|
|
234
234
|
|
|
235
235
|
## Status
|
|
236
236
|
|
|
237
|
-
**v3.
|
|
237
|
+
**v3.7.0 — three consumers.**
|
|
238
238
|
|
|
239
239
|
| | |
|
|
240
240
|
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as BaseCheckbox_default, o as BaseSheet_default, r as horizontalStep, s as inertOutside, t as focusTarget } from "./focus-target-BtcoJdmz.js";
|
|
2
|
-
import { _ as toRedirectPath, c as useToast, d as isThemePreference, g as safeRedirect, h as tapFeedback, i as BaseInput_default, l as useOnline, m as useTheme, r as GoogleButton_default, s as BaseAlert_default, t as announce } from "./use-announce-
|
|
2
|
+
import { _ as toRedirectPath, c as useToast, d as isThemePreference, g as safeRedirect, h as tapFeedback, i as BaseInput_default, l as useOnline, m as useTheme, r as GoogleButton_default, s as BaseAlert_default, t as announce } from "./use-announce-B8Ln-LsE.js";
|
|
3
3
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
|
|
4
4
|
import { t as BaseButton_default } from "./BaseButton-BD2HKB1L.js";
|
|
5
5
|
import { t as SettingsRow_default } from "./SettingsRow-C6Spi7Np.js";
|
package/dist/check.js
CHANGED
|
@@ -7,6 +7,41 @@ function imports(css, file) {
|
|
|
7
7
|
return new RegExp(`@import\\s+['"]rei-kit/${file}['"]`).test(css);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
+
* The roles a rule in the dark sets, where that rule can beat `:root`.
|
|
11
|
+
*
|
|
12
|
+
* The kit writes two kinds, and the difference is the whole point. A plain
|
|
13
|
+
* `.dark { … }` has the same specificity as `:root` and is emitted after it,
|
|
14
|
+
* so it wins — an app that restates one of those roles in `@theme` and not
|
|
15
|
+
* under `.dark` keeps the kit's colour at night. A `:where(.dark) { … }`
|
|
16
|
+
* carries no specificity at all, which is exactly why the kit puts the
|
|
17
|
+
* filled roles there: an app's own brand has to survive after dark, and
|
|
18
|
+
* before that block existed the kit's lightening beat it.
|
|
19
|
+
*
|
|
20
|
+
* So only the first kind is something an app has to answer, and a reader
|
|
21
|
+
* that lumps them together reports nine roles that are already correct. It
|
|
22
|
+
* did, once, against a real app — which is how this comment came to be here
|
|
23
|
+
* rather than in the version that shipped.
|
|
24
|
+
*
|
|
25
|
+
* The body runs to its matching brace, not the next one: these blocks hold
|
|
26
|
+
* comments and nested rules. And it is found from a rule rather than from
|
|
27
|
+
* the word, or a comment mentioning `.dark` starts the slice and swallows
|
|
28
|
+
* the stylesheet.
|
|
29
|
+
*/
|
|
30
|
+
function darkRoles(css) {
|
|
31
|
+
const bodies = [];
|
|
32
|
+
for (const match of css.matchAll(/(?<![\w):])\.dark\s*\{/g)) {
|
|
33
|
+
let depth = 1;
|
|
34
|
+
let at = match.index + match[0].length;
|
|
35
|
+
while (at < css.length && depth > 0) {
|
|
36
|
+
if (css[at] === "{") depth += 1;
|
|
37
|
+
else if (css[at] === "}") depth -= 1;
|
|
38
|
+
at += 1;
|
|
39
|
+
}
|
|
40
|
+
bodies.push(css.slice(match.index + match[0].length, at - 1));
|
|
41
|
+
}
|
|
42
|
+
return colourRoles(bodies.join("\n"));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
10
45
|
* What is missing from an app's stylesheet, as a list to assert is empty.
|
|
11
46
|
*
|
|
12
47
|
* ```ts
|
|
@@ -47,6 +82,13 @@ function checkStyling({ css, tokens }) {
|
|
|
47
82
|
fix: "@import 'rei-kit/tokens.css';"
|
|
48
83
|
});
|
|
49
84
|
}
|
|
85
|
+
const kitDark = darkRoles(tokens);
|
|
86
|
+
const appDark = darkRoles(css);
|
|
87
|
+
const redefined = [...declared].filter((role) => kitDark.has(role) && !appDark.has(role));
|
|
88
|
+
if (redefined.length) problems.push({
|
|
89
|
+
message: `These roles are redefined for the day and left at the kit's own values at night, because \`@theme\` lands in \`:root\` and the kit's \`.dark\` comes after it: ${redefined.join(", ")}.`,
|
|
90
|
+
fix: ".dark { --color-primary: …; } — restate each one under `.dark` as well"
|
|
91
|
+
});
|
|
50
92
|
return problems;
|
|
51
93
|
}
|
|
52
94
|
//#endregion
|
package/dist/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","names":[],"sources":["../src/check/index.ts"],"sourcesContent":["/**\n * The wiring that fails silently, checked at unit-test speed.\n *\n * Every line of this package's install can be left out and leave a build that\n * is green: a missing `@source` means Tailwind never emits the utilities the\n * components ask for, a missing stylesheet import means the components keep\n * their markup and lose their layout, and a colour role the app never defines\n * makes `bg-primary` emit no declaration at all. None of it is visible to\n * `vue-tsc`, to a component test, or to a reader of the diff. One of the apps\n * in this family shipped a release with its tab bar invisible exactly this\n * way.\n *\n * Both apps then wrote the same check, independently, with three of the four\n * assertions carrying the same names — which is this kit's own test for a\n * missing part. So the check moved here, and it knows one thing their copies\n * could not: that the preset exists and carries the `@source` and the\n * component styles with it.\n *\n * Nothing here reads a file or touches the DOM. The caller supplies the two\n * stylesheets as text, because that is the only part that differs between a\n * Vitest run, a Node script and a CI step.\n */\n\n/** A problem found in an app's stylesheet, written to be read in a failure. */\nexport type StylingProblem = {\n /** What is wrong, in one sentence. */\n message: string\n /** The line to add, where there is a single obvious one. */\n fix?: string\n}\n\nexport type StylingInput = {\n /** The app's own stylesheet — the file that imports Tailwind. */\n css: string\n /** `node_modules/rei-kit/dist/tokens.css`, for the roles it declares. */\n tokens: string\n}\n\n/** Every `--color-<name>` a stylesheet declares. */\nfunction colourRoles(css: string): Set<string> {\n return new Set([...css.matchAll(/--color-([a-z0-9-]+)\\s*:/g)].map(([, name]) => name!))\n}\n\nfunction imports(css: string, file: string): boolean {\n return new RegExp(`@import\\\\s+['\"]rei-kit/${file}['\"]`).test(css)\n}\n\n/**\n * What is missing from an app's stylesheet, as a list to assert is empty.\n *\n * ```ts\n * import { checkStyling } from 'rei-kit/check'\n *\n * it('is wired to the kit', () => {\n * expect(\n * checkStyling({\n * css: readFileSync('src/assets/main.css', 'utf8'),\n * tokens: readFileSync('node_modules/rei-kit/dist/tokens.css', 'utf8'),\n * }),\n * ).toEqual([])\n * })\n * ```\n */\nexport function checkStyling({ css, tokens }: StylingInput): StylingProblem[] {\n const problems: StylingProblem[] = []\n\n /* The preset is tokens, shell, materials, palettes, the compiled component\n styles and the `@source` — so an app that imports one has answered every\n question below at once, and asking them separately would report faults it\n does not have. */\n const preset = imports(css, 'mobile.css') || imports(css, 'web.css')\n\n if (preset && imports(css, 'mobile.css') && imports(css, 'web.css')) {\n problems.push({\n message:\n 'Both presets are imported. They are two answers to the same question, and the second one wins wherever they disagree.',\n fix: \"keep one of @import 'rei-kit/mobile.css' or @import 'rei-kit/web.css'\",\n })\n }\n\n if (!preset) {\n if (!imports(css, 'styles.css')) {\n problems.push({\n message:\n 'The compiled component styles are not imported, so every component keeps its markup and loses its layout. Nothing else reports this: the build is green and the page renders.',\n fix: \"@import 'rei-kit/mobile.css'; /* or web.css — the preset carries the rest too */\",\n })\n }\n\n if (!/@source\\s+['\"][^'\"]*node_modules\\/rei-kit[^'\"]*['\"]/.test(css)) {\n problems.push({\n message:\n 'Tailwind is not told to scan the kit, so it emits no utility the components ask for. It does not walk node_modules unless pointed at it.',\n fix: \"@source '<relative path>/node_modules/rei-kit/dist';\",\n })\n }\n }\n\n /* Checked last and only when the roles cannot be arriving from the kit\n itself, so the list reports what the app has to define rather than\n repeating the import it is already being told about. */\n const declared = colourRoles(css)\n if (!preset && !imports(css, 'tokens.css')) {\n const missing = [...colourRoles(tokens)].filter((role) => !declared.has(role))\n\n if (missing.length) {\n problems.push({\n message: `These colour roles are never defined, so every utility built on them emits nothing: ${missing.join(', ')}.`,\n fix: \"@import 'rei-kit/tokens.css';\",\n })\n }\n }\n\n return problems\n}\n"],"mappings":";;AAuCA,SAAS,YAAY,KAA0B;CAC7C,OAAO,IAAI,IAAI,CAAC,GAAG,IAAI,SAAS,2BAA2B,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,IAAK,CAAC;AACxF;AAEA,SAAS,QAAQ,KAAa,MAAuB;CACnD,OAAO,IAAI,OAAO,0BAA0B,KAAK,KAAK,CAAC,CAAC,KAAK,GAAG;AAClE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,aAAa,EAAE,KAAK,UAA0C;CAC5E,MAAM,WAA6B,CAAC;CAMpC,MAAM,SAAS,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,SAAS;CAEnE,IAAI,UAAU,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,SAAS,GAChE,SAAS,KAAK;EACZ,SACE;EACF,KAAK;CACP,CAAC;CAGH,IAAI,CAAC,QAAQ;EACX,IAAI,CAAC,QAAQ,KAAK,YAAY,GAC5B,SAAS,KAAK;GACZ,SACE;GACF,KAAK;EACP,CAAC;EAGH,IAAI,CAAC,sDAAsD,KAAK,GAAG,GACjE,SAAS,KAAK;GACZ,SACE;GACF,KAAK;EACP,CAAC;CAEL;CAKA,MAAM,WAAW,YAAY,GAAG;CAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,KAAK,YAAY,GAAG;EAC1C,MAAM,UAAU,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC;EAE7E,IAAI,QAAQ,QACV,SAAS,KAAK;GACZ,SAAS,uFAAuF,QAAQ,KAAK,IAAI,EAAE;GACnH,KAAK;EACP,CAAC;CAEL;
|
|
1
|
+
{"version":3,"file":"check.js","names":[],"sources":["../src/check/index.ts"],"sourcesContent":["/**\n * The wiring that fails silently, checked at unit-test speed.\n *\n * Every line of this package's install can be left out and leave a build that\n * is green: a missing `@source` means Tailwind never emits the utilities the\n * components ask for, a missing stylesheet import means the components keep\n * their markup and lose their layout, and a colour role the app never defines\n * makes `bg-primary` emit no declaration at all. None of it is visible to\n * `vue-tsc`, to a component test, or to a reader of the diff. One of the apps\n * in this family shipped a release with its tab bar invisible exactly this\n * way.\n *\n * Both apps then wrote the same check, independently, with three of the four\n * assertions carrying the same names — which is this kit's own test for a\n * missing part. So the check moved here, and it knows one thing their copies\n * could not: that the preset exists and carries the `@source` and the\n * component styles with it.\n *\n * Nothing here reads a file or touches the DOM. The caller supplies the two\n * stylesheets as text, because that is the only part that differs between a\n * Vitest run, a Node script and a CI step.\n */\n\n/** A problem found in an app's stylesheet, written to be read in a failure. */\nexport type StylingProblem = {\n /** What is wrong, in one sentence. */\n message: string\n /** The line to add, where there is a single obvious one. */\n fix?: string\n}\n\nexport type StylingInput = {\n /** The app's own stylesheet — the file that imports Tailwind. */\n css: string\n /** `node_modules/rei-kit/dist/tokens.css`, for the roles it declares. */\n tokens: string\n}\n\n/** Every `--color-<name>` a stylesheet declares. */\nfunction colourRoles(css: string): Set<string> {\n return new Set([...css.matchAll(/--color-([a-z0-9-]+)\\s*:/g)].map(([, name]) => name!))\n}\n\nfunction imports(css: string, file: string): boolean {\n return new RegExp(`@import\\\\s+['\"]rei-kit/${file}['\"]`).test(css)\n}\n\n/**\n * The roles a rule in the dark sets, where that rule can beat `:root`.\n *\n * The kit writes two kinds, and the difference is the whole point. A plain\n * `.dark { … }` has the same specificity as `:root` and is emitted after it,\n * so it wins — an app that restates one of those roles in `@theme` and not\n * under `.dark` keeps the kit's colour at night. A `:where(.dark) { … }`\n * carries no specificity at all, which is exactly why the kit puts the\n * filled roles there: an app's own brand has to survive after dark, and\n * before that block existed the kit's lightening beat it.\n *\n * So only the first kind is something an app has to answer, and a reader\n * that lumps them together reports nine roles that are already correct. It\n * did, once, against a real app — which is how this comment came to be here\n * rather than in the version that shipped.\n *\n * The body runs to its matching brace, not the next one: these blocks hold\n * comments and nested rules. And it is found from a rule rather than from\n * the word, or a comment mentioning `.dark` starts the slice and swallows\n * the stylesheet.\n */\nfunction darkRoles(css: string): Set<string> {\n const bodies: string[] = []\n\n /* Not preceded by `)` or a word character, so `:where(.dark)` and\n `.dark [data-palette]` are both left out — the first for specificity,\n the second because it answers a palette rather than the app. */\n for (const match of css.matchAll(/(?<![\\w):])\\.dark\\s*\\{/g)) {\n let depth = 1\n let at = match.index! + match[0].length\n\n while (at < css.length && depth > 0) {\n if (css[at] === '{') depth += 1\n else if (css[at] === '}') depth -= 1\n at += 1\n }\n\n bodies.push(css.slice(match.index! + match[0].length, at - 1))\n }\n\n return colourRoles(bodies.join('\\n'))\n}\n\n/**\n * What is missing from an app's stylesheet, as a list to assert is empty.\n *\n * ```ts\n * import { checkStyling } from 'rei-kit/check'\n *\n * it('is wired to the kit', () => {\n * expect(\n * checkStyling({\n * css: readFileSync('src/assets/main.css', 'utf8'),\n * tokens: readFileSync('node_modules/rei-kit/dist/tokens.css', 'utf8'),\n * }),\n * ).toEqual([])\n * })\n * ```\n */\nexport function checkStyling({ css, tokens }: StylingInput): StylingProblem[] {\n const problems: StylingProblem[] = []\n\n /* The preset is tokens, shell, materials, palettes, the compiled component\n styles and the `@source` — so an app that imports one has answered every\n question below at once, and asking them separately would report faults it\n does not have. */\n const preset = imports(css, 'mobile.css') || imports(css, 'web.css')\n\n if (preset && imports(css, 'mobile.css') && imports(css, 'web.css')) {\n problems.push({\n message:\n 'Both presets are imported. They are two answers to the same question, and the second one wins wherever they disagree.',\n fix: \"keep one of @import 'rei-kit/mobile.css' or @import 'rei-kit/web.css'\",\n })\n }\n\n if (!preset) {\n if (!imports(css, 'styles.css')) {\n problems.push({\n message:\n 'The compiled component styles are not imported, so every component keeps its markup and loses its layout. Nothing else reports this: the build is green and the page renders.',\n fix: \"@import 'rei-kit/mobile.css'; /* or web.css — the preset carries the rest too */\",\n })\n }\n\n if (!/@source\\s+['\"][^'\"]*node_modules\\/rei-kit[^'\"]*['\"]/.test(css)) {\n problems.push({\n message:\n 'Tailwind is not told to scan the kit, so it emits no utility the components ask for. It does not walk node_modules unless pointed at it.',\n fix: \"@source '<relative path>/node_modules/rei-kit/dist';\",\n })\n }\n }\n\n /* Checked last and only when the roles cannot be arriving from the kit\n itself, so the list reports what the app has to define rather than\n repeating the import it is already being told about. */\n const declared = colourRoles(css)\n if (!preset && !imports(css, 'tokens.css')) {\n const missing = [...colourRoles(tokens)].filter((role) => !declared.has(role))\n\n if (missing.length) {\n problems.push({\n message: `These colour roles are never defined, so every utility built on them emits nothing: ${missing.join(', ')}.`,\n fix: \"@import 'rei-kit/tokens.css';\",\n })\n }\n }\n\n /* The trap an app found before this check existed, and the sharpest one\n here: `@theme` compiles to `:root`, which Tailwind emits near the top of\n the stylesheet, while the kit's `.dark` block arrives after it. A role\n the app restates in `@theme` but not under `.dark` therefore keeps the\n kit's value at night — so the app comes up in somebody else's colours\n after dark, with a green build and every other check passing. */\n const kitDark = darkRoles(tokens)\n const appDark = darkRoles(css)\n const redefined = [...declared].filter((role) => kitDark.has(role) && !appDark.has(role))\n\n if (redefined.length) {\n problems.push({\n message: `These roles are redefined for the day and left at the kit's own values at night, because \\`@theme\\` lands in \\`:root\\` and the kit's \\`.dark\\` comes after it: ${redefined.join(', ')}.`,\n fix: '.dark { --color-primary: …; } — restate each one under `.dark` as well',\n })\n }\n\n return problems\n}\n"],"mappings":";;AAuCA,SAAS,YAAY,KAA0B;CAC7C,OAAO,IAAI,IAAI,CAAC,GAAG,IAAI,SAAS,2BAA2B,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,IAAK,CAAC;AACxF;AAEA,SAAS,QAAQ,KAAa,MAAuB;CACnD,OAAO,IAAI,OAAO,0BAA0B,KAAK,KAAK,CAAC,CAAC,KAAK,GAAG;AAClE;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,UAAU,KAA0B;CAC3C,MAAM,SAAmB,CAAC;CAK1B,KAAK,MAAM,SAAS,IAAI,SAAS,yBAAyB,GAAG;EAC3D,IAAI,QAAQ;EACZ,IAAI,KAAK,MAAM,QAAS,MAAM,EAAE,CAAC;EAEjC,OAAO,KAAK,IAAI,UAAU,QAAQ,GAAG;GACnC,IAAI,IAAI,QAAQ,KAAK,SAAS;QACzB,IAAI,IAAI,QAAQ,KAAK,SAAS;GACnC,MAAM;EACR;EAEA,OAAO,KAAK,IAAI,MAAM,MAAM,QAAS,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,CAAC;CAC/D;CAEA,OAAO,YAAY,OAAO,KAAK,IAAI,CAAC;AACtC;;;;;;;;;;;;;;;;;AAkBA,SAAgB,aAAa,EAAE,KAAK,UAA0C;CAC5E,MAAM,WAA6B,CAAC;CAMpC,MAAM,SAAS,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,SAAS;CAEnE,IAAI,UAAU,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,SAAS,GAChE,SAAS,KAAK;EACZ,SACE;EACF,KAAK;CACP,CAAC;CAGH,IAAI,CAAC,QAAQ;EACX,IAAI,CAAC,QAAQ,KAAK,YAAY,GAC5B,SAAS,KAAK;GACZ,SACE;GACF,KAAK;EACP,CAAC;EAGH,IAAI,CAAC,sDAAsD,KAAK,GAAG,GACjE,SAAS,KAAK;GACZ,SACE;GACF,KAAK;EACP,CAAC;CAEL;CAKA,MAAM,WAAW,YAAY,GAAG;CAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,KAAK,YAAY,GAAG;EAC1C,MAAM,UAAU,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC;EAE7E,IAAI,QAAQ,QACV,SAAS,KAAK;GACZ,SAAS,uFAAuF,QAAQ,KAAK,IAAI,EAAE;GACnH,KAAK;EACP,CAAC;CAEL;CAQA,MAAM,UAAU,UAAU,MAAM;CAChC,MAAM,UAAU,UAAU,GAAG;CAC7B,MAAM,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC;CAExF,IAAI,UAAU,QACZ,SAAS,KAAK;EACZ,SAAS,kKAAkK,UAAU,KAAK,IAAI,EAAE;EAChM,KAAK;CACP,CAAC;CAGH,OAAO;AACT"}
|
|
@@ -42,6 +42,25 @@ declare const __VLS_export: <T extends string | number | undefined = string>(__V
|
|
|
42
42
|
* its errors impossible without hand-writing the control.
|
|
43
43
|
*/
|
|
44
44
|
fieldId?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Classes for the control itself, rather than for the field around it.
|
|
47
|
+
*
|
|
48
|
+
* `class` lands on the field, because that is where Vue puts a
|
|
49
|
+
* component's class and because a layout class means "space this field".
|
|
50
|
+
* That leaves `variant="unstyled"` with no way to paint the control it
|
|
51
|
+
* just stripped — the point of stripping it — which is why an app with a
|
|
52
|
+
* large amount field wrote the whole thing by hand instead.
|
|
53
|
+
*
|
|
54
|
+
* It appends, so with the default variant a conflict is settled by
|
|
55
|
+
* Tailwind's own order rather than by writing it here; reach for it with
|
|
56
|
+
* `unstyled`, where there is nothing to settle.
|
|
57
|
+
*
|
|
58
|
+
* Under `unstyled` it also takes over the 16px floor that stops iOS
|
|
59
|
+
* zooming on focus: `text-base` cannot be beaten by a larger utility, so
|
|
60
|
+
* the kit stops asserting it rather than overrule a caller who asked to
|
|
61
|
+
* paint the control. Keep the control at 16px or more.
|
|
62
|
+
*/
|
|
63
|
+
controlClass?: string | undefined;
|
|
45
64
|
} & Omit<InputHTMLAttributes, "type" | "size">) & {
|
|
46
65
|
"onUpdate:modelValue"?: (value: T) => any;
|
|
47
66
|
}> & (typeof globalThis extends {
|
|
@@ -44,6 +44,20 @@ declare const __VLS_export: <T extends string | number>(__VLS_props: NonNullable
|
|
|
44
44
|
* its errors impossible without hand-writing the control.
|
|
45
45
|
*/
|
|
46
46
|
fieldId?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Classes for the control itself, rather than for the field around it.
|
|
49
|
+
*
|
|
50
|
+
* `class` lands on the field, because that is where Vue puts a
|
|
51
|
+
* component's class and because a layout class means "space this field".
|
|
52
|
+
* That leaves `variant="unstyled"` with no way to paint the control it
|
|
53
|
+
* just stripped — the point of stripping it — which is why an app with a
|
|
54
|
+
* large amount field wrote the whole thing by hand instead.
|
|
55
|
+
*
|
|
56
|
+
* It appends, so with the default variant a conflict is settled by
|
|
57
|
+
* Tailwind's own order rather than by writing it here; reach for it with
|
|
58
|
+
* `unstyled`, where there is nothing to settle.
|
|
59
|
+
*/
|
|
60
|
+
controlClass?: string | undefined;
|
|
47
61
|
} & {
|
|
48
62
|
modelValue?: T | undefined;
|
|
49
63
|
}) & {
|
|
@@ -35,6 +35,20 @@ type __VLS_Props = {
|
|
|
35
35
|
* its errors impossible without hand-writing the control.
|
|
36
36
|
*/
|
|
37
37
|
fieldId?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Classes for the control itself, rather than for the field around it.
|
|
40
|
+
*
|
|
41
|
+
* `class` lands on the field, because that is where Vue puts a
|
|
42
|
+
* component's class and because a layout class means "space this field".
|
|
43
|
+
* That leaves `variant="unstyled"` with no way to paint the control it
|
|
44
|
+
* just stripped — the point of stripping it — which is why an app with a
|
|
45
|
+
* large amount field wrote the whole thing by hand instead.
|
|
46
|
+
*
|
|
47
|
+
* It appends, so with the default variant a conflict is settled by
|
|
48
|
+
* Tailwind's own order rather than by writing it here; reach for it with
|
|
49
|
+
* `unstyled`, where there is nothing to settle.
|
|
50
|
+
*/
|
|
51
|
+
controlClass?: string | undefined;
|
|
38
52
|
};
|
|
39
53
|
/**
|
|
40
54
|
* Focus the control, for a caller that owns when it happens.
|
|
@@ -51,6 +51,20 @@ type __VLS_Props = {
|
|
|
51
51
|
/** The input's `id`, for an `ErrorSummary` that links to this field. */
|
|
52
52
|
fieldId?: string | undefined;
|
|
53
53
|
size?: 'sm' | 'md' | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Classes for the control itself, rather than for the field around it.
|
|
56
|
+
*
|
|
57
|
+
* `class` lands on the field, because that is where Vue puts a
|
|
58
|
+
* component's class and because a layout class means "space this field".
|
|
59
|
+
* That leaves `variant="unstyled"` with no way to paint the control it
|
|
60
|
+
* just stripped — the point of stripping it — which is why an app with a
|
|
61
|
+
* large amount field wrote the whole thing by hand instead.
|
|
62
|
+
*
|
|
63
|
+
* It appends, so with the default variant a conflict is settled by
|
|
64
|
+
* Tailwind's own order rather than by writing it here; reach for it with
|
|
65
|
+
* `unstyled`, where there is nothing to settle.
|
|
66
|
+
*/
|
|
67
|
+
controlClass?: string | undefined;
|
|
54
68
|
} & /* @vue-ignore */ Omit<InputHTMLAttributes, 'size' | 'type'>;
|
|
55
69
|
/**
|
|
56
70
|
* Focus the control, for a caller that owns when it happens.
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as addDays, c as lastNDays, d as toDateKey, f as todayKey, i as needsIosInstall, l as leadingBlanks, n as isApplePortable, o as eachDayOfYear, r as isInstalled, s as fromDateKey, t as SettingsGroup_default, u as startOfWeek } from "./SettingsGroup-BXkajKGl.js";
|
|
2
2
|
import { a as formatNumber, i as formatDate, o as setFormatLocale, r as watchVisibility } from "./environment-Cz5KiC1t.js";
|
|
3
3
|
import { a as BaseCheckbox_default, c as useBoundValue, d as ensureSheetRoot, i as textDirection, l as useVisualViewport, n as elementDirection, o as BaseSheet_default, r as horizontalStep, t as focusTarget, u as SHEET_ROOT_ID } from "./focus-target-BtcoJdmz.js";
|
|
4
|
-
import { _ as toRedirectPath, a as useFieldAttrs, c as useToast, d as isThemePreference, f as readStoredTheme, g as safeRedirect, h as tapFeedback, i as BaseInput_default, l as useOnline, m as useTheme, n as useAnnounce, o as FormField_default, p as setThemeStorageKey, r as GoogleButton_default, s as BaseAlert_default, t as announce, u as applyTheme } from "./use-announce-
|
|
4
|
+
import { _ as toRedirectPath, a as useFieldAttrs, c as useToast, d as isThemePreference, f as readStoredTheme, g as safeRedirect, h as tapFeedback, i as BaseInput_default, l as useOnline, m as useTheme, n as useAnnounce, o as FormField_default, p as setThemeStorageKey, r as GoogleButton_default, s as BaseAlert_default, t as announce, u as applyTheme } from "./use-announce-B8Ln-LsE.js";
|
|
5
5
|
import { n as registerErrorMapper, r as toAppError, t as AppError } from "./app-error-DF9cijE0.js";
|
|
6
6
|
import { a as BaseSkeleton_default, c as useMediaQuery, l as useDragScroll, n as ScrollArea_default, o as useMenuKeys, s as useAnchoredPanel, t as BaseListbox_default } from "./BaseListbox-D-NQ6nDd.js";
|
|
7
7
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
|
|
@@ -1015,7 +1015,8 @@ var BaseSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
1015
1015
|
placeholder: { default: "" },
|
|
1016
1016
|
size: { default: "md" },
|
|
1017
1017
|
variant: { default: "default" },
|
|
1018
|
-
fieldId: { default: () => void 0 }
|
|
1018
|
+
fieldId: { default: () => void 0 },
|
|
1019
|
+
controlClass: { default: () => void 0 }
|
|
1019
1020
|
}, {
|
|
1020
1021
|
"modelValue": {},
|
|
1021
1022
|
"modelModifiers": {}
|
|
@@ -1063,7 +1064,8 @@ var BaseSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
1063
1064
|
class: normalizeClass(["w-full appearance-none", [
|
|
1064
1065
|
__props.variant === "unstyled" ? "" : "control text-ink rounded-card focus-visible:outline-primary py-0 pr-10 pl-3 focus-visible:outline-2 focus-visible:outline-offset-1",
|
|
1065
1066
|
__props.variant === "unstyled" ? "" : SIZE_CLASS[__props.size],
|
|
1066
|
-
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1067
|
+
__props.variant !== "unstyled" && invalid ? "border-negative" : "",
|
|
1068
|
+
__props.controlClass
|
|
1067
1069
|
]])
|
|
1068
1070
|
}, [__props.placeholder ? (openBlock(), createElementBlock("option", _hoisted_3$28, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1069
1071
|
return openBlock(), createElementBlock("option", {
|
|
@@ -1621,7 +1623,8 @@ var BaseTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1621
1623
|
rows: { default: 4 },
|
|
1622
1624
|
size: { default: "md" },
|
|
1623
1625
|
variant: { default: "default" },
|
|
1624
|
-
fieldId: { default: () => void 0 }
|
|
1626
|
+
fieldId: { default: () => void 0 },
|
|
1627
|
+
controlClass: { default: () => void 0 }
|
|
1625
1628
|
},
|
|
1626
1629
|
emits: ["update:modelValue"],
|
|
1627
1630
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -1667,7 +1670,8 @@ var BaseTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1667
1670
|
}, unref(controlAttrs), { class: [
|
|
1668
1671
|
__props.variant === "unstyled" ? "" : "control text-ink rounded-card focus-visible:outline-primary resize-y px-3 py-2 leading-relaxed focus-visible:outline-2 focus-visible:outline-offset-1",
|
|
1669
1672
|
"text-base",
|
|
1670
|
-
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1673
|
+
__props.variant !== "unstyled" && invalid ? "border-negative" : "",
|
|
1674
|
+
__props.controlClass
|
|
1671
1675
|
] }), null, 16, _hoisted_1$40), [[vModelText, unref(model)]])]),
|
|
1672
1676
|
_: 1
|
|
1673
1677
|
}, 8, [
|
|
@@ -4763,7 +4767,8 @@ var PasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
4763
4767
|
default: false
|
|
4764
4768
|
},
|
|
4765
4769
|
fieldId: { default: () => void 0 },
|
|
4766
|
-
size: { default: "md" }
|
|
4770
|
+
size: { default: "md" },
|
|
4771
|
+
controlClass: { default: () => void 0 }
|
|
4767
4772
|
},
|
|
4768
4773
|
emits: ["update:modelValue", "toggle"],
|
|
4769
4774
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -4849,7 +4854,11 @@ var PasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
4849
4854
|
autocapitalize: "none",
|
|
4850
4855
|
spellcheck: false
|
|
4851
4856
|
}, unref(controlAttrs), {
|
|
4852
|
-
class: ["control text-ink rounded-card focus-visible:outline-primary w-full ps-3 pe-11 focus-visible:outline-2 focus-visible:outline-offset-1", [
|
|
4857
|
+
class: ["control text-ink rounded-card focus-visible:outline-primary w-full ps-3 pe-11 focus-visible:outline-2 focus-visible:outline-offset-1", [
|
|
4858
|
+
CONTROL_CLASS,
|
|
4859
|
+
invalid ? "border-negative" : "",
|
|
4860
|
+
__props.controlClass
|
|
4861
|
+
]],
|
|
4853
4862
|
onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
|
|
4854
4863
|
}), null, 16, _hoisted_2$2), createElementVNode("button", {
|
|
4855
4864
|
type: "button",
|
|
@@ -5189,7 +5198,7 @@ function createI18nRuntime(options) {
|
|
|
5189
5198
|
*
|
|
5190
5199
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
5191
5200
|
*/
|
|
5192
|
-
var VERSION = "3.
|
|
5201
|
+
var VERSION = "3.7.0";
|
|
5193
5202
|
//#endregion
|
|
5194
5203
|
export { ActivityGrid_default as ActivityGrid, AnnounceHost_default as AnnounceHost, AppError, AvatarStack_default as AvatarStack, BarChart_default as BarChart, BaseAlert_default as BaseAlert, BaseAvatar_default as BaseAvatar, BaseBadge_default as BaseBadge, BaseButton_default as BaseButton, BaseCalendar_default as BaseCalendar, BaseCard_default as BaseCard, BaseCheckbox_default as BaseCheckbox, BaseChip_default as BaseChip, BaseCombobox_default as BaseCombobox, BaseDatePicker_default as BaseDatePicker, BaseInput_default as BaseInput, BaseKbd_default as BaseKbd, BaseLink_default as BaseLink, BaseListbox_default as BaseListbox, BaseMenu_default as BaseMenu, BasePopconfirm_default as BasePopconfirm, BasePopover_default as BasePopover, BaseRadioGroup_default as BaseRadioGroup, BaseRating_default as BaseRating, BaseSelect_default as BaseSelect, BaseSeparator_default as BaseSeparator, BaseSheet_default as BaseSheet, BaseSkeleton_default as BaseSkeleton, BaseSlider_default as BaseSlider, BaseSpinner_default as BaseSpinner, BaseStepper_default as BaseStepper, BaseSwitch_default as BaseSwitch, BaseTable_default as BaseTable, BaseTextarea_default as BaseTextarea, BaseTimeline_default as BaseTimeline, CircularProgress_default as CircularProgress, CodeBlock_default as CodeBlock, ColorPicker_default as ColorPicker, CopyButton_default as CopyButton, DescriptionList_default as DescriptionList, DonutChart_default as DonutChart, EmptyState_default as EmptyState, ErrorBoundary_default as ErrorBoundary, ErrorSummary_default as ErrorSummary, FileDrop_default as FileDrop, FormField_default as FormField, GoogleButton_default as GoogleButton, LocaleLinks_default as LocaleLinks, MATERIALS, NumberInput_default as NumberInput, PALETTES, PageContainer_default as PageContainer, PageHeader_default as PageHeader, PasswordInput_default as PasswordInput, PinInput_default as PinInput, PriceCard_default as PriceCard, ProgressBar_default as ProgressBar, SHEET_ROOT_ID, ScrollArea_default as ScrollArea, SectionHeading_default as SectionHeading, SegmentedControl_default as SegmentedControl, SettingsGroup_default as SettingsGroup, SettingsRow_default as SettingsRow, SkeletonList_default as SkeletonList, SliderField_default as SliderField, StatCard_default as StatCard, TabBar_default as TabBar, TagsInput_default as TagsInput, TimePicker_default as TimePicker, ToastHost_default as ToastHost, ToggleGroup_default as ToggleGroup, ToneDot_default as ToneDot, VERSION, VirtualList_default as VirtualList, addDays, announce, applyMaterial, applyPalette, applyTheme, createI18nRuntime, downloadJson, eachDayOfYear, elementDirection, ensureSheetRoot, formatDate, formatNumber, fromDateKey, horizontalStep, isApplePortable, isInstalled, isMaterial, isPaletteName, isThemePreference, lastNDays, leadingBlanks, needsIosInstall, readStoredTheme, registerErrorMapper, relativeDayLabel, safeRedirect, setFormatLocale, setMaterialStorageKey, setPaletteStorageKey, setThemeStorageKey, startOfWeek, tapFeedback, textDirection, toAppError, toDateKey, toRedirectPath, todayKey, useAnnounce, useDebouncedCallback, useDragScroll, useMaterial, useMediaQuery, useOnline, usePalette, useTheme, useToast, useToday, useVisualViewport };
|
|
5195
5204
|
|