@bridge-ui/vue 0.25.0 → 0.27.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.
Files changed (102) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Components/ActionFooter/ActionFooter.vue.d.ts +2 -2
  3. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +4 -4
  4. package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +4 -3
  5. package/dist/Components/Autocomplete/composables/useAutocomplete.js +1 -1
  6. package/dist/Components/BaseField/composables/useBaseField.js +0 -1
  7. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +62 -58
  8. package/dist/Components/Calendar/calendar.types.d.ts +8 -0
  9. package/dist/Components/Calendar/composables/useCalendar.d.ts +2 -1
  10. package/dist/Components/Calendar/composables/useCalendar.js +188 -177
  11. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +96 -92
  12. package/dist/Components/CalendarRange/calendarRange.types.d.ts +8 -0
  13. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +2 -1
  14. package/dist/Components/CalendarRange/composables/useCalendarRange.js +203 -220
  15. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -1
  16. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -0
  17. package/dist/Components/Checkbox/composables/useCheckbox.js +2 -1
  18. package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
  19. package/dist/Components/ColorField/composables/useColorField.js +1 -1
  20. package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +2 -2
  21. package/dist/Components/DateField/DateField.vue.d.ts +2 -2
  22. package/dist/Components/DateField/composables/useDateField.js +1 -1
  23. package/dist/Components/DatePicker/DatePicker.vue.d.ts +2 -2
  24. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  25. package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
  26. package/dist/Components/DateRangeField/composables/useDateRangeField.js +1 -1
  27. package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +2 -2
  28. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  29. package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
  30. package/dist/Components/DateTimeField/composables/useDateTimeField.js +1 -1
  31. package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +2 -2
  32. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  33. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
  34. package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +1 -1
  35. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +2 -2
  36. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  37. package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
  38. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  39. package/dist/Components/FormControl/composables/useFormControl.d.ts +1 -0
  40. package/dist/Components/FormControl/composables/useFormControl.js +14 -11
  41. package/dist/Components/FormField/composables/useFormField.js +0 -1
  42. package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -1
  43. package/dist/Components/List/composables/useList.d.ts +1 -1
  44. package/dist/Components/List/composables/useList.js +5 -1
  45. package/dist/Components/List/index.d.ts +1 -1
  46. package/dist/Components/List/list.types.d.ts +10 -1
  47. package/dist/Components/List/listInjectionKey.d.ts +2 -0
  48. package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +1 -0
  49. package/dist/Components/ListItem/composables/useListItem.d.ts +1 -2
  50. package/dist/Components/ListItem/composables/useListItem.js +92 -86
  51. package/dist/Components/ListItem/listItem.types.d.ts +8 -0
  52. package/dist/Components/ListSection/composables/useListSection.js +31 -29
  53. package/dist/Components/Listbox/Listbox.vue.d.ts +2 -2
  54. package/dist/Components/Listbox/listbox.types.d.ts +2 -2
  55. package/dist/Components/Modal/Modal.vue.d.ts +1 -1
  56. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  57. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +30 -30
  58. package/dist/Components/NumberField/composables/useNumberField.d.ts +1 -0
  59. package/dist/Components/NumberField/composables/useNumberField.js +11 -10
  60. package/dist/Components/OtpField/composables/useOtpField.js +7 -1
  61. package/dist/Components/Pagination/Pagination.vue.d.ts +2 -2
  62. package/dist/Components/QrCode/QrCode.js +4 -0
  63. package/dist/Components/QrCode/QrCode.vue.d.ts +17 -0
  64. package/dist/Components/QrCode/QrCode.vue_vue_type_script_setup_true_lang.js +45 -0
  65. package/dist/Components/QrCode/composables/useQrCode.d.ts +881 -0
  66. package/dist/Components/QrCode/composables/useQrCode.js +137 -0
  67. package/dist/Components/QrCode/index.d.ts +3 -0
  68. package/dist/Components/QrCode/index.js +3 -0
  69. package/dist/Components/QrCode/qrCode.types.d.ts +168 -0
  70. package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -1
  71. package/dist/Components/Radio/composables/useRadio.d.ts +1 -0
  72. package/dist/Components/Radio/composables/useRadio.js +2 -1
  73. package/dist/Components/Select/Select.vue.d.ts +4 -4
  74. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +4 -3
  75. package/dist/Components/Select/composables/useSelect.js +1 -1
  76. package/dist/Components/Sidebar/SidebarList.vue_vue_type_script_setup_true_lang.js +1 -0
  77. package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +1 -0
  78. package/dist/Components/Slider/composables/useSlider.d.ts +2 -2
  79. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
  80. package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -1
  81. package/dist/Components/Switch/composables/useSwitch.d.ts +1 -0
  82. package/dist/Components/Switch/composables/useSwitch.js +2 -1
  83. package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
  84. package/dist/Components/TimeField/composables/useTimeField.js +1 -1
  85. package/dist/Components/TimePicker/TimePicker.vue.d.ts +2 -2
  86. package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
  87. package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +1 -1
  88. package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -2
  89. package/dist/Utils/index.d.ts +2 -0
  90. package/dist/Utils/index.js +40 -39
  91. package/dist/Utils/useWheelNavigation.d.ts +11 -0
  92. package/dist/Utils/useWheelNavigation.js +20 -0
  93. package/dist/augments.d.ts +7 -1
  94. package/dist/index.d.ts +3 -1
  95. package/dist/index.js +84 -82
  96. package/docs/README.md +1 -0
  97. package/docs/components/Calendar.md +31 -30
  98. package/docs/components/CalendarRange.md +29 -28
  99. package/docs/components/I18n.md +2 -0
  100. package/docs/components/List.md +43 -27
  101. package/docs/components/QrCode.md +134 -0
  102. package/package.json +3 -3
