@oscarpalmer/oui 0.37.0 → 0.38.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 (96) hide show
  1. package/dist/css/a11y.css +1 -0
  2. package/dist/css/badge.css +1 -0
  3. package/dist/css/button.css +5 -0
  4. package/dist/css/color-picker.css +377 -0
  5. package/dist/css/color.css +0 -1
  6. package/dist/css/combobox.css +7 -0
  7. package/dist/css/content.css +1 -0
  8. package/dist/css/floatable.css +2 -0
  9. package/dist/css/form.css +7 -0
  10. package/dist/css/listbox.css +2 -0
  11. package/dist/css/message.css +2 -0
  12. package/dist/css/mixins/badge.mixins.css +2 -0
  13. package/dist/css/mixins/button.mixins.css +2 -0
  14. package/dist/css/mixins/message.mixins.css +1 -0
  15. package/dist/css/mixins/misc.mixins.css +2 -0
  16. package/dist/css/mixins/shadow.mixins.css +1 -0
  17. package/dist/css/reset.css +2 -2
  18. package/dist/css/splitter.css +1 -1
  19. package/dist/css/tabs.css +21 -21
  20. package/dist/js/color-picker.d.mts +213 -0
  21. package/dist/js/color-picker.mjs +924 -0
  22. package/dist/js/combobox/dom.combobox.mjs +8 -4
  23. package/dist/js/combobox/event.combobox.mjs +1 -1
  24. package/dist/js/combobox/index.d.mts +1 -1
  25. package/dist/js/combobox/index.mjs +56 -2
  26. package/dist/js/combobox/misc.combobox.d.mts +1 -1
  27. package/dist/js/combobox/misc.combobox.mjs +1 -1
  28. package/dist/js/combobox/state.combobox.d.mts +1 -1
  29. package/dist/js/combobox/state.combobox.mjs +1 -1
  30. package/dist/js/dialog.mjs +2 -2
  31. package/dist/js/floatable/floatable.embedded.mjs +13 -10
  32. package/dist/js/focus-trap/focus-trap.embedded.mjs +3 -3
  33. package/dist/js/{index-EfkUSals.d.mts → index-DJdFlTLm.d.mts} +39 -1
  34. package/dist/js/index.d.mts +3 -2
  35. package/dist/js/index.mjs +4 -3
  36. package/dist/js/internal/draggable.mjs +4 -4
  37. package/dist/js/internal/listbox/listbox.data.mjs +1 -1
  38. package/dist/js/internal/listbox/listbox.dom.mjs +1 -1
  39. package/dist/js/internal/listbox/listbox.event.mjs +1 -1
  40. package/dist/js/internal/listbox/listbox.form.mjs +16 -15
  41. package/dist/js/internal/listbox/listbox.misc.mjs +1 -1
  42. package/dist/js/internal/listbox/listbox.state.mjs +3 -3
  43. package/dist/js/internal/navigable.mjs +4 -3
  44. package/dist/js/listbox/event.listbox.mjs +1 -1
  45. package/dist/js/listbox/index.d.mts +38 -0
  46. package/dist/js/listbox/index.mjs +56 -2
  47. package/dist/js/listbox/misc.listbox.mjs +1 -1
  48. package/dist/js/listbox/state.listbox.mjs +1 -1
  49. package/dist/js/{listbox.data-BWd0PCy7.mjs → listbox.data-C7CRa5Ya.mjs} +5 -4
  50. package/dist/js/menu.mjs +1 -1
  51. package/dist/js/{misc.listbox-BI-XsTOf.mjs → misc.listbox-Cyz2CRDy.mjs} +2 -3
  52. package/dist/js/movable/movable.embedded.mjs +2 -2
  53. package/dist/js/popover.mjs +2 -2
  54. package/dist/js/resizable/resizable.embedded.mjs +5 -5
  55. package/dist/js/sortable/sortable.embedded.mjs +4 -4
  56. package/dist/js/splitter.mjs +6 -6
  57. package/dist/js/{state.combobox-4xq0FPCF.mjs → state.combobox-Qm3FWzYW.mjs} +3 -3
  58. package/dist/js/tabs.mjs +4 -7
  59. package/dist/js/tooltip.mjs +3 -3
  60. package/package.json +7 -5
  61. package/src/css/a11y.scss +2 -2
  62. package/src/css/badge.scss +8 -8
  63. package/src/css/button.scss +8 -8
  64. package/src/css/color-picker.scss +344 -0
  65. package/src/css/color.scss +0 -2
  66. package/src/css/combobox.scss +12 -9
  67. package/src/css/content.scss +11 -10
  68. package/src/css/floatable.scss +6 -3
  69. package/src/css/form.scss +12 -10
  70. package/src/css/listbox.scss +4 -3
  71. package/src/css/message.scss +9 -8
  72. package/src/css/mixins/badge.mixins.scss +53 -0
  73. package/src/css/mixins/button.mixins.scss +112 -0
  74. package/src/css/mixins/input.mixins.scss +114 -0
  75. package/src/css/mixins/message.mixins.scss +41 -0
  76. package/src/css/mixins/misc.mixins.scss +48 -0
  77. package/src/css/mixins/shadow.mixins.scss +57 -0
  78. package/src/css/reset.scss +2 -2
  79. package/src/css/splitter.scss +1 -1
  80. package/src/css/tabs.scss +20 -31
  81. package/src/js/color-picker.ts +1653 -0
  82. package/src/js/combobox/dom.combobox.ts +4 -0
  83. package/src/js/combobox/index.ts +63 -1
  84. package/src/js/dialog.ts +1 -1
  85. package/src/js/floatable/floatable.embedded.ts +18 -14
  86. package/src/js/index.ts +1 -0
  87. package/src/js/internal/listbox/listbox.dom.ts +2 -1
  88. package/src/js/internal/listbox/listbox.form.ts +31 -21
  89. package/src/js/internal/listbox/listbox.state.ts +2 -2
  90. package/src/js/internal/navigable.ts +2 -0
  91. package/src/js/listbox/index.ts +62 -0
  92. package/src/js/listbox/state.listbox.ts +0 -2
  93. package/src/js/popover.ts +1 -1
  94. package/src/js/tabs.ts +4 -10
  95. package/src/css/mixins.scss +0 -419
  96. /package/dist/css/{mixins.css → mixins/input.mixins.css} +0 -0
