@oscarpalmer/oui 0.17.0 → 0.19.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 (72) hide show
  1. package/dist/css/badge.css +13 -13
  2. package/dist/css/button.css +9 -9
  3. package/dist/css/color.css +99 -99
  4. package/dist/css/content.css +10 -12
  5. package/dist/css/flex.css +39 -39
  6. package/dist/css/form.css +47 -60
  7. package/dist/css/message.css +10 -6
  8. package/dist/css/reset.css +178 -57
  9. package/dist/css/table.css +4 -4
  10. package/dist/css/tooltip.css +26 -1
  11. package/dist/js/attributable.full.js +36 -0
  12. package/dist/js/attributable.js +30 -45
  13. package/dist/js/floatable.full.js +398 -0
  14. package/dist/js/floatable.js +254 -169
  15. package/dist/js/focus-trap/embedded.full.js +408 -0
  16. package/dist/js/focus-trap/embedded.js +131 -131
  17. package/dist/js/focus-trap/standalone.full.js +447 -0
  18. package/dist/js/focus-trap/standalone.js +4 -4
  19. package/dist/js/index.js +3 -4
  20. package/dist/js/oui.full.js +1573 -0
  21. package/dist/js/popover.full.js +760 -0
  22. package/dist/js/popover.js +84 -163
  23. package/dist/js/splitter.full.js +769 -0
  24. package/dist/js/splitter.js +264 -246
  25. package/dist/js/tooltip.full.js +613 -0
  26. package/dist/js/tooltip.js +160 -151
  27. package/package.json +35 -63
  28. package/src/css/a11y.scss +1 -1
  29. package/src/css/badge.scss +23 -19
  30. package/src/css/button.scss +9 -9
  31. package/src/css/color.scss +99 -99
  32. package/src/css/content.scss +6 -9
  33. package/src/css/flex.scss +21 -20
  34. package/src/css/form.scss +47 -62
  35. package/src/css/message.scss +11 -12
  36. package/src/css/mixins.scss +16 -10
  37. package/src/css/popover.scss +2 -2
  38. package/src/css/reset.scss +181 -55
  39. package/src/css/splitter.scss +15 -13
  40. package/src/css/table.scss +11 -11
  41. package/src/css/tooltip.scss +31 -2
  42. package/src/js/attributable.ts +3 -10
  43. package/src/js/floatable.ts +370 -141
  44. package/src/js/focus-trap/embedded.ts +141 -74
  45. package/src/js/focus-trap/standalone.ts +4 -4
  46. package/src/js/index.ts +1 -0
  47. package/src/js/popover.ts +52 -122
  48. package/src/js/splitter.ts +248 -131
  49. package/src/js/tooltip.ts +143 -68
  50. package/types/floatable.d.ts +17 -10
  51. package/types/focus-trap/embedded.d.ts +18 -5
  52. package/types/index.d.ts +1 -0
  53. package/types/popover.d.ts +2 -0
  54. package/types/splitter.d.ts +13 -1
  55. package/types/tooltip.d.ts +2 -1
  56. package/dist/css/value.css +0 -1
  57. package/dist/js/attributable.cjs +0 -51
  58. package/dist/js/floatable.cjs +0 -176
  59. package/dist/js/focus-trap/embedded.cjs +0 -150
  60. package/dist/js/focus-trap/standalone.cjs +0 -8
  61. package/dist/js/index.cjs +0 -6
  62. package/dist/js/popover.cjs +0 -166
  63. package/dist/js/splitter.cjs +0 -272
  64. package/dist/js/tooltip.cjs +0 -166
  65. package/types/attributable.d.cts +0 -5
  66. package/types/floatable.d.cts +0 -20
  67. package/types/focus-trap/embedded.d.cts +0 -15
  68. package/types/focus-trap/standalone.d.cts +0 -3
  69. package/types/index.d.cts +0 -14
  70. package/types/popover.d.cts +0 -14
  71. package/types/splitter.d.cts +0 -10
  72. package/types/tooltip.d.cts +0 -3
@@ -1,165 +1,174 @@
1
- import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
2
- import { on } from "@oscarpalmer/toretto/event";
3
1
  import { attributable } from "./attributable.js";
