oneslash-design-system 1.8.5 → 2.0.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 (53) hide show
  1. package/README.md +20 -6
  2. package/dist/components/alert.jsx +10 -10
  3. package/dist/components/button.jsx +22 -22
  4. package/dist/components/checkBox.jsx +10 -10
  5. package/dist/components/emptyBox.jsx +2 -2
  6. package/dist/components/icon.jsx +8 -8
  7. package/dist/components/iconButton.jsx +16 -16
  8. package/dist/components/line.jsx +1 -1
  9. package/dist/components/link.jsx +13 -13
  10. package/dist/components/loadingScreen.jsx +1 -1
  11. package/dist/components/menu.jsx +2 -1
  12. package/dist/components/menuItem.jsx +8 -8
  13. package/dist/components/modal.jsx +7 -6
  14. package/dist/components/navigation.jsx +1 -1
  15. package/dist/components/popover.jsx +3 -2
  16. package/dist/components/radioGroup.jsx +6 -6
  17. package/dist/components/select.jsx +10 -10
  18. package/dist/components/sharedStyles.d.ts +5 -5
  19. package/dist/components/sharedStyles.jsx +5 -5
  20. package/dist/components/tab.jsx +4 -4
  21. package/dist/components/tableCell.jsx +1 -1
  22. package/dist/components/tableContainer.jsx +1 -1
  23. package/dist/components/tableHeader.jsx +1 -1
  24. package/dist/components/tableHeaderCell.jsx +1 -1
  25. package/dist/components/tabsContainer.jsx +2 -2
  26. package/dist/components/tag.jsx +36 -36
  27. package/dist/components/textField.jsx +9 -9
  28. package/dist/components/textarea.jsx +8 -8
  29. package/dist/components/timeStamp.jsx +2 -2
  30. package/dist/components/tooltip.jsx +1 -1
  31. package/dist/components/useDarkMode.d.ts +3 -0
  32. package/dist/components/useDarkMode.js +25 -9
  33. package/dist/components/userImage.jsx +6 -3
  34. package/dist/designTokens.d.ts +619 -269
  35. package/dist/designTokens.js +103 -1
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.js +1 -0
  38. package/dist/stories/EmptyBox.stories.jsx +1 -0
  39. package/dist/tailwind-preset-auto.js +402 -0
  40. package/dist/tailwind-preset.js +396 -0
  41. package/dist/theme-auto.css +256 -0
  42. package/dist/theme.css +251 -0
  43. package/dist/themes/default-auto.css +248 -0
  44. package/dist/themes/default.css +165 -0
  45. package/dist/themes/forest-auto.css +248 -0
  46. package/dist/themes/forest.css +165 -0
  47. package/dist/tokens.css +19 -0
  48. package/dist/typography.css +81 -0
  49. package/package.json +18 -5
  50. package/dist/output.css +0 -2021
  51. package/dist/tailwind.config.d.ts +0 -3
  52. package/dist/tailwind.config.js +0 -222
  53. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,165 @@
