oneslash-design-system 2.0.4 → 2.1.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.
- package/README.md +1 -0
- package/dist/components/textField.jsx +3 -3
- package/dist/components/textarea.jsx +3 -3
- package/dist/designTokens.d.ts +918 -0
- package/dist/designTokens.js +47 -2
- package/dist/themes/clay-auto.css +251 -0
- package/dist/themes/clay.css +167 -0
- package/dist/themes/indigo-auto.css +251 -0
- package/dist/themes/indigo.css +167 -0
- package/dist/themes/wine-auto.css +251 -0
- package/dist/themes/wine.css +167 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ The package ships Tailwind class names, CSS variables and untranspiled `.jsx`. E
|
|
|
10
10
|
- light/dark toggle that sets `.dark` on `<html>`: `oneslash-design-system/themes/default.css`
|
|
11
11
|
- follows the OS: `oneslash-design-system/themes/default-auto.css` (`.light` opts out of OS dark)
|
|
12
12
|
- Scindo: `themes/forest.css` / `themes/forest-auto.css`
|
|
13
|
+
- other brand themes: `themes/clay.css`, `themes/indigo.css`, `themes/wine.css` (each with an `-auto` version)
|
|
13
14
|
2. **Tailwind v3:** `presets: [require("oneslash-design-system/tailwind")]` (toggle) or `oneslash-design-system/tailwind-auto` (OS). Without the preset the components render unstyled.
|
|
14
15
|
3. **Tailwind v4:** import `oneslash-design-system/theme.css` (toggle) or `theme-auto.css` (OS), plus `typography.css` if you want the type scale.
|
|
15
16
|
4. **Next.js:** `transpilePackages: ["oneslash-design-system"]` in `next.config`.
|
|
@@ -24,15 +24,15 @@ export default function TextField(_a) {
|
|
|
24
24
|
var colorClasses = disabled
|
|
25
25
|
? 'bg-transparent text-fg-disabled cursor-not-allowed'
|
|
26
26
|
: 'bg-background-default text-fg-primary';
|
|
27
|
-
// Border: error > focus (
|
|
27
|
+
// Border: error > focus (1px offset outline, the same weight as the border) > hover > default
|
|
28
28
|
var getBorderColor = function () {
|
|
29
29
|
if (error) {
|
|
30
|
-
return 'border-error-main focus:outline focus:outline-
|
|
30
|
+
return 'border-error-main focus:outline focus:outline-1 focus:outline-offset-2 focus:outline-error-main';
|
|
31
31
|
}
|
|
32
32
|
if (disabled) {
|
|
33
33
|
return 'border-fg-disabled';
|
|
34
34
|
}
|
|
35
|
-
return "border-fg-disabled\n hover:border-fg-secondary\n focus:outline focus:outline-
|
|
35
|
+
return "border-fg-disabled\n hover:border-fg-secondary\n focus:outline focus:outline-1 focus:outline-offset-2 focus:outline-fg-primary";
|
|
36
36
|
};
|
|
37
37
|
var errorId = "".concat(id, "-error");
|
|
38
38
|
// Get inputMode for mobile keyboard optimization
|
|
@@ -48,15 +48,15 @@ export default function Textarea(_a) {
|
|
|
48
48
|
var colorClasses = disabled
|
|
49
49
|
? 'bg-transparent text-fg-disabled cursor-not-allowed'
|
|
50
50
|
: 'bg-background-default text-fg-primary';
|
|
51
|
-
// Border: error > focus (
|
|
51
|
+
// Border: error > focus (1px offset outline, the same weight as the border) > hover > default
|
|
52
52
|
var getBorderColor = function () {
|
|
53
53
|
if (error) {
|
|
54
|
-
return 'border-error-main focus:outline focus:outline-
|
|
54
|
+
return 'border-error-main focus:outline focus:outline-1 focus:outline-offset-2 focus:outline-error-main';
|
|
55
55
|
}
|
|
56
56
|
if (disabled) {
|
|
57
57
|
return 'border-fg-disabled';
|
|
58
58
|
}
|
|
59
|
-
return "border-fg-disabled\n hover:border-fg-secondary\n focus:outline focus:outline-
|
|
59
|
+
return "border-fg-disabled\n hover:border-fg-secondary\n focus:outline focus:outline-1 focus:outline-offset-2 focus:outline-fg-primary";
|
|
60
60
|
};
|
|
61
61
|
var containerClasses = "\n ".concat(colorClasses, "\n ").concat(baseClasses, "\n ").concat(sizeClasses, "\n ").concat(getBorderColor(), "\n ");
|
|
62
62
|
var errorId = "".concat(id, "-error");
|