4
- import { deactivate, Floatable, activate } from "./floatable.js";
5
- class Tooltip {
6
- abortController = new AbortController();
7
- attributes;
8
- floatable;
9
- constructor(anchor, content) {
10
- this.attributes = content.attributes;
11
- this.floatable = new Floatable(
12
- anchor,
13
- content.element,
14
- `${selector}-position`,
15
- "vertical",
16
- true
17
- );
18
- initialize(this);
19
- }
20
- destroy() {
21
- deactivate(this.floatable, active);
22
- reset(this.floatable.anchor, this.attributes);
23
- this.abortController.abort();
24
- this.floatable.content.remove();
25
- this.floatable.destroy();
26
- this.abortController = void 0;
27
- this.attributes = void 0;
28
- this.floatable = void 0;
29
- }
30
- }
2
+ import { Floatable } from "./floatable.js";
3
+ import { on } from "@oscarpalmer/toretto/event";
4
+ import { findAncestor } from "@oscarpalmer/toretto/find";
5
+ import { isNullableOrWhitespace } from "@oscarpalmer/atoms/is";
6
+ var Tooltip = class {
7
+ attributes;
8
+ floatable;
9
+ timer;
10
+ constructor(anchor, content) {
11
+ this.attributes = content.attributes;
12
+ this.floatable = new Floatable({
13
+ anchor,
14
+ content: content.element,
15
+ defaultPosition: "vertical",
16
+ interactive: false,
17
+ preferAbove: true,
18
+ positionAttribute: ATTRIBUTE_POSITION
19
+ });
20
+ anchor.insertAdjacentElement("afterend", content.element);
21
+ TOOLTIPS_ALL.set(content.element, this);
22
+ }
23
+ destroy() {
24
+ const { attributes, floatable } = this;
25
+ TOOLTIPS_ACTIVE.delete(this);
26
+ TOOLTIPS_ALL.delete(floatable.options.anchor);
27
+ TOOLTIPS_ALL.delete(floatable.options.content);
28
+ reset(floatable.options.anchor, attributes);
29
+ floatable.options.content.remove();
30
+ floatable.destroy();
31
+ this.attributes = void 0;
32
+ this.floatable = void 0;
33
+ }
34
+ };
31
35
  function addTooltip(anchor) {
32
- if (tooltips.has(anchor)) {
33
- return;
34
- }
35
- const content = getContent(anchor);
36
- if (content != null) {
37
- tooltips.set(anchor, new Tooltip(anchor, content));
38
- }
36
+ if (TOOLTIPS_ALL.has(anchor)) return;
37
+ const content = getContent(anchor);
38
+ if (content != null) TOOLTIPS_ALL.set(anchor, new Tooltip(anchor, content));
39
+ }
40
+ function closeTooltips(next) {
41
+ const tooltips = [...TOOLTIPS_ACTIVE];
42
+ for (const active of tooltips) {
43
+ if (active === next) continue;
44
+ if (active.timer != null) clearTimeout(active.timer);
45
+ active.floatable.options.content.removeAttribute("oui-tooltip-content-active");
46
+ requestAnimationFrame(() => {
47
+ active.timer = setTimeout(() => {
48
+ TOOLTIPS_ACTIVE.delete(active);
49
+ active.floatable.toggle(false);
50
+ }, delay);
51
+ });
52
+ }
39
53
  }