1
+ /* Generated from designTokens.js by scripts/build-tokens.js. Do not edit. */
2
+ /* Theme "forest". Variables hold RGB channels: use rgb(var(--os-color-…) / <alpha>). */
3
+ @import "../tokens.css";
4
+ :root {
5
+ --os-mode: light;
6
+ --os-color-text-primary: 28 34 19;
7
+ --os-color-text-secondary: 81 94 60;
8
+ --os-color-text-disabled: 138 150 112;
9
+ --os-color-text-contrast: 255 255 255;
10
+ --os-color-accent-main: 28 34 19;
11
+ --os-color-accent-dark: 42 51 30;
12
+ --os-color-accent-light: 58 71 43;
13
+ --os-color-accent-contrast: 231 236 218;
14
+ --os-color-primary-main: 69 69 69;
15
+ --os-color-primary-dark: 38 38 38;
16
+ --os-color-primary-light: 136 136 136;
17
+ --os-color-primary-contrast: 255 255 255;
18
+ --os-color-secondary-main: 110 122 90;
19
+ --os-color-secondary-dark: 93 104 73;
20
+ --os-color-secondary-light: 130 141 107;
21
+ --os-color-error-main: 211 47 47;
22
+ --os-color-error-dark: 178 35 35;
23
+ --os-color-error-light: 242 119 119;
24
+ --os-color-error-alertBg: 242 196 196;
25
+ --os-color-error-contrast: 255 255 255;
26
+ --os-color-error-fill: 178 35 35;
27
+ --os-color-error-onFill: 255 255 255;
28
+ --os-color-error-text: 178 35 35;
29
+ --os-color-error-textHover: 178 35 35;
30
+ --os-color-error-tint: 242 119 119;
31
+ --os-color-warning-main: 239 108 0;
32
+ --os-color-warning-dark: 168 70 0;
33
+ --os-color-warning-light: 255 167 50;
34
+ --os-color-warning-alertBg: 245 213 176;
35
+ --os-color-warning-contrast: 255 255 255;
36
+ --os-color-warning-fill: 168 70 0;
37
+ --os-color-warning-onFill: 255 255 255;
38
+ --os-color-warning-text: 168 70 0;
39
+ --os-color-warning-textHover: 168 70 0;
40
+ --os-color-warning-tint: 255 167 50;
41
+ --os-color-info-main: 0 135 212;
42
+ --os-color-info-dark: 0 107 171;
43
+ --os-color-info-light: 44 193 255;
44
+ --os-color-info-alertBg: 184 217 240;
45
+ --os-color-info-contrast: 255 255 255;
46
+ --os-color-info-fill: 0 107 171;
47
+ --os-color-info-onFill: 255 255 255;
48
+ --os-color-info-text: 0 104 163;
49
+ --os-color-info-textHover: 0 104 163;
50
+ --os-color-info-tint: 44 193 255;
51
+ --os-color-success-main: 50 135 54;
52
+ --os-color-success-dark: 42 107 45;
53
+ --os-color-success-light: 103 193 107;
54
+ --os-color-success-alertBg: 196 226 197;
55
+ --os-color-success-contrast: 255 255 255;
56
+ --os-color-success-fill: 42 107 45;
57
+ --os-color-success-onFill: 255 255 255;
58
+ --os-color-success-text: 42 107 45;
59
+ --os-color-success-textHover: 42 107 45;
60
+ --os-color-success-tint: 103 193 107;
61
+ --os-color-background-default: 217 229 199;
62
+ --os-color-background-accent100: 226 236 212;
63
+ --os-color-background-accent200: 235 241 224;
64
+ --os-color-background-accent300: 244 247 236;
65
+ --os-color-background-elevated: 217 229 199;
66
+ --os-color-background-overlay: 244 247 236;
67
+ --os-color-action-active: 136 136 136;
68
+ --os-color-action-hover: 243 243 243;
69
+ --os-color-action-selected: 227 227 227;
70
+ --os-color-action-disabledBackground: 209 209 209;
71
+ --os-color-action-disabled: 176 176 176;
72
+ --os-color-actionBackground-enabled: 255 255 255;
73
+ --os-color-actionBackground-hovered: 255 255 255;
74
+ --os-color-actionBackground-selected: 255 255 255;
75
+ --os-color-actionBackground-disabled: 238 238 238;
76
+ --os-color-actionOutlinedBorder-enabled: 136 136 136;
77
+ --os-color-actionOutlinedBorder-hovered: 205 205 205;
78
+ --os-color-actionOutlinedBorder-selected: 232 232 232;
79
+ --os-color-actionOutlinedBorder-disabled: 176 176 176;
80
+ --os-color-misc-divider: 209 209 209;
81
+ --os-color-misc-scrim: 0 0 0;
82
+ --os-color-misc-tooltipBg: 66 79 52;
83
+ --os-color-misc-tooltipText: 217 229 199;
84
+ }
85
+ .dark {
86
+ --os-mode: dark;
87
+ --os-color-text-primary: 217 229 199;
88
+ --os-color-text-secondary: 157 170 133;
89
+ --os-color-text-disabled: 109 121 86;
90
+ --os-color-text-contrast: 0 0 0;
91
+ --os-color-accent-main: 231 236 218;
92
+ --os-color-accent-dark: 214 222 195;
93
+ --os-color-accent-light: 242 245 234;
94
+ --os-color-accent-contrast: 28 34 19;
95
+ --os-color-primary-main: 213 213 213;
96
+ --os-color-primary-dark: 233 233 233;
97
+ --os-color-primary-light: 154 154 154;
98
+ --os-color-primary-contrast: 0 0 0;
99
+ --os-color-secondary-main: 110 122 90;
100
+ --os-color-secondary-dark: 93 104 73;
101
+ --os-color-secondary-light: 130 141 107;
102
+ --os-color-error-main: 231 76 76;
103
+ --os-color-error-dark: 178 35 35;
104
+ --os-color-error-light: 242 119 119;
105
+ --os-color-error-alertBg: 92 26 26;
106
+ --os-color-error-contrast: 255 255 255;
107
+ --os-color-error-fill: 231 76 76;
108
+ --os-color-error-onFill: 0 0 0;
109
+ --os-color-error-text: 242 119 119;
110
+ --os-color-error-textHover: 242 119 119;
111
+ --os-color-error-tint: 178 35 35;
112
+ --os-color-warning-main: 255 140 10;
113
+ --os-color-warning-dark: 204 83 2;
114
+ --os-color-warning-light: 255 167 50;
115
+ --os-color-warning-alertBg: 92 46 10;
116
+ --os-color-warning-contrast: 255 255 255;
117
+ --os-color-warning-fill: 255 140 10;
118
+ --os-color-warning-onFill: 0 0 0;
119
+ --os-color-warning-text: 255 140 10;
120
+ --os-color-warning-textHover: 255 167 50;
121
+ --os-color-warning-tint: 204 83 2;
122
+ --os-color-info-main: 0 175 255;
123
+ --os-color-info-dark: 0 107 171;
124
+ --os-color-info-light: 44 193 255;
125
+ --os-color-info-alertBg: 10 58 92;
126
+ --os-color-info-contrast: 255 255 255;
127
+ --os-color-info-fill: 0 175 255;
128
+ --os-color-info-onFill: 0 0 0;
129
+ --os-color-info-text: 0 175 255;
130
+ --os-color-info-textHover: 44 193 255;
131
+ --os-color-info-tint: 0 107 171;
132
+ --os-color-success-main: 66 165 71;
133
+ --os-color-success-dark: 42 107 45;
134
+ --os-color-success-light: 103 193 107;
135
+ --os-color-success-alertBg: 26 74 29;
136
+ --os-color-success-contrast: 255 255 255;
137
+ --os-color-success-fill: 66 165 71;
138
+ --os-color-success-onFill: 0 0 0;
139
+ --os-color-success-text: 66 165 71;
140
+ --os-color-success-textHover: 103 193 107;
141
+ --os-color-success-tint: 42 107 45;
142
+ --os-color-background-default: 28 34 19;
143
+ --os-color-background-accent100: 39 48 27;
144
+ --os-color-background-accent200: 54 66 40;
145
+ --os-color-background-accent300: 66 79 52;
146
+ --os-color-background-elevated: 39 48 27;
147
+ --os-color-background-overlay: 39 48 27;
148
+ --os-color-action-active: 23 23 23;
149
+ --os-color-action-hover: 61 61 61;
150
+ --os-color-action-selected: 78 78 78;
151
+ --os-color-action-disabledBackground: 60 60 60;
152
+ --os-color-action-disabled: 56 56 56;
153
+ --os-color-actionBackground-enabled: 255 255 255;
154
+ --os-color-actionBackground-hovered: 255 255 255;
155
+ --os-color-actionBackground-selected: 255 255 255;
156
+ --os-color-actionBackground-disabled: 56 56 56;
157
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
158
+ --os-color-actionOutlinedBorder-hovered: 47 47 47;
159
+ --os-color-actionOutlinedBorder-selected: 64 64 64;
160
+ --os-color-actionOutlinedBorder-disabled: 56 56 56;
161
+ --os-color-misc-divider: 64 64 64;
162
+ --os-color-misc-scrim: 0 0 0;
163
+ --os-color-misc-tooltipBg: 244 247 236;
164
+ --os-color-misc-tooltipText: 28 34 19;
165
+ }
@@ -0,0 +1,19 @@
1
+ /* Generated from designTokens.js by scripts/build-tokens.js. Do not edit. */
2
+ :root {
3
+ --os-radius-inline: 2px;
4
+ --os-radius-control: 8px;
5
+ --os-radius-container: 12px;
6
+ --os-radius-full: 9999px;
7
+ --os-shadow-overlay: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
8
+ --os-z-overlay: 50;
9
+ --os-z-tooltip: 1000;
10
+ --os-duration-fast: 150ms;
11
+ --os-duration-slide: 200ms;
12
+ --os-duration-pop: 220ms;
13
+ --os-ease-out: cubic-bezier(0, 0, 0.2, 1);
14
+ --os-ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
15
+ --os-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
16
+ --os-spacing-small: 4px;
17
+ --os-spacing-medium: 8px;
18
+ --os-spacing-large: 16px;
19
+ }
@@ -0,0 +1,81 @@
1
+ /* Generated from designTokens.js by scripts/build-tokens.js. Do not edit. */
2
+ @theme inline {
3
+ --font-inter: Inter, sans-serif;
4
+ --text-h1: 96px;
5
+ --text-h1--line-height: 115px;
6
+ --text-h1--letter-spacing: -1.5px;
7
+ --text-h1--font-weight: 400;
8
+ --font-weight-h1: 400;
9
+ --leading-h1: 115px;
10
+ --tracking-h1: -1.5px;
11
+ --text-h2: 60px;
12
+ --text-h2--line-height: 72px;
13
+ --text-h2--letter-spacing: -0.5px;
14
+ --text-h2--font-weight: 400;
15
+ --font-weight-h2: 400;
16
+ --leading-h2: 72px;
17
+ --tracking-h2: -0.5px;
18
+ --text-h3: 48px;
19
+ --text-h3--line-height: 58px;
20
+ --text-h3--letter-spacing: 0px;
21
+ --text-h3--font-weight: 400;
22
+ --font-weight-h3: 400;
23
+ --leading-h3: 58px;
24
+ --tracking-h3: 0px;
25
+ --text-h4: 34px;
26
+ --text-h4--line-height: 41px;
27
+ --text-h4--letter-spacing: 0.3px;
28
+ --text-h4--font-weight: 400;
29
+ --font-weight-h4: 400;
30
+ --leading-h4: 41px;
31
+ --tracking-h4: 0.3px;
32
+ --text-h5: 24px;
33
+ --text-h5--line-height: 29px;
34
+ --text-h5--letter-spacing: 0px;
35
+ --text-h5--font-weight: 400;
36
+ --font-weight-h5: 400;
37
+ --leading-h5: 29px;
38
+ --tracking-h5: 0px;
39
+ --text-h6: 20px;
40
+ --text-h6--line-height: 30px;
41
+ --text-h6--letter-spacing: 0.2px;
42
+ --text-h6--font-weight: 400;
43
+ --font-weight-h6: 400;
44
+ --leading-h6: 30px;
45
+ --tracking-h6: 0.2px;
46
+ --text-subtitle1: 16px;
47
+ --text-subtitle1--line-height: 24px;
48
+ --text-subtitle1--letter-spacing: 0.2px;
49
+ --text-subtitle1--font-weight: 400;
50
+ --font-weight-subtitle1: 400;
51
+ --leading-subtitle1: 24px;
52
+ --tracking-subtitle1: 0.2px;
53
+ --text-subtitle2: 14px;
54
+ --text-subtitle2--line-height: 21px;
55
+ --text-subtitle2--letter-spacing: 0.1px;
56
+ --text-subtitle2--font-weight: 400;
57
+ --font-weight-subtitle2: 400;
58
+ --leading-subtitle2: 21px;
59
+ --tracking-subtitle2: 0.1px;
60
+ --text-body1: 16px;
61
+ --text-body1--line-height: 24px;
62
+ --text-body1--letter-spacing: 0.2px;
63
+ --text-body1--font-weight: 400;
64
+ --font-weight-body1: 400;
65
+ --leading-body1: 24px;
66
+ --tracking-body1: 0.2px;
67
+ --text-body2: 14px;
68
+ --text-body2--line-height: 21px;
69
+ --text-body2--letter-spacing: 0.2px;
70
+ --text-body2--font-weight: 400;
71
+ --font-weight-body2: 400;
72
+ --leading-body2: 21px;
73
+ --tracking-body2: 0.2px;
74
+ --text-caption: 12px;
75
+ --text-caption--line-height: 18px;
76
+ --text-caption--letter-spacing: 0.5px;
77
+ --text-caption--font-weight: 400;
78
+ --font-weight-caption: 400;
79
+ --leading-caption: 18px;
80
+ --tracking-caption: 0.5px;
81
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "1.8.5",
4
+ "version": "2.0.0",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -18,20 +18,31 @@
18
18
  "types": "./dist/designTokens.d.ts",
19
19
  "default": "./dist/designTokens.js"
20
20
  },
