bitboss-ui 3.0.0-beta.28 → 3.0.0-beta.30
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/bin/bitboss-ui.mjs +1 -1
- package/dist/ai/BbAccordion.md +18 -2
- package/dist/ai/BbAlert.md +14 -2
- package/dist/ai/BbAsterisk.md +9 -1
- package/dist/ai/BbAvatar.md +11 -2
- package/dist/ai/BbBadge.md +21 -3
- package/dist/ai/BbBadgeButton.md +16 -2
- package/dist/ai/BbBaseButton.md +51 -17
- package/dist/ai/BbBaseCheckboxIcon.md +22 -1
- package/dist/ai/BbBaseRadioIcon.md +21 -1
- package/dist/ai/BbBaseSwitchIcon.md +24 -3
- package/dist/ai/BbBreadcrumbs.md +24 -6
- package/dist/ai/BbButton.md +89 -8
- package/dist/ai/BbCalendar.md +548 -0
- package/dist/ai/BbCheckbox.md +28 -2
- package/dist/ai/BbCheckboxGroup.md +48 -3
- package/dist/ai/BbCollapsible.md +16 -1
- package/dist/ai/BbColorInput.md +40 -5
- package/dist/ai/BbColorPalette.md +22 -4
- package/dist/ai/BbConfirm.md +34 -4
- package/dist/ai/BbDatePicker.md +66 -21
- package/dist/ai/BbDatePickerInput.md +61 -9
- package/dist/ai/BbDialog.md +65 -10
- package/dist/ai/BbDropdown.md +134 -8
- package/dist/ai/BbDropdownButton.md +32 -6
- package/dist/ai/BbDropzone.md +20 -1
- package/dist/ai/BbIcon.md +9 -1
- package/dist/ai/BbIndicator.md +11 -2
- package/dist/ai/BbNumberInput.md +33 -3
- package/dist/ai/BbOffCanvas.md +68 -9
- package/dist/ai/BbPagination.md +19 -2
- package/dist/ai/BbPopover.md +26 -4
- package/dist/ai/BbProgress.md +9 -1
- package/dist/ai/BbRadio.md +27 -2
- package/dist/ai/BbRadioGroup.md +111 -6
- package/dist/ai/BbRating.md +26 -2
- package/dist/ai/BbSelect.md +75 -11
- package/dist/ai/BbSelectPopover.md +57 -10
- package/dist/ai/BbSlider.md +27 -3
- package/dist/ai/BbSmoothHeight.md +9 -1
- package/dist/ai/BbSpinner.md +9 -1
- package/dist/ai/BbSwitch.md +29 -3
- package/dist/ai/BbSwitchGroup.md +45 -4
- package/dist/ai/BbTable.md +132 -4
- package/dist/ai/BbTabs.md +331 -17
- package/dist/ai/BbTabsList.md +19 -9
- package/dist/ai/BbTabsPanes.md +15 -7
- package/dist/ai/BbTabsRoot.md +34 -8
- package/dist/ai/BbTag.md +36 -5
- package/dist/ai/BbTextInput.md +33 -3
- package/dist/ai/BbTextarea.md +33 -3
- package/dist/ai/BbTimePicker.md +22 -4
- package/dist/ai/BbTimePickerInput.md +42 -6
- package/dist/ai/BbToast.md +16 -4
- package/dist/ai/BbToastPortal.md +1 -1
- package/dist/ai/BbTooltip.md +17 -2
- package/dist/ai/BbTree.md +16 -1
- package/dist/ai/ChipsBox.md +3 -3
- package/dist/ai/CommonField.md +1 -1
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/CommonTimeSelector.md +1 -1
- package/dist/ai/FlatListBox.md +3 -3
- package/dist/ai/GroupedListBox.md +3 -3
- package/dist/ai/ListBox.md +5 -4
- package/dist/ai/OptionsContainer.md +1 -1
- package/dist/ai/changelog.json +129 -4
- package/dist/ai/components.json +5700 -660
- package/dist/ai/guides/agent-contract.md +35 -3
- package/dist/ai/guides/ai-router.md +16 -16
- package/dist/ai/guides/component-picker.md +2 -1
- package/dist/ai/guides/design-language.md +48 -35
- package/dist/ai/guides/design-tokens.md +47 -10
- package/dist/ai/guides/installation-and-plugin-setup.md +63 -1
- package/dist/ai/guides/migration/components/bb-date-picker-input.md +6 -0
- package/dist/ai/guides/migration/components/bb-dialog.md +10 -5
- package/dist/ai/guides/migration/components/bb-select-popover.md +8 -0
- package/dist/ai/guides/migration/components/bb-select.md +13 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +53 -11
- package/dist/ai/guides/migration/components/bb-text-input.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +83 -40
- package/dist/ai/guides/passthrough.md +249 -61
- package/dist/ai/guides/validated-forms.md +5 -0
- package/dist/ai/index.md +1 -0
- package/dist/ai/recipes/inertia/records-workspace.md +103 -0
- package/dist/ai/recipes/inertia/wizard-form.md +63 -0
- package/dist/ai/recipes/nuxt/records-workspace.md +105 -0
- package/dist/ai/recipes/nuxt/wizard-form.md +63 -0
- package/dist/ai/recipes/vue/records-workspace.md +99 -0
- package/dist/ai/recipes/vue/wizard-form.md +60 -0
- package/dist/ai/source/BbAccordion.md +13 -5
- package/dist/ai/source/BbAlert.md +9 -1
- package/dist/ai/source/BbAsterisk.md +5 -1
- package/dist/ai/source/BbAvatar.md +7 -1
- package/dist/ai/source/BbBadge.md +28 -19
- package/dist/ai/source/BbBadgeButton.md +28 -19
- package/dist/ai/source/BbBaseButton.md +11 -2
- package/dist/ai/source/BbBaseCheckboxIcon.md +6 -1
- package/dist/ai/source/BbBaseRadioIcon.md +6 -1
- package/dist/ai/source/BbBaseSwitchIcon.md +9 -4
- package/dist/ai/source/BbBreadcrumbs.md +18 -2
- package/dist/ai/source/BbButton.md +74 -18
- package/dist/ai/source/BbCalendar.md +1617 -0
- package/dist/ai/source/BbCheckboxGroup.md +25 -7
- package/dist/ai/source/BbCollapsible.md +10 -2
- package/dist/ai/source/BbColorInput.md +26 -11
- package/dist/ai/source/BbColorPalette.md +40 -4
- package/dist/ai/source/BbConfirm.md +23 -10
- package/dist/ai/source/BbConfirmPortal.md +23 -10
- package/dist/ai/source/BbDatePicker.md +172 -1298
- package/dist/ai/source/BbDatePickerInput.md +44 -3
- package/dist/ai/source/BbDialog.md +119 -32
- package/dist/ai/source/BbDropdown.md +85 -9
- package/dist/ai/source/BbDropdownButton.md +58 -9
- package/dist/ai/source/BbDropdownGroup.md +84 -9
- package/dist/ai/source/BbDropzone.md +14 -2
- package/dist/ai/source/BbIcon.md +5 -4
- package/dist/ai/source/BbIndicator.md +10 -3
- package/dist/ai/source/BbOffCanvas.md +199 -43
- package/dist/ai/source/BbPagination.md +15 -2
- package/dist/ai/source/BbPopover.md +32 -4
- package/dist/ai/source/BbProgress.md +5 -1
- package/dist/ai/source/BbRadioGroup.md +25 -7
- package/dist/ai/source/BbRating.md +24 -2
- package/dist/ai/source/BbSelect.md +97 -12
- package/dist/ai/source/BbSelectPopover.md +162 -24
- package/dist/ai/source/BbSlider.md +26 -6
- package/dist/ai/source/BbSmoothHeight.md +2 -0
- package/dist/ai/source/BbSpinner.md +5 -1
- package/dist/ai/source/BbSwitchGroup.md +8 -3
- package/dist/ai/source/BbTable.md +35 -5
- package/dist/ai/source/BbTabs.md +67 -9
- package/dist/ai/source/BbTabsList.md +89 -17
- package/dist/ai/source/BbTabsPanes.md +66 -9
- package/dist/ai/source/BbTabsRoot.md +67 -9
- package/dist/ai/source/BbTag.md +6 -1
- package/dist/ai/source/BbTimePicker.md +40 -4
- package/dist/ai/source/BbTimePickerInput.md +47 -5
- package/dist/ai/source/BbToast.md +12 -3
- package/dist/ai/source/BbToastPortal.md +12 -3
- package/dist/ai/source/BbTooltip.md +10 -2
- package/dist/ai/source/BbTree.md +12 -2
- package/dist/ai/source/CommonTimeSelector.md +3 -3
- package/dist/ai/source/FlatListBox.md +54 -28
- package/dist/ai/source/GroupedListBox.md +71 -43
- package/dist/ai/source/ListBox.md +4 -3
- package/dist/ai/source/OptionsContainer.md +23 -8
- package/dist/components/BbAccordion/types.d.ts +13 -5
- package/dist/components/BbAlert/types.d.ts +9 -1
- package/dist/components/BbAsterisk/types.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +7 -1
- package/dist/components/BbBadge/types.d.ts +17 -8
- package/dist/components/BbBaseButton/types.d.ts +11 -2
- package/dist/components/BbBaseCheckboxIcon/types.d.ts +6 -1
- package/dist/components/BbBaseRadioIcon/types.d.ts +6 -1
- package/dist/components/BbBaseSwitchIcon/types.d.ts +6 -1
- package/dist/components/BbBreadcrumbs/types.d.ts +18 -2
- package/dist/components/BbButton/types.d.ts +31 -11
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +34 -0
- package/dist/components/BbCalendar/BbCalendar.vue.js +6 -0
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +576 -0
- package/dist/components/BbCalendar/CalendarMonthPanel.vue.js +5 -0
- package/dist/components/{BbDatePicker/DatePickerMonthPanel.vue_vue_type_script_setup_true_lang.js → BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js} +13 -13
- package/dist/components/BbCalendar/CalendarYearPanel.vue.js +5 -0
- package/dist/components/{BbDatePicker/DatePickerYearPanel.vue_vue_type_script_setup_true_lang.js → BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js} +14 -14
- package/dist/components/BbCalendar/calendarHost.d.ts +29 -0
- package/dist/components/BbCalendar/calendarHost.js +10 -0
- package/dist/components/BbCalendar/types.d.ts +211 -0
- package/dist/components/BbCalendar/types.js +28 -0
- package/dist/components/{BbDatePicker/useDatePickerContext.d.ts → BbCalendar/useCalendarContext.d.ts} +8 -8
- package/dist/components/BbCalendar/useCalendarContext.js +11 -0
- package/dist/components/{BbDatePicker → BbCalendar}/useCalendarGrid.d.ts +14 -14
- package/dist/components/{BbDatePicker → BbCalendar}/useCalendarGrid.js +3 -3
- package/dist/components/{BbDatePicker → BbCalendar}/useDayGrid.d.ts +2 -2
- package/dist/components/{BbDatePicker → BbCalendar}/useDayGrid.js +2 -2
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/components/BbCheckboxGroup/types.d.ts +9 -5
- package/dist/components/BbCollapsible/types.d.ts +10 -2
- package/dist/components/BbColorInput/types.d.ts +26 -11
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +200 -199
- package/dist/components/BbColorPalette/types.d.ts +31 -2
- package/dist/components/BbConfirm/types.d.ts +23 -10
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +5 -6
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +159 -526
- package/dist/components/BbDatePicker/types.d.ts +55 -22
- package/dist/components/BbDatePicker/types.js +4 -3
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +18 -2
- package/dist/components/BbDatePickerInput/types.d.ts +41 -4
- package/dist/components/BbDatePickerInput/types.js +1 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +114 -102
- package/dist/components/BbDialog/types.d.ts +42 -4
- package/dist/components/BbDialog/types.js +1 -1
- package/dist/components/BbDialog/useDialogStack.d.ts +12 -0
- package/dist/components/BbDialog/useDialogStack.js +9 -2
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +42 -41
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbDropdown/types.d.ts +55 -7
- package/dist/components/BbDropdown/types.js +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/BbDropdownButton/types.d.ts +39 -6
- package/dist/components/BbDropzone/types.d.ts +14 -2
- package/dist/components/BbIcon/types.d.ts +5 -4
- package/dist/components/BbIndicator/types.d.ts +8 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +211 -194
- package/dist/components/BbOffCanvas/types.d.ts +26 -4
- package/dist/components/BbOffCanvas/types.js +1 -1
- package/dist/components/BbPagination/types.d.ts +15 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +162 -161
- package/dist/components/BbPopover/types.d.ts +28 -2
- package/dist/components/BbProgress/types.d.ts +5 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/components/BbRadioGroup/types.d.ts +9 -5
- package/dist/components/BbRating/types.d.ts +24 -2
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +145 -129
- package/dist/components/BbSelect/types.d.ts +54 -11
- package/dist/components/BbSelect/types.js +1 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +346 -330
- package/dist/components/BbSelectPopover/types.d.ts +69 -10
- package/dist/components/BbSelectPopover/types.js +1 -0
- package/dist/components/BbSlider/types.d.ts +22 -2
- package/dist/components/BbSmoothHeight/types.d.ts +2 -0
- package/dist/components/BbSpinner/types.d.ts +5 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/components/BbSwitchGroup/types.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTable/BbTableDataRow.js +1 -1
- package/dist/components/BbTable/types.d.ts +28 -5
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BbTabs/BbTabsList.vue.d.ts +3 -10
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +32 -30
- package/dist/components/BbTabs/BbTabsRoot.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BbTabs/types.d.ts +56 -9
- package/dist/components/BbTag/types.d.ts +6 -1
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +77 -76
- package/dist/components/BbTimePicker/types.d.ts +31 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +215 -205
- package/dist/components/BbTimePickerInput/types.d.ts +35 -4
- package/dist/components/BbTimePickerInput/types.js +1 -0
- package/dist/components/BbToast/types.d.ts +10 -1
- package/dist/components/BbTooltip/types.d.ts +10 -2
- package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
- package/dist/components/BbTree/types.d.ts +12 -2
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/components/FlatListBox/types.d.ts +4 -3
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/GroupedListBox/types.d.ts +4 -3
- package/dist/components/ListBox/types.d.ts +4 -3
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/OptionsContainer/types.d.ts +5 -4
- package/dist/composables/useBbTabsContext.d.ts +6 -0
- package/dist/composables/useBbTabsContext.js +2 -0
- package/dist/composables/usePassthrough.d.ts +18 -2
- package/dist/composables/usePassthrough.js +132 -109
- package/dist/index.d.ts +5 -1
- package/dist/index.js +59 -58
- package/dist/llms-full.txt +4139 -673
- package/dist/llms-medium.txt +165 -56
- package/dist/nuxt-auto-imports.js +1 -1
- package/dist/nuxt-module.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/tabs-variants.d.ts +18 -0
- package/dist/types/Config.d.ts +13 -0
- package/dist/types/TabsVariant.d.ts +17 -0
- package/dist/types/passthrough.d.ts +125 -12
- package/dist/types/passthrough.js +1 -0
- package/dist/types/ptComponentMap.d.ts +11 -10
- package/dist/utilities/functions/hasVnodeListener.d.ts +16 -0
- package/dist/utilities/functions/hasVnodeListener.js +12 -0
- package/dist/utils/passthrough.d.ts +29 -0
- package/dist/utils/passthrough.js +35 -24
- package/dist/validated/BbCheckboxGroup.vue.d.ts +13 -5
- package/dist/validated/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/validated/BbRadioGroup.vue.d.ts +13 -5
- package/dist/validated/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/validated/BbSelect.vue.d.ts +16 -6
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +17 -5
- package/dist/validated/BbSwitchGroup.vue.d.ts +13 -5
- package/dist/validated/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +9 -0
- package/dist/validated/index.d.ts +1 -0
- package/dist/vite-plugin.d.ts +30 -1
- package/dist/vite.js +224 -197
- package/package.json +5 -4
- package/dist/components/BbDatePicker/DatePickerMonthPanel.vue.js +0 -5
- package/dist/components/BbDatePicker/DatePickerYearPanel.vue.js +0 -5
- package/dist/components/BbDatePicker/useDatePickerContext.js +0 -11
- /package/dist/components/{BbDatePicker/DatePickerMonthPanel.vue.d.ts → BbCalendar/CalendarMonthPanel.vue.d.ts} +0 -0
- /package/dist/components/{BbDatePicker/DatePickerYearPanel.vue.d.ts → BbCalendar/CalendarYearPanel.vue.d.ts} +0 -0
package/dist/ai/BbButton.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## Reachable through `BbButton`
|
|
12
12
|
|
|
13
|
-
`BbButton` mounts other components (all of them: _Component tree_, near the end). These are the parts of its API that land inside them.
|
|
13
|
+
`BbButton` mounts other components (all of them: _Component tree_, near the end). These are the parts of its API that land inside them. Prefer these over `:deep()` on an inner class (allowed, unsupported: it can break on upgrade) — and never an import of an internal component.
|
|
14
14
|
|
|
15
15
|
| pt part | Lands on | In |
|
|
16
16
|
| --- | --- | --- |
|
|
@@ -113,6 +113,46 @@ restate a state:
|
|
|
113
113
|
}
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
Every state has the full trio. Hover and pressed also take `--fg-hover` /
|
|
117
|
+
`--border-hover` and `--fg-pressed` / `--border-pressed` (both default to the
|
|
118
|
+
resting `--fg` / `--border-color`, so only the fill moves unless you say
|
|
119
|
+
otherwise), which is how a toggle chip can flip from a light label on a dark
|
|
120
|
+
fill to a dark label on a coloured one without a rule on `[aria-pressed]`.
|
|
121
|
+
Disabled paints `--bg-disabled` / `--fg-disabled` / `--border-disabled` plus
|
|
122
|
+
`--opacity-disabled` — muted grey at full opacity by default, whatever the
|
|
123
|
+
variant. The complete matrix is in the contract's token table.
|
|
124
|
+
|
|
125
|
+
#### Disabled: fade instead of grey
|
|
126
|
+
|
|
127
|
+
The shadcn-style alternative keeps the variant's colours and fades the whole
|
|
128
|
+
button, so a disabled destructive button stays recognisably red. Point the
|
|
129
|
+
disabled trio back at the resting tokens and lower the opacity — on every
|
|
130
|
+
button, in your stylesheet:
|
|
131
|
+
|
|
132
|
+
```css
|
|
133
|
+
.bb-button {
|
|
134
|
+
--bg-disabled: var(--bg);
|
|
135
|
+
--fg-disabled: var(--fg);
|
|
136
|
+
--border-disabled: var(--border-color);
|
|
137
|
+
--opacity-disabled: 0.5;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
or on one button, through `pt:root` and Tailwind's arbitrary properties:
|
|
142
|
+
|
|
143
|
+
```vue
|
|
144
|
+
<BbButton
|
|
145
|
+
variant="destructive"
|
|
146
|
+
disabled
|
|
147
|
+
pt:root="[--bg-disabled:var(--bg)] [--fg-disabled:var(--fg)] [--border-disabled:var(--border-color)] [--opacity-disabled:.5]"
|
|
148
|
+
>
|
|
149
|
+
Delete
|
|
150
|
+
</BbButton>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
(`loading` is not `disabled`: a loading button keeps its variant colours by
|
|
154
|
+
design and never reads the disabled trio — see _Loading and async actions_.)
|
|
155
|
+
|
|
116
156
|
Never use a variant name that is neither built-in nor registered in the
|
|
117
157
|
project's `vite.config.*` / `nuxt.config.*`. Unsure what's currently legal in
|
|
118
158
|
a given project (built-ins plus whatever it has registered)? Don't guess from
|
|
@@ -253,8 +293,19 @@ button its accessible name the same way as any other — through the default slo
|
|
|
253
293
|
visible text but announces "Settings". `aria-label` is plan B — an override for
|
|
254
294
|
when the accessible name must differ from (or you can't supply) slot content.
|
|
255
295
|
Just don't ship an icon-only button with neither. When `icon` is set,
|
|
256
|
-
`append:icon` is ignored. Icons scale with the button's `size
|
|
257
|
-
|
|
296
|
+
`append:icon` is ignored. Icons scale with the button's `size`. Icon names come
|
|
297
|
+
from an installed provider set (e.g. `lucide:*`) or from your own SVGs as
|
|
298
|
+
`local:<file-name>` (see the icons policy) — a brand mark or a custom glyph is
|
|
299
|
+
a `local:` file in your `iconDir`, not a hand-made icon component wrapped in a
|
|
300
|
+
`BbBaseButton`. The `local:` name below is one of _this repository's_ fixture
|
|
301
|
+
SVGs: in your project it resolves only if `<file-name>.svg` sits in your own
|
|
302
|
+
`iconDir`.
|
|
303
|
+
|
|
304
|
+
**A local: icon from your own SVGs**
|
|
305
|
+
|
|
306
|
+
```vue
|
|
307
|
+
<BbButton variant="outline" prepend:icon="local:sparkles">Generate</BbButton>
|
|
308
|
+
```
|
|
258
309
|
|
|
259
310
|
**Icons and icon-only**
|
|
260
311
|
|
|
@@ -542,8 +593,12 @@ Escape hatches, when the default isn't right:
|
|
|
542
593
|
`BbDropdownButton` caret stays usable while the primary action runs).
|
|
543
594
|
|
|
544
595
|
The visually-hidden loading announcement is localized via the plugin's `locale`
|
|
545
|
-
option. `disabled` and `loading` are independent
|
|
546
|
-
|
|
596
|
+
option. `disabled` and `loading` are independent props, and setting both is
|
|
597
|
+
redundant but harmless: `loading` wins the look (the spinner shows and the
|
|
598
|
+
variant colours stay — the disabled paint is skipped while loading), and
|
|
599
|
+
`disabled` adds native blocking on top of loading's soft block. The
|
|
600
|
+
Inertia-form habit `:loading="form.processing" :disabled="form.processing"`
|
|
601
|
+
therefore renders as a loading button, not a grey one.
|
|
547
602
|
|
|
548
603
|
**Externally-owned loading state**
|
|
549
604
|
|
|
@@ -973,7 +1028,7 @@ Anti-patterns:
|
|
|
973
1028
|
|
|
974
1029
|
| Prop | Type | Default | Required | Description |
|
|
975
1030
|
| --- | --- | --- | --- | --- |
|
|
976
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `icon`, `root`, `spinner`, `text`. States: `disabled`, `loading`. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. |
|
|
1031
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `icon`, `root`, `spinner`, `text`. States: `disabled`, `loading`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. |
|
|
977
1032
|
| `activeClass` | `string \| undefined` | | | Class to apply when the link is active. |
|
|
978
1033
|
| `append:icon` | `string \| undefined` | | | Icon to be added on the right of the text. |
|
|
979
1034
|
| `ariaCurrentValue` | `"page" \| "step" \| "location" \| "date" \| "time" \| "true" \| "false" \| undefined` | `'page'` | | Value passed to the attribute `aria-current` when the link is exact active. |
|
|
@@ -984,7 +1039,7 @@ Anti-patterns:
|
|
|
984
1039
|
| `component` | `string \| undefined` | | | Inertia: the page component this visit resolves to. Rarely set by hand — the server normally decides it. |
|
|
985
1040
|
| `data` | `object \| undefined` | | | |
|
|
986
1041
|
| `disableAutoLoading` | `boolean \| undefined` | `false` | | Disables the automatic loading state that tracks async click handlers (enabled by default). |
|
|
987
|
-
| `disabled` | `boolean \| undefined` | `false` | | Disables the component. |
|
|
1042
|
+
| `disabled` | `boolean \| undefined` | `false` | | Disables the component: native `disabled` (or `aria-disabled` on a link), muted paint. Beside `loading`, loading wins the look (spinner and variant colours) and this only adds the native blocking — redundant but harmless. |
|
|
988
1043
|
| `download` | `string \| boolean \| undefined` | | | Marks an `href` link as a download: renders a plain `<a download>` doing a native navigation (never an Inertia/router visit), so file downloads work. Pass a string for the suggested filename. A native-anchor signal alongside `target` and `e… |
|
|
989
1044
|
| `exactActiveClass` | `string \| undefined` | | | Class to apply when the link is exact active. |
|
|
990
1045
|
| `except` | `string[] \| undefined` | | | Inertia: the inverse of `only` — properties to EXCLUDE from a partial reload. Pass one or the other, not both. |
|
|
@@ -996,7 +1051,7 @@ Anti-patterns:
|
|
|
996
1051
|
| `icon` | `string \| undefined` | | | Used when only an icon with no text should be displayed. |
|
|
997
1052
|
| `instant` | `boolean \| undefined` | `false` | | Inertia: navigate optimistically on click and reconcile when the response lands, instead of waiting for the round trip. |
|
|
998
1053
|
| `interactiveWhileLoading` | `boolean \| undefined` | `false` | | Keeps the button clickable while it is loading. Buttons are disabled while loading by default; this escape hatch exists for toggles that must stay interactive (e.g. the dropdown-button caret). |
|
|
999
|
-
| `loading` | `boolean \| undefined` | `false` | | Triggers a loading indicator. |
|
|
1054
|
+
| `loading` | `boolean \| undefined` | `false` | | Triggers a loading indicator. A loading button is soft-disabled on its own (`aria-disabled`, out of the tab order, clicks and navigation blocked) and keeps its variant colours; with `disabled` set too, loading still wins the look. |
|
|
1000
1055
|
| `method` | `"get" \| "post" \| "put" \| "patch" \| "delete" \| undefined` | | | |
|
|
1001
1056
|
| `modelValue` | `any` | | | |
|
|
1002
1057
|
| `onBefore` | `(() => void) \| undefined` | | | |
|
|
@@ -1028,6 +1083,24 @@ Anti-patterns:
|
|
|
1028
1083
|
| `variant` | `ButtonVariantType \| undefined` | `"primary"` | | Visual variant of the button. Controls colors and surface style while keeping spacing and sizing unchanged. |
|
|
1029
1084
|
| `viewTransition` | `boolean \| undefined` | `false` | | Inertia: run the page swap inside a View Transition, where the browser supports one. |
|
|
1030
1085
|
|
|
1086
|
+
## Passthrough parts and states
|
|
1087
|
+
|
|
1088
|
+
`pt:<part>="…"` restyles a part; `pt:<part>:<state>="…"` applies only while the state is on. A component-wide state is on for every part at once; a _per node_ state resolves on each node of a broadcast part (one row, one option, one day). Grammar and merge rules: `guides/passthrough.md`.
|
|
1089
|
+
|
|
1090
|
+
| Part | What it is |
|
|
1091
|
+
| --- | --- |
|
|
1092
|
+
| `root` | The button element. The glyph size lives here: `--icon-size` on `pt:root` resizes the icon, the spinner and the gap between them together. |
|
|
1093
|
+
| `icon` | Every content icon the button renders (`icon`, `prepend:icon`, `append:icon`) — a broadcast; at most two render together. For colour, opacity and attributes — size it through `--icon-size` on `root`, never a size utility here (it breaks the icon / spinner pair). |
|
|
1094
|
+
| `spinner` | The loading spinner, parked exactly over the icon. Like `icon`: colour and opacity here, size through `--icon-size` on `root`. |
|
|
1095
|
+
| `text` | The label span. Typography inherits from `root`, so reach for `text` only when a class must apply to the label alone — `truncate` on a long label that must not clip the icons. It carries the margin the label slides by while the spinner is in, so a margin of your own fights the slide. |
|
|
1096
|
+
|
|
1097
|
+
States are listed in precedence order: when two are on at once and their entries conflict, the later one wins.
|
|
1098
|
+
|
|
1099
|
+
| State | When it is on |
|
|
1100
|
+
| --- | --- |
|
|
1101
|
+
| `disabled` | Component-wide: the button is `disabled`. |
|
|
1102
|
+
| `loading` | Component-wide: `loading` is on — the spinner shows and the button ignores the pointer. |
|
|
1103
|
+
|
|
1031
1104
|
## Events
|
|
1032
1105
|
|
|
1033
1106
|
- `update:modelValue` — `(event: "update:modelValue", value: any): void`
|
|
@@ -1091,6 +1164,14 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
1091
1164
|
| `--border-color` | `transparent` | the frame; its width is --bw |
|
|
1092
1165
|
| `--ring` | `transparent` | focus ring, drawn --bb-ring-size outside the border |
|
|
1093
1166
|
| `--bw` | `var(--bb-border-w)` | border width |
|
|
1167
|
+
| `--fg-hover` | `var(--fg)` | label and icons on hover (and focus-visible) |
|
|
1168
|
+
| `--border-hover` | `var(--border-color)` | the frame on hover (and focus-visible) |
|
|
1169
|
+
| `--fg-pressed` | `var(--fg)` | label and icons while [aria-pressed='true'] |
|
|
1170
|
+
| `--border-pressed` | `var(--border-color)` | the frame while [aria-pressed='true'] |
|
|
1171
|
+
| `--bg-disabled` | `var(--bb-muted)` | the plate while disabled (not loading) |
|
|
1172
|
+
| `--fg-disabled` | `color-mix(in oklab, var(--bb-text) 45%, var(--bb-panel))` | label and icons while disabled |
|
|
1173
|
+
| `--border-disabled` | `var(--bb-muted)` | the frame while disabled |
|
|
1174
|
+
| `--opacity-disabled` | `1` | whole-button opacity while disabled — `.5` with the three above set to the resting tokens gives "fade instead of grey" |
|
|
1094
1175
|
| `--elev-tier` | `var(--bb-elev)` | the shadow a plate variant may take |
|
|
1095
1176
|
| `--elev` | `0 0 0 0 transparent` | the shadow painted; flat variants keep this |
|
|
1096
1177
|
|