40
54
  function getContent(anchor) {
41
- const attributes = {
42
- ariaDescribedby: anchor.getAttribute("aria-describedby"),
43
- ariaLabelledBy: anchor.getAttribute("aria-labelledby")
44
- };
45
- const wrapper = getWrapper(anchor);
46
- const labelledElements = getElements(attributes.ariaLabelledBy);
47
- if (labelledElements.length > 0) {
48
- anchor.setAttribute("aria-labelledby", wrapper.id);
49
- for (const element of labelledElements) {
50
- wrapper.append(element);
51
- }
52
- return {
53
- attributes,
54
- element: wrapper
55
- };
56
- }
57
- const describedElements = getElements(attributes.ariaDescribedby);
58
- if (describedElements.length > 0) {
59
- anchor.setAttribute("aria-describedby", wrapper.id);
60
- for (const element of describedElements) {
61
- wrapper.append(element);
62
- }
63
- return {
64
- attributes,
65
- element: wrapper
66
- };
67
- }
68
- let content = anchor.getAttribute("aria-label");
69
- if (isNullableOrWhitespace(content)) {
70
- content = anchor.getAttribute("aria-description");
71
- }
72
- if (isNullableOrWhitespace(content)) {
73
- return;
74
- }
75
- const paragraph = document.createElement("p");
76
- paragraph.textContent = content;
77
- wrapper.append(paragraph);
78
- return {
79
- attributes,
80
- element: wrapper
81
- };
55
+ const attributes = {
56
+ ariaDescribedby: anchor.getAttribute("aria-describedby"),
57
+ ariaLabelledBy: anchor.getAttribute("aria-labelledby")
58
+ };
59
+ const wrapper = getWrapper(anchor);
60
+ const labelledElements = getElements(attributes.ariaLabelledBy);
61
+ if (labelledElements.length > 0) {
62
+ anchor.setAttribute("aria-labelledby", wrapper.id);
63
+ for (const element of labelledElements) wrapper.append(element);
64
+ return {
65
+ attributes,
66
+ element: wrapper
67
+ };
68
+ }
69
+ const describedElements = getElements(attributes.ariaDescribedby);
70
+ if (describedElements.length > 0) {
71
+ anchor.setAttribute("aria-describedby", wrapper.id);
72
+ for (const element of describedElements) wrapper.append(element);
73
+ return {
74
+ attributes,
75
+ element: wrapper
76
+ };
77
+ }
78
+ let content = anchor.getAttribute("aria-label");
79
+ if (isNullableOrWhitespace(content)) content = anchor.getAttribute("aria-description");
80
+ if (isNullableOrWhitespace(content)) return;
81
+ const paragraph = document.createElement("p");
82
+ paragraph.textContent = content;
83
+ wrapper.append(paragraph);
84
+ return {
85
+ attributes,
86
+ element: wrapper
87
+ };
82
88
  }
83
89
  function getElements(attribute) {
84
- const ids = attribute?.split(/\s+/) ?? [];
85
- const elements = [];
86
- for (const id of ids) {
87
- if (isNullableOrWhitespace(id)) {
88
- continue;
89
- }
90
- const element = document.querySelector(`#${id}`);
91
- if (element instanceof HTMLElement) {
92
- const cloned = element.cloneNode(true);
93
- cloned.hidden = false;
94
- elements.push(cloned);
95
- }
96
- }
97
- return elements;
90
+ const ids = attribute?.split(EXPRESSION_WHITESPACE) ?? [];
91
+ const elements = [];
92
+ for (const id of ids) {
93
+ if (isNullableOrWhitespace(id)) continue;
94
+ const element = document.querySelector(`#${id}`);
95
+ if (element instanceof HTMLElement) {
96
+ const cloned = element.cloneNode(true);
97
+ cloned.hidden = false;
98
+ elements.push(cloned);
99
+ }
100
+ }
101
+ return elements;
98
102
  }
99
103
  function getWrapper(anchor) {
100
- const wrapper = document.createElement("div");
101
- wrapper.setAttribute(`${selector}-content`, "");
102
- wrapper.className = anchor.getAttribute(`${selector}-class`) ?? "";
103
- wrapper.hidden = true;
104
- wrapper.id = `${selector}-${++index}`;
105
- wrapper.role = "tooltip";
106
- wrapper.tabIndex = -1;
107
- return wrapper;
104
+ const wrapper = document.createElement("div");
105
+ wrapper.setAttribute(ATTRIBUTE_CONTENT, "");
106
+ wrapper.className = anchor.getAttribute(ATTRIBUTE_CLASS) ?? "";
107
+ wrapper.hidden = true;
108
+ wrapper.id = `${SELECTOR}-${++index}`;
109
+ wrapper.role = "tooltip";
110
+ wrapper.tabIndex = -1;
111
+ return wrapper;
112
+ }
113
+ function onActivate(event) {
114
+ onToggle(event, true);
115
+ }
116
+ function onClick(event) {
117
+ if (findAncestor(event.target, SELECTOR_CONTENT) != null) event.stopPropagation();
108
118
  }
