@bridge-ui/vue 0.0.6 → 0.0.8
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/ai/AGENTS.md +31 -0
- package/ai/README.md +35 -0
- package/ai/guidelines/core.md +44 -0
- package/ai/llms.txt +38 -0
- package/ai/skills/bridge-ui-components/SKILL.md +37 -0
- package/ai/skills/bridge-ui-forms/SKILL.md +38 -0
- package/ai/skills/bridge-ui-overlays/SKILL.md +37 -0
- package/ai/skills/bridge-ui-setup/SKILL.md +38 -0
- package/bin/__tests__/ai.test.ts +319 -0
- package/bin/ai.mjs +469 -0
- package/dist/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +17 -17
- package/dist/Adapters/I18n/index.d.ts +1 -1
- package/dist/Adapters/I18n/index.js +2 -2
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +7 -3
- package/dist/Adapters/I18n/useI18nAdapter.js +12 -7
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/index.d.ts +1 -1
- package/dist/Adapters/index.js +3 -3
- package/dist/Components/Alert/composables/useAlert.js +17 -17
- package/dist/Components/Autocomplete/Autocomplete.js +5 -0
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
- package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +763 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +386 -0
- package/dist/Components/Autocomplete/index.d.ts +4 -0
- package/dist/Components/Autocomplete/index.js +4 -0
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +13 -13
- package/dist/Components/Badge/composables/useBadge.js +8 -8
- package/dist/Components/BaseField/BaseField.js +5 -0
- package/dist/Components/BaseField/BaseField.vue.d.ts +15 -0
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/Components/BaseField/BaseFieldLabel.js +5 -0
- package/dist/Components/BaseField/BaseFieldLabel.vue.d.ts +7 -0
- package/dist/Components/BaseField/BaseFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/Components/BaseField/baseField.types.d.ts +222 -0
- package/dist/Components/BaseField/composables/useBaseField.d.ts +55 -0
- package/dist/Components/BaseField/composables/useBaseField.js +131 -0
- package/dist/Components/BaseField/index.d.ts +4 -0
- package/dist/Components/BaseField/index.js +3 -0
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Button/composables/useButton.js +14 -14
- package/dist/Components/Card/composables/useCard.js +27 -27
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
- package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
- package/dist/Components/Chip/Chip.vue.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.js +6 -6
- package/dist/Components/Divider/composables/useDivider.js +5 -5
- package/dist/Components/Drawer/Drawer.vue.d.ts +2 -2
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +23 -23
- package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +13 -4
- package/dist/Components/FormControl/composables/useFormControl.js +63 -59
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormControl/index.d.ts +1 -1
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/composables/useFormField.d.ts +7 -3
- package/dist/Components/FormField/composables/useFormField.js +29 -29
- package/dist/Components/FormField/formField.types.d.ts +14 -14
- package/dist/Components/Icon/composables/useIcon.js +5 -5
- package/dist/Components/Label/composables/useLabel.js +5 -5
- package/dist/Components/Link/composables/useLink.js +9 -9
- package/dist/Components/List/composables/useList.js +6 -6
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +20 -20
- package/dist/Components/ListSection/composables/useListSection.js +8 -8
- package/dist/Components/Listbox/Listbox.vue.d.ts +3 -3
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +29 -28
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -1
- package/dist/Components/Listbox/composables/useListbox.js +23 -23
- package/dist/Components/Listbox/index.d.ts +1 -0
- package/dist/Components/Listbox/index.js +3 -3
- package/dist/Components/Listbox/listbox.types.d.ts +6 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.js +43 -43
- package/dist/Components/Modal/Modal.vue.d.ts +2 -2
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.js +18 -18
- package/dist/Components/NumberField/NumberField.vue.d.ts +2 -2
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -4
- package/dist/Components/NumberField/composables/useNumberField.js +13 -10
- package/dist/Components/OtpField/OtpField.js +5 -0
- package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/OtpField/composables/useOtpField.d.ts +287 -0
- package/dist/Components/OtpField/composables/useOtpField.js +154 -0
- package/dist/Components/OtpField/index.d.ts +4 -0
- package/dist/Components/OtpField/index.js +3 -0
- package/dist/Components/OtpField/otpField.types.d.ts +120 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -4
- package/dist/Components/PasswordField/composables/usePasswordField.js +6 -3
- package/dist/Components/Progress/composables/useProgress.js +11 -11
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
- package/dist/Components/Radio/composables/useRadio.js +9 -9
- package/dist/Components/Select/Select.vue.d.ts +5 -5
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +16 -13
- package/dist/Components/Select/composables/useSelect.d.ts +5 -4
- package/dist/Components/Select/composables/useSelect.js +167 -163
- package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
- package/dist/Components/Slider/Slider.js +5 -0
- package/dist/Components/Slider/Slider.vue.d.ts +25 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +482 -0
- package/dist/Components/Slider/composables/useSlider.js +287 -0
- package/dist/Components/Slider/index.d.ts +4 -0
- package/dist/Components/Slider/index.js +3 -0
- package/dist/Components/Slider/slider.types.d.ts +169 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +2 -2
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +54 -54
- package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
- package/dist/Components/Spinner/composables/useSpinner.js +11 -11
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
- package/dist/Components/Switch/composables/useSwitch.js +9 -9
- package/dist/Components/Tab/composables/useTab.js +11 -11
- package/dist/Components/TabList/composables/useTabList.js +7 -7
- package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
- package/dist/Components/Tabs/Tabs.vue.d.ts +2 -2
- package/dist/Components/Tabs/composables/useTabs.js +22 -22
- package/dist/Components/TextField/TextField.vue.d.ts +1 -1
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/TextField/composables/useTextField.d.ts +4 -4
- package/dist/Components/TextField/composables/useTextField.js +2 -2
- package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -4
- package/dist/Components/Textarea/composables/useTextarea.js +10 -9
- package/dist/Components/Tooltip/composables/useTooltip.js +17 -17
- package/dist/Provider/bridgeUITypes.d.ts +4 -1
- package/dist/Provider/createBridgeUIApi.js +13 -1
- package/dist/Utils/index.d.ts +3 -3
- package/dist/Utils/index.js +11 -8
- package/dist/Utils/useBreakpoint.js +7 -7
- package/dist/augments.d.ts +29 -17
- package/dist/index.d.ts +11 -3
- package/dist/index.js +88 -80
- package/docs/README.md +56 -0
- package/docs/components/Alert.md +96 -0
- package/docs/components/Autocomplete.md +198 -0
- package/docs/components/Avatar.md +60 -0
- package/docs/components/Badge.md +47 -0
- package/docs/components/BaseField.md +126 -0
- package/docs/components/BridgeUIProvider.md +151 -0
- package/docs/components/Button.md +93 -0
- package/docs/components/Card.md +287 -0
- package/docs/components/Checkbox.md +87 -0
- package/docs/components/Divider.md +56 -0
- package/docs/components/Drawer.md +137 -0
- package/docs/components/FormControl.md +66 -0
- package/docs/components/FormField.md +71 -0
- package/docs/components/I18n.md +125 -0
- package/docs/components/Icon.md +88 -0
- package/docs/components/Label.md +31 -0
- package/docs/components/Link.md +71 -0
- package/docs/components/List.md +167 -0
- package/docs/components/Menu.md +97 -0
- package/docs/components/Modal.md +154 -0
- package/docs/components/NumberField.md +80 -0
- package/docs/components/OtpField.md +133 -0
- package/docs/components/PasswordField.md +82 -0
- package/docs/components/Progress.md +68 -0
- package/docs/components/Radio.md +91 -0
- package/docs/components/Select.md +181 -0
- package/docs/components/Skeleton.md +38 -0
- package/docs/components/Slider.md +140 -0
- package/docs/components/Snackbar.md +99 -0
- package/docs/components/Spinner.md +61 -0
- package/docs/components/Switch.md +72 -0
- package/docs/components/Tabs.md +207 -0
- package/docs/components/TextField.md +72 -0
- package/docs/components/Textarea.md +80 -0
- package/docs/components/Tooltip.md +125 -0
- package/docs/components/useBreakpoint.md +100 -0
- package/docs/components/useDialogAction.md +97 -0
- package/docs/components/useDrawerAction.md +75 -0
- package/docs/components/useModalAction.md +75 -0
- package/docs/components/useSnackbarAction.md +85 -0
- package/docs/examples/i18n-dictionary.ts +48 -0
- package/docs/examples/i18n-vue-i18n.ts +34 -0
- package/docs/examples/icon-fontawesome.ts +112 -0
- package/docs/examples/icon-heroicons.ts +57 -0
- package/docs/examples/icon-lucide.ts +57 -0
- package/docs/examples/icon-phosphor.ts +57 -0
- package/docs/examples/icon-tabler.ts +57 -0
- package/package.json +13 -5
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Modal
|
|
2
|
+
|
|
3
|
+
Modal overlay with portal, backdrop, and focus management. Put `Card` or any content inside.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Modal } from "@bridge-ui/vue/Components/Modal";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Button v-on:click="open = true">Open modal</Button>
|
|
17
|
+
|
|
18
|
+
<Modal v-model="open">
|
|
19
|
+
<Card title="Confirm action" :on-close="() => (open = false)">
|
|
20
|
+
Are you sure you want to continue?
|
|
21
|
+
</Card>
|
|
22
|
+
</Modal>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Persistent
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Modal persistent v-model="open">
|
|
29
|
+
<Card title="Persistent modal" :on-close="() => (open = false)">
|
|
30
|
+
Clicking the backdrop or pressing Escape has no effect.
|
|
31
|
+
</Card>
|
|
32
|
+
</Modal>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Responsive align
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<script setup>
|
|
39
|
+
import { useBreakpoint } from "@bridge-ui/vue";
|
|
40
|
+
|
|
41
|
+
const breakpoint = useBreakpoint();
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<Modal
|
|
46
|
+
v-model="open"
|
|
47
|
+
:align="breakpoint.mobile ? 'bottom-center' : 'middle-center'"
|
|
48
|
+
>
|
|
49
|
+
<Card title="Responsive" :on-close="() => (open = false)">
|
|
50
|
+
Bottom sheet on mobile, centered from `sm` up.
|
|
51
|
+
</Card>
|
|
52
|
+
</Modal>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> **Breaking:** `align` now applies on all breakpoints. Mobile no longer forces a bottom sheet — use `useBreakpoint` (as above) to restore that pattern.
|
|
57
|
+
|
|
58
|
+
### Nested modals
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<Modal size="lg" v-model="outerOpen">
|
|
62
|
+
<Card title="Outer modal" :on-close="() => (outerOpen = false)">
|
|
63
|
+
<Button size="sm" v-on:click="innerOpen = true">Open nested modal</Button>
|
|
64
|
+
</Card>
|
|
65
|
+
|
|
66
|
+
<Modal size="sm" v-model="innerOpen">
|
|
67
|
+
<Card title="Nested confirmation" :on-close="() => (innerOpen = false)">
|
|
68
|
+
Press Escape to close only this layer.
|
|
69
|
+
</Card>
|
|
70
|
+
</Modal>
|
|
71
|
+
</Modal>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Full composition (Card)
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<Modal blur="md" size="lg" v-model="open" transition="slide-up">
|
|
78
|
+
<Card
|
|
79
|
+
borderless
|
|
80
|
+
shadow="lg"
|
|
81
|
+
rounded="2xl"
|
|
82
|
+
padding="large"
|
|
83
|
+
variant="elevated"
|
|
84
|
+
title="Edit profile"
|
|
85
|
+
>
|
|
86
|
+
Large modal with Card title, body, and footer slots.
|
|
87
|
+
|
|
88
|
+
<template #footer>
|
|
89
|
+
<Button size="sm" color="error" variant="flat" v-on:click="open = false">
|
|
90
|
+
Discard
|
|
91
|
+
</Button>
|
|
92
|
+
|
|
93
|
+
<Button size="sm" color="primary" v-on:click="open = false">Save</Button>
|
|
94
|
+
</template>
|
|
95
|
+
</Card>
|
|
96
|
+
</Modal>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### customProps
|
|
100
|
+
|
|
101
|
+
```vue
|
|
102
|
+
<Modal
|
|
103
|
+
v-model="open"
|
|
104
|
+
:custom-props="{
|
|
105
|
+
root: { id: 'modal-root' },
|
|
106
|
+
panel: { id: 'modal-panel' },
|
|
107
|
+
overlay: { id: 'modal-overlay' },
|
|
108
|
+
}"
|
|
109
|
+
>
|
|
110
|
+
<Card title="customProps" :on-close="() => (open = false)">
|
|
111
|
+
Inspect the DOM for ids on each modal part.
|
|
112
|
+
</Card>
|
|
113
|
+
</Modal>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Props
|
|
117
|
+
|
|
118
|
+
| Prop | Type | Default | Description |
|
|
119
|
+
| --------------------- | ------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
120
|
+
| `align` | `ModalAlign` | "middle-center" | Panel position on all breakpoints (`{row}-{column}` grid). Use `useBreakpoint` for a different align per viewport. |
|
|
121
|
+
| `autoFocus` | `boolean` | `false` | When true, focuses the first focusable element inside the dialog on open. |
|
|
122
|
+
| `blur` | `ModalBlur` | "none" | Backdrop blur on the overlay. |
|
|
123
|
+
| `classes` | `ModalClasses` | — | The classes to apply to the modal. |
|
|
124
|
+
| `closeOnEscape` | `boolean` | `true` | Whether the modal closes on escape key press. |
|
|
125
|
+
| `closeOnOverlay` | `boolean` | `true` | Whether the modal closes on overlay click. |
|
|
126
|
+
| `customProps` | `ModalCustomProps` | — | Props forwarded to each modal part. |
|
|
127
|
+
| `disableEnforceFocus` | `boolean` | `false` | When true, focus is not trapped inside the modal while open. |
|
|
128
|
+
| `disableRestoreFocus` | `boolean` | `false` | When true, focus is not restored to the previously focused element on close. |
|
|
129
|
+
| `disableScrollLock` | `boolean` | `false` | When true, body scroll is not locked while the modal is open. |
|
|
130
|
+
| `hideBackdrop` | `boolean` | `false` | When true, the backdrop overlay is not rendered. |
|
|
131
|
+
| `keepMounted` | `boolean` | `false` | When true, the modal stays mounted in the DOM after closing (hidden). |
|
|
132
|
+
| `persistent` | `boolean` | `false` | When true, escape and overlay clicks do not close the modal. |
|
|
133
|
+
| `scroll` | `ModalScroll` | "body" | Where scroll happens: the page (`body`) or the dialog panel (`paper`). |
|
|
134
|
+
| `size` | `ModalSize` | "md" | Max width of the dialog from the `sm` breakpoint up (`sm:max-w-*`). |
|
|
135
|
+
| `teleportTo` | `string \| false` | "body" | Where to teleport the modal. Pass `false` to render in place. |
|
|
136
|
+
| `transition` | `ModalTransition` | "fade" | Enter/leave animation for overlay and panel. |
|
|
137
|
+
|
|
138
|
+
### v-model
|
|
139
|
+
|
|
140
|
+
| Prop / Event | Type | Default | Description |
|
|
141
|
+
| ------------------- | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
142
|
+
| `modelValue` | `boolean` | `false` | Whether the modal is visible. Bound with `v-model`. |
|
|
143
|
+
| `update:modelValue` | `(value: boolean) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
144
|
+
|
|
145
|
+
## Events
|
|
146
|
+
|
|
147
|
+
| Event | Payload | Description |
|
|
148
|
+
| ------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
149
|
+
| `v-on:close` | — | Emitted when the user dismisses the modal (overlay or Escape). Not emitted when the parent sets `v-model` to `false` directly. |
|
|
150
|
+
| `v-on:show-change` | `(show: boolean)` | Emitted when visibility should change (controlled state). Listen with `v-on:show-change`. |
|
|
151
|
+
|
|
152
|
+
## Related components
|
|
153
|
+
|
|
154
|
+
Card, useDialogAction, useModalAction
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# NumberField
|
|
2
|
+
|
|
3
|
+
Numeric input with increment/decrement controls. Extends FormField props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { NumberField } from "@bridge-ui/vue/Components/NumberField";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<NumberField :min="0" :max="20" :step="1" placeholder="0" label="Quantity" />
|
|
17
|
+
|
|
18
|
+
<NumberField
|
|
19
|
+
label="Units"
|
|
20
|
+
v-model="quantity"
|
|
21
|
+
description="Use the stepper or type a value."
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<NumberField
|
|
25
|
+
error
|
|
26
|
+
label="Amount"
|
|
27
|
+
error-message="Value must be between 0 and 100."
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Min, max, and step
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<NumberField :min="1" :max="99" :step="5" label="Items" placeholder="0" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### customProps
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<NumberField
|
|
41
|
+
placeholder="0"
|
|
42
|
+
label="Quantity"
|
|
43
|
+
description="Input uses name via customProps."
|
|
44
|
+
:custom-props="{
|
|
45
|
+
input: { name: 'demo-quantity' },
|
|
46
|
+
}"
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Props
|
|
51
|
+
|
|
52
|
+
### NumberField-specific
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Default | Description |
|
|
55
|
+
| --------- | -------------------- | ------- | ----------------------------------------- |
|
|
56
|
+
| `classes` | `NumberFieldClasses` | — | The classes to apply to the number field. |
|
|
57
|
+
| `max` | `number` | — | The maximum value. |
|
|
58
|
+
| `min` | `number` | — | The minimum value. |
|
|
59
|
+
| `step` | `number` | 1 | The step increment value. |
|
|
60
|
+
|
|
61
|
+
### v-model
|
|
62
|
+
|
|
63
|
+
| Prop / Event | Type | Default | Description |
|
|
64
|
+
| ------------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
65
|
+
| `modelValue` | `number \| null` | — | Bound with `v-model`. |
|
|
66
|
+
| `update:modelValue` | `(value: number \| null) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
67
|
+
|
|
68
|
+
### Inherited from FormField
|
|
69
|
+
|
|
70
|
+
See [FormField](./FormField.md).
|
|
71
|
+
|
|
72
|
+
## Events
|
|
73
|
+
|
|
74
|
+
| Event | Payload | Description |
|
|
75
|
+
| ------------- | ----------------- | ----------------------------------------------- |
|
|
76
|
+
| `v-on:change` | `(value: number)` | Emitted with the numeric value when it changes. |
|
|
77
|
+
|
|
78
|
+
## Related components
|
|
79
|
+
|
|
80
|
+
TextField, FormField
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# OtpField
|
|
2
|
+
|
|
3
|
+
One-time password / PIN input with individual pin cells. Label, description, and
|
|
4
|
+
error chrome are rendered via the shared `BaseField` layout; variants style each
|
|
5
|
+
pin.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { OtpField } from "@bridge-ui/vue/Components/OtpField";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<OtpField label="Verification code" />
|
|
19
|
+
|
|
20
|
+
<OtpField
|
|
21
|
+
v-model="code"
|
|
22
|
+
:length="4"
|
|
23
|
+
label="PIN"
|
|
24
|
+
description="Enter the 4-digit code from your email."
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<OtpField error label="Code" error-message="Invalid or expired code." />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Length and type
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<OtpField :length="4" label="PIN" />
|
|
34
|
+
|
|
35
|
+
<OtpField :length="8" type="alphanumeric" label="Backup code" />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Variants
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<OtpField variant="outline" label="Outline" />
|
|
42
|
+
<OtpField variant="filled" label="Filled" />
|
|
43
|
+
<OtpField variant="underlined" label="Underlined" />
|
|
44
|
+
<OtpField variant="stacked" label="Stacked" />
|
|
45
|
+
<OtpField variant="notched" label="Notched" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Masked
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<OtpField mask label="Secure code" />
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Adornment slots
|
|
55
|
+
|
|
56
|
+
```vue
|
|
57
|
+
<OtpField label="Code">
|
|
58
|
+
<template #start>
|
|
59
|
+
<Lock aria-hidden="true" />
|
|
60
|
+
</template>
|
|
61
|
+
<template #end>
|
|
62
|
+
<button type="button">Resend</button>
|
|
63
|
+
</template>
|
|
64
|
+
</OtpField>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### customProps
|
|
68
|
+
|
|
69
|
+
```vue
|
|
70
|
+
<OtpField
|
|
71
|
+
label="Code"
|
|
72
|
+
description="Pins use name via customProps."
|
|
73
|
+
:custom-props="{
|
|
74
|
+
input: { name: 'demo-otp' },
|
|
75
|
+
}"
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Props
|
|
80
|
+
|
|
81
|
+
### OtpField-specific
|
|
82
|
+
|
|
83
|
+
| Prop | Type | Default | Description |
|
|
84
|
+
| -------------- | ----------------------------- | ----------- | ------------------------------------------- |
|
|
85
|
+
| `autoFocus` | `boolean` | `false` | Focus the first empty pin on mount. |
|
|
86
|
+
| `classes` | `OtpFieldClasses` | — | Classes for the field chrome and pin cells. |
|
|
87
|
+
| `defaultValue` | `string` | — | Initial value when `v-model` is unbound. |
|
|
88
|
+
| `length` | `number` | `6` | Number of pin slots. |
|
|
89
|
+
| `mask` | `boolean` | `false` | Mask pin values (password-style). |
|
|
90
|
+
| `placeholder` | `string` | — | Placeholder character in empty pins. |
|
|
91
|
+
| `type` | `"numeric" \| "alphanumeric"` | `"numeric"` | Character set accepted by each pin. |
|
|
92
|
+
| `variant` | `OtpFieldVariant` | `"outline"` | Visual variant applied to each pin cell. |
|
|
93
|
+
|
|
94
|
+
### Binding
|
|
95
|
+
|
|
96
|
+
| Prop | Type | Default | Description |
|
|
97
|
+
| ------------ | -------- | ------- | ----------------------------------- |
|
|
98
|
+
| `modelValue` | `string` | — | Concatenated OTP value (`v-model`). |
|
|
99
|
+
|
|
100
|
+
### Field chrome
|
|
101
|
+
|
|
102
|
+
Label, corner, description, error message, and start/end adornment slots use the
|
|
103
|
+
same `BaseField` layout as other field components. Pin-specific props (`length`,
|
|
104
|
+
`mask`, `variant`, …) apply only to the pin row.
|
|
105
|
+
|
|
106
|
+
| Prop | Type | Default | Description |
|
|
107
|
+
| ------------------ | --------- | ----------- | ----------------------------------------------------------------------- |
|
|
108
|
+
| `color` | token | `"primary"` | Focus color on each pin. |
|
|
109
|
+
| `controlId` | `string` | auto | Id for the pin group and related labels. |
|
|
110
|
+
| `corner` | `string` | — | Secondary header text. |
|
|
111
|
+
| `customProps` | object | — | Extra props for internal parts. |
|
|
112
|
+
| `description` | `string` | — | Helper text below the pins. |
|
|
113
|
+
| `disabled` | `boolean` | `false` | Disables all pins. |
|
|
114
|
+
| `error` | `boolean` | `false` | Invalid styling. |
|
|
115
|
+
| `errorMessage` | `string` | — | Error message below the pins. |
|
|
116
|
+
| `hideErrorMessage` | `boolean` | `false` | Hides the error message row. |
|
|
117
|
+
| `label` | `string` | — | Primary label above the pins. |
|
|
118
|
+
| `readonly` | `boolean` | `false` | Makes all pins read-only. |
|
|
119
|
+
| `required` | `boolean` | `false` | Shows a required asterisk on the label. |
|
|
120
|
+
| `rounded` | token | `"md"` | Border radius of each pin. |
|
|
121
|
+
| `size` | token | `"md"` | Pin size and label typography (`2xs` … `2xl`). |
|
|
122
|
+
| `slots` | — | — | `#label`, `#corner`, `#description`, `#errorMessage`, `#start`, `#end`. |
|
|
123
|
+
|
|
124
|
+
## Events
|
|
125
|
+
|
|
126
|
+
| Event | Payload | Description |
|
|
127
|
+
| ---------- | -------- | ------------------------------------ |
|
|
128
|
+
| `change` | `string` | Emitted when the OTP string changes. |
|
|
129
|
+
| `complete` | `string` | Emitted when every pin is filled. |
|
|
130
|
+
|
|
131
|
+
## Related components
|
|
132
|
+
|
|
133
|
+
BaseField, TextField, FormField, NumberField
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# PasswordField
|
|
2
|
+
|
|
3
|
+
Password input with visibility toggle. Extends FormField props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { PasswordField } from "@bridge-ui/vue/Components/PasswordField";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<PasswordField label="Password" placeholder="Enter password..." />
|
|
17
|
+
|
|
18
|
+
<PasswordField
|
|
19
|
+
v-model="password"
|
|
20
|
+
label="New password"
|
|
21
|
+
description="Use at least 8 characters."
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<PasswordField error label="Password" error-message="Password is too weak." />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Controlled visibility
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<PasswordField
|
|
31
|
+
label="Password"
|
|
32
|
+
:visible="visible"
|
|
33
|
+
placeholder="••••••••"
|
|
34
|
+
v-on:visibility-change="visible = $event"
|
|
35
|
+
description="visible is bound to parent state."
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### customProps
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<PasswordField
|
|
43
|
+
label="Password"
|
|
44
|
+
placeholder="••••••••"
|
|
45
|
+
:custom-props="{
|
|
46
|
+
input: {
|
|
47
|
+
name: 'demo-password',
|
|
48
|
+
autocomplete: 'new-password',
|
|
49
|
+
},
|
|
50
|
+
}"
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Props
|
|
55
|
+
|
|
56
|
+
### PasswordField-specific
|
|
57
|
+
|
|
58
|
+
| Prop | Type | Default | Description |
|
|
59
|
+
| --------- | ---------------------- | ------- | ------------------------------------------------------------ |
|
|
60
|
+
| `classes` | `PasswordFieldClasses` | — | The classes to apply to the password field. |
|
|
61
|
+
| `visible` | `boolean \| null` | — | Whether the password is visible. Omit for uncontrolled mode. |
|
|
62
|
+
|
|
63
|
+
### v-model
|
|
64
|
+
|
|
65
|
+
| Prop / Event | Type | Default | Description |
|
|
66
|
+
| ------------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
67
|
+
| `modelValue` | `string \| null` | — | Bound with `v-model`. |
|
|
68
|
+
| `update:modelValue` | `(value: string \| null) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
69
|
+
|
|
70
|
+
### Inherited from FormField
|
|
71
|
+
|
|
72
|
+
See [FormField](./FormField.md).
|
|
73
|
+
|
|
74
|
+
## Events
|
|
75
|
+
|
|
76
|
+
| Event | Payload | Description |
|
|
77
|
+
| ------------------------ | -------------------- | ----------------------------------------- |
|
|
78
|
+
| `v-on:visibility-change` | `(visible: boolean)` | Emitted when password visibility changes. |
|
|
79
|
+
|
|
80
|
+
## Related components
|
|
81
|
+
|
|
82
|
+
TextField, FormField
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
Linear progress indicator for determinate, indeterminate, buffer, and query loading states.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Progress } from "@bridge-ui/vue/Components/Progress";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Indeterminate
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Progress aria-label="Loading…" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Determinate
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<Progress :value="40" variant="determinate" aria-label="Export data" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Buffer
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Progress
|
|
29
|
+
:value="30"
|
|
30
|
+
variant="buffer"
|
|
31
|
+
:value-buffer="60"
|
|
32
|
+
aria-label="Loading…"
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Query
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<Progress variant="query" aria-label="Loading…" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Color and size
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<Progress size="lg" color="success" aria-label="Saving…" />
|
|
46
|
+
<Progress size="2xs" rounded="md" aria-label="Syncing…" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`size` uses the shared scale (`2xs` … `2xl`). `rounded` uses the shared radius scale (`none` / `xs` … `4xl` / `full`).
|
|
50
|
+
|
|
51
|
+
## Props
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Default | Description |
|
|
54
|
+
| ------------- | --------------------- | ----------------- | ------------------------------------------------- |
|
|
55
|
+
| `classes` | `ProgressClasses` | — | Classes for `root`, `track`, `bar`, and `buffer`. |
|
|
56
|
+
| `color` | `ProgressColor` | `"primary"` | Semantic color of the bar and track. |
|
|
57
|
+
| `customProps` | `ProgressCustomProps` | — | Extra props for internal parts. |
|
|
58
|
+
| `rounded` | `ProgressRounded` | `"full"` | Border radius of the bar. |
|
|
59
|
+
| `size` | `ProgressSize` | `"md"` | Height of the progress bar. |
|
|
60
|
+
| `value` | `number` | — | Progress 0–100 (`determinate` / `buffer`). |
|
|
61
|
+
| `valueBuffer` | `number` | — | Buffer 0–100 (`buffer` variant). |
|
|
62
|
+
| `variant` | `ProgressVariant` | `"indeterminate"` | Visual mode of the indicator. |
|
|
63
|
+
|
|
64
|
+
Pass `aria-label` or `aria-labelledby` for an accessible name.
|
|
65
|
+
|
|
66
|
+
## Related components
|
|
67
|
+
|
|
68
|
+
Spinner, Skeleton, Snackbar
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
Radio input for mutually exclusive choices. Extends FormControl props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Radio } from "@bridge-ui/vue/Components/Radio";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Radio
|
|
17
|
+
name="plan"
|
|
18
|
+
v-model="plan"
|
|
19
|
+
value="starter"
|
|
20
|
+
end-label="Starter"
|
|
21
|
+
description="Free tier for individuals."
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<Radio
|
|
25
|
+
name="plan"
|
|
26
|
+
value="pro"
|
|
27
|
+
v-model="plan"
|
|
28
|
+
end-label="Pro"
|
|
29
|
+
description="For growing teams."
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Required and error
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<Radio required value="req" name="required" end-label="Required field" />
|
|
37
|
+
|
|
38
|
+
<Radio
|
|
39
|
+
error
|
|
40
|
+
value="err"
|
|
41
|
+
name="error"
|
|
42
|
+
end-label="Invalid option"
|
|
43
|
+
error-message="Please select a valid option."
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### customProps
|
|
48
|
+
|
|
49
|
+
```vue
|
|
50
|
+
<Radio
|
|
51
|
+
name="plan"
|
|
52
|
+
value="pro"
|
|
53
|
+
end-label="Pro plan"
|
|
54
|
+
:custom-props="{
|
|
55
|
+
input: { id: 'plan-pro' },
|
|
56
|
+
dot: { 'aria-hidden': true },
|
|
57
|
+
control: { 'data-testid': 'plan-pro-control' },
|
|
58
|
+
}"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Props
|
|
63
|
+
|
|
64
|
+
### Radio-specific
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Default | Description |
|
|
67
|
+
| ------------- | ------------------ | --------- | ------------------------------------------------------------------------------------------ |
|
|
68
|
+
| `checked` | `boolean` | — | Whether the radio is checked. |
|
|
69
|
+
| `classes` | `RadioClasses` | — | Classes for the form control chrome and the radio control. |
|
|
70
|
+
| `color` | `RadioColor` | "primary" | The color to apply to the radio. |
|
|
71
|
+
| `customProps` | `RadioCustomProps` | — | Extra props for internal parts. |
|
|
72
|
+
| `name` | `string` | — | The `name` attribute shared by radios in the same group. |
|
|
73
|
+
| `rounded` | `RadioRounded` | "full" | The roundedness of the radio control. |
|
|
74
|
+
| `size` | `RadioSize` | "md" | Size of the control and of form control labels (`2xs` … `2xl`, same scale as `FormField`). |
|
|
75
|
+
| `slots` | `RadioSlots` | — | Chrome slots and the control slot. |
|
|
76
|
+
| `value` | `string \| number` | — | The value of this radio option. |
|
|
77
|
+
|
|
78
|
+
### v-model
|
|
79
|
+
|
|
80
|
+
| Prop / Event | Type | Default | Description |
|
|
81
|
+
| ------------------- | ----------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
82
|
+
| `modelValue` | `string \| number` | — | Bound with `v-model`. |
|
|
83
|
+
| `update:modelValue` | `(value: string \| number) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
84
|
+
|
|
85
|
+
### Inherited from FormControl
|
|
86
|
+
|
|
87
|
+
See [FormControl](./FormControl.md).
|
|
88
|
+
|
|
89
|
+
## Related components
|
|
90
|
+
|
|
91
|
+
Checkbox, FormControl
|