tandd-ui 0.0.0-stage → 0.2.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 (269) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/LICENSE +21 -0
  3. package/README.md +96 -2
  4. package/dist/components/_shared/direction.d.ts +6 -0
  5. package/dist/components/_shared/escapeLayers.d.ts +21 -0
  6. package/dist/components/_shared/formatLabel.d.ts +5 -0
  7. package/dist/components/_shared/useDismissiblePopup.d.ts +4 -0
  8. package/dist/components/_shared/useFieldValidation.d.ts +34 -0
  9. package/dist/components/_shared/useFocusTrap.d.ts +16 -0
  10. package/dist/components/_shared/useMessages.d.ts +18 -0
  11. package/dist/components/_shared/usePopover.d.ts +122 -0
  12. package/dist/components/_shared/useRipple.d.ts +37 -0
  13. package/dist/components/_shared/useRovingFocus.d.ts +25 -0
  14. package/dist/components/accordion/DTAccordion.vue.d.ts +42 -0
  15. package/dist/components/accordion/DTAccordionItem.vue.d.ts +34 -0
  16. package/dist/components/accordion/accordionContext.d.ts +13 -0
  17. package/dist/components/alert/DTAlert.vue.d.ts +57 -0
  18. package/dist/components/anchor/DTAnchor.vue.d.ts +48 -0
  19. package/dist/components/anchor/DTAnchorLink.vue.d.ts +21 -0
  20. package/dist/components/anchor/anchorContext.d.ts +10 -0
  21. package/dist/components/app-bar/DTAppBar.vue.d.ts +56 -0
  22. package/dist/components/autocomplete/DTAutocomplete.vue.d.ts +131 -0
  23. package/dist/components/avatar/DTAvatar.vue.d.ts +37 -0
  24. package/dist/components/avatar/DTAvatarGroup.vue.d.ts +18 -0
  25. package/dist/components/badge/DTBadge.vue.d.ts +47 -0
  26. package/dist/components/badge/index.d.ts +2 -0
  27. package/dist/components/border-beam/DTBorderBeam.vue.d.ts +47 -0
  28. package/dist/components/breadcrumb/DTBreadcrumb.vue.d.ts +46 -0
  29. package/dist/components/button/DTButton.vue.d.ts +60 -0
  30. package/dist/components/button-group/DTButtonGroup.vue.d.ts +56 -0
  31. package/dist/components/button-group/buttonGroupContext.d.ts +16 -0
  32. package/dist/components/card/DTCard.vue.d.ts +38 -0
  33. package/dist/components/card/DTCardBody.vue.d.ts +13 -0
  34. package/dist/components/card/DTCardFooter.vue.d.ts +13 -0
  35. package/dist/components/card/DTCardHeader.vue.d.ts +17 -0
  36. package/dist/components/card/DTCardMedia.vue.d.ts +24 -0
  37. package/dist/components/card/DTCardSubtitle.vue.d.ts +13 -0
  38. package/dist/components/card/DTCardText.vue.d.ts +13 -0
  39. package/dist/components/card/DTCardTitle.vue.d.ts +24 -0
  40. package/dist/components/card/context.d.ts +6 -0
  41. package/dist/components/card/index.d.ts +2 -0
  42. package/dist/components/carousel/DTCarousel.vue.d.ts +69 -0
  43. package/dist/components/carousel/DTCarouselItem.vue.d.ts +21 -0
  44. package/dist/components/carousel/carouselContext.d.ts +22 -0
  45. package/dist/components/checkbox/DTCheckbox.vue.d.ts +50 -0
  46. package/dist/components/chip/DTChip.vue.d.ts +62 -0
  47. package/dist/components/chip/DTChipGroup.vue.d.ts +36 -0
  48. package/dist/components/chip/chipGroupContext.d.ts +9 -0
  49. package/dist/components/code/DTCode.vue.d.ts +13 -0
  50. package/dist/components/col/DTCol.vue.d.ts +55 -0
  51. package/dist/components/color-input/DTColorInput.vue.d.ts +89 -0
  52. package/dist/components/color-input/colorMath.d.ts +36 -0
  53. package/dist/components/color-picker/DTColorPicker.vue.d.ts +66 -0
  54. package/dist/components/color-picker/context.d.ts +9 -0
  55. package/dist/components/combobox/DTCombobox.vue.d.ts +106 -0
  56. package/dist/components/container/DTContainer.vue.d.ts +29 -0
  57. package/dist/components/data-table/DTDataTable.vue.d.ts +112 -0
  58. package/dist/components/data-table/types.d.ts +70 -0
  59. package/dist/components/date-picker/DTDateInput.vue.d.ts +98 -0
  60. package/dist/components/date-picker/DTDatePicker.vue.d.ts +106 -0
  61. package/dist/components/date-picker/DTDateShortcuts.vue.d.ts +15 -0
  62. package/dist/components/date-picker/isoDate.d.ts +38 -0
  63. package/dist/components/date-picker/shortcuts.d.ts +11 -0
  64. package/dist/components/date-time-picker/DTDateTimeInput.vue.d.ts +107 -0
  65. package/dist/components/date-time-picker/DTDateTimePicker.vue.d.ts +94 -0
  66. package/dist/components/date-time-picker/isoDateTime.d.ts +30 -0
  67. package/dist/components/divider/DTDivider.vue.d.ts +19 -0
  68. package/dist/components/empty-state/DTEmptyState.vue.d.ts +51 -0
  69. package/dist/components/field/DTField.vue.d.ts +36 -0
  70. package/dist/components/field/fieldContext.d.ts +14 -0
  71. package/dist/components/field-control/DTFieldControl.vue.d.ts +135 -0
  72. package/dist/components/field-control/index.d.ts +1 -0
  73. package/dist/components/file-input/DTFileInput.vue.d.ts +142 -0
  74. package/dist/components/file-upload/DTFileUpload.vue.d.ts +132 -0
  75. package/dist/components/file-upload/icons.d.ts +1 -0
  76. package/dist/components/file-upload/types.d.ts +47 -0
  77. package/dist/components/grid/DTGrid.vue.d.ts +44 -0
  78. package/dist/components/grid/DTGridItem.vue.d.ts +42 -0
  79. package/dist/components/heading/DTHeading.vue.d.ts +31 -0
  80. package/dist/components/icon/DTIcon.vue.d.ts +43 -0
  81. package/dist/components/icon/play.d.ts +6 -0
  82. package/dist/components/icon/registry.d.ts +16 -0
  83. package/dist/components/infinite-scroll/DTInfiniteScroll.vue.d.ts +67 -0
  84. package/dist/components/infinite-scroll/icons.d.ts +1 -0
  85. package/dist/components/inline/DTInline.vue.d.ts +26 -0
  86. package/dist/components/kbd/DTKbd.vue.d.ts +13 -0
  87. package/dist/components/layout-app/DTLayout.vue.d.ts +18 -0
  88. package/dist/components/layout-app/DTMain.vue.d.ts +21 -0
  89. package/dist/components/layout-app/layoutContext.d.ts +33 -0
  90. package/dist/components/link/DTLink.vue.d.ts +26 -0
  91. package/dist/components/list/DTList.vue.d.ts +53 -0
  92. package/dist/components/list/DTListItem.vue.d.ts +61 -0
  93. package/dist/components/list/DTListSubheader.vue.d.ts +24 -0
  94. package/dist/components/list/listContext.d.ts +16 -0
  95. package/dist/components/mention/DTMention.vue.d.ts +93 -0
  96. package/dist/components/mention/caret.d.ts +7 -0
  97. package/dist/components/menu/DTMenu.vue.d.ts +66 -0
  98. package/dist/components/menu/DTMenuItem.vue.d.ts +45 -0
  99. package/dist/components/menu/DTMenuLabel.vue.d.ts +13 -0
  100. package/dist/components/menu/DTMenuSeparator.vue.d.ts +3 -0
  101. package/dist/components/menu/menuContext.d.ts +38 -0
  102. package/dist/components/modal/DTModal.vue.d.ts +52 -0
  103. package/dist/components/modal/modalStack.d.ts +20 -0
  104. package/dist/components/navigation-drawer/DTNavigationDrawer.vue.d.ts +93 -0
  105. package/dist/components/number-input/DTNumberInput.vue.d.ts +66 -0
  106. package/dist/components/otp-input/DTOtpInput.vue.d.ts +71 -0
  107. package/dist/components/pagination/DTPagination.vue.d.ts +55 -0
  108. package/dist/components/popover/DTPopover.vue.d.ts +67 -0
  109. package/dist/components/progress/DTProgress.vue.d.ts +48 -0
  110. package/dist/components/pull-refresh/DTPullRefresh.vue.d.ts +69 -0
  111. package/dist/components/radio/DTRadio.vue.d.ts +41 -0
  112. package/dist/components/radio/DTRadioGroup.vue.d.ts +35 -0
  113. package/dist/components/radio/radioGroupContext.d.ts +12 -0
  114. package/dist/components/rating/DTRating.vue.d.ts +65 -0
  115. package/dist/components/row/DTRow.vue.d.ts +38 -0
  116. package/dist/components/select/DTSelect.vue.d.ts +140 -0
  117. package/dist/components/sheet/DTSheet.vue.d.ts +57 -0
  118. package/dist/components/skeleton/DTSkeleton.vue.d.ts +34 -0
  119. package/dist/components/skip-link/DTSkipLink.vue.d.ts +33 -0
  120. package/dist/components/slider/DTSlider.vue.d.ts +88 -0
  121. package/dist/components/spinner/DTSpinner.vue.d.ts +34 -0
  122. package/dist/components/stack/DTStack.vue.d.ts +24 -0
  123. package/dist/components/statistic/DTCountdown.vue.d.ts +49 -0
  124. package/dist/components/statistic/DTStatistic.vue.d.ts +49 -0
  125. package/dist/components/statistic/format.d.ts +39 -0
  126. package/dist/components/stepper/DTStep.vue.d.ts +41 -0
  127. package/dist/components/stepper/DTStepHeader.vue.d.ts +8 -0
  128. package/dist/components/stepper/DTStepper.vue.d.ts +46 -0
  129. package/dist/components/stepper/stepperContext.d.ts +39 -0
  130. package/dist/components/surface/DTSurface.vue.d.ts +43 -0
  131. package/dist/components/surface/index.d.ts +2 -0
  132. package/dist/components/switch/DTSwitch.vue.d.ts +59 -0
  133. package/dist/components/table/DTTable.vue.d.ts +55 -0
  134. package/dist/components/table/DTTableScrollbars.vue.d.ts +9 -0
  135. package/dist/components/tabs/DTTab.vue.d.ts +23 -0
  136. package/dist/components/tabs/DTTabs.vue.d.ts +45 -0
  137. package/dist/components/tabs/tabsContext.d.ts +19 -0
  138. package/dist/components/text/DTText.vue.d.ts +32 -0
  139. package/dist/components/text-field/DTFieldShell.vue.d.ts +59 -0
  140. package/dist/components/text-field/DTInput.vue.d.ts +70 -0
  141. package/dist/components/text-field/fieldShared.d.ts +87 -0
  142. package/dist/components/textarea/DTTextarea.vue.d.ts +56 -0
  143. package/dist/components/time-picker/DTTimeInput.vue.d.ts +71 -0
  144. package/dist/components/time-picker/DTTimePicker.vue.d.ts +52 -0
  145. package/dist/components/time-picker/isoTime.d.ts +21 -0
  146. package/dist/components/timeline/DTTimeline.vue.d.ts +36 -0
  147. package/dist/components/timeline/DTTimelineItem.vue.d.ts +46 -0
  148. package/dist/components/timeline/timelineContext.d.ts +13 -0
  149. package/dist/components/toast/DTToastRegion.vue.d.ts +18 -0
  150. package/dist/components/toast/toastStore.d.ts +77 -0
  151. package/dist/components/tooltip/DTTooltip.vue.d.ts +45 -0
  152. package/dist/components/tour/DTTour.vue.d.ts +62 -0
  153. package/dist/components/tour/DTTourStep.vue.d.ts +31 -0
  154. package/dist/components/tour/tourContext.d.ts +20 -0
  155. package/dist/components/tree-select/DTTreeSelect.vue.d.ts +86 -0
  156. package/dist/components/treeview/DTTreeview.vue.d.ts +92 -0
  157. package/dist/components/watermark/DTWatermark.vue.d.ts +48 -0
  158. package/dist/config.d.ts +58 -0
  159. package/dist/index.d.ts +183 -0
  160. package/dist/locale/en.d.ts +311 -0
  161. package/dist/locale/en.js +192 -0
  162. package/dist/locale/messages.d.ts +295 -0
  163. package/dist/locale/vi.d.ts +309 -0
  164. package/dist/locale/vi.js +192 -0
  165. package/dist/plugin.d.ts +26 -0
  166. package/dist/tandd-ui.css +11585 -0
  167. package/dist/tandd-ui.js +13039 -0
  168. package/dist/theme/cssVariables.d.ts +14 -0
  169. package/dist/theme/defaultTheme.d.ts +5 -0
  170. package/dist/theme/index.d.ts +34 -0
  171. package/dist/useLocale.d.ts +15 -0
  172. package/dist/useTheme.d.ts +9 -0
  173. package/package.json +112 -4
  174. package/src/components/_index.scss +73 -0
  175. package/src/components/accordion/DTAccordion.scss +123 -0
  176. package/src/components/alert/DTAlert.scss +222 -0
  177. package/src/components/anchor/DTAnchor.scss +137 -0
  178. package/src/components/app-bar/DTAppBar.scss +151 -0
  179. package/src/components/autocomplete/DTAutocomplete.scss +89 -0
  180. package/src/components/avatar/DTAvatar.scss +67 -0
  181. package/src/components/badge/DTBadge.scss +218 -0
  182. package/src/components/border-beam/DTBorderBeam.scss +67 -0
  183. package/src/components/breadcrumb/DTBreadcrumb.scss +58 -0
  184. package/src/components/button/DTButton.scss +252 -0
  185. package/src/components/button-group/DTButtonGroup.scss +103 -0
  186. package/src/components/card/DTCard.scss +183 -0
  187. package/src/components/carousel/DTCarousel.scss +228 -0
  188. package/src/components/checkbox/DTChoice.scss +351 -0
  189. package/src/components/chip/DTChip.scss +280 -0
  190. package/src/components/code/DTCode.scss +10 -0
  191. package/src/components/col/DTCol.scss +124 -0
  192. package/src/components/color-input/DTColorInput.scss +118 -0
  193. package/src/components/color-picker/DTColorPicker.scss +334 -0
  194. package/src/components/container/DTContainer.scss +24 -0
  195. package/src/components/data-table/DTDataTable.scss +274 -0
  196. package/src/components/date-picker/DTDatePicker.scss +474 -0
  197. package/src/components/date-time-picker/DTDateTimePicker.scss +144 -0
  198. package/src/components/divider/DTDivider.scss +67 -0
  199. package/src/components/empty-state/DTEmptyState.scss +106 -0
  200. package/src/components/field/DTField.scss +69 -0
  201. package/src/components/field-control/DTFieldControl.scss +221 -0
  202. package/src/components/file-input/DTFileInput.scss +98 -0
  203. package/src/components/file-upload/DTFileUpload.scss +185 -0
  204. package/src/components/grid/DTGrid.scss +135 -0
  205. package/src/components/heading/DTHeading.scss +9 -0
  206. package/src/components/icon/DTIcon.scss +64 -0
  207. package/src/components/infinite-scroll/DTInfiniteScroll.scss +67 -0
  208. package/src/components/inline/DTInline.scss +19 -0
  209. package/src/components/kbd/DTKbd.scss +17 -0
  210. package/src/components/layout-app/DTLayout.scss +69 -0
  211. package/src/components/link/DTLink.scss +35 -0
  212. package/src/components/list/DTList.scss +261 -0
  213. package/src/components/mention/DTMention.scss +24 -0
  214. package/src/components/menu/DTMenu.scss +282 -0
  215. package/src/components/modal/DTModal.scss +178 -0
  216. package/src/components/navigation-drawer/DTNavigationDrawer.scss +172 -0
  217. package/src/components/number-input/DTNumberInput.scss +124 -0
  218. package/src/components/otp-input/DTOtpInput.scss +121 -0
  219. package/src/components/pagination/DTPagination.scss +115 -0
  220. package/src/components/popover/DTPopover.scss +119 -0
  221. package/src/components/progress/DTProgress.scss +227 -0
  222. package/src/components/pull-refresh/DTPullRefresh.scss +83 -0
  223. package/src/components/rating/DTRating.scss +153 -0
  224. package/src/components/row/DTRow.scss +73 -0
  225. package/src/components/select/DTSelect.scss +347 -0
  226. package/src/components/sheet/DTSheet.scss +256 -0
  227. package/src/components/skeleton/DTSkeleton.scss +74 -0
  228. package/src/components/skip-link/DTSkipLink.scss +76 -0
  229. package/src/components/slider/DTSlider.scss +652 -0
  230. package/src/components/spinner/DTSpinner.scss +123 -0
  231. package/src/components/stack/DTStack.scss +8 -0
  232. package/src/components/statistic/DTStatistic.scss +44 -0
  233. package/src/components/stepper/DTStepper.scss +268 -0
  234. package/src/components/surface/DTSurface.scss +99 -0
  235. package/src/components/switch/DTSwitch.scss +306 -0
  236. package/src/components/table/DTTable.scss +287 -0
  237. package/src/components/tabs/DTTabs.scss +402 -0
  238. package/src/components/text/DTText.scss +9 -0
  239. package/src/components/text-field/DTTextField.scss +452 -0
  240. package/src/components/time-picker/DTTimePicker.scss +131 -0
  241. package/src/components/timeline/DTTimeline.scss +322 -0
  242. package/src/components/toast/DTToast.scss +297 -0
  243. package/src/components/tooltip/DTTooltip.scss +168 -0
  244. package/src/components/tour/DTTour.scss +173 -0
  245. package/src/components/tree-select/DTTreeSelect.scss +60 -0
  246. package/src/components/treeview/DTTreeview.scss +205 -0
  247. package/src/components/watermark/DTWatermark.scss +8 -0
  248. package/src/styles/foundation/_direction.scss +6 -0
  249. package/src/styles/foundation/_focus.scss +12 -0
  250. package/src/styles/foundation/_forced-colors.scss +9 -0
  251. package/src/styles/foundation/_motion.scss +10 -0
  252. package/src/styles/foundation/_reset.scss +39 -0
  253. package/src/styles/foundation/_root.scss +112 -0
  254. package/src/styles/foundation/_state.scss +29 -0
  255. package/src/styles/foundation/_typography.scss +81 -0
  256. package/src/styles/foundation/_visually-hidden.scss +21 -0
  257. package/src/styles/index.scss +9 -0
  258. package/src/styles/tokens/_border.scss +2 -0
  259. package/src/styles/tokens/_breakpoint.scss +15 -0
  260. package/src/styles/tokens/_color.scss +56 -0
  261. package/src/styles/tokens/_index.scss +11 -0
  262. package/src/styles/tokens/_motion.scss +13 -0
  263. package/src/styles/tokens/_radius.scss +13 -0
  264. package/src/styles/tokens/_shadow.scss +18 -0
  265. package/src/styles/tokens/_spacing.scss +21 -0
  266. package/src/styles/tokens/_state.scss +30 -0
  267. package/src/styles/tokens/_surface.scss +33 -0
  268. package/src/styles/tokens/_typography.scss +40 -0
  269. package/src/styles/tokens/_z-index.scss +11 -0
