@mich8060/chg-design-system 0.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.
Files changed (260) hide show
  1. package/.github/workflows/figma-sync.yml +30 -0
  2. package/ARCHITECTURE_FIX.md +241 -0
  3. package/LICENSE +21 -0
  4. package/README.lib.md +103 -0
  5. package/README.md +177 -0
  6. package/figma.config.json +9 -0
  7. package/package.json +67 -0
  8. package/package.lib.json +49 -0
  9. package/public/data/figma-variables.json +40026 -0
  10. package/public/favicon.ico +0 -0
  11. package/public/index.html +46 -0
  12. package/public/logo192.png +0 -0
  13. package/public/logo512.png +0 -0
  14. package/public/manifest.json +25 -0
  15. package/public/robots.txt +3 -0
  16. package/public/styles/tokens.css +1994 -0
  17. package/scripts/index.js +896 -0
  18. package/scripts/publish-lib.js +150 -0
  19. package/scripts/validate.js +94 -0
  20. package/src/App.css +457 -0
  21. package/src/App.css.map +1 -0
  22. package/src/App.js +161 -0
  23. package/src/App.scss +548 -0
  24. package/src/App.test.js +8 -0
  25. package/src/assets/images/.gitkeep +0 -0
  26. package/src/assets/images/doctors/Avatar-1.png +0 -0
  27. package/src/assets/images/doctors/Avatar-10.png +0 -0
  28. package/src/assets/images/doctors/Avatar-11.png +0 -0
  29. package/src/assets/images/doctors/Avatar-12.png +0 -0
  30. package/src/assets/images/doctors/Avatar-13.png +0 -0
  31. package/src/assets/images/doctors/Avatar-14.png +0 -0
  32. package/src/assets/images/doctors/Avatar-15.png +0 -0
  33. package/src/assets/images/doctors/Avatar-16.png +0 -0
  34. package/src/assets/images/doctors/Avatar-17.png +0 -0
  35. package/src/assets/images/doctors/Avatar-18.png +0 -0
  36. package/src/assets/images/doctors/Avatar-19.png +0 -0
  37. package/src/assets/images/doctors/Avatar-2.png +0 -0
  38. package/src/assets/images/doctors/Avatar-20.png +0 -0
  39. package/src/assets/images/doctors/Avatar-21.png +0 -0
  40. package/src/assets/images/doctors/Avatar-3.png +0 -0
  41. package/src/assets/images/doctors/Avatar-4.png +0 -0
  42. package/src/assets/images/doctors/Avatar-5.png +0 -0
  43. package/src/assets/images/doctors/Avatar-6.png +0 -0
  44. package/src/assets/images/doctors/Avatar-7.png +0 -0
  45. package/src/assets/images/doctors/Avatar-8.png +0 -0
  46. package/src/assets/images/doctors/Avatar-9.png +0 -0
  47. package/src/assets/images/doctors/Avatar.png +0 -0
  48. package/src/assets/images/doctors/index.js +141 -0
  49. package/src/data/figma-variables.json +90305 -0
  50. package/src/index.js +20 -0
  51. package/src/index.scss +10 -0
  52. package/src/pages/AccordionDemo.jsx +206 -0
  53. package/src/pages/AccordionDemo.scss +34 -0
  54. package/src/pages/ActionMenuDemo.jsx +957 -0
  55. package/src/pages/ActionMenuDemo.scss +34 -0
  56. package/src/pages/AvatarDemo.jsx +328 -0
  57. package/src/pages/AvatarDemo.scss +40 -0
  58. package/src/pages/BadgeDemo.jsx +254 -0
  59. package/src/pages/BadgeDemo.scss +40 -0
  60. package/src/pages/BorderRadiusDemo.jsx +112 -0
  61. package/src/pages/BorderRadiusDemo.scss +50 -0
  62. package/src/pages/BrandingDemo.jsx +117 -0
  63. package/src/pages/BreadcrumbDemo.jsx +172 -0
  64. package/src/pages/ButtonDemo.jsx +708 -0
  65. package/src/pages/ButtonDemo.scss +34 -0
  66. package/src/pages/CheckboxDemo.jsx +194 -0
  67. package/src/pages/ChipDemo.jsx +359 -0
  68. package/src/pages/ChipDemo.scss +40 -0
  69. package/src/pages/ColorsDemo.jsx +566 -0
  70. package/src/pages/ColorsDemo.scss +243 -0
  71. package/src/pages/ComponentsUsage.jsx +401 -0
  72. package/src/pages/DatepickerDemo.jsx +223 -0
  73. package/src/pages/DividerDemo.jsx +337 -0
  74. package/src/pages/DotStatusDemo.jsx +223 -0
  75. package/src/pages/DropdownDemo.jsx +229 -0
  76. package/src/pages/FieldDemo.jsx +253 -0
  77. package/src/pages/FigmaVariablesDemo.jsx +426 -0
  78. package/src/pages/FigmaVariablesDemo.scss +316 -0
  79. package/src/pages/FileUploadDemo.jsx +186 -0
  80. package/src/pages/FlexDemo.jsx +144 -0
  81. package/src/pages/FlexDemo.scss +119 -0
  82. package/src/pages/FontInstallation.jsx +252 -0
  83. package/src/pages/FontInstallation.scss +40 -0
  84. package/src/pages/Home.jsx +3156 -0
  85. package/src/pages/IconDemo.jsx +1680 -0
  86. package/src/pages/ImageAspectDemo.jsx +152 -0
  87. package/src/pages/InputDemo.jsx +245 -0
  88. package/src/pages/Installation.jsx +257 -0
  89. package/src/pages/Installation.scss +40 -0
  90. package/src/pages/KeyDemo.jsx +184 -0
  91. package/src/pages/MenuDemo.jsx +139 -0
  92. package/src/pages/MicroCalendarDemo.jsx +165 -0
  93. package/src/pages/PaginationDemo.jsx +176 -0
  94. package/src/pages/PillToggleDemo.jsx +212 -0
  95. package/src/pages/ProgressCircleDemo.jsx +206 -0
  96. package/src/pages/ProgressIndicatorDemo.jsx +227 -0
  97. package/src/pages/RadioDemo.jsx +282 -0
  98. package/src/pages/ShadowsDemo.jsx +118 -0
  99. package/src/pages/ShadowsDemo.scss +93 -0
  100. package/src/pages/SliderDemo.jsx +226 -0
  101. package/src/pages/SpacingDemo.jsx +160 -0
  102. package/src/pages/SpacingDemo.scss +107 -0
  103. package/src/pages/StatusDemo.jsx +196 -0
  104. package/src/pages/StepsDemo.jsx +308 -0
  105. package/src/pages/TableDemo.jsx +376 -0
  106. package/src/pages/TabsDemo.jsx +221 -0
  107. package/src/pages/ToastDemo.jsx +195 -0
  108. package/src/pages/ToggleDemo.jsx +187 -0
  109. package/src/pages/TokensDemo.jsx +637 -0
  110. package/src/pages/TokensDemo.scss +270 -0
  111. package/src/pages/TokensUsage.jsx +220 -0
  112. package/src/pages/TooltipDemo.jsx +170 -0
  113. package/src/pages/TypographyDemo.jsx +229 -0
  114. package/src/pages/TypographyDemo.scss +105 -0
  115. package/src/pages/UtilitiesDemo.jsx +381 -0
  116. package/src/pages/UtilitiesDemo.scss +214 -0
  117. package/src/reportWebVitals.js +13 -0
  118. package/src/setupTests.js +5 -0
  119. package/src/styles/_typography.scss +932 -0
  120. package/src/styles/_utilities.scss +3635 -0
  121. package/src/styles/_variables.scss +887 -0
  122. package/src/styles/prism-custom.css +206 -0
  123. package/src/styles/prism-custom.css.map +1 -0
  124. package/src/styles/prism-custom.scss +205 -0
  125. package/src/styles/tokens.css +4416 -0
  126. package/src/styles/tokens.css.map +1 -0
  127. package/src/styles/tokens.scss +1456 -0
  128. package/src/ui/Accordion/Accordion.jsx +70 -0
  129. package/src/ui/Accordion/Accordion.scss +82 -0
  130. package/src/ui/Accordion/index.js +1 -0
  131. package/src/ui/ActionMenu/ActionMenu.jsx +383 -0
  132. package/src/ui/ActionMenu/ActionMenu.scss +198 -0
  133. package/src/ui/ActionMenu/index.js +1 -0
  134. package/src/ui/Avatar/Avatar.jsx +49 -0
  135. package/src/ui/Avatar/Avatar.scss +82 -0
  136. package/src/ui/Avatar/index.js +1 -0
  137. package/src/ui/Badge/Badge.jsx +64 -0
  138. package/src/ui/Badge/Badge.scss +84 -0
  139. package/src/ui/Badge/index.js +1 -0
  140. package/src/ui/Branding/Branding.jsx +65 -0
  141. package/src/ui/Branding/Branding.scss +116 -0
  142. package/src/ui/Branding/index.js +1 -0
  143. package/src/ui/Breadcrumb/Breadcrumb.jsx +162 -0
  144. package/src/ui/Breadcrumb/Breadcrumb.scss +46 -0
  145. package/src/ui/Breadcrumb/index.js +2 -0
  146. package/src/ui/Button/Button.figma.tsx +49 -0
  147. package/src/ui/Button/Button.jsx +135 -0
  148. package/src/ui/Button/Button.scss +188 -0
  149. package/src/ui/Button/index.js +1 -0
  150. package/src/ui/Card/Card.jsx +25 -0
  151. package/src/ui/Card/Card.scss +47 -0
  152. package/src/ui/Card/index.js +1 -0
  153. package/src/ui/Checkbox/Checkbox.jsx +70 -0
  154. package/src/ui/Checkbox/Checkbox.scss +96 -0
  155. package/src/ui/Checkbox/index.js +1 -0
  156. package/src/ui/Chip/Chip.jsx +104 -0
  157. package/src/ui/Chip/Chip.scss +118 -0
  158. package/src/ui/Chip/index.js +1 -0
  159. package/src/ui/CopyButton/CopyButton.jsx +102 -0
  160. package/src/ui/CopyButton/CopyButton.scss +56 -0
  161. package/src/ui/CopyButton/index.js +1 -0
  162. package/src/ui/Datepicker/Datepicker.jsx +326 -0
  163. package/src/ui/Datepicker/Datepicker.scss +187 -0
  164. package/src/ui/Datepicker/index.js +2 -0
  165. package/src/ui/Divider/Divider.jsx +89 -0
  166. package/src/ui/Divider/Divider.scss +112 -0
  167. package/src/ui/Divider/index.js +1 -0
  168. package/src/ui/DotStatus/DotStatus.jsx +64 -0
  169. package/src/ui/DotStatus/DotStatus.scss +87 -0
  170. package/src/ui/DotStatus/index.js +1 -0
  171. package/src/ui/Dropdown/Dropdown.jsx +200 -0
  172. package/src/ui/Dropdown/Dropdown.scss +156 -0
  173. package/src/ui/Dropdown/index.js +1 -0
  174. package/src/ui/Field/Field.jsx +89 -0
  175. package/src/ui/Field/Field.scss +119 -0
  176. package/src/ui/Field/index.js +1 -0
  177. package/src/ui/FileUpload/FileUpload.figma.tsx +28 -0
  178. package/src/ui/FileUpload/FileUpload.jsx +153 -0
  179. package/src/ui/FileUpload/FileUpload.scss +78 -0
  180. package/src/ui/FileUpload/index.js +2 -0
  181. package/src/ui/Flex/Flex.jsx +42 -0
  182. package/src/ui/Flex/Flex.scss +119 -0
  183. package/src/ui/Flex/index.js +1 -0
  184. package/src/ui/Icon/Icon.figma.tsx +22 -0
  185. package/src/ui/Icon/Icon.jsx +47 -0
  186. package/src/ui/Icon/index.js +1 -0
  187. package/src/ui/ImageAspect/ImageAspect.jsx +56 -0
  188. package/src/ui/ImageAspect/ImageAspect.scss +62 -0
  189. package/src/ui/ImageAspect/index.js +1 -0
  190. package/src/ui/Input/Input.figma.tsx +35 -0
  191. package/src/ui/Input/Input.jsx +68 -0
  192. package/src/ui/Input/Input.scss +64 -0
  193. package/src/ui/Input/index.js +2 -0
  194. package/src/ui/Key/Key.jsx +37 -0
  195. package/src/ui/Key/Key.scss +34 -0
  196. package/src/ui/Key/index.js +1 -0
  197. package/src/ui/Menu/Menu.jsx +389 -0
  198. package/src/ui/Menu/Menu.scss +382 -0
  199. package/src/ui/Menu/index.js +1 -0
  200. package/src/ui/MicroCalendar/MicroCalendar.jsx +392 -0
  201. package/src/ui/MicroCalendar/MicroCalendar.scss +277 -0
  202. package/src/ui/MicroCalendar/index.js +1 -0
  203. package/src/ui/Pagination/Pagination.jsx +237 -0
  204. package/src/ui/Pagination/Pagination.scss +182 -0
  205. package/src/ui/Pagination/index.js +1 -0
  206. package/src/ui/PillToggle/PillToggle.jsx +56 -0
  207. package/src/ui/PillToggle/PillToggle.scss +84 -0
  208. package/src/ui/PillToggle/index.js +1 -0
  209. package/src/ui/Playground/Playground.jsx +524 -0
  210. package/src/ui/Playground/Playground.scss +310 -0
  211. package/src/ui/Playground/index.js +2 -0
  212. package/src/ui/ProgressCircle/ProgressCircle.jsx +147 -0
  213. package/src/ui/ProgressCircle/ProgressCircle.scss +143 -0
  214. package/src/ui/ProgressCircle/index.js +1 -0
  215. package/src/ui/ProgressIndicator/ProgressIndicator.jsx +92 -0
  216. package/src/ui/ProgressIndicator/ProgressIndicator.scss +133 -0
  217. package/src/ui/ProgressIndicator/index.js +1 -0
  218. package/src/ui/Radio/Radio.jsx +57 -0
  219. package/src/ui/Radio/Radio.scss +84 -0
  220. package/src/ui/Radio/index.js +1 -0
  221. package/src/ui/Slider/Slider.jsx +283 -0
  222. package/src/ui/Slider/Slider.scss +156 -0
  223. package/src/ui/Slider/index.js +1 -0
  224. package/src/ui/Status/Status.jsx +66 -0
  225. package/src/ui/Status/Status.scss +90 -0
  226. package/src/ui/Status/index.js +1 -0
  227. package/src/ui/Steps/Steps.jsx +201 -0
  228. package/src/ui/Steps/Steps.scss +240 -0
  229. package/src/ui/Steps/index.js +1 -0
  230. package/src/ui/Table/Table.jsx +143 -0
  231. package/src/ui/Table/Table.scss +90 -0
  232. package/src/ui/Table/index.js +1 -0
  233. package/src/ui/Tabs/TabItem.jsx +86 -0
  234. package/src/ui/Tabs/Tabs.figma.tsx +30 -0
  235. package/src/ui/Tabs/Tabs.jsx +318 -0
  236. package/src/ui/Tabs/Tabs.scss +164 -0
  237. package/src/ui/Tabs/Untitled +1 -0
  238. package/src/ui/Tabs/index.js +3 -0
  239. package/src/ui/Tag/Tag.figma.tsx +29 -0
  240. package/src/ui/Tag/Tag.jsx +93 -0
  241. package/src/ui/Tag/Tag.scss +229 -0
  242. package/src/ui/Tag/index.js +2 -0
  243. package/src/ui/Textarea/Textarea.figma.tsx +35 -0
  244. package/src/ui/Textarea/Textarea.jsx +68 -0
  245. package/src/ui/Textarea/Textarea.scss +69 -0
  246. package/src/ui/Textarea/index.js +2 -0
  247. package/src/ui/Toast/Toast.jsx +75 -0
  248. package/src/ui/Toast/Toast.scss +132 -0
  249. package/src/ui/Toast/index.js +2 -0
  250. package/src/ui/Toggle/Toggle.jsx +73 -0
  251. package/src/ui/Toggle/Toggle.scss +139 -0
  252. package/src/ui/Toggle/index.js +1 -0
  253. package/src/ui/Tooltip/Tooltip.figma.tsx +24 -0
  254. package/src/ui/Tooltip/Tooltip.jsx +123 -0
  255. package/src/ui/Tooltip/Tooltip.scss +80 -0
  256. package/src/ui/Tooltip/index.js +2 -0
  257. package/src/ui/index.js +63 -0
  258. package/src/utils/formatDate.js +27 -0
  259. package/src/utils/headerVariants.js +69 -0
  260. package/vite.config.lib.js +55 -0
