@designil/labdsnov 0.0.0-stage → 1.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 (290) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -2
  3. package/dist/components/Accordion/Accordion.d.ts +8 -0
  4. package/dist/components/Accordion/Accordion.js +82 -0
  5. package/dist/components/Accordion/Accordion.module.css.js +23 -0
  6. package/dist/components/Accordion/index.d.ts +1 -0
  7. package/dist/components/Alert/Alert.d.ts +17 -0
  8. package/dist/components/Alert/Alert.js +58 -0
  9. package/dist/components/Alert/Alert.module.css.js +17 -0
  10. package/dist/components/Alert/index.d.ts +1 -0
  11. package/dist/components/AlertDialog/AlertDialog.d.ts +29 -0
  12. package/dist/components/AlertDialog/AlertDialog.js +150 -0
  13. package/dist/components/AlertDialog/AlertDialog.module.css.js +23 -0
  14. package/dist/components/AlertDialog/index.d.ts +1 -0
  15. package/dist/components/Avatar/Avatar.d.ts +23 -0
  16. package/dist/components/Avatar/Avatar.js +84 -0
  17. package/dist/components/Avatar/Avatar.module.css.js +23 -0
  18. package/dist/components/Avatar/index.d.ts +1 -0
  19. package/dist/components/Badge/Badge.d.ts +17 -0
  20. package/dist/components/Badge/Badge.js +37 -0
  21. package/dist/components/Badge/Badge.module.css.js +19 -0
  22. package/dist/components/Badge/index.d.ts +1 -0
  23. package/dist/components/Breadcrumb/Breadcrumb.d.ts +15 -0
  24. package/dist/components/Breadcrumb/Breadcrumb.js +111 -0
  25. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +19 -0
  26. package/dist/components/Breadcrumb/index.d.ts +1 -0
  27. package/dist/components/Button/Button.d.ts +39 -0
  28. package/dist/components/Button/Button.js +62 -0
  29. package/dist/components/Button/Button.module.css.js +37 -0
  30. package/dist/components/Button/index.d.ts +1 -0
  31. package/dist/components/ButtonGroup/ButtonGroup.d.ts +21 -0
  32. package/dist/components/ButtonGroup/ButtonGroup.js +59 -0
  33. package/dist/components/ButtonGroup/ButtonGroup.module.css.js +15 -0
  34. package/dist/components/ButtonGroup/index.d.ts +1 -0
  35. package/dist/components/Calendar/Calendar.d.ts +17 -0
  36. package/dist/components/Calendar/Calendar.js +154 -0
  37. package/dist/components/Calendar/Calendar.module.css.js +67 -0
  38. package/dist/components/Calendar/index.d.ts +1 -0
  39. package/dist/components/Card/Card.d.ts +20 -0
  40. package/dist/components/Card/Card.js +87 -0
  41. package/dist/components/Card/Card.module.css.js +23 -0
  42. package/dist/components/Card/index.d.ts +1 -0
  43. package/dist/components/Chart/Chart.d.ts +59 -0
  44. package/dist/components/Chart/Chart.js +199 -0
  45. package/dist/components/Chart/Chart.module.css.js +47 -0
  46. package/dist/components/Chart/index.d.ts +1 -0
  47. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  48. package/dist/components/Checkbox/Checkbox.js +44 -0
  49. package/dist/components/Checkbox/Checkbox.module.css.js +13 -0
  50. package/dist/components/Checkbox/index.d.ts +1 -0
  51. package/dist/components/Collapsible/Collapsible.d.ts +8 -0
  52. package/dist/components/Collapsible/Collapsible.js +28 -0
  53. package/dist/components/Collapsible/Collapsible.module.css.js +7 -0
  54. package/dist/components/Collapsible/index.d.ts +1 -0
  55. package/dist/components/Combobox/Combobox.d.ts +36 -0
  56. package/dist/components/Combobox/Combobox.js +296 -0
  57. package/dist/components/Combobox/Combobox.module.css.js +39 -0
  58. package/dist/components/Combobox/index.d.ts +1 -0
  59. package/dist/components/DatePicker/DatePicker.d.ts +28 -0
  60. package/dist/components/DatePicker/DatePicker.js +73 -0
  61. package/dist/components/DatePicker/DatePicker.module.css.js +9 -0
  62. package/dist/components/DatePicker/index.d.ts +1 -0
  63. package/dist/components/Dialog/Dialog.d.ts +27 -0
  64. package/dist/components/Dialog/Dialog.js +144 -0
  65. package/dist/components/Dialog/Dialog.module.css.js +29 -0
  66. package/dist/components/Dialog/index.d.ts +1 -0
  67. package/dist/components/Drawer/Drawer.d.ts +22 -0
  68. package/dist/components/Drawer/Drawer.js +166 -0
  69. package/dist/components/Drawer/Drawer.module.css.js +23 -0
  70. package/dist/components/Drawer/index.d.ts +1 -0
  71. package/dist/components/DropdownMenu/DropdownMenu.d.ts +32 -0
  72. package/dist/components/DropdownMenu/DropdownMenu.js +245 -0
  73. package/dist/components/DropdownMenu/DropdownMenu.module.css.js +33 -0
  74. package/dist/components/DropdownMenu/index.d.ts +1 -0
  75. package/dist/components/Empty/Empty.d.ts +18 -0
  76. package/dist/components/Empty/Empty.js +76 -0
  77. package/dist/components/Empty/Empty.module.css.js +21 -0
  78. package/dist/components/Empty/index.d.ts +1 -0
  79. package/dist/components/Field/Field.d.ts +53 -0
  80. package/dist/components/Field/Field.js +172 -0
  81. package/dist/components/Field/Field.module.css.js +41 -0
  82. package/dist/components/Field/index.d.ts +1 -0
  83. package/dist/components/FundCard/FundCard.d.ts +18 -0
  84. package/dist/components/FundCard/FundCard.js +66 -0
  85. package/dist/components/FundCard/FundCard.module.css.js +25 -0
  86. package/dist/components/FundCard/index.d.ts +1 -0
  87. package/dist/components/HoverCard/HoverCard.d.ts +8 -0
  88. package/dist/components/HoverCard/HoverCard.js +42 -0
  89. package/dist/components/HoverCard/HoverCard.module.css.js +9 -0
  90. package/dist/components/HoverCard/index.d.ts +1 -0
  91. package/dist/components/Input/Input.d.ts +12 -0
  92. package/dist/components/Input/Input.js +23 -0
  93. package/dist/components/Input/Input.module.css.js +11 -0
  94. package/dist/components/Input/index.d.ts +1 -0
  95. package/dist/components/InputGroup/InputGroup.d.ts +39 -0
  96. package/dist/components/InputGroup/InputGroup.js +103 -0
  97. package/dist/components/InputGroup/InputGroup.module.css.js +31 -0
  98. package/dist/components/InputGroup/index.d.ts +1 -0
  99. package/dist/components/InputOTP/InputOTP.d.ts +18 -0
  100. package/dist/components/InputOTP/InputOTP.js +72 -0
  101. package/dist/components/InputOTP/InputOTP.module.css.js +19 -0
  102. package/dist/components/InputOTP/index.d.ts +1 -0
  103. package/dist/components/Kbd/Kbd.d.ts +5 -0
  104. package/dist/components/Kbd/Kbd.js +20 -0
  105. package/dist/components/Kbd/Kbd.module.css.js +9 -0
  106. package/dist/components/Kbd/index.d.ts +1 -0
  107. package/dist/components/Label/Label.d.ts +7 -0
  108. package/dist/components/Label/Label.js +17 -0
  109. package/dist/components/Label/Label.module.css.js +9 -0
  110. package/dist/components/Label/index.d.ts +1 -0
  111. package/dist/components/NavigationMenu/NavigationMenu.d.ts +20 -0
  112. package/dist/components/NavigationMenu/NavigationMenu.js +153 -0
  113. package/dist/components/NavigationMenu/NavigationMenu.module.css.js +29 -0
  114. package/dist/components/NavigationMenu/index.d.ts +1 -0
  115. package/dist/components/Pagination/Pagination.d.ts +29 -0
  116. package/dist/components/Pagination/Pagination.js +133 -0
  117. package/dist/components/Pagination/Pagination.module.css.js +19 -0
  118. package/dist/components/Pagination/index.d.ts +1 -0
  119. package/dist/components/Popover/Popover.d.ts +10 -0
  120. package/dist/components/Popover/Popover.js +78 -0
  121. package/dist/components/Popover/Popover.module.css.js +15 -0
  122. package/dist/components/Popover/index.d.ts +1 -0
  123. package/dist/components/Progress/Progress.d.ts +12 -0
  124. package/dist/components/Progress/Progress.js +74 -0
  125. package/dist/components/Progress/Progress.module.css.js +15 -0
  126. package/dist/components/Progress/index.d.ts +1 -0
  127. package/dist/components/RadioGroup/RadioGroup.d.ts +6 -0
  128. package/dist/components/RadioGroup/RadioGroup.js +37 -0
  129. package/dist/components/RadioGroup/RadioGroup.module.css.js +13 -0
  130. package/dist/components/RadioGroup/index.d.ts +1 -0
  131. package/dist/components/ScrollArea/ScrollArea.d.ts +9 -0
  132. package/dist/components/ScrollArea/ScrollArea.js +60 -0
  133. package/dist/components/ScrollArea/ScrollArea.module.css.js +17 -0
  134. package/dist/components/ScrollArea/index.d.ts +1 -0
  135. package/dist/components/Select/Select.d.ts +23 -0
  136. package/dist/components/Select/Select.js +188 -0
  137. package/dist/components/Select/Select.module.css.js +37 -0
  138. package/dist/components/Select/index.d.ts +1 -0
  139. package/dist/components/Separator/Separator.d.ts +4 -0
  140. package/dist/components/Separator/Separator.js +22 -0
  141. package/dist/components/Separator/Separator.module.css.js +7 -0
  142. package/dist/components/Separator/index.d.ts +1 -0
  143. package/dist/components/Skeleton/Skeleton.d.ts +4 -0
  144. package/dist/components/Skeleton/Skeleton.js +16 -0
  145. package/dist/components/Skeleton/Skeleton.module.css.js +7 -0
  146. package/dist/components/Skeleton/index.d.ts +1 -0
  147. package/dist/components/Slider/Slider.d.ts +13 -0
  148. package/dist/components/Slider/Slider.js +61 -0
  149. package/dist/components/Slider/Slider.module.css.js +15 -0
  150. package/dist/components/Slider/index.d.ts +1 -0
  151. package/dist/components/Spinner/Spinner.d.ts +6 -0
  152. package/dist/components/Spinner/Spinner.js +22 -0
  153. package/dist/components/Spinner/Spinner.module.css.js +7 -0
  154. package/dist/components/Spinner/index.d.ts +1 -0
  155. package/dist/components/Switch/Switch.d.ts +13 -0
  156. package/dist/components/Switch/Switch.js +29 -0
  157. package/dist/components/Switch/Switch.module.css.js +13 -0
  158. package/dist/components/Switch/index.d.ts +1 -0
  159. package/dist/components/Table/Table.d.ts +12 -0
  160. package/dist/components/Table/Table.js +96 -0
  161. package/dist/components/Table/Table.module.css.js +23 -0
  162. package/dist/components/Table/index.d.ts +1 -0
  163. package/dist/components/Tabs/Tabs.d.ts +16 -0
  164. package/dist/components/Tabs/Tabs.js +55 -0
  165. package/dist/components/Tabs/Tabs.module.css.js +17 -0
  166. package/dist/components/Tabs/index.d.ts +1 -0
  167. package/dist/components/Textarea/Textarea.d.ts +4 -0
  168. package/dist/components/Textarea/Textarea.js +16 -0
  169. package/dist/components/Textarea/Textarea.module.css.js +7 -0
  170. package/dist/components/Textarea/index.d.ts +1 -0
  171. package/dist/components/Toaster/Toaster.d.ts +8 -0
  172. package/dist/components/Toaster/Toaster.js +85 -0
  173. package/dist/components/Toaster/Toaster.module.css.js +11 -0
  174. package/dist/components/Toaster/index.d.ts +1 -0
  175. package/dist/components/Toggle/Toggle.d.ts +26 -0
  176. package/dist/components/Toggle/Toggle.js +35 -0
  177. package/dist/components/Toggle/Toggle.module.css.js +17 -0
  178. package/dist/components/Toggle/index.d.ts +1 -0
  179. package/dist/components/ToggleGroup/ToggleGroup.d.ts +20 -0
  180. package/dist/components/ToggleGroup/ToggleGroup.js +64 -0
  181. package/dist/components/ToggleGroup/ToggleGroup.module.css.js +11 -0
  182. package/dist/components/ToggleGroup/index.d.ts +1 -0
  183. package/dist/components/Tooltip/Tooltip.d.ts +8 -0
  184. package/dist/components/Tooltip/Tooltip.js +61 -0
  185. package/dist/components/Tooltip/Tooltip.module.css.js +11 -0
  186. package/dist/components/Tooltip/index.d.ts +1 -0
  187. package/dist/index.d.ts +47 -0
  188. package/dist/index.js +265 -0
  189. package/dist/styles.css +1 -0
  190. package/docs/Accessibility.md +129 -0
  191. package/docs/Colors.md +149 -0
  192. package/docs/ComponentTokens.md +191 -0
  193. package/docs/Contributing.md +104 -0
  194. package/docs/GettingStarted.md +106 -0
  195. package/docs/Radius.md +25 -0
  196. package/docs/Typography.md +38 -0
  197. package/package.json +88 -4
  198. package/src/components/Accordion/Accordion.dsds.yaml +195 -0
  199. package/src/components/Accordion/Accordion.md +102 -0
  200. package/src/components/Alert/Alert.dsds.yaml +206 -0
  201. package/src/components/Alert/Alert.md +90 -0
  202. package/src/components/AlertDialog/AlertDialog.dsds.yaml +243 -0
  203. package/src/components/AlertDialog/AlertDialog.md +131 -0
  204. package/src/components/Avatar/Avatar.dsds.yaml +172 -0
  205. package/src/components/Avatar/Avatar.md +77 -0
  206. package/src/components/Badge/Badge.dsds.yaml +191 -0
  207. package/src/components/Badge/Badge.md +124 -0
  208. package/src/components/Breadcrumb/Breadcrumb.dsds.yaml +162 -0
  209. package/src/components/Breadcrumb/Breadcrumb.md +110 -0
  210. package/src/components/Button/Button.dsds.yaml +350 -0
  211. package/src/components/Button/Button.md +165 -0
  212. package/src/components/ButtonGroup/ButtonGroup.dsds.yaml +193 -0
  213. package/src/components/ButtonGroup/ButtonGroup.md +96 -0
  214. package/src/components/Calendar/Calendar.dsds.yaml +236 -0
  215. package/src/components/Calendar/Calendar.md +111 -0
  216. package/src/components/Card/Card.dsds.yaml +199 -0
  217. package/src/components/Card/Card.md +99 -0
  218. package/src/components/Chart/Chart.dsds.yaml +216 -0
  219. package/src/components/Chart/Chart.md +112 -0
  220. package/src/components/Checkbox/Checkbox.dsds.yaml +215 -0
  221. package/src/components/Checkbox/Checkbox.md +105 -0
  222. package/src/components/Collapsible/Collapsible.dsds.yaml +146 -0
  223. package/src/components/Collapsible/Collapsible.md +86 -0
  224. package/src/components/Combobox/Combobox.dsds.yaml +241 -0
  225. package/src/components/Combobox/Combobox.md +143 -0
  226. package/src/components/DatePicker/DatePicker.dsds.yaml +179 -0
  227. package/src/components/DatePicker/DatePicker.md +82 -0
  228. package/src/components/Dialog/Dialog.dsds.yaml +300 -0
  229. package/src/components/Dialog/Dialog.md +193 -0
  230. package/src/components/Drawer/Drawer.dsds.yaml +207 -0
  231. package/src/components/Drawer/Drawer.md +125 -0
  232. package/src/components/DropdownMenu/DropdownMenu.dsds.yaml +265 -0
  233. package/src/components/DropdownMenu/DropdownMenu.md +151 -0
  234. package/src/components/Empty/Empty.dsds.yaml +171 -0
  235. package/src/components/Empty/Empty.md +90 -0
  236. package/src/components/Field/Field.dsds.yaml +285 -0
  237. package/src/components/Field/Field.md +139 -0
  238. package/src/components/FundCard/FundCard.dsds.yaml +195 -0
  239. package/src/components/FundCard/FundCard.md +93 -0
  240. package/src/components/HoverCard/HoverCard.dsds.yaml +157 -0
  241. package/src/components/HoverCard/HoverCard.md +100 -0
  242. package/src/components/Input/Input.dsds.yaml +235 -0
  243. package/src/components/Input/Input.md +115 -0
  244. package/src/components/InputGroup/InputGroup.dsds.yaml +234 -0
  245. package/src/components/InputGroup/InputGroup.md +115 -0
  246. package/src/components/InputOTP/InputOTP.dsds.yaml +184 -0
  247. package/src/components/InputOTP/InputOTP.md +105 -0
  248. package/src/components/Kbd/Kbd.dsds.yaml +119 -0
  249. package/src/components/Kbd/Kbd.md +85 -0
  250. package/src/components/Label/Label.dsds.yaml +141 -0
  251. package/src/components/Label/Label.md +75 -0
  252. package/src/components/NavigationMenu/NavigationMenu.dsds.yaml +196 -0
  253. package/src/components/NavigationMenu/NavigationMenu.md +128 -0
  254. package/src/components/Pagination/Pagination.dsds.yaml +172 -0
  255. package/src/components/Pagination/Pagination.md +115 -0
  256. package/src/components/Popover/Popover.dsds.yaml +168 -0
  257. package/src/components/Popover/Popover.md +111 -0
  258. package/src/components/Progress/Progress.dsds.yaml +169 -0
  259. package/src/components/Progress/Progress.md +83 -0
  260. package/src/components/RadioGroup/RadioGroup.dsds.yaml +215 -0
  261. package/src/components/RadioGroup/RadioGroup.md +123 -0
  262. package/src/components/ScrollArea/ScrollArea.dsds.yaml +153 -0
  263. package/src/components/ScrollArea/ScrollArea.md +88 -0
  264. package/src/components/Select/Select.dsds.yaml +239 -0
  265. package/src/components/Select/Select.md +170 -0
  266. package/src/components/Separator/Separator.dsds.yaml +121 -0
  267. package/src/components/Separator/Separator.md +68 -0
  268. package/src/components/Skeleton/Skeleton.dsds.yaml +124 -0
  269. package/src/components/Skeleton/Skeleton.md +68 -0
  270. package/src/components/Slider/Slider.dsds.yaml +194 -0
  271. package/src/components/Slider/Slider.md +107 -0
  272. package/src/components/Spinner/Spinner.dsds.yaml +126 -0
  273. package/src/components/Spinner/Spinner.md +64 -0
  274. package/src/components/Switch/Switch.dsds.yaml +198 -0
  275. package/src/components/Switch/Switch.md +101 -0
  276. package/src/components/Table/Table.dsds.yaml +195 -0
  277. package/src/components/Table/Table.md +117 -0
  278. package/src/components/Tabs/Tabs.dsds.yaml +239 -0
  279. package/src/components/Tabs/Tabs.md +173 -0
  280. package/src/components/Textarea/Textarea.dsds.yaml +167 -0
  281. package/src/components/Textarea/Textarea.md +89 -0
  282. package/src/components/Toaster/Toaster.dsds.yaml +226 -0
  283. package/src/components/Toaster/Toaster.md +107 -0
  284. package/src/components/Toggle/Toggle.dsds.yaml +224 -0
  285. package/src/components/Toggle/Toggle.md +103 -0
  286. package/src/components/ToggleGroup/ToggleGroup.dsds.yaml +230 -0
  287. package/src/components/ToggleGroup/ToggleGroup.md +95 -0
  288. package/src/components/Tooltip/Tooltip.dsds.yaml +202 -0
  289. package/src/components/Tooltip/Tooltip.md +104 -0
  290. package/src/index.dsds.yaml +467 -0