@@ -0,0 +1,306 @@
1
+ // Switch (HTML reference .dt-switch). Every dimension is a local variable set per size;
2
+ // the thumb sits 2px inside the track, and the halo follows the thumb centre.
3
+ .dt-switch {
4
+ --dt-switch-w: 44px;
5
+ --dt-switch-h: 24px;
6
+ --dt-switch-thumb-size: 20px;
7
+ --dt-switch-icon-size: 12px;
8
+ --dt-switch-halo: 36px;
9
+ --dt-switch-gap: 10px;
10
+ --dt-switch-font-size: var(--dt-font-size-md);
11
+ --dt-switch-square-radius: 6px;
12
+ --dt-switch-square-thumb-radius: 4px;
13
+ --dt-switch-square-halo-radius: 8px;
14
+ --dt-switch-inset: calc((var(--dt-switch-h) - var(--dt-switch-thumb-size)) / 2);
15
+ --dt-switch-travel: calc(var(--dt-switch-w) - var(--dt-switch-thumb-size) - 2 * var(--dt-switch-inset));
16
+ --dt-switch-on: var(--dt-color-primary);
17
+ --dt-switch-off: var(--dt-color-border-strong);
18
+ --dt-switch-thumb: var(--dt-color-surface);
19
+ // 1 in left-to-right, -1 in right-to-left: the thumb, halo, and press wave travel toward the
20
+ // inline end (D32 item 7).
21
+ --dt-switch-dir: 1;
22
+
23
+ position: relative;
24
+ display: inline-flex;
25
+ align-items: center;
26
+ gap: var(--dt-switch-gap);
27
+ // The label is the hit area. At least 24px tall (WCAG 2.5.8, D32 item 9): xs and sm tracks are
28
+ // 16 and 20px, so the label, not the track, grows; the track keeps its size.
29
+ min-height: max(24px, calc(var(--dt-switch-h) + var(--dt-space-1)));
30
+ color: var(--dt-color-text);
31
+ font-size: var(--dt-switch-font-size);
32
+ cursor: pointer;
33
+ }
34
+
35
+ // :dir() follows the resolved direction, so `dir="rtl"` on any ancestor applies and a `dir="ltr"`
36
+ // island inside an RTL page keeps the left-to-right travel.
37
+ .dt-switch:dir(rtl) {
38
+ --dt-switch-dir: -1;
39
+ }
40
+
41
+ .dt-switch--xs {
42
+ --dt-switch-w: 28px;
43
+ --dt-switch-h: 16px;
44
+ --dt-switch-thumb-size: 12px;
45
+ --dt-switch-icon-size: 8px;
46
+ --dt-switch-halo: 24px;
47
+ --dt-switch-gap: 6px;
48
+ --dt-switch-font-size: var(--dt-font-size-xs);
49
+ --dt-switch-square-radius: 4px;
50
+ --dt-switch-square-thumb-radius: 3px;
51
+ --dt-switch-square-halo-radius: 6px;
52
+ }
53
+
54
+ .dt-switch--sm {
55
+ --dt-switch-w: 36px;
56
+ --dt-switch-h: 20px;
57
+ --dt-switch-thumb-size: 16px;
58
+ --dt-switch-icon-size: 10px;
59
+ --dt-switch-halo: 30px;
60
+ --dt-switch-gap: 8px;
61
+ --dt-switch-font-size: var(--dt-font-size-sm);
62
+ --dt-switch-square-radius: 5px;
63
+ --dt-switch-square-thumb-radius: 4px;
64
+ --dt-switch-square-halo-radius: 7px;
65
+ }
66
+
67
+ .dt-switch--lg {
68
+ --dt-switch-w: 52px;
69
+ --dt-switch-h: 28px;
70
+ --dt-switch-thumb-size: 24px;
71
+ --dt-switch-icon-size: 14px;
72
+ --dt-switch-halo: 42px;
73
+ --dt-switch-gap: 12px;
74
+ --dt-switch-font-size: var(--dt-font-size-lg);
75
+ --dt-switch-square-radius: 7px;
76
+ --dt-switch-square-thumb-radius: 5px;
77
+ --dt-switch-square-halo-radius: 9px;
78
+ }
79
+
80
+ .dt-switch--xl {
81
+ --dt-switch-w: 60px;
82
+ --dt-switch-h: 34px;
83
+ --dt-switch-thumb-size: 30px;
84
+ --dt-switch-icon-size: 16px;
85
+ --dt-switch-halo: 48px;
86
+ --dt-switch-gap: 14px;
87
+ --dt-switch-font-size: var(--dt-font-size-xl);
88
+ --dt-switch-square-radius: 8px;
89
+ --dt-switch-square-thumb-radius: 6px;
90
+ --dt-switch-square-halo-radius: 10px;
91
+ }
92
+
93
+ .dt-switch__control {
94
+ position: absolute;
95
+ width: 1px;
96
+ height: 1px;
97
+ margin: 0;
98
+ opacity: 0;
99
+ }
100
+
101
+ .dt-switch__track {
102
+ position: relative;
103
+ isolation: isolate;
104
+ display: block;
105
+ flex: 0 0 var(--dt-switch-w);
106
+ width: var(--dt-switch-w);
107
+ height: var(--dt-switch-h);
108
+ border-radius: var(--dt-radius-full);
109
+ background: var(--dt-switch-off);
110
+ transition: background var(--dt-duration-base), box-shadow var(--dt-duration-fast);
111
+ }
112
+
113
+ .dt-switch__thumb {
114
+ position: absolute;
115
+ z-index: 1;
116
+ top: var(--dt-switch-inset);
117
+ inset-inline-start: var(--dt-switch-inset);
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ width: var(--dt-switch-thumb-size);
122
+ height: var(--dt-switch-thumb-size);
123
+ border-radius: 50%;
124
+ color: var(--dt-color-text-muted);
125
+ background: var(--dt-switch-thumb);
126
+ box-shadow: var(--dt-shadow-xs);
127
+ transition: transform var(--dt-duration-base) var(--dt-ease-standard), color var(--dt-duration-fast);
128
+ }
129
+
130
+ .dt-switch--square {
131
+ .dt-switch__track {
132
+ border-radius: var(--dt-switch-square-radius);
133
+ }
134
+
135
+ .dt-switch__thumb {
136
+ border-radius: var(--dt-switch-square-thumb-radius);
137
+ }
138
+
139
+ .dt-switch__halo {
140
+ border-radius: var(--dt-switch-square-halo-radius);
141
+ }
142
+ }
143
+
144
+ // Cross when off, check when on; strokes stay 2px at every size.
145
+ .dt-switch__icon {
146
+ position: absolute;
147
+ width: var(--dt-switch-icon-size);
148
+ height: var(--dt-switch-icon-size);
149
+ fill: none;
150
+ stroke: currentColor;
151
+ stroke-width: 2;
152
+ stroke-linecap: round;
153
+ stroke-linejoin: round;
154
+ transition: opacity var(--dt-duration-base) var(--dt-ease-standard), transform var(--dt-duration-base) var(--dt-ease-standard);
155
+
156
+ path {
157
+ vector-effect: non-scaling-stroke;
158
+ }
159
+ }
160
+
161
+ // A tandd-icon from true-icon / false-icon: 24px grid, so a heavier stroke keeps it as bold as the
162
+ // drawn 2px marks at the thumb's icon size.
163
+ .dt-switch__icon--custom {
164
+ --dt-icon-stroke: 2.5;
165
+
166
+ stroke-width: var(--dt-icon-stroke);
167
+
168
+ path {
169
+ vector-effect: none;
170
+ }
171
+ }
172
+
173
+ .dt-switch__icon--on {
174
+ opacity: 0;
175
+ transform: scale(0.65);
176
+ }
177
+
178
+ .dt-switch__control:checked + .dt-switch__track {
179
+ background: var(--dt-switch-on);
180
+
181
+ .dt-switch__thumb {
182
+ color: var(--dt-switch-on);
183
+ transform: translateX(calc(var(--dt-switch-travel) * var(--dt-switch-dir)));
184
+ }
185
+
186
+ .dt-switch__icon--on {
187
+ opacity: 1;
188
+ transform: scale(1);
189
+ }
190
+
191
+ .dt-switch__icon--off {
192
+ opacity: 0;
193
+ transform: scale(0.65);
194
+ }
195
+
196
+ .dt-switch__halo {
197
+ transform: translate(calc((-50% + var(--dt-switch-travel)) * var(--dt-switch-dir)), -50%);
198
+ }
199
+ }
200
+
201
+ // Keyboard focus draws the global solid ring on the track. The reference's 23% halo alone was
202
+ // 1.4:1 against the page, below WCAG 1.4.11's 3:1 for a focus indicator (round 8, T8-F9).
203
+ .dt-switch__control:focus-visible + .dt-switch__track {
204
+ outline: var(--dt-focus-ring-width) solid var(--dt-focus-ring-color);
205
+ outline-offset: var(--dt-focus-ring-offset);
206
+ }
207
+
208
+ .dt-switch__halo {
209
+ position: absolute;
210
+ z-index: 0;
211
+ top: 50%;
212
+ inset-inline-start: calc(var(--dt-switch-inset) + var(--dt-switch-thumb-size) / 2);
213
+ width: var(--dt-switch-halo);
214
+ height: var(--dt-switch-halo);
215
+ overflow: hidden;
216
+ border-radius: 50%;
217
+ pointer-events: none;
218
+ transform: translate(calc(-50% * var(--dt-switch-dir)), -50%);
219
+ transition: transform var(--dt-duration-base) var(--dt-ease-standard), background var(--dt-duration-fast);
220
+ }
221
+
222
+ // As on DTCheckbox/DTRadio: ripple off also turns off the hover halo the ripple grows in.
223
+ .dt-switch:not(.is-disabled, .is-loading, .dt-switch--no-ripple):hover .dt-switch__halo {
224
+ background: color-mix(in srgb, var(--dt-color-primary) 7%, transparent);
225
+ }
226
+
227
+ .dt-switch__wave {
228
+ position: absolute;
229
+ inset: 0;
230
+ border-radius: inherit;
231
+ background: color-mix(in srgb, var(--dt-color-primary) 20%, transparent);
232
+ transform: scale(0);
233
+ animation: dt-choice-ripple 700ms var(--dt-ease-standard) forwards;
234
+ }
235
+
236
+ // Loading: a spinner replaces the thumb icons and the switch cannot be toggled.
237
+ .dt-switch__thumb .dt-switch__spinner {
238
+ --dt-spinner-size: var(--dt-switch-icon-size);
239
+ --dt-spinner-thickness: 2px;
240
+ }
241
+
242
+ .dt-switch.is-loading {
243
+ cursor: progress;
244
+ }
245
+
246
+ .dt-switch.is-disabled {
247
+ cursor: not-allowed;
248
+
249
+ .dt-switch__track {
250
+ opacity: 0.5;
251
+ }
252
+ }
253
+
254
+ // Forced colors (Windows high contrast, D32): the track fill disappears, so the track gets a
255
+ // ButtonText border and the thumb a solid fill. On: the track border and thumb turn Highlight, so
256
+ // "on" is visible from colour and from the thumb's position, not only from the ✓/✗ glyph.
257
+ @media (forced-colors: active) {
258
+ .dt-switch__track {
259
+ border: 1px solid ButtonText;
260
+ background: Canvas;
261
+ }
262
+
263
+ .dt-switch__thumb {
264
+ top: calc(var(--dt-switch-inset) - 1px);
265
+ inset-inline-start: calc(var(--dt-switch-inset) - 1px);
266
+ color: Canvas;
267
+ background: ButtonText;
268
+ }
269
+
270
+ .dt-switch__control:checked + .dt-switch__track {
271
+ border-color: Highlight;
272
+ background: Canvas;
273
+
274
+ .dt-switch__thumb {
275
+ color: HighlightText;
276
+ background: Highlight;
277
+ }
278
+ }
279
+
280
+ .dt-switch__control:focus-visible + .dt-switch__track {
281
+ outline-color: Highlight;
282
+ }
283
+
284
+ .dt-switch.is-disabled {
285
+ color: GrayText;
286
+
287
+ .dt-switch__track {
288
+ border-color: GrayText;
289
+ opacity: 1;
290
+ }
291
+
292
+ .dt-switch__thumb,
293
+ .dt-switch__control:checked + .dt-switch__track .dt-switch__thumb {
294
+ color: Canvas;
295
+ background: GrayText;
296
+ }
297
+ }
298
+ }
299
+
300
+ @media (prefers-reduced-motion: reduce) {
301
+ .dt-switch__thumb,
302
+ .dt-switch__halo,
303
+ .dt-switch__icon {
304
+ transition: none;
305
+ }
306
+ }
@@ -0,0 +1,287 @@
1
+ // Table (HTML reference .dt-table-wrap / .dt-table). Native <table> markup goes in the slot;
2
+ // add `dt-table-num` to numeric cells.
3
+ .dt-table-wrap {
4
+ width: 100%;
5
+ max-height: var(--dt-table-max-height, none);
6
+ overflow: auto;
7
+ overscroll-behavior: contain;
8
+ border: 1px solid var(--dt-color-border);
9
+ border-radius: var(--dt-radius-md);
10
+ background: var(--dt-color-surface);
11
+ }
12
+
13
+ // `height`: the scroll area keeps its height even when the rows are fewer.
14
+ .dt-table-wrap--fixed-height {
15
+ height: var(--dt-table-height);
16
+ }
17
+
18
+ .dt-table-wrap:focus-visible {
19
+ outline: 2px solid var(--dt-color-primary);
20
+ outline-offset: 2px;
21
+ }
22
+
23
+ // Separate borders with no spacing look the same as collapsed ones, but they stay on sticky
24
+ // cells (collapsed borders belong to the table and are left behind when a cell sticks).
25
+ .dt-table {
26
+ --dt-table-row-bg: var(--dt-color-surface);
27
+ --dt-table-head-bg: var(--dt-color-surface-muted);
28
+
29
+ width: 100%;
30
+ border-collapse: separate;
31
+ border-spacing: 0;
32
+ color: var(--dt-color-text);
33
+ font-size: var(--dt-font-size-sm);
34
+
35
+ th,
36
+ td {
37
+ padding: var(--dt-space-3) var(--dt-space-4);
38
+ border-bottom: 1px solid var(--dt-color-border);
39
+ text-align: left;
40
+ vertical-align: middle;
41
+ white-space: nowrap;
42
+ }
43
+
44
+ thead th {
45
+ color: var(--dt-color-text-muted);
46
+ background: var(--dt-table-head-bg);
47
+ font-size: var(--dt-font-size-xs);
48
+ font-weight: var(--dt-font-weight-semibold);
49
+ letter-spacing: var(--dt-letter-spacing-wide);
50
+ text-transform: uppercase;
51
+ }
52
+
53
+ tbody tr:last-child > * {
54
+ border-bottom: 0;
55
+ }
56
+
57
+ caption {
58
+ padding: var(--dt-space-3) var(--dt-space-4);
59
+ color: var(--dt-color-text-muted);
60
+ font-size: var(--dt-font-size-xs);
61
+ text-align: left;
62
+ caption-side: bottom;
63
+ }
64
+
65
+ :is(th, td).dt-table-num {
66
+ font-variant-numeric: tabular-nums;
67
+ text-align: right;
68
+ }
69
+ }
70
+
71
+ // Row colours go through --dt-table-row-bg, so a fixed (sticky) first cell paints the same colour
72
+ // as its row and hides what scrolls under it.
73
+ .dt-table tbody tr {
74
+ background: var(--dt-table-row-bg);
75
+ }
76
+
77
+ .dt-table--striped tbody tr:nth-child(even) {
78
+ --dt-table-row-bg: var(--dt-color-surface-muted);
79
+ }
80
+
81
+ .dt-table--hover tbody tr:hover {
82
+ --dt-table-row-bg: var(--dt-color-surface-hover);
83
+ }
84
+
85
+ .dt-table tfoot :is(th, td) {
86
+ border-top: 1px solid var(--dt-color-border);
87
+ border-bottom: 0;
88
+ background: var(--dt-table-head-bg);
89
+ font-weight: var(--dt-font-weight-semibold);
90
+ }
91
+
92
+ // fixed-header (default) / fixed-footer: the thead and tfoot rows stick to the scroll area's edges.
93
+ .dt-table--fixed-header thead :is(th, td) {
94
+ position: sticky;
95
+ z-index: 2;
96
+ top: 0;
97
+ }
98
+
99
+ .dt-table--fixed-footer tfoot :is(th, td) {
100
+ position: sticky;
101
+ z-index: 2;
102
+ bottom: 0;
103
+ }
104
+
105
+ // fixed-column: the first cell of every row sticks to the start edge. Its shadow shows only once
106
+ // the table has scrolled sideways (.is-scrolled-x), so it marks content hidden under the column.
107
+ .dt-table--fixed-column tr > :first-child {
108
+ position: sticky;
109
+ z-index: 1;
110
+ inset-inline-start: 0;
111
+ background: var(--dt-table-row-bg);
112
+ transition: box-shadow var(--dt-duration-fast);
113
+ }
114
+
115
+ .dt-table--fixed-column :is(thead, tfoot) tr > :first-child {
116
+ z-index: 3;
117
+ background: var(--dt-table-head-bg);
118
+ }
119
+
120
+ .is-scrolled-x > .dt-table--fixed-column tr > :first-child {
121
+ box-shadow: 6px 0 6px -4px color-mix(in srgb, var(--dt-color-foreground) 18%, transparent);
122
+ }
123
+
124
+ [dir="rtl"] .is-scrolled-x > .dt-table--fixed-column tr > :first-child {
125
+ box-shadow: -6px 0 6px -4px color-mix(in srgb, var(--dt-color-foreground) 18%, transparent);
126
+ }
127
+
128
+ // Virtual mode: spacer rows stand in for the rows outside the window. They are skipped when
129
+ // striping, and the window always starts on an even row, so stripes follow the real row index.
130
+ .dt-table .dt-table__spacer > td {
131
+ padding: 0;
132
+ border: 0;
133
+ }
134
+
135
+ .dt-table--virtual.dt-table--striped tbody tr:nth-child(even) {
136
+ --dt-table-row-bg: var(--dt-color-surface);
137
+ }
138
+
139
+ .dt-table--virtual.dt-table--striped tbody tr:nth-child(even of :not(.dt-table__spacer)) {
140
+ --dt-table-row-bg: var(--dt-color-surface-muted);
141
+ }
142
+
143
+ .dt-table--virtual.dt-table--striped.dt-table--hover tbody tr:not(.dt-table__spacer):hover {
144
+ --dt-table-row-bg: var(--dt-color-surface-hover);
145
+ }
146
+
147
+ .dt-table--virtual.dt-table--hover tbody tr.dt-table__spacer:hover {
148
+ --dt-table-row-bg: var(--dt-color-surface);
149
+ }
150
+
151
+ .dt-table--compact :is(th, td) {
152
+ padding: var(--dt-space-2) var(--dt-space-3);
153
+ }
154
+
155
+ @media (prefers-reduced-motion: reduce) {
156
+ .dt-table--fixed-column tr > :first-child {
157
+ transition: none;
158
+ }
159
+ }
160
+
161
+ // body-scroll (D29): the native scrollbars are hidden and DTTableScrollbars draws its own, so the
162
+ // vertical bar runs beside the body rows only, below a sticky header and above a sticky footer.
163
+ // The box is a one-cell grid: the table and the zero-height bar layer share the cell, which spans
164
+ // the whole scroll area, so the layer can stick to the visible top-left corner in both directions.
165
+ .dt-table-wrap--body-scroll {
166
+ display: grid;
167
+ grid-template: auto / auto;
168
+ scrollbar-width: none;
169
+
170
+ &::-webkit-scrollbar {
171
+ display: none;
172
+ }
173
+
174
+ > .dt-table,
175
+ > .dt-table-scrollbars {
176
+ grid-area: 1 / 1;
177
+ }
178
+ }
179
+
180
+ .dt-table-scrollbars {
181
+ position: sticky;
182
+ z-index: 4;
183
+ top: 0;
184
+ left: 0;
185
+ align-self: start;
186
+ justify-self: start;
187
+ width: var(--dt-scrollbars-width, 100%);
188
+ height: 0;
189
+ pointer-events: none;
190
+ }
191
+
192
+ .dt-table-scrollbars__track {
193
+ position: absolute;
194
+ pointer-events: auto;
195
+ }
196
+
197
+ .dt-table-scrollbars__track--y {
198
+ right: 2px;
199
+ width: 10px;
200
+ }
201
+
202
+ .dt-table-scrollbars__track--x {
203
+ top: calc(var(--dt-scrollbars-height, 0px) - 12px);
204
+ left: 2px;
205
+ height: 10px;
206
+ }
207
+
208
+ .dt-table-scrollbars__thumb {
209
+ position: absolute;
210
+ border-radius: var(--dt-radius-full);
211
+ background: color-mix(in srgb, var(--dt-color-foreground) 28%, transparent);
212
+ transition: background var(--dt-duration-fast), width var(--dt-duration-fast), height var(--dt-duration-fast), inset var(--dt-duration-fast);
213
+ touch-action: none;
214
+ }
215
+
216
+ .dt-table-scrollbars__track--y .dt-table-scrollbars__thumb {
217
+ top: 0;
218
+ right: 2px;
219
+ width: 6px;
220
+ transform: translateY(var(--dt-scrollbar-offset, 0px));
221
+ }
222
+
223
+ .dt-table-scrollbars__track--x .dt-table-scrollbars__thumb {
224
+ bottom: 2px;
225
+ left: 0;
226
+ height: 6px;
227
+ transform: translateX(var(--dt-scrollbar-offset, 0px));
228
+ }
229
+
230
+ // Hovering or dragging a bar widens its thumb, as overlay scrollbars do.
231
+ .dt-table-scrollbars__track--y:hover .dt-table-scrollbars__thumb,
232
+ .dt-table-scrollbars__track--y.is-active .dt-table-scrollbars__thumb {
233
+ right: 1px;
234
+ width: 8px;
235
+ }
236
+
237
+ .dt-table-scrollbars__track--x:hover .dt-table-scrollbars__thumb,
238
+ .dt-table-scrollbars__track--x.is-active .dt-table-scrollbars__thumb {
239
+ bottom: 1px;
240
+ height: 8px;
241
+ }
242
+
243
+ .dt-table-scrollbars__track:hover .dt-table-scrollbars__thumb {
244
+ background: color-mix(in srgb, var(--dt-color-foreground) 42%, transparent);
245
+ }
246
+
247
+ .dt-table-scrollbars__track.is-active .dt-table-scrollbars__thumb {
248
+ background: color-mix(in srgb, var(--dt-color-foreground) 55%, transparent);
249
+ }
250
+
251
+ .dt-table-scrollbars.is-dragging {
252
+ user-select: none;
253
+ }
254
+
255
+ // RTL: the vertical bar sits on the left edge; the horizontal thumb runs from the right.
256
+ [dir="rtl"] .dt-table-scrollbars {
257
+ right: 0;
258
+ left: auto;
259
+ justify-self: end;
260
+ }
261
+
262
+ [dir="rtl"] .dt-table-scrollbars__track--y {
263
+ right: auto;
264
+ left: 2px;
265
+ }
266
+
267
+ [dir="rtl"] .dt-table-scrollbars__track--y .dt-table-scrollbars__thumb {
268
+ right: auto;
269
+ left: 2px;
270
+ }
271
+
272
+ [dir="rtl"] .dt-table-scrollbars__track--x {
273
+ right: 2px;
274
+ left: auto;
275
+ }
276
+
277
+ [dir="rtl"] .dt-table-scrollbars__track--x .dt-table-scrollbars__thumb {
278
+ right: 0;
279
+ left: auto;
280
+ transform: translateX(calc(-1 * var(--dt-scrollbar-offset, 0px)));
281
+ }
282
+
283
+ @media (prefers-reduced-motion: reduce) {
284
+ .dt-table-scrollbars__thumb {
285
+ transition: none;
286
+ }
287
+ }