origam 2.13.0 → 2.14.1

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 (32) hide show
  1. package/CHANGELOG.md +2012 -0
  2. package/README.md +4 -4
  3. package/dist/src/components/Avatar/OrigamAvatar.vue +14 -0
  4. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +7 -1
  5. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +12 -1
  6. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +14 -2
  7. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +14 -1
  8. package/dist/src/components/Field/OrigamField.vue +9 -7
  9. package/dist/src/components/Messages/OrigamMessages.vue +1 -0
  10. package/dist/src/components/Select/OrigamSelect.vue +16 -1
  11. package/dist/src/components/TextField/OrigamTextField.vue +1 -1
  12. package/dist/src/composables/Commons/defaults.composable.cjs +1 -1
  13. package/dist/src/composables/Commons/defaults.composable.js +1 -1
  14. package/dist/src/composables/Commons/style.composable.cjs +4 -1
  15. package/dist/src/composables/Commons/style.composable.js +4 -1
  16. package/dist/src/composables/Commons/teleport-typography.composable.cjs +38 -0
  17. package/dist/src/composables/Commons/teleport-typography.composable.d.ts +86 -0
  18. package/dist/src/composables/Commons/teleport-typography.composable.js +30 -0
  19. package/dist/src/composables/index.cjs +12 -0
  20. package/dist/src/composables/index.d.ts +1 -0
  21. package/dist/src/composables/index.js +1 -0
  22. package/dist/src/consts/Commons/rounded.const.d.ts +1 -1
  23. package/dist/src/enums/Commons/rounded.enum.cjs +12 -2
  24. package/dist/src/enums/Commons/rounded.enum.d.ts +25 -0
  25. package/dist/src/enums/Commons/rounded.enum.js +10 -0
  26. package/dist/src/themes/origam.theme.cjs +2 -2
  27. package/dist/src/themes/origam.theme.js +2 -2
  28. package/dist/src/types/Commons/rounded.type.d.ts +14 -2
  29. package/dist/src/utils/Commons/color.util.cjs +2 -2
  30. package/dist/src/utils/Commons/color.util.d.ts +24 -1
  31. package/dist/src/utils/Commons/color.util.js +2 -2
  32. package/package.json +9 -3
@@ -3,15 +3,38 @@ import type { TBgFgRole, TColor, TColorType, THex, THSLA, THSVA, TIntent, TLAB,
3
3
  * Recognise any string the CSS engine treats as a colour:
4
4
  * - hex (`#abc`, `#aabbcc`, `#aabbccdd`)
5
5
  * - functional notation (`rgb()`, `rgba()`, `hsl()`, `hsla()`,
6
- * `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`)
6
+ * `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`,
7
+ * `color-mix()`)
7
8
  * - CSS variable (`var(--…)`)
8
9
  * - one of the 148 named colours OR a CSS-wide keyword
9
10
  * (`transparent`, `currentColor`, `inherit`, …)
11
+ *
12
+ * `color-mix` was added ADR-005 (Kbd pilot): it is a real CSS `<color>`
13
+ * function (e.g. `color-mix(in srgb, currentColor 8%, transparent)`, the
14
+ * literal value the pre-migration `OrigamKbd` `tonal` variant SCSS used for
15
+ * its background). Before this fix the alternation only recognised bare
16
+ * `color(...)` (CSS Color() Level 4), so `color-mix(...)` silently fell
17
+ * through — NOT a regression risk: no caller could have been relying on a
18
+ * `color-mix(...)` string being silently dropped as "expected" behaviour.
19
+ * `useElevation`'s equivalent custom-value detector
20
+ * (`CUSTOM_BOX_SHADOW_REGEX`) already listed `color-mix` — this brings
21
+ * `isCssColor` in line with it.
10
22
  */
11
23
  export declare function isCssColor(color?: string | null | false): boolean;
12
24
  /**
13
25
  * Is parsable color.
14
26
  *
27
+ * @description
28
+ * A CSS colour is "parsable" when `parseColor()` (below) can actually
29
+ * compute its RGBA components in JS — used to gate the auto-contrast
30
+ * (`getForeground`) path. `var(--…)` references are excluded because their
31
+ * final value is only known to the browser. `color-mix(...)` is excluded
32
+ * for the same reason PLUS one more: its operands are frequently
33
+ * `currentColor` or another `var(--…)`, which have no static value at all
34
+ * — `parseColor` has no case for the `color-mix` function and would throw.
35
+ * `isCssColor` recognising `color-mix` (so it still renders verbatim via
36
+ * the "custom value" style channel) does NOT make it parsable.
37
+ *
15
38
  * @param color …
16
39
  * @returns …
17
40
  */
@@ -33,10 +33,10 @@ import {
33
33
  import { chunk, clamp, has, int, padEnd } from "./commons.util.js";
34
34
  import { consoleWarn } from "./console.util.js";
35
35
  export function isCssColor(color) {
36
- return !!color && (/^(#|var\(--|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\()/i.test(color) || CSS_NAMED_COLORS.has(color.toLowerCase()));
36
+ return !!color && (/^(#|var\(--|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color-mix|color)\()/i.test(color) || CSS_NAMED_COLORS.has(color.toLowerCase()));
37
37
  }
38
38
  export function isParsableColor(color) {
39
- return isCssColor(color) && !/^((rgb|hsl)a?\()?var\(--/.test(color);
39
+ return isCssColor(color) && !/^((rgb|hsl)a?\()?var\(--/.test(color) && !/^color-mix\(/i.test(color);
40
40
  }
41
41
  export function parseColor(color) {
42
42
  if (typeof color === "number") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.13.0",
3
+ "version": "2.14.1",
4
4
  "type": "module",
5
5
  "description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
6
6
  "keywords": [
@@ -106,7 +106,13 @@
106
106
  "styles:build": "sass src/assets/scss/main.scss src/assets/css/main.css --no-source-map --style=compressed",
107
107
  "tokens:watch": "node scripts/build-tokens.mjs --watch",
108
108
  "tokens:lint": "node scripts/build-tokens.mjs --dry-run --strict",
109
- "prepublishOnly": "pnpm run build"
109
+ "guards": "node scripts/guards/run-all.mjs",
110
+ "guards:declarations": "node scripts/guards/no-declarations-in-vue.mjs",
111
+ "guards:variant-css": "node scripts/guards/no-variant-css.mjs",
112
+ "guards:instance-types": "node scripts/guards/instance-types.mjs",
113
+ "guards:naming": "node scripts/guards/file-naming.mjs",
114
+ "prepublishOnly": "pnpm run build",
115
+ "prepack": "node -e \"require('fs').copyFileSync('../../CHANGELOG.md','CHANGELOG.md')\""
110
116
  },
111
117
  "dependencies": {
112
118
  "@mdi/font": "^7.4.47",
@@ -135,7 +141,7 @@
135
141
  "@tokens-studio/sd-transforms": "^2.0.3",
136
142
  "@types/node": "^26.1.0",
137
143
  "@vitejs/plugin-vue": "^6.0.7",
138
- "sass": "^1.89.2",
144
+ "sass": "^1.102.0",
139
145
  "style-dictionary": "^5.5.0",
140
146
  "ts-transformer-keys": "^0.4.4",
141
147
  "typescript": "^6.0.3",