@@ -1,7 +1,7 @@
1
- import { C as setListboxDisabled, D as setListboxReadonly, O as setListboxRequired, T as setListboxLimit, a as setListboxValue, o as setListboxValues, w as setListboxFilter } from "../listbox.data-BWd0PCy7.mjs";
1
+ import { C as setListboxDisabled, D as setListboxReadonly, O as setListboxRequired, T as setListboxLimit, a as setListboxValue, o as setListboxValues, w as setListboxFilter } from "../listbox.data-C7CRa5Ya.mjs";
2
2
  import { attachListbox, detachListbox } from "../internal/listbox/listbox.state.mjs";
3
3
  import { LISTBOX_TAGNAME } from "./constants.listbox.mjs";
4
- import { c as onDetachListbox, i as createListboxState, n as setListboxLocalizations, o as listboxStates, r as updateListboxLocalizations, s as onAttachListbox } from "../misc.listbox-BI-XsTOf.mjs";
4
+ import { c as onDetachListbox, i as createListboxState, n as setListboxLocalizations, o as listboxStates, r as updateListboxLocalizations, s as onAttachListbox } from "../misc.listbox-Cyz2CRDy.mjs";
5
5
  import { getAttribute } from "@oscarpalmer/toretto/attribute";
6
6
  import { parse } from "@oscarpalmer/atoms/string";
7
7
  //#region src/js/listbox/index.ts