@@ -0,0 +1,162 @@
1
+ kind: component
2
+ id: breadcrumb
3
+ name: Breadcrumb
4
+ description: >-
5
+ A row of links showing where the current page sits, with a way back to earlier
6
+ pages. 14px muted text; the current page in normal colour; separated by a ›
7
+ chevron.
8
+ metadata:
9
+ status: {status: stable}
10
+ since: 1.0.0
11
+ tags: [navigation]
12
+
13
+ sections:
14
+ - kind: guidelines
15
+ for: all
16
+ framing: when-to-use
17
+ items:
18
+ - level: should
19
+ statement: >-
20
+ Use on pages more than 2 levels deep, e.g. บัญชีของฉัน › ใบแจ้งยอด › ปี 2569
21
+ (My account › Statements › Year 2569).
22
+ - level: should-not
23
+ statement: >-
24
+ Don't add it to top-level pages (just "หน้าแรก" home doesn't help).
25
+ - level: must-not
26
+ statement: >-
27
+ Never use it as the site's main menu; use <dsds:navigation-menu>.
28
+ alternatives:
29
+ - to: navigation-menu
30
+ checkedBy: manual
31
+ - level: must-not
32
+ statement: >-
33
+ Never use it to show ordered steps (there's no stepper component yet).
34
+ Breadcrumb shows position in the page structure, not progress.
35
+ checkedBy: manual
36
+
37
+ - kind: guidelines
38
+ for: all
39
+ items:
40
+ - id: last-is-page
41
+ level: must
42
+ statement: >-
43
+ The last item is a `BreadcrumbPage` (text, not a link) matching the page's
44
+ `h1`.
45
+ checks:
46
+ - href: ./Breadcrumb.stories.tsx#Playground
47
+ role: test
48
+ note: The play function checks there are 3 links and the current page has aria-current="page"
49
+ checkedBy: automated
50
+ - id: next-link-render
51
+ level: must
52
+ statement: >-
53
+ Next.js links use `<BreadcrumbLink render={<Link href="…" />}>`; plain links
54
+ use `href` directly. Never wrap a `Link` around `BreadcrumbLink`.
55
+ example:
56
+ ref:
57
+ href: ./Breadcrumb.stories.tsx#CustomLink
58
+ rel: demo
59
+ checkedBy: manual
60
+ - id: separator-between
61
+ level: must
62
+ statement: >-
63
+ `BreadcrumbSeparator` sits between `BreadcrumbItem`s as a sibling: not inside
64
+ an item, and not after the last item.
65
+ checkedBy: manual
66
+ - id: collapse-middle
67
+ level: should
68
+ statement: >-
69
+ Paths deeper than 4 levels hide the middle items behind `BreadcrumbEllipsis`,
70
+ keeping the first item and the last two.
71
+ example:
72
+ ref:
73
+ href: ./Breadcrumb.stories.tsx#Collapsed
74
+ rel: demo
75
+ checkedBy: manual
76
+ - id: short-names
77
+ level: should
78
+ statement: >-
79
+ Each item's name matches the page name but is short, 1–3 words. Items wrap to
80
+ a new line on narrow screens.
81
+ checkedBy: manual
82
+
83
+ - kind: guidelines
84
+ for: all
85
+ title: Accessibility
86
+ tags: [accessibility]
87
+ items:
88
+ - id: nav-landmark
89
+ level: must
90
+ statement: >-
91
+ `Breadcrumb` is a `<nav aria-label="เส้นทางนำทาง">` (breadcrumb trail) and the
92
+ current page has `aria-current="page"`. Don't change the `aria-label` to
93
+ English.
94
+ evidence:
95
+ - href: https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/
96
+ role: WAI-ARIA APG Breadcrumb pattern
97
+ checks:
98
+ - href: ./Breadcrumb.stories.tsx#Playground
99
+ role: test
100
+ checkedBy: automated
101
+ - id: separator-hidden
102
+ level: must
103
+ statement: >-
104
+ Separators and the "…" are hidden from screen readers. A custom separator
105
+ (e.g. "/") goes in as children of `BreadcrumbSeparator` so it stays hidden.
106
+ checkedBy: manual
107
+
108
+ - kind: definitions
109
+ for: all
110
+ context: anatomy
111
+ items:
112
+ - term: Breadcrumb
113
+ definition: >-
114
+ A `<nav>` named "เส้นทางนำทาง" (breadcrumb trail).
115
+ - term: BreadcrumbList
116
+ definition: >-
117
+ An `<ol>`; wraps on narrow screens.
118
+ - term: BreadcrumbItem
119
+ definition: >-
120
+ An `<li>`, one item.
121
+ - term: BreadcrumbLink
122
+ definition: >-
123
+ A link (`href` or `render`); darkens on hover, has a focus ring.
124
+ - term: BreadcrumbPage
125
+ definition: >-
126
+ The current page, `aria-current="page"`.
127
+ - term: BreadcrumbSeparator
128
+ definition: >-
129
+ A › chevron; pass children to use another symbol.
130
+ - term: BreadcrumbEllipsis
131
+ definition: >-
132
+ A "…" standing in for hidden middle items.
133
+
134
+ - kind: section
135
+ for: all
136
+ title: Open decisions
137
+ freeform:
138
+ - title: TODO
139
+ body: >-
140
+ There's no example yet of revealing the items hidden behind
141
+ `BreadcrumbEllipsis` (e.g. with DropdownMenu), and no stepper component.
142
+
143
+ sourceFiles:
144
+ - platform: react
145
+ file: ./Breadcrumb.tsx
146
+
147
+ imports:
148
+ - platform: react
149
+ code: >-
150
+ import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@designil/labdsnov"
151
+ package: "@designil/labdsnov"
152
+
153
+ alternatives:
154
+ - to: navigation-menu
155
+
156
+ refs:
157
+ - href: ./Breadcrumb.md
158
+ rel: relates-to
159
+ role: Usage doc in Thai
160
+ - href: ./Breadcrumb.stories.tsx
161
+ rel: demo
162
+ role: CSF stories
@@ -0,0 +1,110 @@
1
+ # Breadcrumb (เส้นทางนำทาง)
2
+
3
+ ## Purpose
4
+
5
+ แถวลิงก์บอกว่าหน้าปัจจุบันอยู่ตรงไหน และย้อนกลับไปหน้าก่อน ๆ ได้
6
+
7
+ ## Import and usage
8
+
9
+ **ตั้งค่าครั้งเดียวในแอป** (ใช้ร่วมกันทุกคอมโพเนนต์):
10
+
11
+ 1. ติดตั้ง `@designil/labdsnov` (`pnpm add @designil/labdsnov`) พร้อม `react` และ `react-dom` 19
12
+ 2. import สไตล์ครั้งเดียวที่ root layout: `import "@designil/labdsnov/styles.css"`
13
+ 3. กำหนดตัวแปร `--font-heading` (แอปใช้ IBM Plex Sans Thai) และใส่ class `dark` ที่ `<html>` เมื่อต้องการโหมดมืด
14
+
15
+ ```tsx
16
+ import Link from "next/link"
17
+ import {
18
+ Breadcrumb,
19
+ BreadcrumbItem,
20
+ BreadcrumbLink,
21
+ BreadcrumbList,
22
+ BreadcrumbPage,
23
+ BreadcrumbSeparator,
24
+ } from "@designil/labdsnov"
25
+
26
+ ;<Breadcrumb>
27
+ <BreadcrumbList>
28
+ <BreadcrumbItem>
29
+ <BreadcrumbLink render={<Link href="/" />}>หน้าแรก</BreadcrumbLink>
30
+ </BreadcrumbItem>
31
+ <BreadcrumbSeparator />
32
+ <BreadcrumbItem>
33
+ <BreadcrumbPage>ผู้รับผลประโยชน์</BreadcrumbPage>
34
+ </BreadcrumbItem>
35
+ </BreadcrumbList>
36
+ </Breadcrumb>
37
+ ```
38
+
39
+ - ลิงก์ของ Next.js ใช้ `render={<Link href="…" />}` ลิงก์ธรรมดาใช้ `href`
40
+ - รายการสุดท้ายเป็น `BreadcrumbPage` (ข้อความ ไม่ใช่ลิงก์)
41
+
42
+ ## When to use
43
+
44
+ - หน้าที่อยู่ลึกกว่า 2 ระดับ เช่น บัญชีของฉัน › ใบแจ้งยอด › ปี 2569
45
+
46
+ ## When not to use
47
+
48
+ - **หน้าระดับแรก**: ไม่ต้องมี
49
+ - **ขั้นตอนตามลำดับ**: TODO: ยังไม่มีคอมโพเนนต์ stepper
50
+ - **เมนูหลักของเว็บ**: ใช้ `NavigationMenu`
51
+
52
+ ## Props and variants
53
+
54
+ ไม่มี variant หรือ size ตัวอักษร 14px สี muted หน้าปัจจุบันสีปกติ
55
+
56
+ | ส่วน | ความหมาย |
57
+ | --------------------- | ----------------------------------------------------------------------------------- |
58
+ | `Breadcrumb` | `<nav>` ชื่อ "เส้นทางนำทาง" สำหรับโปรแกรมอ่านหน้าจอ |
59
+ | `BreadcrumbLink` | ลิงก์ (`href` หรือ `render`) เข้มขึ้นเมื่อ hover มีวงแหวน focus |
60
+ | `BreadcrumbPage` | หน้าปัจจุบัน (`aria-current="page"`) |
61
+ | `BreadcrumbSeparator` | ลูกศร › ระหว่างรายการ ใส่ children เพื่อใช้สัญลักษณ์อื่น เช่น "/" |
62
+ | `BreadcrumbEllipsis` | "…" แทนรายการกลางที่ซ่อนไว้ TODO: ยังไม่มีตัวอย่างการเปิดดูรายการที่ซ่อน (เช่น ด้วย `DropdownMenu`) |
63
+
64
+ บนจอแคบรายการขึ้นบรรทัดใหม่ได้
65
+
66
+ ## Tokens used
67
+
68
+ ค่าทั้งหมดมาจาก `src/styles/theme.css`
69
+
70
+ ### Component tokens
71
+
72
+ token เฉพาะของคอมโพเนนต์นี้ ชี้ไปที่ semantic token ด้านล่าง เปลี่ยนที่นี่เพื่อปรับเฉพาะคอมโพเนนต์นี้ (โหมดมืด "–" = ใช้ค่าเดียวกับโหมดสว่าง)
73
+
74
+ | Token | โหมดสว่าง | โหมดมืด | ใช้ใน |
75
+ | -------------- | -------- | ------ | --------------------------------------------- |
76
+ | `--focus-ring` | `--ring` | – | วงแหวน focus จากคีย์บอร์ดของทุกคอมโพเนนต์ (ทึบ 2px) |
77
+
78
+ ### Semantic tokens
79
+
80
+ | Token | โหมดสว่าง | โหมดมืด | ใช้ใน |
81
+ | -------------------- | -------------------------- | -------------------------- | ---------------------- |
82
+ | `--muted-foreground` | `oklch(0.5 0.027 107.3)` | `oklch(0.737 0.021 106.9)` | ลิงก์และตัวคั่น |
83
+ | `--foreground` | `oklch(0.153 0.006 107.1)` | `oklch(0.988 0.003 106.5)` | หน้าปัจจุบัน, ลิงก์ตอน hover |
84
+ | `--ring` | `oklch(0.45 0.03 106.9)` | `oklch(0.8 0.02 106.9)` | วงแหวน focus |
85
+
86
+ ## Example
87
+
88
+ จาก story `Collapsed` ใน `Breadcrumb.stories.tsx`:
89
+
90
+ ```tsx
91
+ <Breadcrumb>
92
+ <BreadcrumbList>
93
+ <BreadcrumbItem>
94
+ <BreadcrumbLink href="#home">หน้าแรก</BreadcrumbLink>
95
+ </BreadcrumbItem>
96
+ <BreadcrumbSeparator />
97
+ <BreadcrumbItem>
98
+ <BreadcrumbEllipsis />
99
+ </BreadcrumbItem>
100
+ <BreadcrumbSeparator />
101
+ <BreadcrumbItem>
102
+ <BreadcrumbLink href="#statements">ใบแจ้งยอด</BreadcrumbLink>
103
+ </BreadcrumbItem>
104
+ <BreadcrumbSeparator />
105
+ <BreadcrumbItem>
106
+ <BreadcrumbPage>ปี 2569</BreadcrumbPage>
107
+ </BreadcrumbItem>
108
+ </BreadcrumbList>
109
+ </Breadcrumb>
110
+ ```
@@ -0,0 +1,350 @@
1
+ kind: component
2
+ id: button
3
+ name: Button
4
+ description: >-
5
+ A button that triggers an action on the current page, such as submitting a form,
6
+ saving or opening a dialog. Pill-shaped, 14px medium text. Wraps Base UI's
7
+ `Button`.
8
+ metadata:
9
+ status: {status: stable}
10
+ since: 1.0.0
11
+ tags: [action, form]
12
+
13
+ sections:
14
+ - kind: guidelines
15
+ for: all
16
+ framing: when-to-use
17
+ items:
18
+ - level: should
19
+ statement: >-
20
+ Use for actions that happen on the current page, such as "บันทึก" (save),
21
+ "เพิ่มเงินสมทบ" (add contribution) or "ลบ" (delete), including form submit
22
+ buttons and buttons that open a dialog or menu.
23
+ - level: should
24
+ statement: >-
25
+ Use `size="icon"` with `variant="ghost"` for icon-only toolbar buttons, such
26
+ as "ตั้งค่า" (settings).
27
+ - level: must-not
28
+ statement: >-
29
+ Never use Button to go to another page. Use an `<a>` or `Link` with
30
+ `className={buttonVariants({ … })}` instead (story `AsLink`).
31
+ refs:
32
+ - to: shared-composition#link-looks-like-button
33
+ rel: same-as
34
+ - level: must-not
35
+ statement: Never use Button as a status label that can't be pressed; use <dsds:badge>.
36
+ alternatives:
37
+ - to: badge
38
+ checkedBy: manual
39
+ - level: must-not
40
+ statement: >-
41
+ Never use a group of buttons as on/off options; use <dsds:toggle> or
42
+ <dsds:toggle-group>, which carry `aria-pressed`.
43
+ alternatives:
44
+ - to: toggle
45
+ - to: toggle-group
46
+ checkedBy: manual
47
+
48
+ - kind: guidelines
49
+ for: all
50
+ items:
51
+ - id: one-primary
52
+ level: must
53
+ statement: >-
54
+ An area (a card, a dialog, a form's button row) has at most one `default`
55
+ button. Other buttons use `outline`, `secondary` or `ghost`.
56
+ checkedBy: manual
57
+ - id: submit-type
58
+ level: must
59
+ statement: >-
60
+ A form's submit button needs `type="submit"`. The default is
61
+ `type="button"`, which doesn't submit the form.
62
+ checkedBy: manual
63
+ - id: destructive-for-irreversible
64
+ level: must
65
+ statement: >-
66
+ Use `destructive` only for actions that delete or can't be undone, and have
67
+ it open an <dsds:alert-dialog> to confirm first rather than deleting at once.
68
+ uses:
69
+ - to: alert-dialog
70
+ checkedBy: manual
71
+ - id: cancel-is-outline
72
+ level: should
73
+ statement: >-
74
+ The button paired with the primary one, such as "ยกเลิก" (cancel), uses
75
+ `outline` (matching `AlertDialogCancel` and the cancel button in Dialog).
76
+ checkedBy: manual
77
+ - id: default-size
78
+ level: should
79
+ statement: >-
80
+ Use the default `size` (36px) when unsure. Icon buttons use the `icon*` size
81
+ that matches the text buttons next to them (`icon` with `default`,
82
+ `icon-sm` with `sm`).
83
+ checkedBy: manual
84
+ - id: full-width-auth
85
+ level: should
86
+ statement: >-
87
+ Login/register submit buttons use `fullWidth`, not `className="w-full"`.
88
+ checkedBy: manual
89
+ - id: icon-placement
90
+ level: should
91
+ statement: >-
92
+ An icon in a button with text gets `data-icon="inline-start"` or
93
+ `"inline-end"` so the padding on that side tightens to fit. Icons are 16px
94
+ (12px at `xs` and `icon-xs`).
95
+ example:
96
+ ref:
97
+ href: ./Button.stories.tsx#WithIcons
98
+ rel: demo
99
+ checkedBy: manual
100
+ - id: disabled-explain
101
+ level: should
102
+ statement: >-
103
+ If users need to know why they can't press a button, use `disabled` with
104
+ `focusableWhenDisabled` so it stays focusable and can carry an explanation
105
+ (e.g. a <dsds:tooltip>). A plain `disabled` button leaves the Tab order.
106
+ checks:
107
+ - href: ./Button.stories.tsx#FocusableWhenDisabled
108
+ role: test
109
+ note: The play function checks it's focusable, has aria-disabled, and Enter doesn't call onClick
110
+ checkedBy: automated
111
+ - id: secondary-vs-outline
112
+ level: may
113
+ statement: >-
114
+ Secondary actions may use either `outline` or `secondary` (no rule yet, see
115
+ Open decisions).
116
+ - id: no-classname-variant
117
+ level: should-not
118
+ statement: >-
119
+ Don't build a new button look with `className` repeated in several places;
120
+ ask for a new variant instead.
121
+ refs:
122
+ - to: shared-composition#classname-one-off
123
+ rel: same-as
124
+
125
+ - kind: guidelines
126
+ for: all
127
+ title: Content
128
+ tags: [content]
129
+ items:
130
+ - refs:
131
+ - to: shared-content#actions-are-verbs
132
+ rel: same-as
133
+ - refs:
134
+ - to: shared-content#thai-copy
135
+ rel: same-as
136
+
137
+ - kind: guidelines
138
+ for: all
139
+ title: Accessibility
140
+ tags: [accessibility]
141
+ items:
142
+ - id: icon-only-aria-label
143
+ level: must
144
+ statement: >-
145
+ An icon-only button (`size="icon*"`) needs a Thai `aria-label`.
146
+ refines:
147
+ - to: shared-a11y#icon-only-label
148
+ checkedBy: assisted
149
+ - id: contrast-verified
150
+ level: must
151
+ statement: >-
152
+ Every variant's text passes 4.5:1, normal and on hover. The pairs closest to
153
+ the limit are `destructive` on hover (4.70:1 light, 4.74:1 dark) and
154
+ `default` (4.93:1 light). Never lighten `--button-destructive-hover-bg` or
155
+ change `--primary` without running `pnpm tokens:check`.
156
+ evidence:
157
+ - href: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
158
+ role: WCAG 2.2 SC 1.4.3 (AA)
159
+ checks:
160
+ - href: ../../../scripts/tokens.mjs
161
+ role: test
162
+ note: All 10 "Button …" pairs in CONTRAST_PAIRS
163
+ checkedBy: automated
164
+ - id: keyboard-focus
165
+ level: must
166
+ statement: >-
167
+ Keyboard focus shows the `--focus-ring` ring on every variant, including
168
+ `destructive` and `link`.
169
+ refs:
170
+ - to: shared-a11y#focus-ring
171
+ rel: relates-to
172
+ checks:
173
+ - href: ./Button.stories.tsx#KeyboardFocus
174
+ role: test
175
+ note: The play function checks that Tab focuses the button (not the ring colour)
176
+ checkedBy: assisted
177
+ - id: xs-target-size
178
+ level: should-not
179
+ statement: >-
180
+ Don't use `xs` / `icon-xs` (24px) as a primary control on mobile, and don't
181
+ place them flush together without spacing: they're exactly the 24px minimum.
182
+ refines:
183
+ - to: shared-a11y#target-size
184
+ evidence:
185
+ - href: https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html
186
+ role: WCAG 2.2 SC 2.5.8 (AA)
187
+ checkedBy: manual
188
+ - refs:
189
+ - to: shared-a11y#no-focus-ring-override
190
+ rel: same-as
191
+
192
+ - kind: guidelines
193
+ for: agent
194
+ items:
195
+ - id: render-not-aschild
196
+ level: must
197
+ statement: >-
198
+ A button that opens a Dialog, Popover, DropdownMenu, etc. is written
199
+ `<DialogTrigger render={<Button variant="outline" />}>`, not a Button nested
200
+ inside the trigger, and never with `asChild`.
201
+ refines:
202
+ - to: shared-composition#render-prop
203
+ checkedBy: assisted
204
+ - id: data-attributes
205
+ level: may
206
+ statement: >-
207
+ App selectors may read `data-variant` and `data-size` from the button (the
208
+ `Clicked` story checks they're always present, even when the prop isn't
209
+ passed).
210
+ checks:
211
+ - href: ./Button.stories.tsx#Clicked
212
+ role: test
213
+ checkedBy: automated
214
+
215
+ - kind: definitions
216
+ for: all
217
+ title: States
218
+ context: labdsnov.states
219
+ items:
220
+ - term: Hover
221
+ definition: >-
222
+ The background darkens or appears; `link` gets an underline. Check by hand
223
+ (can't be forced in a story).
224
+ - term: Pressed (:active)
225
+ definition: >-
226
+ The button moves down 1px.
227
+ - term: Keyboard focus
228
+ definition: >-
229
+ Solid 2px border and ring in `--focus-ring` on every variant.
230
+ - term: Disabled
231
+ definition: >-
232
+ 50% opacity and `pointer-events: none`; can't be pressed or focused (except
233
+ with `focusableWhenDisabled`).
234
+ - term: aria-invalid
235
+ definition: >-
236
+ Red border and ring, for a button that is a choice in a form that isn't
237
+ valid yet.
238
+ - term: aria-expanded
239
+ definition: >-
240
+ While its menu or popover is open, `outline` and `ghost` keep their hover
241
+ background so the open state shows.
242
+
243
+ - kind: section
244
+ for: all
245
+ title: Open decisions
246
+ freeform:
247
+ - title: TODO
248
+ body: >-
249
+ There's no rule yet for whether secondary actions use `outline` or
250
+ `secondary`, and no defined use for the `xs`, `sm` and `lg` sizes. Don't
251
+ guess: ask the team.
252
+
253
+ sourceFiles:
254
+ - platform: react
255
+ file: ./Button.tsx
256
+
257
+ imports:
258
+ - platform: react
259
+ code: import { Button, buttonVariants } from "@designil/labdsnov"
260
+ package: "@designil/labdsnov"
261
+
262
+ traits:
263
+ - traitType: variant
264
+ kind: enum
265
+ id: variant
266
+ description: How prominent the button is.
267
+ values:
268
+ - id: default
269
+ description: The area's primary action (one per area). Primary (orange) fill, light text.
270
+ - id: outline
271
+ description: The alternative to the primary button, such as "ยกเลิก" (cancel). Page-coloured fill with a border.
272
+ - id: secondary
273
+ description: A secondary action. Light grey fill.
274
+ - id: ghost
275
+ description: Toolbar and icon buttons. Transparent, with a background on hover.
276
+ - id: destructive
277
+ description: Actions that delete or can't be undone. Faint red fill (10% light, 20% dark), red text.
278
+ - id: link
279
+ description: An in-page action that looks like a text link. Primary-coloured text, underlined on hover.
280
+ - traitType: variant
281
+ kind: enum
282
+ id: size
283
+ description: Height and padding. Every size is pill-shaped.
284
+ values:
285
+ - id: default
286
+ description: 36px, the usual button.
287
+ - id: xs
288
+ description: 24px, 12px text and 12px icons.
289
+ - id: sm
290
+ description: 32px.
291
+ - id: lg
292
+ description: 40px.
293
+ - id: icon
294
+ description: 36×36px icon-only, pairs with `default`.
295
+ - id: icon-xs
296
+ description: 24×24px icon-only, pairs with `xs`.
297
+ - id: icon-sm
298
+ description: 32×32px icon-only, e.g. the "ปิด" (close) button in Dialog.
299
+ - id: icon-lg
300
+ description: 40×40px icon-only, pairs with `lg`.
301
+ - traitType: variant
302
+ kind: boolean
303
+ id: fullWidth
304
+ description: Stretches to the container's width, e.g. login/register buttons.
305
+ - traitType: state
306
+ kind: boolean
307
+ id: disabled
308
+ description: Disabled, 50% opacity, can't be pressed or focused.
309
+ - traitType: state
310
+ kind: boolean
311
+ id: focusableWhenDisabled
312
+ description: Disabled but still in the Tab order, with `aria-disabled="true"`, so it can explain why it can't be pressed.
313
+
314
+ combos:
315
+ - subject: focusableWhenDisabled
316
+ level: must
317
+ items: [disabled]
318
+ note: Has no effect without `disabled`.
319
+ - subject: variant.link
320
+ level: should-not
321
+ items: [fullWidth]
322
+ note: A button that looks like an inline link shouldn't span the full width; use `default` or `outline`.
323
+
324
+ uses:
325
+ - to: shared-composition
326
+ alternatives:
327
+ - to: toggle
328
+ - to: badge
329
+
330
+ refs:
331
+ - href: ./Button.md
332
+ rel: relates-to
333
+ role: Usage doc in Thai (props, all tokens)
334
+ - href: ./Button.stories.tsx
335
+ rel: demo
336
+ role: CSF stories
337
+ - href: https://www.figma.com/design/QsKWb3A53lIh4QBDnAkGHh/labdsnov?node-id=8-674
338
+ rel: design
339
+ role: Button in Figma
340
+ - href: https://www.figma.com/design/QsKWb3A53lIh4QBDnAkGHh/labdsnov?node-id=8-915
341
+ rel: design
342
+ role: Icon Button in Figma
343
+ - href: ../../../figma/Button.figma.ts
344
+ rel: source
345
+ role: Code Connect template
346
+
347
+ $extensions:
348
+ com.figma:
349
+ nodeId: "8:674"
350
+ iconButtonNodeId: "8:915"