bitboss-ui 3.0.0-beta.75 → 3.0.0-beta.76
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/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +1 -1
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbColorInput.md +1 -1
- package/dist/ai/BbColorPalette.md +1 -1
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +1 -1
- package/dist/ai/BbDatePickerInput.md +1 -1
- package/dist/ai/BbDialog.md +3 -2
- package/dist/ai/BbDropdown.md +23 -21
- package/dist/ai/BbDropdownButton.md +13 -11
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbSelect.md +153 -43
- package/dist/ai/BbSelectPopover.md +115 -9
- package/dist/ai/BbTable.md +1 -1
- package/dist/ai/BbTimePicker.md +1 -1
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/GroupedListBox.md +2 -2
- package/dist/ai/ListBox.md +3 -2
- package/dist/ai/changelog.json +153 -7
- package/dist/ai/components.json +12 -12
- package/dist/ai/guides/agent-contract.md +1 -1
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/v2-to-v3.md +48 -19
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +19 -17
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -9
- package/dist/ai/manifest/components/BbDropdownButton.json +12 -10
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +44 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -6
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +4 -1
- package/dist/ai/manifest/components/BbTable.tree.json +5 -1
- package/dist/ai/manifest/components/GroupedListBox.json +1 -1
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +1 -1
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +9 -2
- package/dist/ai/source/BbBadge.md +6 -2
- package/dist/ai/source/BbBreadcrumbs.md +5 -2
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +10 -6
- package/dist/ai/source/BbColorPalette.md +5 -2
- package/dist/ai/source/BbDatePickerInput.md +7 -2
- package/dist/ai/source/BbDropdown.md +91 -66
- package/dist/ai/source/BbDropdownButton.md +36 -19
- package/dist/ai/source/BbDropdownGroup.md +91 -66
- package/dist/ai/source/BbGallery.md +6 -5
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +130 -106
- package/dist/ai/source/BbSelectPopover.md +128 -21
- package/dist/ai/source/BbTable.md +42 -9
- package/dist/ai/source/BbTimePickerInput.md +6 -2
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +7 -2
- package/dist/ai/source/GroupedListBox.md +22 -3
- package/dist/ai/source/ListBox.md +7 -1
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +48 -47
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +128 -127
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +500 -499
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +175 -174
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +263 -262
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +318 -312
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +47 -46
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +36 -20
- package/dist/components/BbDropdown/types.d.ts +51 -53
- package/dist/components/BbDropdown/types.js +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +1 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +74 -59
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +111 -63
- package/dist/components/BbDropdownButton/types.d.ts +12 -10
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +204 -203
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +30 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +201 -184
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +101 -105
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +6 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +617 -585
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +22 -13
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1092 -1090
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +225 -224
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +76 -75
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +69 -68
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +166 -165
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/llms-full.txt +477 -187
- package/dist/llms-medium.txt +25 -24
- package/dist/llms.txt +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +4 -4
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +319 -306
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +73 -12
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BB_COMPONENT_ICON_ROLES as e, BB_ICON_ROLES as t } from "../types/internalIcons.js";
|
|
2
|
+
import { closestName as n } from "./configDefaults.js";
|
|
3
|
+
import { existsSync as r, readdirSync as i, statSync as a } from "node:fs";
|
|
4
|
+
import { join as o } from "node:path";
|
|
5
|
+
// src/utils/iconsOption.ts
|
|
6
|
+
var s = (e) => !!e && typeof e == "object" && !Array.isArray(e), c = /^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9_.-]*$/i, l = [
|
|
7
|
+
"dir",
|
|
8
|
+
"whitelist",
|
|
9
|
+
"defaults"
|
|
10
|
+
], u = t, d = (e, t, r = u) => {
|
|
11
|
+
if (!s(e)) return `[bitboss-ui] ${t} must be an object of role → icon name, e.g. { close: 'ph:x-bold' }.`;
|
|
12
|
+
for (let [i, a] of Object.entries(e)) {
|
|
13
|
+
if (!r.includes(i)) {
|
|
14
|
+
let e = n(i, r);
|
|
15
|
+
return `[bitboss-ui] ${t}.${i}: not a glyph role here.${u.includes(i) ? ` ${t.replace(/\.icons$/, "")} draws no \`${i}\`.` : ""}${e ? ` Did you mean "${e}"?` : ""} It takes: ${r.join(", ")}.`;
|
|
16
|
+
}
|
|
17
|
+
if (typeof a != "string" || !c.test(a)) return `[bitboss-ui] ${t}.${i} must be an icon name, \`prefix:name\` from an installed set ('ph:x-bold') or \`local:name\` (an SVG in icons.dir); received ${JSON.stringify(a)}.`;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}, f = (e) => {
|
|
21
|
+
if (e === void 0) return null;
|
|
22
|
+
if (!s(e)) return "[bitboss-ui] icons must be an object, e.g. icons: { dir: './assets/icons', whitelist: ['tabler:crown'], defaults: { close: 'ph:x-bold' } }.";
|
|
23
|
+
for (let t of Object.keys(e)) if (!l.includes(t)) {
|
|
24
|
+
let e = n(t, l);
|
|
25
|
+
return `[bitboss-ui] icons.${t}: not a key icons takes${e ? ` — did you mean "${e}"?` : "."} It takes: ${l.join(", ")}. A role goes under icons.defaults (icons: { defaults: { ${u.includes(t) ? t : "close"}: '…' } }).`;
|
|
26
|
+
}
|
|
27
|
+
return e.dir !== void 0 && typeof e.dir != "string" ? "[bitboss-ui] icons.dir must be a path string." : e.whitelist !== void 0 && !(Array.isArray(e.whitelist) && e.whitelist.every((e) => typeof e == "string")) ? "[bitboss-ui] icons.whitelist must be an array of icon names or globs." : e.defaults === void 0 ? null : d(e.defaults, "icons.defaults");
|
|
28
|
+
}, p = (t, n, r) => {
|
|
29
|
+
let i = e[t];
|
|
30
|
+
return i ? d(n, `${r}.${t}.icons`, i) : `[bitboss-ui] ${r}.${t}.icons: ${t} draws none of the library's swappable glyphs.`;
|
|
31
|
+
}, m = (e, t) => {
|
|
32
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
33
|
+
if (s(e)) for (let t of Object.values(e)) typeof t == "string" && n.add(t);
|
|
34
|
+
};
|
|
35
|
+
r(e?.defaults);
|
|
36
|
+
for (let e of Object.values(t ?? {})) s(e) && r(e.icons);
|
|
37
|
+
return [...n];
|
|
38
|
+
}, h = (e, t) => {
|
|
39
|
+
if (!e.length) return [];
|
|
40
|
+
let n = /* @__PURE__ */ new Set(), s = (e) => {
|
|
41
|
+
for (let t of i(e)) {
|
|
42
|
+
let r = o(e, t);
|
|
43
|
+
a(r).isDirectory() ? s(r) : /\.svg$/i.test(t) && n.add(`local:${t.replace(/\.svg$/i, "")}`);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return r(t) && s(t), e.filter((e) => !n.has(e));
|
|
47
|
+
};
|
|
48
|
+
export { m as iconNamesOf, h as missingLocalIcons, p as validateComponentIcons, d as validateGlyphMap, f as validateIconsOption };
|
|
@@ -9,7 +9,7 @@ function r() {
|
|
|
9
9
|
if (process.env.NODE_ENV === "production" || n || typeof window > "u") return;
|
|
10
10
|
n = !0;
|
|
11
11
|
let r = () => {
|
|
12
|
-
let n = t("3.0.0-beta.
|
|
12
|
+
let n = t("3.0.0-beta.76", getComputedStyle(document.documentElement).getPropertyValue(e));
|
|
13
13
|
n && console.warn(n);
|
|
14
14
|
};
|
|
15
15
|
document.readyState === "complete" ? setTimeout(r, 0) : window.addEventListener("load", r, { once: !0 });
|
package/dist/vite-plugin.d.ts
CHANGED
|
@@ -6,16 +6,18 @@ import { BUILTIN_LOCALE_KEYS, BuiltinLocaleKey } from './i18n/regions.js';
|
|
|
6
6
|
import { InternationalCalendarId } from './utilities/calendar/types.js';
|
|
7
7
|
import { invalidLocaleTag } from './i18n/localeTags.js';
|
|
8
8
|
import { CssLayersOption } from './utils/cssLayers.js';
|
|
9
|
+
import { BbIconsOption } from './types/internalIcons.js';
|
|
9
10
|
import { BbComponentsMap, BbInferredComponentsMap, BbUninferredVariants } from './types/ConfigDefaults.js';
|
|
10
11
|
export { DEFAULT_MAX_FILE_SIZE, IconScanner, extractIconCandidates, iconLiteralRegExp, iconScanCacheFile, } from './icon-scan.js';
|
|
11
12
|
export type { IconsScannerOptions, ScanStats } from './icon-scan.js';
|
|
13
|
+
export type { BbIconName, BbIconRole, BbIconsOption, } from './types/internalIcons.js';
|
|
12
14
|
export { BB_LAYERS, TAILWIND_V3_LAYERS, TAILWIND_V4_LAYERS, type CssLayersOption, } from './utils/cssLayers.js';
|
|
13
15
|
export { invalidLocaleTag };
|
|
14
16
|
type DiagnoseFn = (key: string, loaded: Set<string>, known: (prefix: string) => string[], all: (prefix: string) => string[] | null, ip: Set<string>) => string | null;
|
|
15
17
|
/** The diagnosis, as a callable, for the Node side (whitelist validation). */
|
|
16
18
|
export declare const diagnoseMissingIcon: DiagnoseFn;
|
|
17
19
|
/**
|
|
18
|
-
* Expand `
|
|
20
|
+
* Expand `icons.whitelist` into concrete `prefix:name` entries. Exact names must
|
|
19
21
|
* resolve; a glob (`tabler:calendar-*`) expands to every matching name of the
|
|
20
22
|
* set and must match at least one. Anything else is an error carrying the same
|
|
21
23
|
* message the dev overlay shows for a missing icon — a whitelist entry that
|
|
@@ -243,12 +245,13 @@ export interface BitbossUiOptions<V = BbUninferredVariants> extends Partial<Edit
|
|
|
243
245
|
*/
|
|
244
246
|
enabledLocales?: ReadonlyArray<import('./i18n/index.js').BuiltinLocaleInput | import('./i18n/index.js').LocaleWithExtension>;
|
|
245
247
|
/**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
248
|
+
* Icons: `dir` (the folder of `local:` SVGs, default `'./assets/icons'`),
|
|
249
|
+
* `whitelist` (provider icons that always ship, scanned or not) and
|
|
250
|
+
* `defaults` (the library's own glyphs swapped app-wide:
|
|
251
|
+
* `{ close: 'ph:x-bold' }`; a component's `components.<C>.icons` wins).
|
|
252
|
+
* Every name in `defaults` and `components.<C>.icons` is bundled.
|
|
250
253
|
*/
|
|
251
|
-
|
|
254
|
+
icons?: BbIconsOption;
|
|
252
255
|
/**
|
|
253
256
|
* Tunes the provider-icon source scan. Every file under the Vite root is
|
|
254
257
|
* read as bytes for `<prefix>:<name>` literals of the installed
|
|
@@ -264,15 +267,6 @@ export interface BitbossUiOptions<V = BbUninferredVariants> extends Partial<Edit
|
|
|
264
267
|
* Default 256 MiB — a real source file is never skipped for its size.
|
|
265
268
|
*/
|
|
266
269
|
iconsScanner?: IconsScannerOptions;
|
|
267
|
-
/**
|
|
268
|
-
* Provider icons that ALWAYS ship, scanned or not: exact names
|
|
269
|
-
* (`'tabler:crown'`) and globs (`'tabler:calendar-*'`). This is the home of
|
|
270
|
-
* every name the scanner cannot see as a literal — composed at runtime,
|
|
271
|
-
* stored in a database, chosen by an admin. An entry that resolves in no
|
|
272
|
-
* installed set fails the build with the same message the dev overlay
|
|
273
|
-
* shows for a missing icon.
|
|
274
|
-
*/
|
|
275
|
-
iconWhitelist?: string[];
|
|
276
270
|
/**
|
|
277
271
|
* Agent setup: the files that tell coding agents this app's UI is built
|
|
278
272
|
* with bitboss-ui (a marked block in `AGENTS.md`, an `@AGENTS.md` import in
|
|
@@ -507,7 +501,7 @@ export declare const defaultVscodeSettings: () => Record<string, unknown>;
|
|
|
507
501
|
*/
|
|
508
502
|
export declare function writeLocalIconifyCollection(dir: string, root: string): string | null;
|
|
509
503
|
/**
|
|
510
|
-
* Build-time check for a custom `
|
|
504
|
+
* Build-time check for a custom `icons.dir` that resolves to nothing. A relative
|
|
511
505
|
* path resolves from the Vite root (under Nuxt that is `app/`), so a path
|
|
512
506
|
* written from the project root can point at a folder that does not exist,
|
|
513
507
|
* and every `local:` icon then fails only at runtime. The default folder stays
|