@@ -0,0 +1,270 @@
1
+ .tokens-demo {
2
+ padding: var(--uds-spacing-24);
3
+ max-width: 1600px;
4
+ margin: 0 auto;
5
+ background: white;
6
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
7
+ border-radius: var(--uds-radius-8);
8
+ color: var(--uds-text-primary);
9
+ font-family: var(--uds-font-family);
10
+
11
+ &__header {
12
+ margin-bottom: var(--uds-spacing-24);
13
+ }
14
+
15
+ &__title {
16
+ font-size: var(--uds-font-size-24) !important;
17
+ font-weight: var(--uds-font-weight-bold) !important;
18
+ line-height: var(--uds-line-heading-24) !important;
19
+ margin: 0 0 var(--uds-spacing-8) 0;
20
+ color: var(--uds-text-brand-primary);
21
+ font-family: var(--uds-font-family);
22
+ }
23
+
24
+ &__subtitle {
25
+ font-size: var(--uds-font-size-14);
26
+ line-height: var(--uds-line-14);
27
+ color: var(--uds-text-secondary);
28
+ margin: 0;
29
+ font-family: var(--uds-font-family);
30
+ }
31
+
32
+ &__section-title {
33
+ font-size: var(--uds-font-size-16);
34
+ font-weight: var(--uds-font-weight-semibold);
35
+ line-height: var(--uds-line-16);
36
+ margin: 0 0 var(--uds-spacing-16) 0;
37
+ color: var(--uds-text-primary);
38
+ font-family: var(--uds-font-family);
39
+ }
40
+
41
+ &__core {
42
+ margin-bottom: var(--uds-spacing-48);
43
+ }
44
+
45
+ &__core-content {
46
+ background: var(--uds-surface-secondary);
47
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
48
+ border-radius: var(--uds-radius-8);
49
+ padding: 16px;
50
+ }
51
+
52
+ &__brands,
53
+ &__modes {
54
+ margin-bottom: var(--uds-spacing-48);
55
+ }
56
+
57
+ &__grid {
58
+ display: grid;
59
+ gap: var(--uds-gap-24);
60
+
61
+ &--brands {
62
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
63
+ }
64
+
65
+ &--modes {
66
+ grid-template-columns: repeat(2, 1fr);
67
+ max-width: 1400px;
68
+ }
69
+ }
70
+
71
+ &__loading,
72
+ &__error {
73
+ text-align: center;
74
+ padding: var(--uds-spacing-48);
75
+ color: var(--uds-text-secondary);
76
+ }
77
+ }
78
+
79
+ .tokens-section {
80
+ background: var(--uds-surface-secondary);
81
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
82
+ border-radius: var(--uds-radius-8);
83
+ padding: var(--uds-spacing-24);
84
+
85
+ &__title {
86
+ font-size: var(--uds-font-size-18);
87
+ font-weight: var(--uds-font-weight-semibold);
88
+ line-height: var(--uds-line-18);
89
+ margin: 0 0 var(--uds-spacing-12) 0;
90
+ color: var(--uds-text-primary);
91
+ font-family: var(--uds-font-family);
92
+ text-transform: capitalize;
93
+ padding-bottom: var(--uds-spacing-12);
94
+ border-bottom: var(--uds-border-width-2) solid var(--uds-border-primary);
95
+ }
96
+
97
+ &__content {
98
+ display: flex;
99
+ flex-direction: column;
100
+ gap: var(--uds-gap-24);
101
+ }
102
+ }
103
+
104
+ .token-table-wrapper {
105
+ margin-bottom: var(--uds-spacing-24);
106
+
107
+ &:last-child {
108
+ margin-bottom: 0;
109
+ }
110
+
111
+ &__title {
112
+ font-size: var(--uds-font-size-16);
113
+ font-weight: var(--uds-font-weight-semibold);
114
+ line-height: var(--uds-line-16);
115
+ color: var(--uds-text-primary);
116
+ font-family: var(--uds-font-family);
117
+ text-transform: capitalize;
118
+ margin: 0 0 var(--uds-spacing-12) 0;
119
+ padding-bottom: var(--uds-spacing-8);
120
+ border-bottom: var(--uds-border-width-2) solid var(--uds-border-primary);
121
+ }
122
+ }
123
+
124
+ .token-subgroup {
125
+ margin-bottom: var(--uds-spacing-24);
126
+
127
+ &:last-child {
128
+ margin-bottom: 0;
129
+ }
130
+
131
+ &__title {
132
+ font-size: var(--uds-font-size-14);
133
+ font-weight: var(--uds-font-weight-semibold);
134
+ line-height: var(--uds-line-14);
135
+ color: var(--uds-text-secondary);
136
+ font-family: var(--uds-font-family);
137
+ text-transform: capitalize;
138
+ margin: 0 0 var(--uds-spacing-12) 0;
139
+ padding: var(--uds-spacing-8) var(--uds-spacing-12);
140
+ background: var(--uds-surface-tertiary);
141
+ border-radius: var(--uds-radius-4);
142
+ display: inline-block;
143
+ }
144
+ }
145
+
146
+ .token-subgroup-nested {
147
+ margin-bottom: var(--uds-spacing-24);
148
+ margin-left: var(--uds-spacing-16);
149
+
150
+ &:last-child {
151
+ margin-bottom: 0;
152
+ }
153
+
154
+ &__title {
155
+ font-size: var(--uds-font-size-12);
156
+ font-weight: var(--uds-font-weight-semibold);
157
+ line-height: var(--uds-line-12);
158
+ color: var(--uds-text-secondary);
159
+ font-family: var(--uds-font-family);
160
+ text-transform: uppercase;
161
+ letter-spacing: var(--uds-letter-spacing-loose);
162
+ margin: 0 0 var(--uds-spacing-8) 0;
163
+ opacity: 0.8;
164
+ }
165
+ }
166
+
167
+ .token-table {
168
+ width: 100%;
169
+ border-collapse: collapse;
170
+ font-size: var(--uds-font-size-14);
171
+ font-family: var(--uds-font-family);
172
+
173
+ &__header {
174
+ text-align: left;
175
+ padding: var(--uds-spacing-10) var(--uds-spacing-12);
176
+ font-weight: var(--uds-font-weight-semibold);
177
+ font-size: var(--uds-font-size-12);
178
+ line-height: var(--uds-line-12);
179
+ text-transform: uppercase;
180
+ letter-spacing: var(--uds-letter-spacing-loose);
181
+ color: var(--uds-text-secondary);
182
+ font-family: var(--uds-font-family);
183
+ background: var(--uds-surface-tertiary);
184
+ border-bottom: var(--uds-border-width-2) solid var(--uds-border-primary);
185
+
186
+ &--name {
187
+ width: 50%;
188
+ }
189
+
190
+ &--value {
191
+ width: 50%;
192
+ }
193
+ }
194
+
195
+ &__row {
196
+ border-bottom: var(--uds-border-width-1) solid var(--uds-border-quaternary);
197
+ transition: background-color 0.15s ease;
198
+
199
+ &:hover {
200
+ background: var(--uds-surface-tertiary);
201
+ }
202
+
203
+ &:last-child {
204
+ border-bottom: none;
205
+ }
206
+ }
207
+
208
+ &__cell {
209
+ padding: var(--uds-spacing-10) var(--uds-spacing-12);
210
+ vertical-align: middle;
211
+ font-size: var(--uds-font-size-14);
212
+ line-height: var(--uds-line-14);
213
+ font-family: var(--uds-font-family);
214
+
215
+ &--name {
216
+ font-family: var(--uds-font-family);
217
+ color: var(--uds-text-primary);
218
+
219
+ code {
220
+ font-size: var(--uds-font-size-14);
221
+ line-height: var(--uds-line-14);
222
+ font-family: var(--uds-font-family);
223
+ background: var(--uds-surface-tertiary);
224
+ padding: var(--uds-spacing-2) var(--uds-spacing-6);
225
+ border-radius: var(--uds-radius-4);
226
+ }
227
+ }
228
+
229
+ &--value {
230
+ color: var(--uds-text-secondary);
231
+ }
232
+ }
233
+ }
234
+
235
+ .token-value {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: var(--uds-gap-8);
239
+ font-family: var(--uds-font-family);
240
+ color: var(--uds-text-secondary);
241
+ white-space: nowrap;
242
+ font-size: var(--uds-font-size-14);
243
+ line-height: var(--uds-line-14);
244
+
245
+ &--color {
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 8px;
249
+ }
250
+
251
+ &__swatch {
252
+ width: 20px;
253
+ height: 20px;
254
+ border-radius: var(--uds-radius-4);
255
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
256
+ flex-shrink: 0;
257
+ box-shadow: 0 0 0 1px var(--uds-scrim-subtle);
258
+ }
259
+
260
+ &__text {
261
+ font-size: var(--uds-font-size-14);
262
+ line-height: var(--uds-line-14);
263
+ }
264
+
265
+ &--text {
266
+ font-size: var(--uds-font-size-14);
267
+ line-height: var(--uds-line-14);
268
+ color: var(--uds-text-secondary);
269
+ }
270
+ }
@@ -0,0 +1,220 @@
1
+ import React, { useEffect } from "react";
2
+ import Breadcrumb from "../ui/Breadcrumb/Breadcrumb";
3
+ import Divider from "../ui/Divider/Divider";
4
+ import { formatLastUpdated } from "../utils/formatDate";
5
+ import Prism from "prismjs";
6
+ import "../styles/prism-custom.css";
7
+ import "prismjs/components/prism-css";
8
+ import "prismjs/components/prism-markup";
9
+
10
+ export default function TokensUsage() {
11
+ useEffect(() => {
12
+ Prism.highlightAll();
13
+ }, []);
14
+
15
+ return (
16
+ <section className="page">
17
+ <header className="page__header">
18
+ <div className="page__header-container">
19
+ <Breadcrumb />
20
+ <div className="page__header-info">
21
+ <div className="page__header-content">
22
+ <h1 className="page__header-title">CSS Tokens Usage</h1>
23
+ <p className="page__header-description">
24
+ Learn how to use design tokens (CSS custom properties) in your stylesheets.
25
+ </p>
26
+ </div>
27
+ <div className="page__header-metadata">
28
+ <div className="page__metadata-row">
29
+ <p className="page__metadata-label">Last updated</p>
30
+ <p className="page__metadata-value">{formatLastUpdated()}</p>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </header>
36
+
37
+ <main className="page__content">
38
+ <div className="page__examples-section">
39
+ <div className="demo-group">
40
+ <h2 className="demo-group__heading">What are Design Tokens?</h2>
41
+ <p className="demo-group__description">
42
+ Design tokens are CSS custom properties (variables) that store design decisions
43
+ like colors, spacing, typography, and more. They ensure consistency across your
44
+ application and make it easy to update the design system.
45
+ </p>
46
+ </div>
47
+
48
+ <div className="demo-group">
49
+ <h2 className="demo-group__heading">Basic Usage</h2>
50
+ <p className="demo-group__description">
51
+ Reference tokens in your CSS using the <code>var()</code> function:
52
+ </p>
53
+ <pre className="code-block">
54
+ <code className="language-css">{`.my-component {
55
+ color: var(--uds-text-primary);
56
+ background: var(--uds-surface-primary);
57
+ padding: var(--uds-spacing-16);
58
+ border-radius: var(--uds-radius-8);
59
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
60
+ }`}</code>
61
+ </pre>
62
+ </div>
63
+
64
+ <div className="demo-group">
65
+ <h2 className="demo-group__heading">Token Categories</h2>
66
+
67
+ <div style={{ marginTop: "16px" }}>
68
+ <h3 className="uds-heading-20-semibold" style={{ marginBottom: "12px" }}>Colors</h3>
69
+ <p className="uds-body-16" style={{ marginBottom: "12px" }}>
70
+ Color tokens follow this naming pattern:
71
+ </p>
72
+ <ul className="uds-body-16" style={{ marginLeft: "24px", marginBottom: "16px" }}>
73
+ <li><code>--uds-color-primary-*</code> - Primary brand colors</li>
74
+ <li><code>--uds-color-secondary-*</code> - Secondary brand colors</li>
75
+ <li><code>--uds-text-*</code> - Text colors</li>
76
+ <li><code>--uds-surface-*</code> - Background/surface colors</li>
77
+ <li><code>--uds-border-*</code> - Border colors</li>
78
+ </ul>
79
+ <pre className="code-block">
80
+ <code className="language-css">{`.card {
81
+ background: var(--uds-surface-primary);
82
+ color: var(--uds-text-primary);
83
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
84
+ }`}</code>
85
+ </pre>
86
+ </div>
87
+
88
+ <div style={{ marginTop: "24px" }}>
89
+ <h3 className="uds-heading-20-semibold" style={{ marginBottom: "12px" }}>Spacing</h3>
90
+ <p className="uds-body-16" style={{ marginBottom: "12px" }}>
91
+ Spacing tokens use the pattern <code>--uds-spacing-{`{size}`}</code>:
92
+ </p>
93
+ <pre className="code-block">
94
+ <code className="language-css">{`.container {
95
+ padding: var(--uds-spacing-16);
96
+ margin: var(--uds-spacing-24);
97
+ gap: var(--uds-spacing-8);
98
+ }`}</code>
99
+ </pre>
100
+ </div>
101
+
102
+ <div style={{ marginTop: "24px" }}>
103
+ <h3 className="uds-heading-20-semibold" style={{ marginBottom: "12px" }}>Typography</h3>
104
+ <p className="uds-body-16" style={{ marginBottom: "12px" }}>
105
+ Typography tokens include font size, line height, and weight:
106
+ </p>
107
+ <pre className="code-block">
108
+ <code className="language-css">{`.custom-text {
109
+ font-family: var(--uds-font-family);
110
+ font-size: var(--uds-font-size-16);
111
+ line-height: var(--uds-line-16);
112
+ font-weight: var(--uds-font-weight-semibold);
113
+ }`}</code>
114
+ </pre>
115
+ </div>
116
+
117
+ <div style={{ marginTop: "24px" }}>
118
+ <h3 className="uds-heading-20-semibold" style={{ marginBottom: "12px" }}>Border Radius</h3>
119
+ <p className="uds-body-16" style={{ marginBottom: "12px" }}>
120
+ Border radius tokens: <code>--uds-radius-{`{size}`}</code>
121
+ </p>
122
+ <pre className="code-block">
123
+ <code className="language-css">{`.rounded {
124
+ border-radius: var(--uds-radius-8);
125
+ }
126
+
127
+ .rounded-lg {
128
+ border-radius: var(--uds-radius-12);
129
+ }`}</code>
130
+ </pre>
131
+ </div>
132
+ </div>
133
+
134
+ <div className="demo-group">
135
+ <h2 className="demo-group__heading">Brand and Theme Switching</h2>
136
+ <p className="demo-group__description">
137
+ Tokens automatically adapt based on the <code>data-brand</code> and <code>data-mode</code>
138
+ attributes on your root HTML element.
139
+ </p>
140
+ <pre className="code-block">
141
+ <code className="language-markup">{`<!-- Light mode, default brand -->
142
+ <html data-brand="design-system" data-mode="light">
143
+
144
+ <!-- Dark mode, CompHealth brand -->
145
+ <html data-brand="comphealth" data-mode="dark">`}</code>
146
+ </pre>
147
+ <p className="uds-body-14" style={{ marginTop: "16px", color: "var(--uds-text-secondary)" }}>
148
+ When you change these attributes, all tokens automatically update to match the selected
149
+ brand and theme. No code changes needed!
150
+ </p>
151
+ </div>
152
+
153
+ <div className="demo-group">
154
+ <h2 className="demo-group__heading">Inline Styles (React)</h2>
155
+ <p className="demo-group__description">
156
+ You can also use tokens directly in inline styles:
157
+ </p>
158
+ <pre className="code-block">
159
+ <code className="language-markup">{`<div style={{
160
+ color: 'var(--uds-text-primary)',
161
+ padding: 'var(--uds-spacing-16)',
162
+ background: 'var(--uds-surface-secondary)'
163
+ }}>
164
+ Content
165
+ </div>`}</code>
166
+ </pre>
167
+ </div>
168
+
169
+ <div className="demo-group">
170
+ <h2 className="demo-group__heading">Animation Tokens</h2>
171
+ <p className="demo-group__description">
172
+ Use animation tokens for consistent motion:
173
+ </p>
174
+ <pre className="code-block">
175
+ <code className="language-css">{`.animated-element {
176
+ transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
177
+ }
178
+
179
+ .animated-element:hover {
180
+ transform: scale(1.05);
181
+ }`}</code>
182
+ </pre>
183
+ </div>
184
+
185
+ <div className="demo-group">
186
+ <h2 className="demo-group__heading">Button Tokens</h2>
187
+ <p className="demo-group__description">
188
+ Button-specific tokens for consistent button styling:
189
+ </p>
190
+ <pre className="code-block">
191
+ <code className="language-css">{`.custom-button {
192
+ background: var(--uds-button-surface-primary-default);
193
+ color: var(--uds-button-text-default);
194
+ border: var(--uds-border-width-1) solid var(--uds-button-border-primary-default);
195
+ }
196
+
197
+ .custom-button:hover {
198
+ background: var(--uds-button-surface-primary-hover);
199
+ border-color: var(--uds-button-border-primary-hover);
200
+ }`}</code>
201
+ </pre>
202
+ </div>
203
+
204
+ <div className="demo-group">
205
+ <h2 className="demo-group__heading">Exploring Tokens</h2>
206
+ <p className="demo-group__description">
207
+ View all available tokens in the{" "}
208
+ <a href="/figma-variables" style={{ color: "var(--uds-text-brand-primary)" }}>
209
+ Design Tokens
210
+ </a>{" "}
211
+ page, or inspect the <code>tokens.css</code> file directly.
212
+ </p>
213
+ </div>
214
+ </div>
215
+
216
+ <Divider variant="solid" />
217
+ </main>
218
+ </section>
219
+ );
220
+ }
@@ -0,0 +1,170 @@
1
+ import React, { useState } from "react";
2
+ import { Link } from "react-router-dom";
3
+ import Tooltip from "../ui/Tooltip/Tooltip";
4
+ import Button from "../ui/Button/Button";
5
+ import Icon from "../ui/Icon/Icon";
6
+ import Flex from "../ui/Flex/Flex";
7
+ import Breadcrumb from "../ui/Breadcrumb/Breadcrumb";
8
+ import Divider from "../ui/Divider/Divider";
9
+ import { formatLastUpdated } from "../utils/formatDate";
10
+
11
+ const tooltipContent =
12
+ "A message which appears when a cursor is positioned over an icon, image, hyperlink, or other element in a graphical user interface.";
13
+
14
+ /**
15
+ * Tooltip Component Demo & Documentation
16
+ *
17
+ * This page demonstrates the Tooltip component and its various configurations.
18
+ */
19
+ export default function TooltipDemo() {
20
+
21
+ return (
22
+ <section className="page">
23
+ <header className="page__header">
24
+ <div className="page__header-container">
25
+ <Breadcrumb />
26
+ <div className="page__header-info">
27
+ <div className="page__header-content">
28
+ <h1 className="page__header-title">Tooltip</h1>
29
+ <p className="page__header-description">
30
+ Tooltips provide additional context or information when users
31
+ hover over or focus on an element. They appear temporarily and
32
+ disappear when the user moves their cursor away.
33
+ </p>
34
+ </div>
35
+ <div className="page__header-metadata">
36
+ <div className="page__metadata-row">
37
+ <p className="page__metadata-label">Author</p>
38
+ <a
39
+ href="https://chgit.slack.com/team/U06V9C0K06S"
40
+ className="page__metadata-link"
41
+ target="_blank"
42
+ rel="noopener noreferrer"
43
+ >
44
+ @Michael-Stevens
45
+ </a>
46
+ </div>
47
+ <div className="page__metadata-row">
48
+ <p className="page__metadata-label">Last updated</p>
49
+ <p className="page__metadata-value">{formatLastUpdated()}</p>
50
+ </div>
51
+ <div className="page__metadata-row">
52
+ <p className="page__metadata-label">Version</p>
53
+ <Flex direction="row" gap="8" alignItems="center">
54
+ <p className="page__metadata-value">1.0.0</p>
55
+ <span className="page__version-badge">BETA</span>
56
+ </Flex>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </header>
62
+
63
+ <main className="page__content">
64
+ <div className="page__examples-section">
65
+ <div className="demo-group">
66
+ <h2 className="demo-group__heading">Placement</h2>
67
+ <p className="demo-group__description">
68
+ Tooltips can be positioned on any side of the trigger element: top, bottom, left, or right. The default placement is top.
69
+ </p>
70
+ <Flex direction="row" gap="24" wrap={true} alignItems="center" className="demo-content">
71
+ <Tooltip content={tooltipContent} placement="top">
72
+ <Button appearance="outline">Top</Button>
73
+ </Tooltip>
74
+ <Tooltip content={tooltipContent} placement="bottom">
75
+ <Button appearance="outline">Bottom</Button>
76
+ </Tooltip>
77
+ <Tooltip content={tooltipContent} placement="left">
78
+ <Button appearance="outline">Left</Button>
79
+ </Tooltip>
80
+ <Tooltip content={tooltipContent} placement="right">
81
+ <Button appearance="outline">Right</Button>
82
+ </Tooltip>
83
+ </Flex>
84
+ </div>
85
+
86
+ <div className="demo-group">
87
+ <h2 className="demo-group__heading">With Icons</h2>
88
+ <p className="demo-group__description">
89
+ Tooltips work well with icon buttons to provide additional context without cluttering the interface.
90
+ </p>
91
+ <Flex direction="row" gap="16" wrap={true} alignItems="center" className="demo-content">
92
+ <Tooltip content="Edit this item" placement="top">
93
+ <Button appearance="text" layout="icon-only" icon="Pencil" size="small" />
94
+ </Tooltip>
95
+ <Tooltip content="Delete this item" placement="top">
96
+ <Button appearance="text" layout="icon-only" icon="Trash" size="small" />
97
+ </Tooltip>
98
+ <Tooltip content="More information" placement="top">
99
+ <Button appearance="text" layout="icon-only" icon="Info" size="small" />
100
+ </Tooltip>
101
+ <Tooltip content="Settings" placement="top">
102
+ <Button appearance="text" layout="icon-only" icon="Gear" size="small" />
103
+ </Tooltip>
104
+ </Flex>
105
+ </div>
106
+
107
+ <div className="demo-group">
108
+ <h2 className="demo-group__heading">With Text</h2>
109
+ <p className="demo-group__description">
110
+ Tooltips can be attached to any element, including text links or labels, to provide helpful context.
111
+ </p>
112
+ <Flex direction="column" gap="16" className="demo-content">
113
+ <p>
114
+ This is a paragraph with a{" "}
115
+ <Tooltip content="This is a helpful tooltip" placement="top">
116
+ <a href="#" style={{ color: 'var(--uds-text-link-primary-default)', textDecoration: 'underline' }}>
117
+ tooltip on a link
118
+ </a>
119
+ </Tooltip>
120
+ .
121
+ </p>
122
+ <p>
123
+ Hover over this{" "}
124
+ <Tooltip content="Additional information appears here" placement="bottom">
125
+ <span style={{ borderBottom: '1px dotted', cursor: 'help' }}>dotted text</span>
126
+ </Tooltip>
127
+ {" "}to see the tooltip.
128
+ </p>
129
+ </Flex>
130
+ </div>
131
+
132
+ <div className="demo-group">
133
+ <h2 className="demo-group__heading">Disabled Tooltip</h2>
134
+ <p className="demo-group__description">
135
+ Tooltips can be disabled when they are not needed or should not be displayed.
136
+ </p>
137
+ <div className="demo-content">
138
+ <Tooltip content="This tooltip is disabled" placement="top" disabled>
139
+ <Button appearance="outline">Hover me (tooltip disabled)</Button>
140
+ </Tooltip>
141
+ </div>
142
+ </div>
143
+ </div>
144
+
145
+ <Divider variant="solid" />
146
+
147
+ <div className="page__tabs-content-container">
148
+ <div className="demo-group">
149
+ <div className="page__navigation">
150
+ <Link
151
+ to="/toggle"
152
+ className="page__nav-link page__nav-link--prev"
153
+ >
154
+ <span className="page__nav-label">Previous</span>
155
+ <span className="page__nav-title">Toggle</span>
156
+ </Link>
157
+ <Link
158
+ to="/input"
159
+ className="page__nav-link page__nav-link--next"
160
+ >
161
+ <span className="page__nav-label">Next</span>
162
+ <span className="page__nav-title">Text Input</span>
163
+ </Link>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </main>
168
+ </section>
169
+ );
170
+ }