@brandsync/wc 0.0.8 → 0.0.9

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 (193) hide show
  1. package/custom-elements.json +1808 -353
  2. package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
  3. package/dist/brandsync-wc/p-0d64ea40.entry.js +1 -0
  4. package/dist/brandsync-wc/{p-c63d16e1.entry.js → p-1515498e.entry.js} +1 -1
  5. package/dist/brandsync-wc/p-16a54578.entry.js +1 -0
  6. package/dist/brandsync-wc/p-18af02df.entry.js +1 -0
  7. package/dist/brandsync-wc/p-30a0e168.entry.js +1 -0
  8. package/dist/brandsync-wc/p-3dacae70.entry.js +1 -0
  9. package/dist/brandsync-wc/p-5333bb5a.entry.js +1 -0
  10. package/dist/brandsync-wc/p-575ce905.entry.js +1 -0
  11. package/dist/brandsync-wc/{p-dd0fea0e.entry.js → p-7776b57b.entry.js} +1 -1
  12. package/dist/brandsync-wc/{p-260bd201.entry.js → p-805644e4.entry.js} +1 -1
  13. package/dist/brandsync-wc/{p-f88d9a6e.entry.js → p-8a78d6ea.entry.js} +1 -1
  14. package/dist/brandsync-wc/p-8d12ed96.entry.js +1 -0
  15. package/dist/brandsync-wc/p-94ed898a.entry.js +1 -0
  16. package/dist/brandsync-wc/{p-9e5d2211.entry.js → p-96f374be.entry.js} +1 -1
  17. package/dist/brandsync-wc/{p-ab5cc7af.entry.js → p-a34f460d.entry.js} +1 -1
  18. package/dist/brandsync-wc/p-bc72439a.entry.js +1 -0
  19. package/dist/brandsync-wc/{p-76eca100.entry.js → p-ce0914a7.entry.js} +1 -1
  20. package/dist/brandsync-wc/{p-5a0fe72e.entry.js → p-d682675e.entry.js} +1 -1
  21. package/dist/brandsync-wc/p-dad4a92c.entry.js +1 -0
  22. package/dist/brandsync-wc/{p-cfc3421b.entry.js → p-dd747a12.entry.js} +1 -1
  23. package/dist/brandsync-wc/{p-2742ecef.entry.js → p-eb4d87f0.entry.js} +1 -1
  24. package/dist/cjs/brandsync-wc.cjs.js +1 -1
  25. package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +17 -0
  26. package/dist/cjs/bs-ai-greeting.cjs.entry.js +24 -0
  27. package/dist/cjs/bs-ai-thinking.cjs.entry.js +1 -1
  28. package/dist/cjs/bs-attachment-list.cjs.entry.js +47 -0
  29. package/dist/cjs/bs-attachment.cjs.entry.js +46 -0
  30. package/dist/cjs/bs-badge.cjs.entry.js +1 -1
  31. package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
  32. package/dist/cjs/bs-button.cjs.entry.js +1 -1
  33. package/dist/cjs/bs-card.cjs.entry.js +1 -1
  34. package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +94 -0
  35. package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
  36. package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
  37. package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +38 -0
  38. package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
  39. package/dist/cjs/bs-composer-status-banner.cjs.entry.js +43 -0
  40. package/dist/cjs/bs-composer.cjs.entry.js +16 -2
  41. package/dist/cjs/bs-data-table.cjs.entry.js +2 -2
  42. package/dist/cjs/bs-input.cjs.entry.js +270 -4
  43. package/dist/cjs/{bs-menu-item.cjs.entry.js → bs-menu_2.cjs.entry.js} +14 -1
  44. package/dist/cjs/bs-source-link.cjs.entry.js +39 -0
  45. package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
  46. package/dist/cjs/loader.cjs.js +1 -1
  47. package/dist/collection/collection-manifest.json +8 -0
  48. package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +180 -0
  49. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.js +14 -0
  50. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.css +27 -0
  51. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +41 -0
  52. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.js +15 -0
  53. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.cmp.test.js +22 -0
  54. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.css +53 -0
  55. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +103 -0
  56. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.stories.js +23 -0
  57. package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
  58. package/dist/collection/components/bs-attachment/bs-attachment.cmp.test.js +41 -0
  59. package/dist/collection/components/bs-attachment/bs-attachment.css +184 -0
  60. package/dist/collection/components/bs-attachment/bs-attachment.js +230 -0
  61. package/dist/collection/components/bs-attachment/bs-attachment.stories.js +58 -0
  62. package/dist/collection/components/bs-attachment-list/bs-attachment-list.cmp.test.js +28 -0
  63. package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +56 -0
  64. package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +105 -0
  65. package/dist/collection/components/bs-attachment-list/bs-attachment-list.stories.js +47 -0
  66. package/dist/collection/components/bs-badge/bs-badge.js +1 -1
  67. package/dist/collection/components/bs-button/bs-button.js +1 -1
  68. package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
  69. package/dist/collection/components/bs-card/bs-card.js +1 -1
  70. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.js +73 -0
  71. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +253 -0
  72. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +324 -0
  73. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.js +54 -0
  74. package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
  75. package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
  76. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.js +34 -0
  77. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.css +106 -0
  78. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +142 -0
  79. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.js +44 -0
  80. package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
  81. package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +12 -0
  82. package/dist/collection/components/bs-composer/bs-composer.css +10 -0
  83. package/dist/collection/components/bs-composer/bs-composer.js +25 -1
  84. package/dist/collection/components/bs-composer/bs-composer.stories.js +13 -0
  85. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +42 -0
  86. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.css +173 -0
  87. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +270 -0
  88. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.stories.js +75 -0
  89. package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
  90. package/dist/collection/components/bs-input/bs-input.cmp.test.js +296 -0
  91. package/dist/collection/components/bs-input/bs-input.css +333 -23
  92. package/dist/collection/components/bs-input/bs-input.js +647 -11
  93. package/dist/collection/components/bs-input/bs-input.stories.js +128 -1
  94. package/dist/collection/components/bs-menu/bs-menu.js +1 -1
  95. package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
  96. package/dist/collection/components/bs-source-link/bs-source-link.cmp.test.js +42 -0
  97. package/dist/collection/components/bs-source-link/bs-source-link.css +114 -0
  98. package/dist/collection/components/bs-source-link/bs-source-link.js +192 -0
  99. package/dist/collection/components/bs-source-link/bs-source-link.stories.js +33 -0
  100. package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
  101. package/dist/components/bs-ai-disclaimer.d.ts +11 -0
  102. package/dist/components/bs-ai-disclaimer.js +1 -0
  103. package/dist/components/bs-ai-greeting.d.ts +11 -0
  104. package/dist/components/bs-ai-greeting.js +1 -0
  105. package/dist/components/bs-ai-thinking.js +1 -1
  106. package/dist/components/bs-attachment-list.d.ts +11 -0
  107. package/dist/components/bs-attachment-list.js +1 -0
  108. package/dist/components/bs-attachment.d.ts +11 -0
  109. package/dist/components/bs-attachment.js +1 -0
  110. package/dist/components/bs-badge.js +1 -1
  111. package/dist/components/bs-button-skeleton.js +1 -1
  112. package/dist/components/bs-button.js +1 -1
  113. package/dist/components/bs-card.js +1 -1
  114. package/dist/components/bs-chatbot-feedback.d.ts +11 -0
  115. package/dist/components/bs-chatbot-feedback.js +1 -0
  116. package/dist/components/bs-chatbot-header.js +1 -1
  117. package/dist/components/bs-chatbot-response-action.js +1 -1
  118. package/dist/components/bs-chatbot-sources-drawer.d.ts +11 -0
  119. package/dist/components/bs-chatbot-sources-drawer.js +1 -0
  120. package/dist/components/bs-chatbot-suggestion-button.js +1 -1
  121. package/dist/components/bs-composer-status-banner.d.ts +11 -0
  122. package/dist/components/bs-composer-status-banner.js +1 -0
  123. package/dist/components/bs-composer.js +1 -1
  124. package/dist/components/bs-data-table.js +1 -1
  125. package/dist/components/bs-input.js +1 -1
  126. package/dist/components/bs-menu-item.js +1 -1
  127. package/dist/components/bs-menu.js +1 -1
  128. package/dist/components/bs-source-link.d.ts +11 -0
  129. package/dist/components/bs-source-link.js +1 -0
  130. package/dist/components/bs-tooltip.js +1 -1
  131. package/dist/components/{p-CoC4LQCI.js → p-Cz2nfz2j.js} +1 -1
  132. package/dist/components/p-DndQiCMP.js +1 -0
  133. package/dist/components/p-_vXDfB3V.js +1 -0
  134. package/dist/esm/brandsync-wc.js +1 -1
  135. package/dist/esm/bs-ai-disclaimer.entry.js +15 -0
  136. package/dist/esm/bs-ai-greeting.entry.js +22 -0
  137. package/dist/esm/bs-ai-thinking.entry.js +1 -1
  138. package/dist/esm/bs-attachment-list.entry.js +45 -0
  139. package/dist/esm/bs-attachment.entry.js +44 -0
  140. package/dist/esm/bs-badge.entry.js +1 -1
  141. package/dist/esm/bs-button-skeleton.entry.js +1 -1
  142. package/dist/esm/bs-button.entry.js +1 -1
  143. package/dist/esm/bs-card.entry.js +1 -1
  144. package/dist/esm/bs-chatbot-feedback.entry.js +92 -0
  145. package/dist/esm/bs-chatbot-header.entry.js +1 -1
  146. package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
  147. package/dist/esm/bs-chatbot-sources-drawer.entry.js +36 -0
  148. package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
  149. package/dist/esm/bs-composer-status-banner.entry.js +41 -0
  150. package/dist/esm/bs-composer.entry.js +17 -3
  151. package/dist/esm/bs-data-table.entry.js +2 -2
  152. package/dist/esm/bs-input.entry.js +271 -5
  153. package/dist/esm/{bs-menu-item.entry.js → bs-menu_2.entry.js} +15 -3
  154. package/dist/esm/bs-source-link.entry.js +37 -0
  155. package/dist/esm/bs-tooltip.entry.js +1 -1
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/types/components/bs-ai-chatbot/bs-ai-chatbot.stories.d.ts +18 -0
  158. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.d.ts +1 -0
  159. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.d.ts +26 -0
  160. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.d.ts +8 -0
  161. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.cmp.test.d.ts +1 -0
  162. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.d.ts +42 -0
  163. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.stories.d.ts +10 -0
  164. package/dist/types/components/bs-attachment/bs-attachment.cmp.test.d.ts +1 -0
  165. package/dist/types/components/bs-attachment/bs-attachment.d.ts +59 -0
  166. package/dist/types/components/bs-attachment/bs-attachment.stories.d.ts +17 -0
  167. package/dist/types/components/bs-attachment-list/bs-attachment-list.cmp.test.d.ts +1 -0
  168. package/dist/types/components/bs-attachment-list/bs-attachment-list.d.ts +42 -0
  169. package/dist/types/components/bs-attachment-list/bs-attachment-list.stories.d.ts +10 -0
  170. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.d.ts +1 -0
  171. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.d.ts +90 -0
  172. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.d.ts +16 -0
  173. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.d.ts +1 -0
  174. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.d.ts +54 -0
  175. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.d.ts +10 -0
  176. package/dist/types/components/bs-composer/bs-composer.d.ts +14 -0
  177. package/dist/types/components/bs-composer/bs-composer.stories.d.ts +1 -0
  178. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.d.ts +1 -0
  179. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +88 -0
  180. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.stories.d.ts +20 -0
  181. package/dist/types/components/bs-input/bs-input.d.ts +139 -6
  182. package/dist/types/components/bs-input/bs-input.stories.d.ts +19 -0
  183. package/dist/types/components/bs-source-link/bs-source-link.cmp.test.d.ts +1 -0
  184. package/dist/types/components/bs-source-link/bs-source-link.d.ts +51 -0
  185. package/dist/types/components/bs-source-link/bs-source-link.stories.d.ts +13 -0
  186. package/dist/types/components.d.ts +1746 -19
  187. package/package.json +1 -1
  188. package/dist/brandsync-wc/p-6abdfaf0.entry.js +0 -1
  189. package/dist/brandsync-wc/p-6c1fa4da.entry.js +0 -1
  190. package/dist/brandsync-wc/p-a12d0a60.entry.js +0 -1
  191. package/dist/brandsync-wc/p-f5f443e2.entry.js +0 -1
  192. package/dist/cjs/bs-menu.cjs.entry.js +0 -17
  193. package/dist/esm/bs-menu.entry.js +0 -15