109
- function initialize(tooltip) {
110
- const { abortController, floatable } = tooltip;
111
- const { anchor, content } = floatable;
112
- anchor.insertAdjacentElement("afterend", content);
113
- const elements = [anchor, content];
114
- for (const element of elements) {
115
- for (const event of activateEvents) {
116
- on(
117
- element,
118
- event,
119
- () => {
120
- activate(floatable, active, void 0, 250);
121
- },
122
- {
123
- signal: abortController.signal
124
- }
125
- );
126
- }
127
- for (const event of deactivateEvents) {
128
- on(
129
- element,
130
- event,
131
- () => {
132
- deactivate(floatable, active, void 0, 250);
133
- },
134
- {
135
- signal: abortController.signal
136
- }
137
- );
138
- }
139
- }
119
+ function onDeactivate(event) {
120
+ onToggle(event, false);
121
+ }
122
+ function onToggle(event, activate) {
123
+ if (toggle != null) cancelAnimationFrame(toggle);
124
+ toggle = requestAnimationFrame(() => {
125
+ toggle = void 0;
126
+ const element = findAncestor(event.target, SELECTOR_FULL);
127
+ const tooltip = TOOLTIPS_ALL.get(element);
128
+ if (TOOLTIPS_ACTIVE.size > 0) closeTooltips(tooltip);
129
+ if (tooltip == null || tooltip.floatable.options.content.hasAttribute("oui-tooltip-content-active") === activate) return;
130
+ if (activate) {
131
+ if (tooltip.timer != null) clearTimeout(tooltip.timer);
132
+ TOOLTIPS_ACTIVE.add(tooltip);
133
+ tooltip.floatable.toggle(true);
134
+ requestAnimationFrame(() => {
135
+ tooltip.floatable.options.content.setAttribute("oui-tooltip-content-active", "");
136
+ });
137
+ return;
138
+ }
139
+ tooltip.floatable.options.content.removeAttribute("oui-tooltip-content-active");
140
+ tooltip.timer ??= setTimeout(() => {
141
+ TOOLTIPS_ACTIVE.delete(tooltip);
142
+ tooltip.floatable.toggle(false);
143
+ }, delay);
144
+ });
140
145
  }
141
146
  function removeTooltip(element) {
142
- tooltips.get(element)?.destroy();
143
- tooltips.delete(element);
147
+ if (!element.hasAttribute(ATTRIBUTE_CONTENT)) TOOLTIPS_ALL.get(element)?.destroy();
144
148
  }
145
149
  function reset(anchor, attributes) {
146
- if (attributes.ariaDescribedby == null) {
147
- anchor.removeAttribute("aria-describedby");
148
- } else {
149
- anchor.setAttribute("aria-describedby", attributes.ariaDescribedby);
150
- }
150
+ if (attributes.ariaDescribedby == null) anchor.removeAttribute("aria-describedby");
151
+ else anchor.setAttribute("aria-describedby", attributes.ariaDescribedby);
152
+ }
153
+ function setDelay(value) {
154
+ delay = typeof value === "number" && value >= 0 ? value : delay;
151
155
  }
152
- const active = /* @__PURE__ */ new Set();
153
- const activateEvents = ["focus", "mouseenter", "touchstart"];
154
- const deactivateEvents = ["blur", "mouseleave"];
155
- const selector = "oui-tooltip";
156
- const tooltips = /* @__PURE__ */ new WeakMap();
157
- let index = 0;
158
- attributable(selector, addTooltip, removeTooltip);
159
- on(document, "keydown", (event) => {
160
- if (event.key === "Escape") {
161
- for (const floatable of active) {
162
- deactivate(floatable, active);
163
- }
164
- }
165
- });
156
+ var SELECTOR = "oui-tooltip";
157
+ var ATTRIBUTE_CLASS = `${SELECTOR}-class`;
158
+ var ATTRIBUTE_CONTENT = `${SELECTOR}-content`;
159
+ var ATTRIBUTE_POSITION = `${SELECTOR}-position`;
160
+ var SELECTOR_CONTENT = `[${ATTRIBUTE_CONTENT}]`;
161
+ var SELECTOR_FULL = `[${SELECTOR}], [${ATTRIBUTE_CONTENT}]`;
162
+ var EXPRESSION_WHITESPACE = /\s+/;
163
+ var TOOLTIPS_ACTIVE = /* @__PURE__ */ new Set();
164
+ var TOOLTIPS_ALL = /* @__PURE__ */ new WeakMap();
165
+ var delay = 250;
166
+ var index = 0;
167
+ var toggle;
168
+ attributable(SELECTOR, addTooltip, removeTooltip);
169
+ on(document, "click", onClick, { capture: true });
170
+ on(document, "focusin", onActivate);
171
+ on(document, "focusout", onDeactivate);
172
+ on(document, "mousemove", onActivate);
173
+ on(document, "touchstart", onActivate);
174
+ export { setDelay };
package/package.json CHANGED
@@ -4,83 +4,56 @@
4
4
  "url": "https://oscarpalmer.se"
5
5
  },