@@ -132,6 +132,7 @@ Other ready adapters:
132
132
  | `Close` |
133
133
  | `Reset` |
134
134
  | `Search` |
135
+ | `Refresh` |
135
136
  | `Columns` |
136
137
  | `Loading` |
137
138
  | `No data` |
@@ -143,6 +144,7 @@ Other ready adapters:
143
144
  | `No options` |
144
145
  | `Pagination` |
145
146
  | `Select row` |
147
+ | `Code expired` |
146
148
  | `Filter column` |
147
149
  | `Hide password` |
148
150
  | `Rows per page` |
@@ -114,6 +114,20 @@ Set `href` to render the row as an anchor. The browser shows the URL on hover, a
114
114
  </List>
115
115
  ```
116
116
 
117
+ ### Size
118
+
119
+ `size` sets the typography scale for every item and section title in the list. A `ListItem` can override it with its own `size`. Inside a `Listbox`, the `Listbox` size applies instead.
120
+
121
+ ```vue
122
+ <List size="lg">
123
+ <ListSection title="Account" />
124
+ <ListItem interactive primary="Profile" secondary="Name and avatar" />
125
+ <ListItem size="md" interactive primary="Billing" />
126
+ </List>
127
+ ```
128
+
129
+ Set the default for every list in the provider with `List: { defaultProps: { size: "lg" } }`.
130
+
117
131
  ### Sticky section
118
132
 
119
133
  With the default `as="li"`, sticky styles apply on the section root. The list (or a parent) needs a scroll container with a constrained height.
@@ -137,36 +151,38 @@ With the default `as="li"`, sticky styles apply on the section root. The list (o
137
151
 
138
152
  ## Props (`List`)
139
153
 
140
- | Prop | Type | Default | Description |
141
- | ------------- | ----------------------- | ------- | ---------------------------------------------------------------------------------- |
142
- | `as` | `"nav" \| "ol" \| "ul"` | "ul" | The element to render as. |
143
- | `classes` | `ListClasses` | — | The classes to apply to the list. |
144
- | `customProps` | `ListCustomProps` | — | Props forwarded to each list part. |
145
- | `dense` | `boolean` | `false` | Compact vertical spacing on items (`ListItem` / `ListSection`), not the list root. |
146
- | `nested` | `boolean` | `false` | When true, indents the list for nested navigation/submenus. |
154
+ | Prop | Type | Default | Description |
155
+ | ------------- | ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
156
+ | `as` | `"nav" \| "ol" \| "ul"` | "ul" | The element to render as. |
157
+ | `classes` | `ListClasses` | — | The classes to apply to the list. |
158
+ | `customProps` | `ListCustomProps` | — | Props forwarded to each list part. |
159
+ | `dense` | `boolean` | `false` | Compact vertical spacing on items (`ListItem` / `ListSection`), not the list root. |
160
+ | `nested` | `boolean` | `false` | When true, indents the list for nested navigation/submenus. |
161
+ | `size` | `"lg" \| "md" \| "sm"` | "md" | Typography scale for items (`ListItem`) and section titles (`ListSection`). Items can override it with their own `size`. |
147
162
 
148
163
  ## Props (`ListItem`)
149
164
 
150
- | Prop | Type | Default | Description |
151
- | -------------- | ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------ |
152
- | `as` | `"div" \| "li"` | "li" | The element to render as. |
153
- | `classes` | `ListItemClasses` | — | The classes to apply to the item. |
154
- | `customProps` | `ListItemCustomProps` | — | Props forwarded to each item part. |
155
- | `dense` | `boolean` | — | Compact vertical padding. Inherits `dense` from parent `List` when omitted. |
156
- | `disabled` | `boolean` | `false` | When true, the item is not interactive and appears muted. |
157
- | `divider` | `boolean` | `false` | When true, renders a bottom divider on the item. |
158
- | `href` | `string` | — | URL for the interactive wrapper. Renders an anchor so hover shows the address and middle-click opens a new tab. |
159
- | `interactive` | `boolean` | `false` | When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper. Implied when `href` is set. |
160
- | `linkAs` | `string \| Component` | — | Component rendered in place of the interactive `<a>`. The root stays `as` (`li` or `div`). Ignored while disabled. |
161
- | `linkProps` | props of `linkAs` | — | Props forwarded to `linkAs`. Checked against that component. Ignored while `linkAs` is not rendered. |
162
- | `primary` | `string` | — | Primary label text. |
163
- | `rel` | `string` | — | Relationship of the linked URL. Forwarded to the anchor when `href` is set. |
164
- | `role` | `"button" \| "menuitem" \| "option"` | "button" | ARIA role for the interactive wrapper. Omitted when `href` is set. |
165
- | `secondary` | `string` | — | Secondary/description text below the primary line. |
166
- | `selected` | `boolean` | `false` | When true, highlights the item as selected. |
167
- | `selectedIcon` | `null \| LucideIcon` | `Check` | Icon shown when `selected` is true. Use `null` to hide it. Replaced by `#end`. |
168
- | `target` | `string` | — | Where to open the URL. Forwarded to the anchor when `href` is set. |
169
- | `value` | `ListboxValue` | — | When set inside a `Select` / `Listbox`, registers this row as a selectable option. |
165
+ | Prop | Type | Default | Description |
166
+ | -------------- | ------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
167
+ | `as` | `"div" \| "li"` | "li" | The element to render as. |
168
+ | `classes` | `ListItemClasses` | — | The classes to apply to the item. |
169
+ | `customProps` | `ListItemCustomProps` | — | Props forwarded to each item part. |
170
+ | `dense` | `boolean` | — | Compact vertical padding. Inherits `dense` from parent `List` when omitted. |
171
+ | `disabled` | `boolean` | `false` | When true, the item is not interactive and appears muted. |
172
+ | `divider` | `boolean` | `false` | When true, renders a bottom divider on the item. |
173
+ | `href` | `string` | — | URL for the interactive wrapper. Renders an anchor so hover shows the address and middle-click opens a new tab. |
174
+ | `interactive` | `boolean` | `false` | When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper. Implied when `href` is set. |
175
+ | `linkAs` | `string \| Component` | — | Component rendered in place of the interactive `<a>`. The root stays `as` (`li` or `div`). Ignored while disabled. |
176
+ | `linkProps` | props of `linkAs` | — | Props forwarded to `linkAs`. Checked against that component. Ignored while `linkAs` is not rendered. |
177
+ | `primary` | `string` | — | Primary label text. |
178
+ | `rel` | `string` | — | Relationship of the linked URL. Forwarded to the anchor when `href` is set. |
179
+ | `role` | `"button" \| "menuitem" \| "option"` | "button" | ARIA role for the interactive wrapper. Omitted when `href` is set. |
180
+ | `secondary` | `string` | — | Secondary/description text below the primary line. |
181
+ | `selected` | `boolean` | `false` | When true, highlights the item as selected. |
182
+ | `selectedIcon` | `null \| LucideIcon` | `Check` | Icon shown when `selected` is true. Use `null` to hide it. Replaced by `#end`. |
183
+ | `size` | `"lg" \| "md" \| "sm"` | — | Typography scale for the row. Inherits `size` from parent `List` when omitted. Ignored inside a `Listbox`, which applies its own size. |
184
+ | `target` | `string` | — | Where to open the URL. Forwarded to the anchor when `href` is set. |
185
+ | `value` | `ListboxValue` | — | When set inside a `Select` / `Listbox`, registers this row as a selectable option. |
170
186
 