@@ -1,23 +1,51 @@
1
1
  import { h } from "@stencil/core";
2
2
  /**
3
- * A single-line text field with an optional label, description, and error state.
3
+ * A single-line text field with an optional label, description, and error state. Also covers a
4
+ * range of related "field" shapes (number stepper, password reveal, date, dropdown trigger,
5
+ * select, textarea, chip input, initials, country, and pin) via the `type` prop, since they all
6
+ * share the same label/description/error/icon-slot chrome.
4
7
  *
5
8
  * ## When to use
6
9
  * - Collecting a single line of free-text, email, password, or numeric input.
10
+ * - Any of the other supported `type`s (search, date, dropdown, select, textarea, chip, initials,
11
+ * country, pin) that share this component's label/description/error chrome.
7
12
  * - Pair with `error` for inline validation feedback tied to that specific field.
8
13
  *
9
14
  * ## When not to use
10
- * - Multi-line text — this component has no `textarea` mode.
11
- * - A fixed set of choices — use a select/radio/checkbox component instead of free text.
15
+ * - A fixed set of choices best served by a dedicated radio/checkbox group rather than a single
16
+ * field. `type="select"` (native `<select>`) and `type="dropdown"` (a `bs-menu` of
17
+ * `bs-menu-item`s from the `options` prop) cover the field-shaped cases; `type="chip"` has no
18
+ * options list at all (freeform chip entry).
12
19
  *
20
+ * @slot icon - Optional leading icon, rendered before the native control (e.g. a mail icon for an
21
+ * email field). For `type="search"`, the slot is used if provided, otherwise a default
22
+ * magnifying-glass icon is shown.
23
+ * @slot end-icon - Optional trailing icon, rendered after the native control (e.g. a chevron for a
24
+ * field that opens a picker). Ignored when `type` is `number` (stepper buttons), `password` (show/hide
25
+ * toggle), or `dropdown` (chevron) -- those types always render their own trailing control there.
26
+ * For `type="date"`, the slot is used if provided, otherwise a default calendar icon is shown.
27
+ * @part field - The bordered field wrapper containing the icon(s) and native control(s).
28
+ * @part menu - The `bs-menu` rendered below the field for `type="dropdown"` when `open` and
29
+ * `options` is non-empty.
13
30
  * @part label - The `<label>` element.
14
- * @part control - The native `<input>` element.
31
+ * @part required - The red `*` rendered after the label text when `required` is set.
32
+ * @part icon - The leading icon wrapper element.
33
+ * @part control - The native control element (`<input>`, `<select>`, or `<textarea>` depending on
34
+ * `type`). Composite types (`initials`, `country`) render this part on more than one element.
35
+ * @part end-icon - The trailing icon wrapper element.
36
+ * @part chip - A single chip pill, when `type="chip"`.
15
37
  * @part description - The helper text element (hidden when `error` is set).
16
38
  * @part error - The error message element.
39
+ * @part error-icon - The warning icon shown before the error message.
17
40
  */