6
6
  "dependencies": {
7
- "@oscarpalmer/atoms": "^0.104",
8
- "@oscarpalmer/toretto": "^0.20"
7
+ "@oscarpalmer/atoms": "^0.124",
8
+ "@oscarpalmer/toretto": "^0.34"
9
9
  },
10
10
  "description": "Styles, components, and utilities for building websites and applications.",
11
11
  "devDependencies": {
12
- "@biomejs/biome": "^2.1",
13
- "@rollup/plugin-node-resolve": "^16",
14
- "@rollup/plugin-typescript": "^12.1",
15
- "@types/node": "^24.1",
16
- "@vitest/coverage-istanbul": "^3.2",
12
+ "@types/node": "^25",
13
+ "@vitest/coverage-istanbul": "^4",
17
14
  "autoprefixer": "^10.4",
18
- "dts-bundle-generator": "^9.5",
19
- "glob": "^11",
20
- "jsdom": "^26.1",
15
+ "jsdom": "^27.4",
16
+ "oxfmt": "^0.21",
17
+ "oxlint": "^1.36",
21
18
  "postcss-cli": "^11",
22
19
  "postcss-input-range": "^6",
23
20
  "postcss-scss": "^4",
24
- "sass": "^1.89",
25
- "stylelint": "^16.22",
21
+ "rolldown": "1.0.0-beta.57",
22
+ "sass": "^1.97",
23
+ "stylelint": "^16.26",
24
+ "stylelint-config-standard-scss": "^16",
26
25
  "tslib": "^2.8",
27
- "typescript": "^5.8",
28
- "vite": "^7",
29
- "vitest": "^3.2"
26
+ "typescript": "^5.9",
27
+ "vite": "8.0.0-beta.5",
28
+ "vitest": "^4"
30
29
  },
31
30
  "exports": {
32
31
  ".": {
33
- "import": {
34
- "types": "./types/index.d.ts",
35
- "default": "./dist/js/index.js"
36
- },
37
- "require": {
38
- "types": "./types/index.d.cts",
39
- "default": "./dist/js/index.cjs"
40
- }
32
+ "types": "./types/index.d.ts",
33
+ "default": "./dist/js/index.js"
41
34
  },
42
35
  "./focus-trap": {
43
- "import": {
44
- "types": "./types/focus-trap/standalone.d.ts",
45
- "default": "./dist/js/focus-trap/standalone.js"
46
- },
47
- "require": {
48
- "types": "./types/focus-trap/standalone.d.cts",
49
- "default": "./dist/js/focus-trap/standalone.cjs"
50
- }
36
+ "types": "./types/focus-trap/standalone.d.ts",
37
+ "default": "./dist/js/focus-trap/standalone.js"
51
38
  },
52
39
  "./popover": {
53
- "import": {
54
- "types": "./types/popover.d.ts",
55
- "default": "./dist/js/popover.js"
56
- },
57
- "require": {
58
- "types": "./types/popover.d.cts",
59
- "default": "./dist/js/popover.cjs"
60
- }
40
+ "types": "./types/popover.d.ts",
41
+ "default": "./dist/js/popover.js"
61
42
  },
62
43
  "./splitter": {
63
- "import": {
64
- "types": "./types/splitter.d.ts",
65
- "default": "./dist/js/splitter.js"
66
- },
67
- "require": {
68
- "types": "./types/splitter.d.cts",
69
- "default": "./dist/js/splitter.cjs"
70
- }
44
+ "types": "./types/splitter.d.ts",
45
+ "default": "./dist/js/splitter.js"
71
46
  },
72
47
  "./tooltip": {
73
- "import": {
74
- "types": "./types/tooltip.d.ts",
75
- "default": "./dist/js/tooltip.js"
76
- },
77
- "require": {
78
- "types": "./types/tooltip.d.cts",
79
- "default": "./dist/js/tooltip.cjs"
80
- }
48
+ "types": "./types/tooltip.d.ts",
49
+ "default": "./dist/js/tooltip.js"
81
50
  }
82
51
  },
83
- "files": ["dist", "src", "types"],
52
+ "files": [
53
+ "dist",
54
+ "src",
55
+ "types"
56
+ ],
84
57
  "keywords": [
85
58
  "css",
86
59
  "scss",
@@ -92,7 +65,6 @@
92
65
  "utility"
93
66
  ],