21
- "./styles": "./dist/output.css"
21
+ "./themes/*": "./dist/themes/*",
22
+ "./tokens.css": "./dist/tokens.css",
23
+ "./theme.css": "./dist/theme.css",
24
+ "./theme-auto.css": "./dist/theme-auto.css",
25
+ "./typography.css": "./dist/typography.css",
26
+ "./tailwind": "./dist/tailwind-preset.js",
27
+ "./tailwind-auto": "./dist/tailwind-preset-auto.js"
22
28
  },
23
29
  "files": [
24
30
  "dist"
25
31
  ],
26
32
  "scripts": {
27
33
  "dev": "next dev",
28
- "build": "tsc && postcss index.css -o dist/output.css",
29
- "build:css": "postcss index.css -o dist/output.css",
34
+ "build:tokens": "node scripts/build-tokens.js",
35
+ "build": "npm run build:tokens && tsc",
30
36
  "watch": "tsc --watch",
31
37
  "start": "next start",
32
38
  "lint": "next lint",
33
39
  "storybook": "storybook dev -p 6006",
34
- "build-storybook": "storybook build"
40
+ "build-storybook": "storybook build",
41
+ "pretest": "npm run build",
42
+ "test": "node --test scripts/*.test.js scripts/tokens/*.test.js",
43
+ "check:contrast": "node scripts/check-contrast.js",
44
+ "test:visual": "playwright test",
45
+ "test:visual:update": "playwright test --update-snapshots"
35
46
  },
36
47
  "dependencies": {
37
48
  "@popperjs/core": "^2.11.8",
@@ -43,6 +54,7 @@
43
54
  "react-dom": "^18 || ^19"
44
55
  },
45
56
  "devDependencies": {
57
+ "@playwright/test": "1.64.1",
46
58
  "@storybook/addon-essentials": "8.6",
47
59
  "@storybook/react-vite": "8.6",
48
60
  "@types/node": "20.16.10",
@@ -52,6 +64,7 @@
52
64
  "autoprefixer": "^10.4.20",
53
65
  "eslint": "^8",
54
66
  "eslint-config-next": "14.2.13",
67
+ "http-server": "14.1.1",
55
68
  "next": "14.2.13",
56
69
  "postcss": "^8",
57
70
  "postcss-cli": "^11.0.0",