@@ -41,6 +41,18 @@ var OuiListboxElement = class extends HTMLElement {
41
41
  setListboxFilter(this.#state, value);
42
42
  }
43
43
  /**
44
+ * Form element associated with the listbox
45
+ */
46
+ get form() {
47
+ return this.#internals.form;
48
+ }
49
+ /**
50
+ * Label elements associated with the listbox
51
+ */
52
+ get labels() {
53
+ return this.#internals.labels;
54
+ }
55
+ /**
44
56
  * Maximum number of selected options
45
57
  */
46
58
  get max() {
@@ -107,6 +119,18 @@ var OuiListboxElement = class extends HTMLElement {
107
119
  return this.#state.options.selected.slice();
108
120
  }
109
121
  /**
122
+ * Validation message for the listbox
123
+ */
124
+ get validationMessage() {
125
+ return this.#internals.validationMessage;
126
+ }
127
+ /**
128
+ * Validity state for the listbox
129
+ */
130
+ get validity() {
131
+ return this.#internals.validity;
132
+ }
133
+ /**
110
134
  * Current value
111
135
  */
112
136
  get value() {
@@ -130,6 +154,12 @@ var OuiListboxElement = class extends HTMLElement {
130
154
  set values(values) {
131
155
  setListboxValues(this.#state, values);
132
156
  }
157
+ /**
158
+ * Can the listbox be validated?
159
+ */
160
+ get willValidate() {
161
+ return this.#internals.willValidate;
162
+ }
133
163
  constructor() {
134
164
  super();
135
165
  this.#internals = this.attachInternals();
@@ -148,6 +178,14 @@ var OuiListboxElement = class extends HTMLElement {
148
178
  }
149
179
  }
150
180
  /**
181
+ * Check if the listbox is valid
182
+ *
183
+ * @returns `true` if the listbox is valid, otherwise `false`
184
+ */
185
+ checkValidity() {
186
+ return this.#internals.checkValidity();
187
+ }
188
+ /**
151
189
  * Clear all selected options
152
190
  */
153
191
  clear() {
@@ -173,6 +211,22 @@ var OuiListboxElement = class extends HTMLElement {
173
211
  if (this.#state == null) this.#restored = parsed;
174
212
  else setListboxValues(this.#state, parsed);
175
213
  }
214
+ /**
215
+ * Check if the listbox is valid and report any validation errors
216
+ *
217
+ * @returns `true` if the listbox is valid, otherwise `false`
218
+ */
219
+ reportValidity() {
220
+ return this.#internals.reportValidity();
221
+ }
222
+ /**
223
+ * Set a custom validation message for the listbox
224
+ *
225
+ * @param message Validation message
226
+ */
227
+ setCustomValidity(message) {
228
+ this.#internals.setValidity({ customError: message !== "" }, message, this);
229
+ }
176
230
  setLocalizations(first, second) {
177
231
  updateListboxLocalizations(this.#state.localizations.global, this.#state.localizations.component, first, second);
178
232
  }
@@ -1,2 +1,2 @@
1
- import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-BI-XsTOf.mjs";
1
+ import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-Cyz2CRDy.mjs";
2
2
  export { getListboxId, setListboxLocalizations, updateListboxLocalizations };
@@ -1,2 +1,2 @@
1
- import { a as listboxLocalizations, c as onDetachListbox, i as createListboxState, o as listboxStates, s as onAttachListbox } from "../misc.listbox-BI-XsTOf.mjs";
1
+ import { a as listboxLocalizations, c as onDetachListbox, i as createListboxState, o as listboxStates, s as onAttachListbox } from "../misc.listbox-Cyz2CRDy.mjs";
2
2
  export { createListboxState, listboxLocalizations, listboxStates, onAttachListbox, onDetachListbox };
@@ -2,8 +2,8 @@ import { getLocalization, localize } from "./l10n.mjs";
2
2
  import { listboxScrollOptions } from "./internal/listbox/listbox.constants.mjs";
3
3
  import { updateListboxForm, updateListboxValidity } from "./internal/listbox/listbox.form.mjs";
4
4
  import { setAria } from "@oscarpalmer/toretto/aria";
5
- import { dispatch } from "@oscarpalmer/toretto/event";
6
5
  import { setAttribute } from "@oscarpalmer/toretto/attribute";
6
+ import { dispatch } from "@oscarpalmer/toretto/event";
7
7
  import { getString } from "@oscarpalmer/atoms/string";
8
8
  import { getData } from "@oscarpalmer/toretto/data";
9
9
  import { createElement, setAria as setAria$1, setAttribute as setAttribute$1 } from "@oscarpalmer/toretto";
@@ -134,13 +134,14 @@ function createListboxInput(parameters, value) {
134
134
  autocorrect: "off",
135
135
  autocomplete: "off",
136
136
  form: "",
137
- spellcheck: "false",
138
- type: "text"
137
+ inputmode: "text",
138
+ spellcheck: "false"
139
139
  },
140
140
  property: {
141
141
  id,
142
142
  value,
143
- role: isAutocomplete || listbox ? "combobox" : "searchbox"
143
+ role: isAutocomplete || listbox ? "combobox" : "searchbox",
144
+ type: "text"
144
145
  }
145
146
  });
146
147
  if (isAutocomplete || listbox) setAria$1(input, "expanded", listbox);
package/dist/js/menu.mjs CHANGED
@@ -2,8 +2,8 @@ import { createEmbeddedFloatable, getOnBeforeToggleListener } from "./floatable/
2
2
  import { attributable } from "./internal/attributable.mjs";
3
3
  import { NAVIGABLE_KEYS_HORIZONTAL, NAVIGABLE_KEYS_VERTICAL, getNavigable, updateNavigableFocus } from "./internal/navigable.mjs";
4
4
  import { setAria, setRole } from "@oscarpalmer/toretto/aria";
5
- import { on } from "@oscarpalmer/toretto/event";
6
5
  import { setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
6
+ import { on } from "@oscarpalmer/toretto/event";
7
7
  import { findAncestor } from "@oscarpalmer/toretto/find";
8
8
  //#region src/js/menu.ts
9
9
  var OuiMenu = class {
@@ -1,11 +1,11 @@
1
1
  import { getLocalizations, updateLocalizations } from "./l10n.mjs";
2
- import { b as updateListboxValueLabel, c as createListboxContent, n as filterListbox, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-BWd0PCy7.mjs";
2
+ import { b as updateListboxValueLabel, c as createListboxContent, n as filterListbox, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-C7CRa5Ya.mjs";
3
3
  import { initializeListboxState } from "./internal/listbox/listbox.state.mjs";
4
4
  import { getBooleanAriaValue } from "./internal/misc.mjs";
5
5
  import { processListboxKeydown } from "./internal/listbox/listbox.event.mjs";
6
6
  import { LISTBOX_ATTRIBUTES, LISTBOX_MESSAGES, LISTBOX_SELECTORS, LISTBOX_TAGNAME } from "./listbox/constants.listbox.mjs";
7
+ import { setAttributes } from "@oscarpalmer/toretto/attribute";
7
8
  import { on } from "@oscarpalmer/toretto/event";
8
- import { setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
9
9
  import { findAncestor } from "@oscarpalmer/toretto/find";
10
10
  import { getData } from "@oscarpalmer/toretto/data";
11
11
  import { noop } from "@oscarpalmer/atoms/function";
@@ -59,7 +59,6 @@ function createListboxState(element, internals) {
59
59
  const label = element.querySelector(`label[for="${select.id}"]`);
60
60
  if (label == null) throw new Error(LISTBOX_MESSAGES.label);
61
61
  element.id = select.id;
62
- setAttribute(element, "name", select.name === "" ? select.id : select.name);
63
62
  const disabled = getBooleanAriaValue(element, "disabled") || select.disabled;
64
63
  const multiple = element.multiple || select.multiple;
65
64
  const readonly = getBooleanAriaValue(element, "readonly");
@@ -1,9 +1,9 @@
1
1
  import { attributable } from "../internal/attributable.mjs";
2
2
  import { OuiDraggable, addDraggable, getDraggableStates, removeDraggable } from "../internal/draggable.mjs";
3
- import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
4
3
  import { setAttribute } from "@oscarpalmer/toretto/attribute";
5
- import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
4
+ import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
6
5
  import { getStyles, setStyle, setStyles } from "@oscarpalmer/toretto/style";
6
+ import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
7
7
  //#region src/js/movable/movable.embedded.ts
8
8
  var OuiMovable = class extends OuiDraggable {
9
9
  #element;
@@ -2,8 +2,8 @@ import { createEmbeddedFloatable, getOnBeforeToggleListener } from "./floatable/
2
2
  import { attributable } from "./internal/attributable.mjs";
3
3
  import { createFocusTrap } from "./focus-trap/focus-trap.embedded.mjs";
4
4
  import { getAria, setAria } from "@oscarpalmer/toretto/aria";
5
- import { on } from "@oscarpalmer/toretto/event";
6
5
  import { setAttribute } from "@oscarpalmer/toretto/attribute";
6
+ import { on } from "@oscarpalmer/toretto/event";
7
7
  import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
8
8
  //#region src/js/popover.ts
9
9
  var OuiPopover = class {
@@ -74,7 +74,7 @@ function getState(anchor, content) {
74
74
  anchor,
75
75
  content,
76
76
  floatable: createEmbeddedFloatable(anchor, content, options),
77
- focusTrap: getAria(content, "modal") === "true" ? createFocusTrap(content, { noescape: true }) : void 0,
77
+ focusTrap: getAria(content, "modal") === true ? createFocusTrap(content, { noescape: true }) : void 0,
78
78
  listeners: [getOnBeforeToggleListener(content), on(content, "toggle", (event) => {
79
79
  const expanded = event.newState === "open";
80
80
  if (expanded) {
@@ -1,12 +1,12 @@
1
1
  import { attributable } from "../internal/attributable.mjs";
2
- import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
3
- import { isPlainObject } from "@oscarpalmer/atoms/is";
4
- import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
5
- import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
6
- import { setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
7
2
  import { getNumber } from "@oscarpalmer/atoms/number";
3
+ import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
4
+ import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
8
5
  import { findAncestor } from "@oscarpalmer/toretto/find";
6
+ import { setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
9
7
  import supportsTouch from "@oscarpalmer/toretto/touch";
8
+ import { isPlainObject } from "@oscarpalmer/atoms/is";
9
+ import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
10
10
  //#region src/js/resizable/resizable.embedded.ts
11
11
  var OuiResizable = class {
12
12
  #state;
@@ -1,11 +1,11 @@
1
1
  import { attributable } from "../internal/attributable.mjs";
2
2
  import { OuiDraggable, addDraggable, getDraggableStates, removeDraggable } from "../internal/draggable.mjs";
3
- import { dispatch, getEventPosition } from "@oscarpalmer/toretto/event";
4
3
  import { getAttribute, setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
5
- import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
6
- import { setStyle } from "@oscarpalmer/toretto/style";
7
- import { findAncestor, getElementFromPosition } from "@oscarpalmer/toretto/find";
8
4
  import { createElement } from "@oscarpalmer/toretto/create";
5
+ import { dispatch, getEventPosition } from "@oscarpalmer/toretto/event";
6
+ import { findAncestor, getElementFromPosition } from "@oscarpalmer/toretto/find";
7
+ import { setStyle } from "@oscarpalmer/toretto/style";
8
+ import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
9
9
  //#region src/js/sortable/sortable.embedded.ts
10
10
  var OuiSortable = class extends OuiDraggable {
11
11
  constructor(element, options) {
@@ -1,13 +1,13 @@
1
+ import { round } from "@oscarpalmer/atoms/math";
2
+ import { clamp } from "@oscarpalmer/atoms/number";
1
3
  import { setAria } from "@oscarpalmer/toretto/aria";
2
- import { getEventPosition, on } from "@oscarpalmer/toretto/event";
3
- import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
4
4
  import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
5
- import { setStyle, toggleStyles } from "@oscarpalmer/toretto/style";
6
- import { clamp } from "@oscarpalmer/atoms/number";
5
+ import { createElement } from "@oscarpalmer/toretto/create";
6
+ import { getEventPosition, on } from "@oscarpalmer/toretto/event";
7
7
  import { findAncestor } from "@oscarpalmer/toretto/find";
8
+ import { setStyle, toggleStyles } from "@oscarpalmer/toretto/style";
8
9
  import supportsTouch from "@oscarpalmer/toretto/touch";
9
- import { createElement } from "@oscarpalmer/toretto/create";
10
- import { round } from "@oscarpalmer/atoms/math";
10
+ import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
11
11
  //#region src/js/splitter.ts
12
12
  const ATTRIBUTE_MAX = "max";
13
13
  const ATTRIBUTE_MIN = "min";
@@ -1,16 +1,16 @@
1
1
  import { createEmbeddedFloatable } from "./floatable/floatable.embedded.mjs";
2
2
  import { getLocalizations, updateLocalizations } from "./l10n.mjs";
3
3
  import { LISTBOX_KEYS, LISTBOX_TYPES } from "./internal/listbox/listbox.constants.mjs";
4
- import { b as updateListboxValueLabel, i as filterListboxOptions, n as filterListbox, r as filterListboxOption, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-BWd0PCy7.mjs";
4
+ import { b as updateListboxValueLabel, i as filterListboxOptions, n as filterListbox, r as filterListboxOption, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-C7CRa5Ya.mjs";
5
5
  import { initializeListboxState } from "./internal/listbox/listbox.state.mjs";
6
6
  import { COMBOBOX_ATTRIBUTES, COMBOBOX_ATTRIBUTE_SELECTION_ITEM, COMBOBOX_AUTOCOMPLETES, COMBOBOX_MESSAGES, COMBOBOX_SELECTORS, COMBOBOX_TAGNAME } from "./combobox/constants.combobox.mjs";
7
7
  import { getAttributeValue, getBooleanAriaValue } from "./internal/misc.mjs";
8
8
  import { createComboboxAnchor, createComboboxContent, updateComboboxAutocomplete, updateComboboxSelection, updateComboboxSelectionItems, updateComboboxTabindices } from "./combobox/dom.combobox.mjs";
9
9
  import { processListboxKeydown } from "./internal/listbox/listbox.event.mjs";
10
+ import { clamp } from "@oscarpalmer/atoms/number";
10
11
  import { setAria } from "@oscarpalmer/toretto/aria";
11
- import { on } from "@oscarpalmer/toretto/event";
12
12
  import { setAttributes } from "@oscarpalmer/toretto/attribute";
13
- import { clamp } from "@oscarpalmer/atoms/number";
13
+ import { on } from "@oscarpalmer/toretto/event";
14
14
  import { getData } from "@oscarpalmer/toretto/data";
15
15
  import { findAncestor, getData as getData$1 } from "@oscarpalmer/toretto";
16
16
  import { noop } from "@oscarpalmer/atoms/function";
package/dist/js/tabs.mjs CHANGED
@@ -67,7 +67,7 @@ function attachTabs(state) {
67
67
  }
68
68
  }
69
69
  function createContent(prefix, panels, active) {
70
- const content = createElement("div", { attribute: { [ATTRIBUTE_CONTENT]: "" } });
70
+ const content = createElement("div", { attribute: { [`${TAGNAME}-content`]: "" } });
71
71
  const { length } = panels;
72
72
  const hidden = [];
73
73
  const roles = [];
@@ -93,7 +93,7 @@ function createTab(prefix, index, panel, label, selected) {
93
93
  selected,
94
94
  controls: panel.id
95
95
  },
96
- attribute: { [ATTRIBUTE_TAB]: "" },
96
+ attribute: { [`${TAGNAME}-tab`]: "" },
97
97
  property: {
98
98
  id: `${prefix}_tab_${index}`,
99
99
  role: "tab",
@@ -105,7 +105,7 @@ function createTab(prefix, index, panel, label, selected) {
105
105
  }
106
106
  function createTabList(prefix, panels, labels, active) {
107
107
  const element = createElement("div", {
108
- attribute: { [ATTRIBUTE_TABLIST]: "" },
108
+ attribute: { [`${TAGNAME}-tablist`]: "" },
109
109
  property: { role: "tablist" }
110
110
  });
111
111
  const { length } = panels;
@@ -226,14 +226,11 @@ function setActive(state, value) {
226
226
  }
227
227
  }
228
228
  const TAGNAME = "oui-tabs";
229
- const ATTRIBUTE_CONTENT = `${TAGNAME}-content`;
230
229
  const ATTRIBUTE_PANEL = `${TAGNAME}-panel`;
231
- const ATTRIBUTE_TAB = `${TAGNAME}-tab`;
232
- const ATTRIBUTE_TABLIST = `${TAGNAME}-tablist`;
233
230
  const MESSAGE_EMPTY = `<${TAGNAME}> must contain at least one [${ATTRIBUTE_PANEL}] child element`;
234
231
  const MESSAGE_INVALID = `A [${ATTRIBUTE_PANEL}] child element of <${TAGNAME}> must have a valid 'aria-label' or 'aria-labelledby' attribute`;
235
232
  const SELECTOR_PANEL = `:scope > [${ATTRIBUTE_PANEL}]`;
236
- const SELECTOR_TAB = `[${ATTRIBUTE_TAB}]`;
233
+ const SELECTOR_TAB = `[${TAGNAME}-tab]`;
237
234
  let index = 0;
238
235
  customElements.define(TAGNAME, OuiTabsElement);
239
236
  //#endregion
@@ -1,11 +1,11 @@
1
1
  import { createEmbeddedFloatable } from "./floatable/floatable.embedded.mjs";
2
2
  import { attributable } from "./internal/attributable.mjs";
3
3
  import { getAria } from "@oscarpalmer/toretto/aria";
4
- import { on } from "@oscarpalmer/toretto/event";
5
- import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
6
4
  import { setAttribute } from "@oscarpalmer/toretto/attribute";
7
- import { findAncestor } from "@oscarpalmer/toretto/find";
8
5
  import { createElement } from "@oscarpalmer/toretto/create";
6
+ import { on } from "@oscarpalmer/toretto/event";
7
+ import { findAncestor } from "@oscarpalmer/toretto/find";
8
+ import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
9
9
  //#region src/js/tooltip.ts
10
10
  var OuiTooltip = class {
11
11
  #state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscarpalmer/oui",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "Styles, components, and utilities for building websites and applications.",
5
5
  "keywords": [
6
6
  "css",
@@ -91,15 +91,17 @@
91
91
  "clean": "rm -rf ./dist && rm -rf ./postcss",
92
92
  "css:build": "vp run postcss:build && vpx sass ./postcss:./dist/css --no-source-map",
93
93
  "css:watch": "vpx sass ./postcss:./dist/css --no-source-map --watch",
94
- "postcss:build": "vpx postcss ./src/css/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss",
95
- "postcss:watch": "vpx postcss ./src/css/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss --watch",
94
+ "postcss:build": "vp run postcss:build:mixins && vp run postcss:build:styles",
95
+ "postcss:build:mixins": "vpx postcss ./src/css/mixins/*.scss -d ./postcss/mixins -u autoprefixer postcss-input-range --parser postcss-scss",
96
+ "postcss:build:styles": "vpx postcss ./src/css/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss",
97
+ "postcss:watch": "vpx postcss ./src/css/**/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss --watch",
96
98
  "test": "vpx vitest --coverage",
97
99
  "tsdown": "vpx tsdown -c ./tsdown.config.ts --watch",
98
100
  "watch": "vp run clean && concurrently \"php -S localhost:3000\" \"vp run postcss:watch\" \"vp run css:watch\" \"vp run tsdown\""
99
101
  },
100
102
  "dependencies": {
101
- "@oscarpalmer/atoms": "^0.188.1",
102
- "@oscarpalmer/toretto": "^0.51"
103
+ "@oscarpalmer/atoms": "^0.189.1",
104
+ "@oscarpalmer/toretto": "^0.52"
103
105
  },
104
106
  "devDependencies": {
105
107
  "@oxlint/plugins": "^1.78",
package/src/css/a11y.scss CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! https://github.com/oscarpalmer/oui */
2
2
 
3
- @use './mixins' as mixins;
3
+ @use './mixins/misc.mixins.scss' as miscMixins;
4
4
 
5
5
  .oui-vh {
6
6
  :where(&) {
@@ -8,6 +8,6 @@
8
8
  }
9
9
 
10
10
  :where(&:not(:active, :focus, :focus-within)) {
11
- @include mixins.visually-hidden;
11
+ @include miscMixins.visually-hidden;
12
12
  }
13
13
  }
@@ -1,10 +1,10 @@
1
1
  /*! https://github.com/oscarpalmer/oui */
2
2
 
3
- @use './mixins.scss' as mixins;
3
+ @use './mixins/badge.mixins.scss' as badgeMixins;
4
4
 
5
5
  .oui {
6
6
  :where(&-pill, &-tag) {
7
- @include mixins.badge;
7
+ @include badgeMixins.badge;
8
8
  }
9
9
 
10
10
  :where(&-pill) {
@@ -37,26 +37,26 @@
37
37
  // Colors
38
38
 
39
39
  :where(&-pill--blue, &-tag--blue) {
40
- @include mixins.badge-blue;
40
+ @include badgeMixins.badge-blue;
41
41
  }
42
42
 
43
43
  :where(&-pill--green, &-tag--green) {
44
- @include mixins.badge-green;
44
+ @include badgeMixins.badge-green;
45
45
  }
46
46
 
47
47
  :where(&-pill--orange, &-tag--orange) {
48
- @include mixins.badge-orange;
48
+ @include badgeMixins.badge-orange;
49
49
  }
50
50
 
51
51
  :where(&-pill--purple, &-tag--purple) {
52
- @include mixins.badge-purple;
52
+ @include badgeMixins.badge-purple;
53
53
  }
54
54
 
55
55
  :where(&-pill--red, &-tag--red) {
56
- @include mixins.badge-red;
56
+ @include badgeMixins.badge-red;
57
57
  }
58
58
 
59
59
  :where(&-pill--yellow, &-tag--yellow) {
60
- @include mixins.badge-yellow;
60
+ @include badgeMixins.badge-yellow;
61
61
  }
62
62
  }
@@ -1,34 +1,34 @@
1
1
  /*! https://github.com/oscarpalmer/oui */
2
2
 
3
- @use './mixins' as mixins;
3
+ @use './mixins/button.mixins.scss' as buttonMixins;
4
4
 
5
5
  .oui-button {
6
6
  :where(&) {
7
- @include mixins.button;
7
+ @include buttonMixins.button;
8
8
  }
9
9
 
10
10
  :where(&--blue) {
11
- @include mixins.button-blue;
11
+ @include buttonMixins.button-blue;
12
12
  }
13
13
 
14
14
  :where(&--green) {
15
- @include mixins.button-green;
15
+ @include buttonMixins.button-green;
16
16
  }
17
17
 
18
18
  :where(&--orange) {
19
- @include mixins.button-orange;
19
+ @include buttonMixins.button-orange;
20
20
  }
21
21
 
22
22
  :where(&--purple) {
23
- @include mixins.button-purple;
23
+ @include buttonMixins.button-purple;
24
24
  }
25
25
 
26
26
  :where(&--red) {
27
- @include mixins.button-red;
27
+ @include buttonMixins.button-red;
28
28
  }
29
29
 
30
30
  :where(&--yellow) {
31
- @include mixins.button-yellow;
31
+ @include buttonMixins.button-yellow;
32
32
  }
33
33
 
34
34
  :where(&--rounded) {