94
67
  "license": "MIT",
95
- "main": "dist/js/index.cjs",
96
68
  "module": "dist/js/index.js",
97
69
  "name": "@oscarpalmer/oui",
98
70
  "repository": {
@@ -100,19 +72,19 @@
100
72
  "url": "git+https://github.com/oscarpalmer/oui.git"
101
73
  },
102
74
  "scripts": {
103
- "build": "npm run clean && npm run build:css && npm run build:js",
75
+ "build": "npm run clean && npm run build:js && npm run build:css",
104
76
  "build:css": "npm run build:postcss && npx sass ./postcss:./dist/css --no-source-map",
105
77
  "build:postcss": "npx postcss ./src/css/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss",
106
- "build:js": "npx vite build && npm run types",
78
+ "build:js": "npm run clean && npx vite build && npm run rolldown:build && npx tsc",
107
79
  "clean": "rm -rf ./dist && rm -rf ./types && rm -f ./tsconfig.tsbuildinfo",
108
- "rollup": "npx rollup -c --watch",
80
+ "rolldown:build": "npx rolldown -c",
81
+ "rolldown:watch": "npx rolldown -c ./rolldown.config.js --watch",
109
82
  "test": "npx vitest --coverage",
110
- "types": "npx tsc && npx dts-bundle-generator --config ./dts.config.cts --silent",
111
83
  "watch:css": "npx sass ./postcss:./dist/css --no-source-map --watch",
112
84
  "watch:postcss": "npx postcss ./src/css/*.scss -d ./postcss -u autoprefixer postcss-input-range --parser postcss-scss --watch",
113
85
  "watch:js": "npx vite build --watch"
114
86
  },
115
87
  "type": "module",
116
- "types": "types/index.d.cts",
117
- "version": "0.17.0"
88
+ "types": "types/index.d.ts",
89
+ "version": "0.19.0"
118
90
  }
package/src/css/a11y.scss CHANGED
@@ -8,6 +8,6 @@
8
8
  }
9
9
 
10
10
  :where(&:not(:active, :focus, :focus-within)) {
11
- @include mixins.visuallyHidden;
11
+ @include mixins.visually-hidden;
12
12
  }
13
13
  }
@@ -14,72 +14,76 @@
14
14
 
15
15
  display: inline-flex;
16
16
  flex-flow: row nowrap;
17
- gap: .5em;
18
- background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-0)), transparent 25%);
17
+ gap: 0.5em;
18
+ background-color: color-mix(
19
+ in oklab,
20
+ var(--oui-background, var(--oui-gray-0)),
21
+ transparent 25%
22
+ );
19
23
  color: var(--oui-foreground, var(--oui-gray-8));
20
24
  line-height: 1.25;
21
25
  }
22
26
 
23
27
  :where(&-pill) {
24
28
  border-radius: 3em;
25
- padding: .5em 1em;
29
+ padding: 0.5em 1em;
26
30
  }
27
31
 
28
32
  :where(&-tag) {
29
- border-radius: .25em;
30
- padding: .5em .75em;
33
+ border-radius: 0.25em;
34
+ padding: 0.5em 0.75em;
31
35
  }
32
36
 
