@roku-ui/preset 0.29.0 → 0.30.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 (3) hide show
  1. package/dist/index.cjs +29 -71
  2. package/dist/index.mjs +29 -71
  3. package/package.json +14 -14
package/dist/index.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var fs = require('node:fs');
4
3
  var unocss = require('unocss');
5
4
 
6
5
  var tailwindReset = "/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n2. [UnoCSS]: allow to override the default border color with css var `--un-default-border-color`\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: var(--un-default-border-color, #e5e7eb); /* 2 */\n}\n\n::before,\n::after {\n --un-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS.\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nMake elements with the HTML hidden attribute stay hidden by default.\n*/\n\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n";
7
6
 
8
- var baseStyle = "/* Base color scheme configuration */\n:root {\n color-scheme: light dark;\n}\n\n:root[data-scheme=\"dark\"] {\n color-scheme: dark;\n}\n\n:root[data-scheme=\"light\"] {\n color-scheme: light;\n}\n\n/* Theme layer for better organization and overrides */\n@layer theme {\n /* Default (light) theme colors */\n * {\n color-scheme: light;\n --r-surface-background-base-color: rgb(var(--r-color-surface-0));\n --r-surface-background-color: rgb(var(--r-color-surface-1));\n --r-surface-background-variant-1-color: rgb(var(--r-color-surface-2));\n --r-surface-background-variant-2-color: rgb(var(--r-color-surface-2));\n --r-surface-border-color: rgb(var(--r-color-surface-3));\n --r-surface-border-variant-color: rgb(var(--r-color-surface-4));\n --r-surface-text-color: rgb(var(--r-color-surface-7));\n --r-surface-text-dimmed-color: rgb(var(--r-color-surface-5));\n\n --r-primary-background-color: rgb(var(--r-color-primary-4));\n --r-secondary-background-color: rgb(var(--r-color-secondary-4));\n --r-tertiary-background-color: rgb(var(--r-color-tertiary-4));\n --r-error-background-color: rgb(var(--r-color-error-4));\n\n --r-primary-text-color: rgb(var(--r-color-primary-6));\n --r-secondary-text-color: rgb(var(--r-color-secondary-6));\n --r-tertiary-text-color: rgb(var(--r-color-tertiary-6));\n --r-error-text-color: rgb(var(--r-color-error-6));\n }\n\n /* Dark theme overrides */\n [data-scheme=\"dark\"] *,\n [data-scheme=\"light\"] [data-scheme=\"dark\"] * {\n color-scheme: dark;\n --r-surface-background-base-color: rgb(var(--r-color-surface-10));\n --r-surface-background-color: rgb(var(--r-color-surface-9));\n --r-surface-background-variant-1-color: rgb(var(--r-color-surface-8));\n --r-surface-background-variant-2-color: rgb(var(--r-color-surface-7));\n --r-surface-border-color: rgb(var(--r-color-surface-7));\n --r-surface-border-variant-color: rgb(var(--r-color-surface-6));\n --r-surface-text-color: rgb(var(--r-color-surface-3));\n --r-surface-text-dimmed-color: rgb(var(--r-color-surface-4));\n\n --r-primary-background-color: rgb(var(--r-color-primary-5));\n --r-secondary-background-color: rgb(var(--r-color-secondary-5));\n --r-tertiary-background-color: rgb(var(--r-color-tertiary-5));\n --r-error-background-color: rgb(var(--r-color-error-5));\n\n --r-primary-text-color: rgb(var(--r-color-primary-3));\n --r-secondary-text-color: rgb(var(--r-color-secondary-3));\n --r-tertiary-text-color: rgb(var(--r-color-tertiary-3));\n --r-error-text-color: rgb(var(--r-color-error-3));\n }\n\n /* Custom theme support - can be overridden by users */\n\n\n}";
7
+ var baseStyle = "/* Base color scheme configuration */\n:root {\n color-scheme: light dark;\n text-autospace: normal;\n}\n:root[data-scheme=\"dark\"] {\n color-scheme: dark;\n}\n\n:root[data-scheme=\"light\"] {\n color-scheme: light;\n}\n/* Theme layer for better organization and overrides */\n@layer theme {\n [data-scheme=\"light\"] *, [data-scheme=\"dark\"] [data-scheme=\"light\"] * {\n color: rgb(var(--r-text-default));\n\n --r-text-primary: var(--r-color-primary-5);\n --r-text-secondary: var(--r-color-secondary-5);\n --r-text-tertiary: var(--r-color-tertiary-5);\n --r-text-success: var(--r-color-success-5);\n --r-text-info: var(--r-color-info-5);\n --r-text-warning: var(--r-color-warning-5);\n --r-text-error: var(--r-color-error-5);\n\n --r-text-dimmed: var(--r-color-surface-3);\n --r-text-muted: var(--r-color-surface-5);\n --r-text-default: var(--r-color-surface-8);\n --r-text-highlight: var(--r-color-surface-10);\n --r-text-inverted: var(--r-color-surface-1);\n\n --r-bg-base: var(--r-color-surface-0);\n --r-bg-container: var(--r-color-surface-0);\n --r-bg-elevated: var(--r-color-surface-1);\n --r-bg-inverted: var(--r-color-surface-9);\n\n --r-bg-primary: var(--r-color-primary-5);\n --r-bg-secondary: var(--r-color-secondary-5);\n --r-bg-tertiary: var(--r-color-tertiary-5);\n --r-bg-success: var(--r-color-success-5);\n --r-bg-info: var(--r-color-info-5);\n --r-bg-warning: var(--r-color-warning-5);\n --r-bg-error: var(--r-color-error-5);\n\n --r-border-base: var(--r-color-surface-3);\n --r-border-container: var(--r-color-surface-4);\n --r-border-elevated: var(--r-color-surface-6);\n --r-border-inverted: var(--r-color-surface-9);\n }\n\n [data-scheme=\"dark\"] * {\n color: rgb(var(--r-text-default));\n\n --r-text-primary: var(--r-color-primary-4);\n --r-text-secondary: var(--r-color-secondary-4);\n --r-text-tertiary: var(--r-color-tertiary-4);\n --r-text-success: var(--r-color-success-4);\n --r-text-info: var(--r-color-info-4);\n --r-text-warning: var(--r-color-warning-4);\n --r-text-error: var(--r-color-error-4);\n\n --r-text-dimmed: var(--r-color-surface-5);\n --r-text-muted: var(--r-color-surface-3);\n --r-text-default: var(--r-color-surface-1);\n --r-text-highlight: var(--r-color-surface-0);\n --r-text-inverted: var(--r-color-surface-9);\n\n --r-bg-base: var(--r-color-surface-9);\n --r-bg-container: var(--r-color-surface-9);\n --r-bg-elevated: var(--r-color-surface-8);\n --r-bg-inverted: var(--r-color-surface-1);\n\n --r-bg-primary: var(--r-color-primary-4);\n --r-bg-secondary: var(--r-color-secondary-4);\n --r-bg-tertiary: var(--r-color-tertiary-4);\n --r-bg-success: var(--r-color-success-4);\n --r-bg-info: var(--r-color-info-4);\n --r-bg-warning: var(--r-color-warning-4);\n --r-bg-error: var(--r-color-error-4);\n\n --r-border-base: var(--r-color-surface-7);\n --r-border-container: var(--r-color-surface-6);\n --r-border-elevated: var(--r-color-surface-5);\n --r-border-inverted: var(--r-color-surface-2);\n }\n}\n\n@layer components {\n :where(*, *::before, *::after) {\n --r-scheme-bg-light: var(--l-bg, transparent);\n --r-scheme-bg-dark: var(--d-bg, var(--r-scheme-bg-light));\n --r-scheme-bg: var(--r-scheme-bg-light);\n\n --r-scheme-bg-hover-light: var(--l-bg-h, var(--r-scheme-bg));\n --r-scheme-bg-hover-dark: var(--d-bg-h, var(--r-scheme-bg-hover-light));\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-light);\n\n --r-scheme-border-light: var(--l-border, currentColor);\n --r-scheme-border-dark: var(--d-border, var(--r-scheme-border-light));\n --r-scheme-border: var(--r-scheme-border-light);\n\n --r-scheme-border-hover-light: var(--l-border-h, var(--r-scheme-border));\n --r-scheme-border-hover-dark: var(--d-border-h, var(--r-scheme-border-hover-light));\n --r-scheme-border-hover: var(--r-scheme-border-hover-light);\n\n --r-scheme-border-focus-light: var(--l-border-f, var(--r-scheme-border));\n --r-scheme-border-focus-dark: var(--d-border-f, var(--r-scheme-border-focus-light));\n --r-scheme-border-focus: var(--r-scheme-border-focus-light);\n\n --r-scheme-text-light: var(--l-text, inherit);\n --r-scheme-text-dark: var(--d-text, var(--r-scheme-text-light));\n --r-scheme-text: var(--r-scheme-text-light);\n\n --r-scheme-text-hover-light: var(--l-text-h, var(--r-scheme-text));\n --r-scheme-text-hover-dark: var(--d-text-h, var(--r-scheme-text-hover-light));\n --r-scheme-text-hover: var(--r-scheme-text-hover-light);\n\n --r-scheme-placeholder-light: var(--l-placeholder, var(--r-scheme-text));\n --r-scheme-placeholder-dark: var(--d-placeholder, var(--r-scheme-placeholder-light));\n --r-scheme-placeholder: var(--r-scheme-placeholder-light);\n\n --r-scheme-outline-light: var(--l-outline, transparent);\n --r-scheme-outline-dark: var(--d-outline, var(--r-scheme-outline-light));\n --r-scheme-outline: var(--r-scheme-outline-light);\n }\n\n [data-scheme=\"dark\"] :where(*, *::before, *::after),\n [data-scheme=\"light\"] [data-scheme=\"dark\"] :where(*, *::before, *::after) {\n --r-scheme-bg: var(--r-scheme-bg-dark);\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-dark);\n --r-scheme-border: var(--r-scheme-border-dark);\n --r-scheme-border-hover: var(--r-scheme-border-hover-dark);\n --r-scheme-border-focus: var(--r-scheme-border-focus-dark);\n --r-scheme-text: var(--r-scheme-text-dark);\n --r-scheme-text-hover: var(--r-scheme-text-hover-dark);\n --r-scheme-placeholder: var(--r-scheme-placeholder-dark);\n --r-scheme-outline: var(--r-scheme-outline-dark);\n }\n\n [data-scheme=\"dark\"] [data-scheme=\"light\"] :where(*, *::before, *::after) {\n --r-scheme-bg: var(--r-scheme-bg-light);\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-light);\n --r-scheme-border: var(--r-scheme-border-light);\n --r-scheme-border-hover: var(--r-scheme-border-hover-light);\n --r-scheme-border-focus: var(--r-scheme-border-focus-light);\n --r-scheme-text: var(--r-scheme-text-light);\n --r-scheme-text-hover: var(--r-scheme-text-hover-light);\n --r-scheme-placeholder: var(--r-scheme-placeholder-light);\n --r-scheme-outline: var(--r-scheme-outline-light);\n }\n}\n";
9
8
 