41
+ // Note: this component's CSS Custom Properties (--bs-input-*) are documented via @prop comments
42
+ // in bs-input.css, not here -- Stencil's docs generator only parses @prop out of CSS file
43
+ // comments (see stencil.js's parseStyleDocs/parseCssComment), not the class-level JSDoc.
18
44
  export class BsInput {
45
+ el;
19
46
  /** Current value. Native `input`/`change` events don't cross the Shadow DOM boundary, so this
20
- * component re-dispatches them as `bsInput`/`bsChange` custom events instead. */
47
+ * component re-dispatches them as `bsInput`/`bsChange` custom events instead. Mutable so the
48
+ * `number` type's stepper buttons can update it directly. */
21
49
  value = '';
22
50
  type = 'text';
23
51
  label;
@@ -25,8 +53,83 @@ export class BsInput {
25
53
  description;
26
54
  error;
27
55
  disabled = false;
56
+ /** Marks the field as required: renders a red `*` after the label and sets `aria-required="true"`
57
+ * on the control. Applies regardless of `type`. */
58
+ required = false;
59
+ /** Step size for `type="number"`'s increment/decrement stepper buttons. */
60
+ step = 1;
61
+ /** Minimum value for `type="number"`'s stepper buttons. */
62
+ min;
63
+ /** Maximum value for `type="number"`'s stepper buttons. */
64
+ max;
65
+ /** Options for `type="select"` (rendered as native `<option>`s) and `type="dropdown"` (rendered
66
+ * as a `bs-menu` of `bs-menu-item`s when `open`). Must be set as a JS property, not an HTML
67
+ * attribute -- see CONVENTIONS.md's non-string props rule. */
68
+ options = [];
69
+ /** Number of visible rows for `type="textarea"`. */
70
+ rows = 3;
71
+ /** Current chips for `type="chip"`. Must be set as a JS property, not an HTML attribute -- see
72
+ * CONVENTIONS.md's non-string props rule. */
73
+ chips = [];
74
+ /** Title select options for `type="initials"` (e.g. `['Mrs.', 'Mr.', 'Dr.']`). Must be set as a
75
+ * JS property, not an HTML attribute -- see CONVENTIONS.md's non-string props rule. */
76
+ titleOptions = [];
77
+ /** Current selected title for `type="initials"`. Named `initialsTitle` rather than `title` --
78
+ * `title` is a reserved standard HTML attribute (tooltip text) inherited by every element, and
79
+ * Stencil warns against shadowing it with a component `@Prop`. */
80
+ initialsTitle = '';
81
+ /** Country select options for `type="country"`. Must be set as a JS property, not an HTML
82
+ * attribute -- see CONVENTIONS.md's non-string props rule. */
83
+ countryOptions = [];
84
+ /** Current selected country code for `type="country"`. */
85
+ country = '';
86
+ /** Number of cells for `type="pin"`. */
87
+ length = 4;
88
+ /** Whether the `type="dropdown"` trigger is open. Reflects to an attribute so consumers can style
89
+ * an open state via CSS. When `options` is non-empty, this also controls whether the `bs-menu`
90
+ * of `bs-menu-item`s is rendered below the field. */
91
+ open = false;
28
92
  bsInput;
29
93
  bsChange;
94
+ /** Emitted when `type="dropdown"`'s trigger is toggled. See `open`'s doc comment for this type's
95
+ * shell-only limitation. */
96
+ bsOpen;
97
+ /** Emitted when a chip is committed (Enter pressed in the draft input) for `type="chip"`. */
98
+ bsChipAdd;
99
+ /** Emitted when a chip's remove button is clicked for `type="chip"`. */
100
+ bsChipRemove;
101
+ /** Emitted when the title `<select>` changes for `type="initials"`. */
102
+ bsTitleChange;
103
+ /** Emitted when the country `<select>` changes for `type="country"`. */
104
+ bsCountryChange;
105
+ /** Tracks whether the `icon` slot has assigned content, so the leading icon wrapper only takes
106
+ * up space in the field when there's actually an icon (same pattern as `bs-button`). */
107
+ hasIcon = false;
108
+ /** Tracks whether the `end-icon` slot has assigned content, so the trailing icon wrapper only
109
+ * takes up space in the field when there's actually a trailing icon. */
110
+ hasEndIcon = false;
111
+ /** Whether `type="password"`'s native input is currently rendered as `type="text"` (revealed). The
112
+ * `type` prop itself stays `'password'` -- this only toggles the rendered native input's type. */
113
+ passwordVisible = false;
114
+ /** Draft text for `type="chip"`'s trailing input, committed to a chip on Enter. */
115
+ chipDraft = '';
116
+ pinInputs = [];
117
+ /** Computes the initial `hasIcon`/`hasEndIcon` state directly from the host's light DOM
118
+ * children, before first render -- see `bs-button`'s `componentWillLoad` for why `slotchange`
119
+ * alone isn't enough for a slot that starts (and stays) empty. */
120
+ componentWillLoad() {
121
+ this.hasIcon = this.hasSlottedContent('icon');
122
+ this.hasEndIcon = this.hasSlottedContent('end-icon');
123
+ }
124
+ hasSlottedContent(slotName) {
125
+ return Array.from(this.el.childNodes).some(node => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === slotName);
126
+ }
127
+ onIconSlotchange = (ev) => {
128
+ this.hasIcon = ev.target.assignedNodes().length > 0;
129
+ };
130
+ onEndIconSlotchange = (ev) => {
131
+ this.hasEndIcon = ev.target.assignedNodes().length > 0;
132
+ };
30
133
  onInput = (ev) => {
31
134
  const value = ev.target.value;
32
135
  this.bsInput.emit(value);
@@ -35,11 +138,195 @@ export class BsInput {
35
138
  const value = ev.target.value;
36
139
  this.bsChange.emit(value);
37
140
  };
141
+ clampNumber(n) {
142
+ if (this.min !== undefined && n < this.min)
143
+ n = this.min;
144
+ if (this.max !== undefined && n > this.max)
145
+ n = this.max;
146
+ return n;
147
+ }
148
+ onStepperIncrement = () => {
149
+ if (this.disabled)
150
+ return;
151
+ const next = this.clampNumber((parseFloat(this.value) || 0) + this.step);
152
+ this.value = String(next);
153
+ this.bsChange.emit(this.value);
154
+ };
155
+ onStepperDecrement = () => {
156
+ if (this.disabled)
157
+ return;
158
+ const next = this.clampNumber((parseFloat(this.value) || 0) - this.step);
159
+ this.value = String(next);
160
+ this.bsChange.emit(this.value);
161
+ };
162
+ onTogglePasswordVisibility = () => {
163
+ this.passwordVisible = !this.passwordVisible;
164
+ };
165
+ onDropdownToggle = () => {
166
+ if (this.disabled)
167
+ return;
168
+ this.open = !this.open;
169
+ this.bsOpen.emit(this.open);
170
+ };
171
+ onDropdownKeydown = (ev) => {
172
+ if (ev.key === 'Enter' || ev.key === ' ') {
173
+ ev.preventDefault();
174
+ this.onDropdownToggle();
175
+ }
176
+ };
177
+ onDropdownOptionSelect = (option) => () => {
178
+ this.value = option.label;
179
+ this.open = false;
180
+ this.bsChange.emit(this.value);
181
+ };
182
+ /** Closes the `type="dropdown"` menu on Escape, from anywhere within the component (host is the
183
+ * default @Listen target, and both keydown from the native control and from `bs-menu-item`
184
+ * buttons bubble/compose up to it). */
185
+ onHostKeydown(ev) {
186
+ if (this.type === 'dropdown' && this.open && ev.key === 'Escape') {
187
+ this.open = false;
188
+ }
189
+ }
190
+ /** Closes the `type="dropdown"` menu once focus leaves the component entirely (e.g. Tab away, or
191
+ * a click outside that moves focus elsewhere) -- `focusout` is composed, so it bubbles across
192
+ * the `bs-menu-item` shadow boundary too. */
193
+ onHostFocusOut(ev) {
194
+ if (this.type !== 'dropdown' || !this.open)
195
+ return;
196
+ const related = ev.relatedTarget;
197
+ if (!related || !this.el.contains(related)) {
198
+ this.open = false;
199
+ }
200
+ }
201
+ onChipDraftInput = (ev) => {
202
+ this.chipDraft = ev.target.value;
203
+ };
204
+ onChipDraftKeydown = (ev) => {
205
+ if (ev.key === 'Enter') {
206
+ ev.preventDefault();
207
+ const value = this.chipDraft.trim();
208
+ if (value) {
209
+ this.bsChipAdd.emit(value);
210
+ this.chipDraft = '';
211
+ }
212
+ }
213
+ };
214
+ onChipRemove = (chip) => () => {
215
+ this.bsChipRemove.emit(chip);
216
+ };
217
+ onTitleChange = (ev) => {
218
+ this.bsTitleChange.emit(ev.target.value);
219
+ };
220
+ onCountryChange = (ev) => {
221
+ this.bsCountryChange.emit(ev.target.value);
222
+ };
223
+ onPinInput = (index) => (ev) => {
224
+ const input = ev.target;
225
+ let value = input.value;
226
+ if (value.length > 1) {
227
+ value = value.slice(-1);
228
+ input.value = value;
229
+ }
230
+ if (value && index < this.length - 1) {
231
+ this.pinInputs[index + 1]?.focus();
232
+ }
233
+ this.bsChange.emit(this.pinInputs.map(i => i?.value ?? '').join(''));
234
+ };
235
+ onPinKeydown = (index) => (ev) => {
236
+ if (ev.key === 'Backspace' && !ev.target.value && index > 0) {
237
+ this.pinInputs[index - 1]?.focus();
238
+ }
239
+ };
240
+ get showsEndIconArea() {
241
+ return (this.type === 'number' || this.type === 'password' || this.type === 'dropdown' || this.type === 'date' || this.hasEndIcon);
242
+ }
243
+ get showsIconArea() {
244
+ return (this.type === 'search' && !this.hasIcon) || this.hasIcon;
245
+ }
246
+ renderIconContent() {
247
+ if (this.type === 'search' && !this.hasIcon) {
248
+ return (h("svg", { class: "bs-input__search-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "7", cy: "7", r: "5", stroke: "currentColor", "stroke-width": "1.3" }), h("path", { d: "M11 11L14.5 14.5", stroke: "currentColor", "stroke-width": "1.3", "stroke-linecap": "round" })));
249
+ }
250
+ return h("slot", { name: "icon", onSlotchange: this.onIconSlotchange });
251
+ }
252
+ renderEndIconContent() {
253
+ if (this.type === 'number') {
254
+ return (h("span", { class: "bs-input__stepper" }, h("button", { type: "button", part: "control", class: "bs-input__stepper-btn", "aria-label": "Increment", tabIndex: -1, disabled: this.disabled, onClick: this.onStepperIncrement }, h("svg", { viewBox: "0 0 10 6", width: "10", height: "6", "aria-hidden": "true" }, h("path", { d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.3", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { type: "button", part: "control", class: "bs-input__stepper-btn", "aria-label": "Decrement", tabIndex: -1, disabled: this.disabled, onClick: this.onStepperDecrement }, h("svg", { viewBox: "0 0 10 6", width: "10", height: "6", "aria-hidden": "true" }, h("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.3", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" })))));
255
+ }
256
+ if (this.type === 'password') {
257
+ return (h("button", { type: "button", part: "control", class: "bs-input__password-toggle", "aria-label": this.passwordVisible ? 'Hide password' : 'Show password', disabled: this.disabled, onClick: this.onTogglePasswordVisibility }, this.passwordVisible ? (h("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("path", { d: "M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z", stroke: "currentColor", "stroke-width": "1.2", "stroke-linejoin": "round" }), h("circle", { cx: "8", cy: "8", r: "2", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M2 2L14 14", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }))) : (h("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("path", { d: "M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z", stroke: "currentColor", "stroke-width": "1.2", "stroke-linejoin": "round" }), h("circle", { cx: "8", cy: "8", r: "2", stroke: "currentColor", "stroke-width": "1.2" })))));
258
+ }
259
+ if (this.type === 'dropdown') {
260
+ return (h("svg", { class: "bs-input__chevron", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", "stroke-width": "1.3", "stroke-linecap": "round", "stroke-linejoin": "round" })));
261
+ }
262
+ if (this.type === 'date' && !this.hasEndIcon) {
263
+ return (h("svg", { class: "bs-input__calendar", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("rect", { x: "2", y: "3", width: "12", height: "11", rx: "1", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M2 6.5H14", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M5 1.5V4M11 1.5V4", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" })));
264
+ }
265
+ return h("slot", { name: "end-icon", onSlotchange: this.onEndIconSlotchange });
266
+ }
267
+ renderStandardControl() {
268
+ const nativeType = this.type === 'password' ? (this.passwordVisible ? 'text' : 'password') : this.type === 'dropdown' ? 'text' : this.type;
269
+ return (h("input", { id: "control", part: "control", class: "bs-input__control", type: nativeType, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.type === 'dropdown', min: this.type === 'number' ? this.min : undefined, max: this.type === 'number' ? this.max : undefined, step: this.type === 'number' ? this.step : undefined, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }));
270
+ }
271
+ renderSelectControl() {
272
+ return (h("select", { id: "control", part: "control", class: "bs-input__control", disabled: this.disabled, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }, this.options.map(opt => (h("option", { value: opt.value, selected: opt.value === this.value }, opt.label)))));
273
+ }
274
+ renderTextareaControl() {
275
+ return (h("textarea", { id: "control", part: "control", class: "bs-input__control bs-input__control--textarea", rows: this.rows, value: this.value, placeholder: this.placeholder, disabled: this.disabled, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }));
276
+ }
277
+ renderChipControl() {
278
+ return (h("div", { class: "bs-input__chips" }, this.chips.map(chip => (h("span", { part: "chip", class: "bs-input__chip" }, chip, h("button", { type: "button", class: "bs-input__chip-remove", "aria-label": `Remove ${chip}`, onClick: this.onChipRemove(chip) }, "\u00D7")))), h("input", { id: "control", part: "control", class: "bs-input__control bs-input__chip-input", type: "text", value: this.chipDraft, placeholder: this.placeholder, disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onChipDraftInput, onKeyDown: this.onChipDraftKeydown })));
279
+ }
280
+ renderInitialsControl() {
281
+ return [
282
+ h("select", { part: "control", class: "bs-input__control bs-input__title-select", disabled: this.disabled, onChange: this.onTitleChange }, this.titleOptions.map(opt => (h("option", { value: opt, selected: opt === this.initialsTitle }, opt)))),
283
+ h("input", { id: "control", part: "control", class: "bs-input__control", type: "text", value: this.value, placeholder: this.placeholder, disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }),
284
+ ];
285
+ }
286
+ renderCountryControl() {
287
+ return [
288
+ h("select", { part: "control", class: "bs-input__control bs-input__country-select", disabled: this.disabled, onChange: this.onCountryChange }, this.countryOptions.map(opt => (h("option", { value: opt.code, selected: opt.code === this.country }, opt.flagIcon ? `${opt.flagIcon} ` : '', opt.code, " ", opt.label)))),
289
+ h("input", { id: "control", part: "control", class: "bs-input__control", type: "text", value: this.value, placeholder: this.placeholder, disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }),
290
+ ];
291
+ }
292
+ renderControl() {
293
+ switch (this.type) {
294
+ case 'select':
295
+ return this.renderSelectControl();
296
+ case 'textarea':
297
+ return this.renderTextareaControl();
298
+ case 'chip':
299
+ return this.renderChipControl();
300
+ case 'initials':
301
+ return this.renderInitialsControl();
302
+ case 'country':
303
+ return this.renderCountryControl();
304
+ default:
305
+ return this.renderStandardControl();
306
+ }
307
+ }
308
+ renderField() {
309
+ const fieldClasses = [
310
+ 'bs-input__field',
311
+ this.error ? 'bs-input__field--error' : '',
312
+ this.disabled ? 'bs-input__field--disabled' : '',
313
+ this.type === 'textarea' ? 'bs-input__field--textarea' : '',
314
+ this.type === 'chip' ? 'bs-input__field--chip' : '',
315
+ ]
316
+ .filter(Boolean)
317
+ .join(' ');
318
+ const isDropdown = this.type === 'dropdown';
319
+ return (h("div", { class: "bs-input__field-wrapper" }, h("div", { part: "field", class: fieldClasses, onClick: isDropdown ? this.onDropdownToggle : undefined, onKeyDown: isDropdown ? this.onDropdownKeydown : undefined, "aria-haspopup": isDropdown ? 'listbox' : undefined, "aria-expanded": isDropdown ? String(this.open) : undefined }, h("span", { part: "icon", class: `bs-input__icon ${this.showsIconArea ? 'bs-input__icon--visible' : ''}` }, this.renderIconContent()), this.renderControl(), h("span", { part: "end-icon", class: `bs-input__end-icon ${this.showsEndIconArea ? 'bs-input__end-icon--visible' : ''}` }, this.renderEndIconContent())), isDropdown && this.open && this.options.length > 0 && (h("bs-menu", { part: "menu", class: "bs-input__dropdown-menu", role: "listbox" }, this.options.map(option => (h("bs-menu-item", { key: option.value, onBsSelect: this.onDropdownOptionSelect(option) }, option.label)))))));
320
+ }
321
+ renderPinField() {
322
+ this.pinInputs = [];
323
+ return (h("div", { part: "field", class: `bs-input__field bs-input__field--pin ${this.disabled ? 'bs-input__field--disabled' : ''}` }, Array.from({ length: this.length }).map((_, i) => (h("input", { id: i === 0 ? 'control' : undefined, ref: el => (this.pinInputs[i] = el), part: "control", class: "bs-input__pin-cell", type: "text", inputMode: "numeric", maxLength: 1, value: this.value[i] ?? '', disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onPinInput(i), onKeyDown: this.onPinKeydown(i) })))));
324
+ }
38
325
  render() {
39
- return (h("div", { key: '2c6b38b4594ccde2536515fcd252831bacb6aaeb', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
326
+ return (h("div", { key: 'a929eee8f7b100f372763a259f5d5fed298c8dff', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
40
327
  // "control" is a fixed id, not a generated one -- safe because Shadow DOM scopes ids
41
328
  // to this instance's own shadow root, so it can never collide with another bs-input.
42
- h("label", { key: '9df0fae013470d8a77b0cc6288c8178b1ac62e0d', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label)), h("input", { key: 'a6ddc857d33c4e51a4c64b422a7df5b6261f5180', id: "control", part: "control", class: "bs-input__control", type: this.type, value: this.value, placeholder: this.placeholder, disabled: this.disabled, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }), this.error ? (h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, this.error)) : this.description ? (h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
329
+ h("label", { key: 'fba27eccc9a351caa58fd849aad54e9388de361c', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (h("span", { key: 'd4852798433e75b6c4cac34a9fbc5f9c23c8925d', part: "required", class: "bs-input__required", "aria-hidden": "true" }, "*")))), this.type === 'pin' ? this.renderPinField() : this.renderField(), this.error ? (h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, h("svg", { part: "error-icon", class: "bs-input__error-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M8 5V8.5", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }), h("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })), this.error)) : this.description ? (h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
43
330
  }
44
331
  static get is() { return "bs-input"; }
45
332
  static get encapsulation() { return "shadow"; }
@@ -58,7 +345,7 @@ export class BsInput {
58
345
  return {
59
346
  "value": {
60
347
  "type": "string",
61
- "mutable": false,
348
+ "mutable": true,
62
349
  "complexType": {
63
350
  "original": "string",
64
351
  "resolved": "string",
@@ -68,7 +355,7 @@ export class BsInput {
68
355
  "optional": false,
69
356
  "docs": {
70
357
  "tags": [],
71
- "text": "Current value. Native `input`/`change` events don't cross the Shadow DOM boundary, so this\ncomponent re-dispatches them as `bsInput`/`bsChange` custom events instead."
358
+ "text": "Current value. Native `input`/`change` events don't cross the Shadow DOM boundary, so this\ncomponent re-dispatches them as `bsInput`/`bsChange` custom events instead. Mutable so the\n`number` type's stepper buttons can update it directly."
72
359
  },
73
360
  "getter": false,
74
361
  "setter": false,
@@ -80,8 +367,8 @@ export class BsInput {
80
367
  "type": "string",
81
368
  "mutable": false,
82
369
  "complexType": {
83
- "original": "'text' | 'email' | 'password' | 'number'",
84
- "resolved": "\"email\" | \"number\" | \"password\" | \"text\"",
370
+ "original": "| 'text'\n | 'email'\n | 'password'\n | 'number'\n | 'search'\n | 'date'\n | 'dropdown'\n | 'select'\n | 'textarea'\n | 'chip'\n | 'initials'\n | 'country'\n | 'pin'",
371
+ "resolved": "\"chip\" | \"country\" | \"date\" | \"dropdown\" | \"email\" | \"initials\" | \"number\" | \"password\" | \"pin\" | \"search\" | \"select\" | \"text\" | \"textarea\"",
85
372
  "references": {}
86
373
  },
87
374
  "required": false,
@@ -191,9 +478,267 @@ export class BsInput {
191
478
  "reflect": false,
192
479
  "attribute": "disabled",
193
480
  "defaultValue": "false"
481
+ },
482
+ "required": {
483
+ "type": "boolean",
484
+ "mutable": false,
485
+ "complexType": {
486
+ "original": "boolean",
487
+ "resolved": "boolean",
488
+ "references": {}
489
+ },
490
+ "required": false,
491
+ "optional": false,
492
+ "docs": {
493
+ "tags": [],
494
+ "text": "Marks the field as required: renders a red `*` after the label and sets `aria-required=\"true\"`\non the control. Applies regardless of `type`."
495
+ },
496
+ "getter": false,
497
+ "setter": false,
498
+ "reflect": false,
499
+ "attribute": "required",
500
+ "defaultValue": "false"
501
+ },
502
+ "step": {
503
+ "type": "number",
504
+ "mutable": false,
505
+ "complexType": {
506
+ "original": "number",
507
+ "resolved": "number",
508
+ "references": {}
509
+ },
510
+ "required": false,
511
+ "optional": false,
512
+ "docs": {
513
+ "tags": [],
514
+ "text": "Step size for `type=\"number\"`'s increment/decrement stepper buttons."
515
+ },
516
+ "getter": false,
517
+ "setter": false,
518
+ "reflect": false,
519
+ "attribute": "step",
520
+ "defaultValue": "1"
521
+ },
522
+ "min": {
523
+ "type": "number",
524
+ "mutable": false,
525
+ "complexType": {
526
+ "original": "number",
527
+ "resolved": "number",
528
+ "references": {}
529
+ },
530
+ "required": false,
531
+ "optional": true,
532
+ "docs": {
533
+ "tags": [],
534
+ "text": "Minimum value for `type=\"number\"`'s stepper buttons."
535
+ },
536
+ "getter": false,
537
+ "setter": false,
538
+ "reflect": false,
539
+ "attribute": "min"
540
+ },
541
+ "max": {
542
+ "type": "number",
543
+ "mutable": false,
544
+ "complexType": {
545
+ "original": "number",
546
+ "resolved": "number",
547
+ "references": {}
548
+ },
549
+ "required": false,
550
+ "optional": true,
551
+ "docs": {
552
+ "tags": [],
553
+ "text": "Maximum value for `type=\"number\"`'s stepper buttons."
554
+ },
555
+ "getter": false,
556
+ "setter": false,
557
+ "reflect": false,
558
+ "attribute": "max"
559
+ },
560
+ "options": {
561
+ "type": "unknown",
562
+ "mutable": false,
563
+ "complexType": {
564
+ "original": "{ label: string; value: string }[]",
565
+ "resolved": "{ label: string; value: string; }[]",
566
+ "references": {}
567
+ },
568
+ "required": false,
569
+ "optional": false,
570
+ "docs": {
571
+ "tags": [],
572
+ "text": "Options for `type=\"select\"` (rendered as native `<option>`s) and `type=\"dropdown\"` (rendered\nas a `bs-menu` of `bs-menu-item`s when `open`). Must be set as a JS property, not an HTML\nattribute -- see CONVENTIONS.md's non-string props rule."
573
+ },
574
+ "getter": false,
575
+ "setter": false,
576
+ "defaultValue": "[]"
577
+ },
578
+ "rows": {
579
+ "type": "number",
580
+ "mutable": false,
581
+ "complexType": {
582
+ "original": "number",
583
+ "resolved": "number",
584
+ "references": {}
585
+ },
586
+ "required": false,
587
+ "optional": false,
588
+ "docs": {
589
+ "tags": [],
590
+ "text": "Number of visible rows for `type=\"textarea\"`."
591
+ },
592
+ "getter": false,
593
+ "setter": false,
594
+ "reflect": false,
595
+ "attribute": "rows",
596
+ "defaultValue": "3"
597
+ },
598
+ "chips": {
599
+ "type": "unknown",
600
+ "mutable": false,
601
+ "complexType": {
602
+ "original": "string[]",
603
+ "resolved": "string[]",
604
+ "references": {}
605
+ },
606
+ "required": false,
607
+ "optional": false,
608
+ "docs": {
609
+ "tags": [],
610
+ "text": "Current chips for `type=\"chip\"`. Must be set as a JS property, not an HTML attribute -- see\nCONVENTIONS.md's non-string props rule."
611
+ },
612
+ "getter": false,
613
+ "setter": false,
614
+ "defaultValue": "[]"
615
+ },
616
+ "titleOptions": {
617
+ "type": "unknown",
618
+ "mutable": false,
619
+ "complexType": {
620
+ "original": "string[]",
621
+ "resolved": "string[]",
622
+ "references": {}
623
+ },
624
+ "required": false,
625
+ "optional": false,
626
+ "docs": {
627
+ "tags": [],
628
+ "text": "Title select options for `type=\"initials\"` (e.g. `['Mrs.', 'Mr.', 'Dr.']`). Must be set as a\nJS property, not an HTML attribute -- see CONVENTIONS.md's non-string props rule."
629
+ },
630
+ "getter": false,
631
+ "setter": false,
632
+ "defaultValue": "[]"
633
+ },
634
+ "initialsTitle": {
635
+ "type": "string",
636
+ "mutable": false,
637
+ "complexType": {
638
+ "original": "string",
639
+ "resolved": "string",
640
+ "references": {}
641
+ },
642
+ "required": false,
643
+ "optional": false,
644
+ "docs": {
645
+ "tags": [],
646
+ "text": "Current selected title for `type=\"initials\"`. Named `initialsTitle` rather than `title` --\n`title` is a reserved standard HTML attribute (tooltip text) inherited by every element, and\nStencil warns against shadowing it with a component `@Prop`."
647
+ },
648
+ "getter": false,
649
+ "setter": false,
650
+ "reflect": false,
651
+ "attribute": "initials-title",
652
+ "defaultValue": "''"
653
+ },
654
+ "countryOptions": {
655
+ "type": "unknown",
656
+ "mutable": false,
657
+ "complexType": {
658
+ "original": "{ code: string; label: string; flagIcon?: string }[]",
659
+ "resolved": "{ code: string; label: string; flagIcon?: string; }[]",
660
+ "references": {}
661
+ },
662
+ "required": false,
663
+ "optional": false,
664
+ "docs": {
665
+ "tags": [],
666
+ "text": "Country select options for `type=\"country\"`. Must be set as a JS property, not an HTML\nattribute -- see CONVENTIONS.md's non-string props rule."
667
+ },
668
+ "getter": false,
669
+ "setter": false,
670
+ "defaultValue": "[]"
671
+ },
672
+ "country": {
673
+ "type": "string",
674
+ "mutable": false,
675
+ "complexType": {
676
+ "original": "string",
677
+ "resolved": "string",
678
+ "references": {}
679
+ },
680
+ "required": false,
681
+ "optional": false,
682
+ "docs": {
683
+ "tags": [],
684
+ "text": "Current selected country code for `type=\"country\"`."
685
+ },
686
+ "getter": false,
687
+ "setter": false,
688
+ "reflect": false,
689
+ "attribute": "country",
690
+ "defaultValue": "''"
691
+ },
692
+ "length": {
693
+ "type": "number",
694
+ "mutable": false,
695
+ "complexType": {
696
+ "original": "number",
697
+ "resolved": "number",
698
+ "references": {}
699
+ },
700
+ "required": false,
701
+ "optional": false,
702
+ "docs": {
703
+ "tags": [],
704
+ "text": "Number of cells for `type=\"pin\"`."
705
+ },
706
+ "getter": false,
707
+ "setter": false,
708
+ "reflect": false,
709
+ "attribute": "length",
710
+ "defaultValue": "4"
711
+ },
712
+ "open": {
713
+ "type": "boolean",
714
+ "mutable": true,
715
+ "complexType": {
716
+ "original": "boolean",
717
+ "resolved": "boolean",
718
+ "references": {}
719
+ },
720
+ "required": false,
721
+ "optional": false,
722
+ "docs": {
723
+ "tags": [],
724
+ "text": "Whether the `type=\"dropdown\"` trigger is open. Reflects to an attribute so consumers can style\nan open state via CSS. When `options` is non-empty, this also controls whether the `bs-menu`\nof `bs-menu-item`s is rendered below the field."
725
+ },
726
+ "getter": false,
727
+ "setter": false,
728
+ "reflect": true,
729
+ "attribute": "open",
730
+ "defaultValue": "false"
194
731
  }
195
732
  };
196
733
  }
734
+ static get states() {
735
+ return {
736
+ "hasIcon": {},
737
+ "hasEndIcon": {},
738
+ "passwordVisible": {},
739
+ "chipDraft": {}
740
+ };
741
+ }
197
742
  static get events() {
198
743
  return [{
199
744
  "method": "bsInput",
@@ -225,6 +770,97 @@ export class BsInput {
225
770
  "resolved": "string",
226
771
  "references": {}
227
772
  }
773
+ }, {
774
+ "method": "bsOpen",
775
+ "name": "bsOpen",
776
+ "bubbles": true,
777
+ "cancelable": true,
778
+ "composed": true,
779
+ "docs": {
780
+ "tags": [],
781
+ "text": "Emitted when `type=\"dropdown\"`'s trigger is toggled. See `open`'s doc comment for this type's\nshell-only limitation."
782
+ },
783
+ "complexType": {
784
+ "original": "boolean",
785
+ "resolved": "boolean",
786
+ "references": {}
787
+ }
788
+ }, {
789
+ "method": "bsChipAdd",
790
+ "name": "bsChipAdd",
791
+ "bubbles": true,
792
+ "cancelable": true,
793
+ "composed": true,
794
+ "docs": {
795
+ "tags": [],
796
+ "text": "Emitted when a chip is committed (Enter pressed in the draft input) for `type=\"chip\"`."
797
+ },
798
+ "complexType": {
799
+ "original": "string",
800
+ "resolved": "string",
801
+ "references": {}
802
+ }
803
+ }, {
804
+ "method": "bsChipRemove",
805
+ "name": "bsChipRemove",
806
+ "bubbles": true,
807
+ "cancelable": true,
808
+ "composed": true,
809
+ "docs": {
810
+ "tags": [],
811
+ "text": "Emitted when a chip's remove button is clicked for `type=\"chip\"`."
812
+ },
813
+ "complexType": {
814
+ "original": "string",
815
+ "resolved": "string",
816
+ "references": {}
817
+ }
818
+ }, {
819
+ "method": "bsTitleChange",
820
+ "name": "bsTitleChange",
821
+ "bubbles": true,
822
+ "cancelable": true,
823
+ "composed": true,
824
+ "docs": {
825
+ "tags": [],
826
+ "text": "Emitted when the title `<select>` changes for `type=\"initials\"`."
827
+ },
828
+ "complexType": {
829
+ "original": "string",
830
+ "resolved": "string",
831
+ "references": {}
832
+ }
833
+ }, {
834
+ "method": "bsCountryChange",
835
+ "name": "bsCountryChange",
836
+ "bubbles": true,
837
+ "cancelable": true,
838
+ "composed": true,
839
+ "docs": {
840
+ "tags": [],
841
+ "text": "Emitted when the country `<select>` changes for `type=\"country\"`."
842
+ },
843
+ "complexType": {
844
+ "original": "string",
845
+ "resolved": "string",
846
+ "references": {}
847
+ }
848
+ }];
849
+ }
850
+ static get elementRef() { return "el"; }
851
+ static get listeners() {
852
+ return [{
853
+ "name": "keydown",
854
+ "method": "onHostKeydown",
855
+ "target": undefined,
856
+ "capture": false,
857
+ "passive": false
858
+ }, {
859
+ "name": "focusout",
860
+ "method": "onHostFocusOut",
861
+ "target": undefined,
862
+ "capture": false,
863
+ "passive": false
228
864
  }];
229
865
  }
230
866
  }