33
- :where(&-pill-small, &-tag-small) {
34
- font-size: .875em;
37
+ :where(&-pill--small, &-tag--small) {
38
+ font-size: 0.875em;
35
39
  }
36
40
 
37
- :where(&-pill-tiny, &-tag-tiny) {
41
+ :where(&-pill--tiny, &-tag--tiny) {
38
42
  color: color-mix(in oklab, var(--oui-foreground, var(--oui-gray-8)), transparent 12.5%);
39
- font-size: .75em;
43
+ font-size: 0.75em;
40
44
  }
41
45
 
42
- :where(&-pill-tiny) {
43
- padding: .25em .75em;
46
+ :where(&-pill--tiny) {
47
+ padding: 0.25em 0.75em;
44
48
  }
45
49
 
46
- :where(&-tag-tiny) {
47
- padding: .25em .5em;
50
+ :where(&-tag--tiny) {
51
+ padding: 0.25em 0.5em;
48
52
  }
49
53
 
50
54
  // Colors
51
55
 
52
- :where(&-pill-blue, &-tag-blue) {
56
+ :where(&-pill--blue, &-tag--blue) {
53
57
  --oui-background: var(--oui-blue-0);
54
58
  --oui-foreground: var(--oui-blue-8);
55
59
  --oui-shadow: var(--oui-blue-6);
56
60
  }
57
61
 
58
- :where(&-pill-green, &-tag-green) {
62
+ :where(&-pill--green, &-tag--green) {
59
63
  --oui-background: var(--oui-green-0);
60
64
  --oui-foreground: var(--oui-green-8);
61
65
  --oui-shadow: var(--oui-green-6);
62
66
  }
63
67
 
64
- :where(&-pill-orange, &-tag-orange) {
68
+ :where(&-pill--orange, &-tag--orange) {
65
69
  --oui-background: var(--oui-orange-0);
66
70
  --oui-foreground: var(--oui-orange-8);
67
71
  --oui-shadow: var(--oui-orange-6);
68
72
  }
69
73
 
70
- :where(&-pill-purple, &-tag-purple) {
74
+ :where(&-pill--purple, &-tag--purple) {
71
75
  --oui-background: var(--oui-purple-0);
72
76
  --oui-foreground: var(--oui-purple-8);
73
77
  --oui-shadow: var(--oui-purple-6);
74
78
  }
75
79
 
76
- :where(&-pill-red, &-tag-red) {
80
+ :where(&-pill--red, &-tag--red) {
77
81
  --oui-background: var(--oui-red-0);
78
82
  --oui-foreground: var(--oui-red-8);
79
83
  --oui-shadow: var(--oui-red-6);
80
84
  }
81
85
 
82
- :where(&-pill-yellow, &-tag-yellow) {
86
+ :where(&-pill--yellow, &-tag--yellow) {
83
87
  --oui-background: var(--oui-yellow-0);
84
88
  --oui-foreground: var(--oui-yellow-8);
85
89
  --oui-shadow: var(--oui-yellow-6);
@@ -7,54 +7,54 @@
7
7
  @include mixins.button;
8
8
  }
9
9
 
10
- :where(&-blue) {
10
+ :where(&--blue) {
11
11
  --oui-background-value: var(--oui-blue-2);
12
12
  --oui-foreground-value: var(--oui-blue-8);
13
13
  --oui-outline-value: var(--oui-blue-6);
14
14
  }
15
15
 
16
- :where(&-green) {
16
+ :where(&--green) {
17
17
  --oui-background-value: var(--oui-green-2);
18
18
  --oui-foreground-value: var(--oui-green-8);
19
19
  --oui-outline-value: var(--oui-green-6);
20
20
  }
21
21
 
22
- :where(&-orange) {
22
+ :where(&--orange) {
23
23
  --oui-background-value: var(--oui-orange-2);
24
24
  --oui-foreground-value: var(--oui-orange-8);
25
25
  --oui-outline-value: var(--oui-orange-6);
26
26
  }
27
27
 
28
- :where(&-purple) {
28
+ :where(&--purple) {
29
29
  --oui-background-value: var(--oui-purple-2);
30
30
  --oui-foreground-value: var(--oui-purple-8);
31
31
  --oui-outline-value: var(--oui-purple-6);
32
32
  }
33
33
 
34
- :where(&-red) {
34
+ :where(&--red) {
35
35
  --oui-background-value: var(--oui-red-2);
36
36
  --oui-foreground-value: var(--oui-red-8);
37
37
  --oui-outline-value: var(--oui-red-6);
38
38
  }
39
39
 
40
- :where(&-yellow) {
40
+ :where(&--yellow) {
41
41
  --oui-background-value: var(--oui-yellow-2);
42
42
  --oui-foreground-value: var(--oui-yellow-8);
43
43
  --oui-outline-value: var(--oui-yellow-6);
44
44
  }
45
45
 
46
- :where(&-rounded) {
46
+ :where(&--rounded) {
47
47
  padding: 0.5em 1em;
48
48
  flex-wrap: nowrap;
49
49
  border-radius: 5em;
50
50
  white-space: nowrap;
51
51
  }
52
52
 
53
- :where(&-small) {
53
+ :where(&--small) {
54
54
  font-size: 0.875em;
55
55
  }
56
56
 
57
- :where(&-tiny) {
57
+ :where(&--tiny) {
58
58
  --oui-foreground-percentage: 12.5%;
59
59
 
60
60
  font-size: 0.75em;