171
187
  ## Props (`ListSection`)
172
188
 
@@ -0,0 +1,134 @@
1
+ # QrCode
2
+
3
+ Renders a QR code from a `value` inside a light frame that cameras read in both themes. Use it for payment codes that expire, two-factor setup, and links to open on a phone.
4
+
5
+ The code is generated on the client and drawn as one svg `path`, never injected as HTML.
6
+
7
+ ## Import
8
+
9
+ ```ts
10
+ import { QrCode } from "@bridge-ui/vue/Components/QrCode";
11
+ ```
12
+
13
+ ## Examples
14
+
15
+ ### Usage
16
+
17
+ ```vue
18
+ <QrCode label="Order QR code" value="https://shop.test/orders/01J9Z/tracking" />
19
+ ```
20
+
21
+ Always show the content next to the code as well (a copy field or the link), since the code alone is not readable by everyone.
22
+
23
+ ### Payment that expires
24
+
25
+ `expired` dims the code and shows an overlay. A `refresh` listener adds a refresh button to it.
26
+
27
+ ```vue
28
+ <QrCode
29
+ :value="pix.code"
30
+ label="Pix QR code"
31
+ v-on:refresh="renewCharge"
32
+ :status="expired ? 'expired' : 'active'"
33
+ />
34
+ ```
35
+
36
+ ### Loading
37
+
38
+ A `null` or empty `value` always renders the loading state, so the frame keeps its size while the value arrives.
39
+
40
+ ```vue
41
+ <QrCode :value="secret?.url ?? null" label="Authenticator QR code" />
42
+ ```
43
+
44
+ ### Icon in the center
45
+
46
+ The modules under the icon are cleared. Use `errorLevel="H"` so the code still reads.
47
+
48
+ ```vue
49
+ <QrCode :icon="logo" :value="url" errorLevel="H" label="Store link" />
50
+ ```
51
+
52
+ ### Size and colors
53
+
54
+ `size` is the code in px. A light margin of at least four modules (the quiet zone) is added around it. Keep a high contrast between `color` and `background`.
55
+
56
+ ```vue
57
+ <QrCode :size="240" :value="url" color="#1e3a8a" label="Store link" />
58
+ ```
59
+
60
+ ### Without border
61
+
62
+ ```vue
63
+ <QrCode :value="url" :bordered="false" label="Store link" />
64
+ ```
65
+
66
+ ### Slots
67
+
68
+ ```vue
69
+ <QrCode status="expired" :value="pix.code" label="Pix QR code">
70
+ <template #loading>
71
+ <Spinner />
72
+ </template>
73
+
74
+ <template #expired>
75
+ <Button v-on:click="renewCharge" text="Generate a new code" />
76
+ </template>
77
+ </QrCode>
78
+ ```
79
+
80
+ ### Classes
81
+
82
+ ```vue
83
+ <QrCode
84
+ :value="url"
85
+ label="Store link"
86
+ :classes="{
87
+ root: 'shadow-md',
88
+ overlay: 'text-base',
89
+ }"
90
+ />
91
+ ```
92
+
93
+ ## Props
94
+
95
+ | Prop | Type | Default | Description |
96
+ | ------------- | ------------------------------------ | ---------- | ------------------------------------------------------------------------------------------- |
97
+ | `background` | `string` | `"#fff"` | Background of the code and the frame. Stays light in the dark theme. |
98
+ | `bordered` | `boolean` | `true` | Draws the frame border. Turn off to embed the code in a custom container. |
99
+ | `classes` | `QrCodeClasses` | — | Part classes (`root`, `code`, `icon`, `overlay`, `skeleton`). |
100
+ | `color` | `string` | `"#000"` | Color of the dark modules. |
101
+ | `customProps` | `QrCodeCustomProps` | — | Extra props for the parts (`root`, `code`, `icon`, `overlay`, `skeleton`, `refreshButton`). |
102
+ | `errorLevel` | `"L" \| "M" \| "Q" \| "H"` | `"M"` | Error correction. Use `H` with `icon`. |
103
+ | `icon` | `string` | — | Image URL drawn in the center. |
104
+ | `iconSize` | `number` | `size / 5` | Size of the icon in px. |
105
+ | `label` | `string` | — | Accessible name of the code. Required. |
106
+ | `rounded` | `QrCodeRounded` | `"xl"` | The roundedness of the frame. |
107
+ | `size` | `number` | `160` | Size of the code in px, without the quiet zone. |
108
+ | `status` | `"active" \| "loading" \| "expired"` | `"active"` | Display state. |
109
+ | `value` | `string \| null` | — | Content encoded in the code. `null` or empty renders the loading state. |
110
+
111
+ ## Events
112
+
113
+ | Event | Payload | Description |
114
+ | --------- | ------- | -------------------------------------------------------------------- |
115
+ | `refresh` | — | Refresh button pressed. A listener shows the button while `expired`. |
116
+
117
+ ## Slots
118
+
119
+ | Slot | Description |
120
+ | --------- | ---------------------------------------------------- |
121
+ | `expired` | Overlay content, in place of the text and button. |
122
+ | `loading` | Placeholder while loading, in place of the Skeleton. |
123
+
124
+ A value too long for a QR code at `errorLevel` renders an empty frame.
125
+
126
+ ## Accessibility
127
+
128
+ - The code has `role="img"` and `label` as its `aria-label`; the svg is `aria-hidden`.
129
+ - The overlay is a polite live region, so `Code expired` is announced. The refresh button sits outside the image and is focusable.
130
+ - `Code expired` and `Refresh` go through the i18n adapter ([I18n](./I18n.md)).
131
+
132
+ ## Related components
133
+
134
+ Skeleton, Button
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "license": "MIT",
4
- "version": "0.25.0",
4
+ "version": "0.27.0",
5
5
  "author": "BridgeUI",
6
6
  "sideEffects": false,
7
7
  "name": "@bridge-ui/vue",
@@ -89,14 +89,14 @@
89
89
  "test:cy:open": "cypress open --component"
90
90
  },
91
91
  "dependencies": {
92
- "@bridge-ui/core": "^0.25.0",
92
+ "@bridge-ui/core": "^0.27.0",
93
93
  "clsx": "^2.1.1",
94
94
  "es-toolkit": "^1.53.2",
95
95
  "tailwind-merge": "^3.7.1"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@inertiajs/vue3": "^3.11.0",
99
- "@lucide/vue": "^1.78.0",
99
+ "@lucide/vue": "^1.80.0",
100
100
  "@tailwindcss/cli": "^4.3.5",
101
101
  "@tailwindcss/typography": "^0.5.20",
102
102
  "@tailwindcss/vite": "^4.3.5",