10
- const colorKeys = ['surface', 'primary', 'secondary', 'tertiary', 'error'];
9
+ const colorKeys = ['surface', 'primary', 'secondary', 'tertiary', 'info', 'warning', 'error'];
11
10
  const colors = {};
12
11
  for (const key of colorKeys) {
13
12
  const obj = {};
@@ -16,50 +15,45 @@ for (const key of colorKeys) {
16
15
  }
17
16
  colors[key] = obj;
18
17
  }
18
+ const shortcuts = {
19
+ // Legacy component integration shortcuts (keep for backward compatibility)
20
+ 'custom-colors': 'border text-[var(--r-scheme-text)] bg-[var(--r-scheme-bg)] border-[var(--r-scheme-border)] hover:bg-[var(--r-scheme-bg-hover)] hover:text-[var(--r-scheme-text-hover)] focus-visible:outline-[var(--r-scheme-outline)]',
21
+ 'custom-input-colors': 'border bg-[var(--r-scheme-bg)] text-[var(--r-scheme-text)] placeholder-[var(--r-scheme-placeholder)] border-[var(--r-scheme-border)] focus:border-[var(--r-scheme-border-focus)] hover:bg-[var(--r-scheme-bg-hover)]',
22
+ };
19
23
  function rokuPresetImpl() {
20
- let file = '';
21
- try {
22
- file = fs.readFileSync('node_modules/@roku-ui/vue/dist/index.js', 'utf8');
23
- }
24
- catch (_a) { }
25
24
  // Dynamic rules generator - replaces many static shortcuts
26
25
  const dynamicRules = [
27
- // Color-mix transparency: bg-{color}-mix-{percentage}
28
- [/^bg-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
29
- 'background-color': `color-mix(in oklch, var(--r-${color}-background-color) ${percentage}%, transparent)`,
26
+ // Standard color backgrounds: bg-{color}
27
+ [/^bg-(primary|secondary|tertiary|success|error|info|warning)$/, ([, color]) => ({
28
+ 'background-color': `rgb(var(--r-bg-${color}) / var(--un-bg-opacity, 1))`,
30
29
  })],
31
- // Color-mix transparency: text-{color}-mix-{percentage}
32
- [/^text-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
33
- color: `color-mix(in oklch, var(--r-${color}-text-color) ${percentage}%, transparent)`,
30
+ // Standard color text: text-{color}
31
+ [/^text-(dimmed|muted|default|highlight|inverted)$/, ([, variant]) => ({
32
+ color: `rgb(var(--r-text-${variant}) / var(--un-text-opacity, 1))`,
34
33
  })],
35
- // Color-mix transparency: border-{color}-mix-{percentage}
36
- [/^border-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
37
- 'border-color': `color-mix(in oklch, var(--r-${color}-background-color) ${percentage}%, transparent)`,
34
+ [/^bg-(base|container|elevated|inverted)$/, ([, variant]) => ({
35
+ 'background-color': `rgb(var(--r-bg-${variant}) / var(--un-bg-opacity, 1))`,
38
36
  })],
39
- // Standard color backgrounds: bg-{color}
40
- [/^bg-(secondary|tertiary|error)$/, ([, color]) => ({
41
- 'background-color': `var(--r-${color}-background-color)`,
37
+ [/^border-(base|container|elevated|inverted)$/, ([, color]) => ({
38
+ 'border-color': `rgb(var(--r-border-${color}) / var(--un-border-opacity, 1))`,
42
39
  })],
43
- // Standard color text: text-{color}
44
- [/^text-(secondary|tertiary|error)$/, ([, color]) => ({
45
- color: `var(--r-${color}-text-color)`,
40
+ [/^text-(primary|secondary|tertiary|success|error|info|warning)$/, ([, color]) => ({
41
+ color: `rgb(var(--r-text-${color}) / var(--un-text-opacity, 1))`,
46
42
  })],
47
43
  // Note: border-{color} handled via shortcuts below to avoid raw declarations
48
44
  // Standard color outlines: outline-{color}
49
- [/^outline-(primary|secondary|tertiary|error)$/, ([, color]) => ({
50
- 'outline-color': `var(--r-${color}-background-color)`,
51
- })],
52
- // Surface variants: bg-surface-variant-{number}
53
- [/^bg-surface-variant-([12])$/, ([, variant]) => ({
54
- 'background-color': `var(--r-surface-background-variant-${variant}-color)`,
55
- })],
56
- // Surface border variants: border-surface-variant
57
- [/^border-surface-variant$/, () => ({
58
- 'border-color': 'var(--r-surface-border-variant-color)',
45
+ [/^outline-(primary|secondary|tertiary|error|info|warning)$/, ([, color]) => ({
46
+ 'outline-color': `rgb(var(--r-bg-${color}) / var(--un-outline-opacity, 1))`,
59
47
  })],
60
48
  ];
61
49
  return {
62
- name: 'roku',
50
+ name: '@roku-ui/preset',
51
+ content: {
52
+ pipeline: {
53
+ include: [/\.js$/],
54
+ },
55
+ filesystem: ['**/node_modules/@roku-ui/vue/dist/index.js'],
56
+ },
63
57
  theme: {
64
58
  colors: {
65
59
  ...colors,
@@ -70,40 +64,7 @@ function rokuPresetImpl() {
70
64
  // Dynamic rules replace many static shortcuts
71
65
  ...dynamicRules,
72
66
  ],
73
- shortcuts: {
74
- // Legacy component integration shortcuts (keep for backward compatibility)
75
- 'custom-colors': 'border dark:text-[var(--d-text)] text-[var(--l-text)] dark:bg-[var(--d-bg)] bg-[var(--l-bg)] dark:border-[var(--d-border)] border-[var(--l-border)] dark:hover:bg-[var(--d-bg-h)] hover:bg-[var(--l-bg-h)] hover:text-[var(--l-text-h)] dark:hover:text-[var(--d-text-h)] focus-visible:outline-[--l-outline] dark:focus-visible:outline-[--d-outline]',
76
- 'custom-input-colors': 'border bg-[var(--l-bg)] dark:bg-[var(--d-bg)] text-[var(--l-text)] dark:text-[var(--d-text)] placeholder-[var(--l-placeholder)] dark:placeholder-[var(--d-placeholder)] border-[var(--l-border)] dark:border-[var(--d-border)] focus:border-[var(--l-border-f)] dark:focus:border-[var(--d-border-f)]',
77
- // Essential semantic color shortcuts
78
- 'bg-surface': 'bg-[--r-surface-background-color]',
79
- 'bg-surface-base': 'bg-[--r-surface-background-base-color]',
80
- 'text-surface': 'text-[--r-surface-text-color]',
81
- 'text-surface-dimmed': 'text-[--r-surface-text-dimmed-color]',
82
- 'border-surface': 'border-[--r-surface-border-color]',
83
- // Core color shortcuts (most commonly used)
84
- 'bg-primary': 'bg-[--r-primary-background-color]',
85
- 'text-primary': 'text-[--r-primary-text-color]',
86
- // Background shortcuts for other semantic colors
87
- 'bg-secondary': 'bg-[--r-secondary-background-color]',
88
- 'bg-tertiary': 'bg-[--r-tertiary-background-color]',
89
- 'bg-error': 'bg-[--r-error-background-color]',
90
- // Text shortcuts for other semantic colors
91
- 'text-secondary': 'text-[--r-secondary-text-color]',
92
- 'text-tertiary': 'text-[--r-tertiary-text-color]',
93
- 'text-error': 'text-[--r-error-text-color]',
94
- // Border color shortcuts using arbitrary values
95
- 'border-primary': 'border-[--r-primary-background-color]',
96
- 'border-secondary': 'border-[--r-secondary-background-color]',
97
- 'border-tertiary': 'border-[--r-tertiary-background-color]',
98
- 'border-error': 'border-[--r-error-background-color]',
99
- // Outline color shortcuts
100
- 'outline-primary': 'outline-[--r-primary-background-color]',
101
- 'outline-secondary': 'outline-[--r-secondary-background-color]',
102
- 'outline-tertiary': 'outline-[--r-tertiary-background-color]',
103
- 'outline-error': 'outline-[--r-error-background-color]',
104
- // Note: Other color combinations (bg-secondary, text-tertiary, etc.) are handled by dynamic rules
105
- // Note: Color-mix transparency (bg-primary-mix-30, etc.) is handled by dynamic rules
106
- },
67
+ shortcuts,
107
68
  presets: [
108
69
  unocss.presetWind4({
109
70
  dark: {
@@ -120,9 +81,6 @@ function rokuPresetImpl() {
120
81
  },
121
82
  }),
122
83
  ],
123
- content: {
124
- inline: [file],
125
- },
126
84
  preflights: [
127
85
  { getCSS: () => tailwindReset },
128
86
  {
package/dist/index.mjs CHANGED
@@ -1,11 +1,10 @@
1
- import fs from 'node:fs';
2
1
  import { presetWind4, presetTypography, presetIcons } from 'unocss';
3
2
 
4
3
  var tailwindReset = "/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n2. [UnoCSS]: allow to override the default border color with css var `--un-default-border-color`\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: var(--un-default-border-color, #e5e7eb); /* 2 */\n}\n\n::before,\n::after {\n --un-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS.\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nMake elements with the HTML hidden attribute stay hidden by default.\n*/\n\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n";
5
4
 
6
- var baseStyle = "/* Base color scheme configuration */\n:root {\n color-scheme: light dark;\n}\n\n:root[data-scheme=\"dark\"] {\n color-scheme: dark;\n}\n\n:root[data-scheme=\"light\"] {\n color-scheme: light;\n}\n\n/* Theme layer for better organization and overrides */\n@layer theme {\n /* Default (light) theme colors */\n * {\n color-scheme: light;\n --r-surface-background-base-color: rgb(var(--r-color-surface-0));\n --r-surface-background-color: rgb(var(--r-color-surface-1));\n --r-surface-background-variant-1-color: rgb(var(--r-color-surface-2));\n --r-surface-background-variant-2-color: rgb(var(--r-color-surface-2));\n --r-surface-border-color: rgb(var(--r-color-surface-3));\n --r-surface-border-variant-color: rgb(var(--r-color-surface-4));\n --r-surface-text-color: rgb(var(--r-color-surface-7));\n --r-surface-text-dimmed-color: rgb(var(--r-color-surface-5));\n\n --r-primary-background-color: rgb(var(--r-color-primary-4));\n --r-secondary-background-color: rgb(var(--r-color-secondary-4));\n --r-tertiary-background-color: rgb(var(--r-color-tertiary-4));\n --r-error-background-color: rgb(var(--r-color-error-4));\n\n --r-primary-text-color: rgb(var(--r-color-primary-6));\n --r-secondary-text-color: rgb(var(--r-color-secondary-6));\n --r-tertiary-text-color: rgb(var(--r-color-tertiary-6));\n --r-error-text-color: rgb(var(--r-color-error-6));\n }\n\n /* Dark theme overrides */\n [data-scheme=\"dark\"] *,\n [data-scheme=\"light\"] [data-scheme=\"dark\"] * {\n color-scheme: dark;\n --r-surface-background-base-color: rgb(var(--r-color-surface-10));\n --r-surface-background-color: rgb(var(--r-color-surface-9));\n --r-surface-background-variant-1-color: rgb(var(--r-color-surface-8));\n --r-surface-background-variant-2-color: rgb(var(--r-color-surface-7));\n --r-surface-border-color: rgb(var(--r-color-surface-7));\n --r-surface-border-variant-color: rgb(var(--r-color-surface-6));\n --r-surface-text-color: rgb(var(--r-color-surface-3));\n --r-surface-text-dimmed-color: rgb(var(--r-color-surface-4));\n\n --r-primary-background-color: rgb(var(--r-color-primary-5));\n --r-secondary-background-color: rgb(var(--r-color-secondary-5));\n --r-tertiary-background-color: rgb(var(--r-color-tertiary-5));\n --r-error-background-color: rgb(var(--r-color-error-5));\n\n --r-primary-text-color: rgb(var(--r-color-primary-3));\n --r-secondary-text-color: rgb(var(--r-color-secondary-3));\n --r-tertiary-text-color: rgb(var(--r-color-tertiary-3));\n --r-error-text-color: rgb(var(--r-color-error-3));\n }\n\n /* Custom theme support - can be overridden by users */\n\n\n}";
5
+ var baseStyle = "/* Base color scheme configuration */\n:root {\n color-scheme: light dark;\n text-autospace: normal;\n}\n:root[data-scheme=\"dark\"] {\n color-scheme: dark;\n}\n\n:root[data-scheme=\"light\"] {\n color-scheme: light;\n}\n/* Theme layer for better organization and overrides */\n@layer theme {\n [data-scheme=\"light\"] *, [data-scheme=\"dark\"] [data-scheme=\"light\"] * {\n color: rgb(var(--r-text-default));\n\n --r-text-primary: var(--r-color-primary-5);\n --r-text-secondary: var(--r-color-secondary-5);\n --r-text-tertiary: var(--r-color-tertiary-5);\n --r-text-success: var(--r-color-success-5);\n --r-text-info: var(--r-color-info-5);\n --r-text-warning: var(--r-color-warning-5);\n --r-text-error: var(--r-color-error-5);\n\n --r-text-dimmed: var(--r-color-surface-3);\n --r-text-muted: var(--r-color-surface-5);\n --r-text-default: var(--r-color-surface-8);\n --r-text-highlight: var(--r-color-surface-10);\n --r-text-inverted: var(--r-color-surface-1);\n\n --r-bg-base: var(--r-color-surface-0);\n --r-bg-container: var(--r-color-surface-0);\n --r-bg-elevated: var(--r-color-surface-1);\n --r-bg-inverted: var(--r-color-surface-9);\n\n --r-bg-primary: var(--r-color-primary-5);\n --r-bg-secondary: var(--r-color-secondary-5);\n --r-bg-tertiary: var(--r-color-tertiary-5);\n --r-bg-success: var(--r-color-success-5);\n --r-bg-info: var(--r-color-info-5);\n --r-bg-warning: var(--r-color-warning-5);\n --r-bg-error: var(--r-color-error-5);\n\n --r-border-base: var(--r-color-surface-3);\n --r-border-container: var(--r-color-surface-4);\n --r-border-elevated: var(--r-color-surface-6);\n --r-border-inverted: var(--r-color-surface-9);\n }\n\n [data-scheme=\"dark\"] * {\n color: rgb(var(--r-text-default));\n\n --r-text-primary: var(--r-color-primary-4);\n --r-text-secondary: var(--r-color-secondary-4);\n --r-text-tertiary: var(--r-color-tertiary-4);\n --r-text-success: var(--r-color-success-4);\n --r-text-info: var(--r-color-info-4);\n --r-text-warning: var(--r-color-warning-4);\n --r-text-error: var(--r-color-error-4);\n\n --r-text-dimmed: var(--r-color-surface-5);\n --r-text-muted: var(--r-color-surface-3);\n --r-text-default: var(--r-color-surface-1);\n --r-text-highlight: var(--r-color-surface-0);\n --r-text-inverted: var(--r-color-surface-9);\n\n --r-bg-base: var(--r-color-surface-9);\n --r-bg-container: var(--r-color-surface-9);\n --r-bg-elevated: var(--r-color-surface-8);\n --r-bg-inverted: var(--r-color-surface-1);\n\n --r-bg-primary: var(--r-color-primary-4);\n --r-bg-secondary: var(--r-color-secondary-4);\n --r-bg-tertiary: var(--r-color-tertiary-4);\n --r-bg-success: var(--r-color-success-4);\n --r-bg-info: var(--r-color-info-4);\n --r-bg-warning: var(--r-color-warning-4);\n --r-bg-error: var(--r-color-error-4);\n\n --r-border-base: var(--r-color-surface-7);\n --r-border-container: var(--r-color-surface-6);\n --r-border-elevated: var(--r-color-surface-5);\n --r-border-inverted: var(--r-color-surface-2);\n }\n}\n\n@layer components {\n :where(*, *::before, *::after) {\n --r-scheme-bg-light: var(--l-bg, transparent);\n --r-scheme-bg-dark: var(--d-bg, var(--r-scheme-bg-light));\n --r-scheme-bg: var(--r-scheme-bg-light);\n\n --r-scheme-bg-hover-light: var(--l-bg-h, var(--r-scheme-bg));\n --r-scheme-bg-hover-dark: var(--d-bg-h, var(--r-scheme-bg-hover-light));\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-light);\n\n --r-scheme-border-light: var(--l-border, currentColor);\n --r-scheme-border-dark: var(--d-border, var(--r-scheme-border-light));\n --r-scheme-border: var(--r-scheme-border-light);\n\n --r-scheme-border-hover-light: var(--l-border-h, var(--r-scheme-border));\n --r-scheme-border-hover-dark: var(--d-border-h, var(--r-scheme-border-hover-light));\n --r-scheme-border-hover: var(--r-scheme-border-hover-light);\n\n --r-scheme-border-focus-light: var(--l-border-f, var(--r-scheme-border));\n --r-scheme-border-focus-dark: var(--d-border-f, var(--r-scheme-border-focus-light));\n --r-scheme-border-focus: var(--r-scheme-border-focus-light);\n\n --r-scheme-text-light: var(--l-text, inherit);\n --r-scheme-text-dark: var(--d-text, var(--r-scheme-text-light));\n --r-scheme-text: var(--r-scheme-text-light);\n\n --r-scheme-text-hover-light: var(--l-text-h, var(--r-scheme-text));\n --r-scheme-text-hover-dark: var(--d-text-h, var(--r-scheme-text-hover-light));\n --r-scheme-text-hover: var(--r-scheme-text-hover-light);\n\n --r-scheme-placeholder-light: var(--l-placeholder, var(--r-scheme-text));\n --r-scheme-placeholder-dark: var(--d-placeholder, var(--r-scheme-placeholder-light));\n --r-scheme-placeholder: var(--r-scheme-placeholder-light);\n\n --r-scheme-outline-light: var(--l-outline, transparent);\n --r-scheme-outline-dark: var(--d-outline, var(--r-scheme-outline-light));\n --r-scheme-outline: var(--r-scheme-outline-light);\n }\n\n [data-scheme=\"dark\"] :where(*, *::before, *::after),\n [data-scheme=\"light\"] [data-scheme=\"dark\"] :where(*, *::before, *::after) {\n --r-scheme-bg: var(--r-scheme-bg-dark);\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-dark);\n --r-scheme-border: var(--r-scheme-border-dark);\n --r-scheme-border-hover: var(--r-scheme-border-hover-dark);\n --r-scheme-border-focus: var(--r-scheme-border-focus-dark);\n --r-scheme-text: var(--r-scheme-text-dark);\n --r-scheme-text-hover: var(--r-scheme-text-hover-dark);\n --r-scheme-placeholder: var(--r-scheme-placeholder-dark);\n --r-scheme-outline: var(--r-scheme-outline-dark);\n }\n\n [data-scheme=\"dark\"] [data-scheme=\"light\"] :where(*, *::before, *::after) {\n --r-scheme-bg: var(--r-scheme-bg-light);\n --r-scheme-bg-hover: var(--r-scheme-bg-hover-light);\n --r-scheme-border: var(--r-scheme-border-light);\n --r-scheme-border-hover: var(--r-scheme-border-hover-light);\n --r-scheme-border-focus: var(--r-scheme-border-focus-light);\n --r-scheme-text: var(--r-scheme-text-light);\n --r-scheme-text-hover: var(--r-scheme-text-hover-light);\n --r-scheme-placeholder: var(--r-scheme-placeholder-light);\n --r-scheme-outline: var(--r-scheme-outline-light);\n }\n}\n";
7
6
 
8
- const colorKeys = ['surface', 'primary', 'secondary', 'tertiary', 'error'];
7
+ const colorKeys = ['surface', 'primary', 'secondary', 'tertiary', 'info', 'warning', 'error'];
9
8
  const colors = {};
10
9
  for (const key of colorKeys) {
11
10
  const obj = {};
@@ -14,50 +13,45 @@ for (const key of colorKeys) {
14
13
  }
15
14
  colors[key] = obj;
16
15
  }
16
+ const shortcuts = {
17
+ // Legacy component integration shortcuts (keep for backward compatibility)
18
+ 'custom-colors': 'border text-[var(--r-scheme-text)] bg-[var(--r-scheme-bg)] border-[var(--r-scheme-border)] hover:bg-[var(--r-scheme-bg-hover)] hover:text-[var(--r-scheme-text-hover)] focus-visible:outline-[var(--r-scheme-outline)]',
19
+ 'custom-input-colors': 'border bg-[var(--r-scheme-bg)] text-[var(--r-scheme-text)] placeholder-[var(--r-scheme-placeholder)] border-[var(--r-scheme-border)] focus:border-[var(--r-scheme-border-focus)] hover:bg-[var(--r-scheme-bg-hover)]',
20
+ };
17
21
  function rokuPresetImpl() {
18
- let file = '';
19
- try {
20
- file = fs.readFileSync('node_modules/@roku-ui/vue/dist/index.js', 'utf8');
21
- }
22
- catch (_a) { }
23
22
  // Dynamic rules generator - replaces many static shortcuts
24
23
  const dynamicRules = [
25
- // Color-mix transparency: bg-{color}-mix-{percentage}
26
- [/^bg-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
27
- 'background-color': `color-mix(in oklch, var(--r-${color}-background-color) ${percentage}%, transparent)`,
24
+ // Standard color backgrounds: bg-{color}
25
+ [/^bg-(primary|secondary|tertiary|success|error|info|warning)$/, ([, color]) => ({
26
+ 'background-color': `rgb(var(--r-bg-${color}) / var(--un-bg-opacity, 1))`,
28
27
  })],
29
- // Color-mix transparency: text-{color}-mix-{percentage}
30
- [/^text-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
31
- color: `color-mix(in oklch, var(--r-${color}-text-color) ${percentage}%, transparent)`,
28
+ // Standard color text: text-{color}
29
+ [/^text-(dimmed|muted|default|highlight|inverted)$/, ([, variant]) => ({
30
+ color: `rgb(var(--r-text-${variant}) / var(--un-text-opacity, 1))`,
32
31
  })],
33
- // Color-mix transparency: border-{color}-mix-{percentage}
34
- [/^border-([a-z]+)-mix-(\d+)$/, ([, color, percentage]) => ({
35
- 'border-color': `color-mix(in oklch, var(--r-${color}-background-color) ${percentage}%, transparent)`,
32
+ [/^bg-(base|container|elevated|inverted)$/, ([, variant]) => ({
33
+ 'background-color': `rgb(var(--r-bg-${variant}) / var(--un-bg-opacity, 1))`,
36
34
  })],
37
- // Standard color backgrounds: bg-{color}
38
- [/^bg-(secondary|tertiary|error)$/, ([, color]) => ({
39
- 'background-color': `var(--r-${color}-background-color)`,
35
+ [/^border-(base|container|elevated|inverted)$/, ([, color]) => ({
36
+ 'border-color': `rgb(var(--r-border-${color}) / var(--un-border-opacity, 1))`,
40
37
  })],
41
- // Standard color text: text-{color}
42
- [/^text-(secondary|tertiary|error)$/, ([, color]) => ({
43
- color: `var(--r-${color}-text-color)`,
38
+ [/^text-(primary|secondary|tertiary|success|error|info|warning)$/, ([, color]) => ({
39
+ color: `rgb(var(--r-text-${color}) / var(--un-text-opacity, 1))`,
44
40
  })],
45
41
  // Note: border-{color} handled via shortcuts below to avoid raw declarations
46
42
  // Standard color outlines: outline-{color}
47
- [/^outline-(primary|secondary|tertiary|error)$/, ([, color]) => ({
48
- 'outline-color': `var(--r-${color}-background-color)`,
49
- })],
50
- // Surface variants: bg-surface-variant-{number}
51
- [/^bg-surface-variant-([12])$/, ([, variant]) => ({
52
- 'background-color': `var(--r-surface-background-variant-${variant}-color)`,
53
- })],
54
- // Surface border variants: border-surface-variant
55
- [/^border-surface-variant$/, () => ({
56
- 'border-color': 'var(--r-surface-border-variant-color)',
43
+ [/^outline-(primary|secondary|tertiary|error|info|warning)$/, ([, color]) => ({
44
+ 'outline-color': `rgb(var(--r-bg-${color}) / var(--un-outline-opacity, 1))`,
57
45
  })],
58
46
  ];
59
47
  return {
60
- name: 'roku',
48
+ name: '@roku-ui/preset',
49
+ content: {
50
+ pipeline: {
51
+ include: [/\.js$/],
52
+ },
53
+ filesystem: ['**/node_modules/@roku-ui/vue/dist/index.js'],
54
+ },
61
55
  theme: {
62
56
  colors: {
63
57
  ...colors,
@@ -68,40 +62,7 @@ function rokuPresetImpl() {
68
62
  // Dynamic rules replace many static shortcuts
69
63
  ...dynamicRules,
70
64
  ],
71
- shortcuts: {
72
- // Legacy component integration shortcuts (keep for backward compatibility)
73
- 'custom-colors': 'border dark:text-[var(--d-text)] text-[var(--l-text)] dark:bg-[var(--d-bg)] bg-[var(--l-bg)] dark:border-[var(--d-border)] border-[var(--l-border)] dark:hover:bg-[var(--d-bg-h)] hover:bg-[var(--l-bg-h)] hover:text-[var(--l-text-h)] dark:hover:text-[var(--d-text-h)] focus-visible:outline-[--l-outline] dark:focus-visible:outline-[--d-outline]',
74
- 'custom-input-colors': 'border bg-[var(--l-bg)] dark:bg-[var(--d-bg)] text-[var(--l-text)] dark:text-[var(--d-text)] placeholder-[var(--l-placeholder)] dark:placeholder-[var(--d-placeholder)] border-[var(--l-border)] dark:border-[var(--d-border)] focus:border-[var(--l-border-f)] dark:focus:border-[var(--d-border-f)]',
75
- // Essential semantic color shortcuts
76
- 'bg-surface': 'bg-[--r-surface-background-color]',
77
- 'bg-surface-base': 'bg-[--r-surface-background-base-color]',
78
- 'text-surface': 'text-[--r-surface-text-color]',
79
- 'text-surface-dimmed': 'text-[--r-surface-text-dimmed-color]',
80
- 'border-surface': 'border-[--r-surface-border-color]',
81
- // Core color shortcuts (most commonly used)
82
- 'bg-primary': 'bg-[--r-primary-background-color]',
83
- 'text-primary': 'text-[--r-primary-text-color]',
84
- // Background shortcuts for other semantic colors
85
- 'bg-secondary': 'bg-[--r-secondary-background-color]',
86
- 'bg-tertiary': 'bg-[--r-tertiary-background-color]',
87
- 'bg-error': 'bg-[--r-error-background-color]',
88
- // Text shortcuts for other semantic colors
89
- 'text-secondary': 'text-[--r-secondary-text-color]',
90
- 'text-tertiary': 'text-[--r-tertiary-text-color]',
91
- 'text-error': 'text-[--r-error-text-color]',
92
- // Border color shortcuts using arbitrary values
93
- 'border-primary': 'border-[--r-primary-background-color]',
94
- 'border-secondary': 'border-[--r-secondary-background-color]',
95
- 'border-tertiary': 'border-[--r-tertiary-background-color]',
96
- 'border-error': 'border-[--r-error-background-color]',
97
- // Outline color shortcuts
98
- 'outline-primary': 'outline-[--r-primary-background-color]',
99
- 'outline-secondary': 'outline-[--r-secondary-background-color]',
100
- 'outline-tertiary': 'outline-[--r-tertiary-background-color]',
101
- 'outline-error': 'outline-[--r-error-background-color]',
102
- // Note: Other color combinations (bg-secondary, text-tertiary, etc.) are handled by dynamic rules
103
- // Note: Color-mix transparency (bg-primary-mix-30, etc.) is handled by dynamic rules
104
- },
65
+ shortcuts,
105
66
  presets: [
106
67
  presetWind4({
107
68
  dark: {
@@ -118,9 +79,6 @@ function rokuPresetImpl() {
118
79
  },
119
80
  }),
120
81
  ],
121
- content: {
122
- inline: [file],
123
- },
124
82
  preflights: [
125
83
  { getCSS: () => tailwindReset },
126
84
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@roku-ui/preset",
3
3
  "type": "module",
4
- "version": "0.29.0",
4
+ "version": "0.30.0",
5
5
  "author": "Jianqi Pan <jannchie@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,21 +29,21 @@
29
29
  ],
30
30
  "devDependencies": {
31
31
  "@jannchie/eslint-config": "^3.7.1",
32
- "@rollup/plugin-commonjs": "^28.0.6",
33
- "@rollup/plugin-node-resolve": "^16.0.1",
34
- "@rollup/plugin-typescript": "^12.1.4",
35
- "@types/node": "^24.3.1",
36
- "@unocss/preset-icons": "66.5.0",
37
- "@unocss/preset-mini": "66.5.0",
38
- "@unocss/reset": "66.5.0",
39
- "eslint": "^9.35.0",
40
- "eslint-plugin-format": "^1.0.1",
41
- "rollup": "^4.50.0",
32
+ "@rollup/plugin-commonjs": "^29.0.0",
33
+ "@rollup/plugin-node-resolve": "^16.0.3",
34
+ "@rollup/plugin-typescript": "^12.3.0",
35
+ "@types/node": "^24.10.1",
36
+ "@unocss/preset-icons": "66.5.9",
37
+ "@unocss/preset-mini": "66.5.9",
38
+ "@unocss/reset": "66.5.9",
39
+ "eslint": "^9.39.1",
40
+ "eslint-plugin-format": "^1.0.2",
41
+ "rollup": "^4.53.3",
42
42
  "rollup-plugin-dts": "^6.2.3",
43
- "rollup-plugin-import-css": "^4.0.2",
43
+ "rollup-plugin-import-css": "^4.1.2",
44
44
  "rollup-plugin-string": "^3.0.0",
45
- "typescript": "^5.9.2",
46
- "unocss": "66.5.0",
45
+ "typescript": "^5.9.3",
46
+ "unocss": "66.5.9",
47
47
  "unocss-preset-scrollbar": "^3.2.0"
48
48
  },
49
49
  "scripts": {