gooee 0.0.0-stage → 0.41.1

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 (247) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -2
  3. package/package.json +36 -4
  4. package/scripts/add.js +533 -0
  5. package/scripts/pro-components.json +82 -0
  6. package/src/base.css +39 -0
  7. package/src/components/Accordion/Accordion.module.css +90 -0
  8. package/src/components/Accordion/Accordion.tsx +125 -0
  9. package/src/components/Accordion/index.ts +1 -0
  10. package/src/components/Alert/Alert.module.css +121 -0
  11. package/src/components/Alert/Alert.tsx +90 -0
  12. package/src/components/Alert/index.ts +1 -0
  13. package/src/components/AlertDialog/AlertDialog.module.css +2 -0
  14. package/src/components/AlertDialog/AlertDialog.tsx +108 -0
  15. package/src/components/AlertDialog/index.ts +1 -0
  16. package/src/components/AnimatedNumber/AnimatedNumber.module.css +48 -0
  17. package/src/components/AnimatedNumber/AnimatedNumber.tsx +52 -0
  18. package/src/components/AnimatedNumber/index.ts +1 -0
  19. package/src/components/AspectRatio/AspectRatio.module.css +15 -0
  20. package/src/components/AspectRatio/AspectRatio.tsx +12 -0
  21. package/src/components/AspectRatio/index.ts +1 -0
  22. package/src/components/Avatar/Avatar.module.css +62 -0
  23. package/src/components/Avatar/Avatar.tsx +55 -0
  24. package/src/components/Avatar/index.ts +3 -0
  25. package/src/components/AvatarGroup/AvatarGroup.module.css +53 -0
  26. package/src/components/AvatarGroup/AvatarGroup.tsx +43 -0
  27. package/src/components/AvatarGroup/index.ts +1 -0
  28. package/src/components/Badge/Badge.module.css +69 -0
  29. package/src/components/Badge/Badge.tsx +25 -0
  30. package/src/components/Badge/index.ts +1 -0
  31. package/src/components/Breadcrumb/Breadcrumb.module.css +104 -0
  32. package/src/components/Breadcrumb/Breadcrumb.tsx +76 -0
  33. package/src/components/Breadcrumb/index.ts +1 -0
  34. package/src/components/Button/Button.module.css +191 -0
  35. package/src/components/Button/Button.tsx +148 -0
  36. package/src/components/Button/index.ts +1 -0
  37. package/src/components/ButtonGroup/ButtonGroup.module.css +59 -0
  38. package/src/components/ButtonGroup/ButtonGroup.tsx +45 -0
  39. package/src/components/ButtonGroup/index.ts +1 -0
  40. package/src/components/Card/Card.module.css +82 -0
  41. package/src/components/Card/Card.tsx +34 -0
  42. package/src/components/Card/index.ts +1 -0
  43. package/src/components/Center/Center.module.css +15 -0
  44. package/src/components/Center/Center.tsx +28 -0
  45. package/src/components/Center/index.ts +1 -0
  46. package/src/components/Checkbox/Checkbox.module.css +120 -0
  47. package/src/components/Checkbox/Checkbox.tsx +133 -0
  48. package/src/components/Checkbox/index.ts +1 -0
  49. package/src/components/CheckboxGroup/CheckboxGroup.module.css +30 -0
  50. package/src/components/CheckboxGroup/CheckboxGroup.tsx +88 -0
  51. package/src/components/CheckboxGroup/index.ts +1 -0
  52. package/src/components/Cluster/Cluster.module.css +25 -0
  53. package/src/components/Cluster/Cluster.tsx +26 -0
  54. package/src/components/Cluster/index.ts +1 -0
  55. package/src/components/CodeBlock/CodeBlock.module.css +74 -0
  56. package/src/components/CodeBlock/CodeBlock.tsx +53 -0
  57. package/src/components/CodeBlock/highlight.ts +73 -0
  58. package/src/components/CodeBlock/index.ts +1 -0
  59. package/src/components/Collapsible/Collapsible.module.css +75 -0
  60. package/src/components/Collapsible/Collapsible.tsx +71 -0
  61. package/src/components/Collapsible/index.ts +1 -0
  62. package/src/components/Container/Container.module.css +14 -0
  63. package/src/components/Container/Container.tsx +19 -0
  64. package/src/components/Container/index.ts +1 -0
  65. package/src/components/CopyButton/CopyButton.module.css +125 -0
  66. package/src/components/CopyButton/CopyButton.tsx +160 -0
  67. package/src/components/CopyButton/index.ts +1 -0
  68. package/src/components/Dial/Dial.module.css +344 -0
  69. package/src/components/Dial/Dial.tsx +332 -0
  70. package/src/components/Dial/index.ts +1 -0
  71. package/src/components/Dialog/Dialog.module.css +190 -0
  72. package/src/components/Dialog/Dialog.tsx +100 -0
  73. package/src/components/Dialog/index.ts +1 -0
  74. package/src/components/Divider/Divider.module.css +39 -0
  75. package/src/components/Divider/Divider.tsx +34 -0
  76. package/src/components/Divider/index.ts +1 -0
  77. package/src/components/DropdownMenu/DropdownMenu.module.css +134 -0
  78. package/src/components/DropdownMenu/DropdownMenu.tsx +215 -0
  79. package/src/components/DropdownMenu/index.ts +1 -0
  80. package/src/components/EmptyState/EmptyState.module.css +66 -0
  81. package/src/components/EmptyState/EmptyState.tsx +38 -0
  82. package/src/components/EmptyState/index.ts +1 -0
  83. package/src/components/Fab/Fab.module.css +176 -0
  84. package/src/components/Fab/Fab.tsx +117 -0
  85. package/src/components/Fab/index.ts +1 -0
  86. package/src/components/Fieldset/Fieldset.module.css +34 -0
  87. package/src/components/Fieldset/Fieldset.tsx +41 -0
  88. package/src/components/Fieldset/index.ts +1 -0
  89. package/src/components/FormField/FormField.module.css +62 -0
  90. package/src/components/FormField/FormField.tsx +91 -0
  91. package/src/components/FormField/index.ts +2 -0
  92. package/src/components/Grid/Grid.module.css +39 -0
  93. package/src/components/Grid/Grid.tsx +35 -0
  94. package/src/components/Grid/index.ts +1 -0
  95. package/src/components/HoldToConfirm/HoldToConfirm.module.css +175 -0
  96. package/src/components/HoldToConfirm/HoldToConfirm.tsx +334 -0
  97. package/src/components/HoldToConfirm/index.ts +1 -0
  98. package/src/components/IconButton/IconButton.module.css +78 -0
  99. package/src/components/IconButton/IconButton.tsx +35 -0
  100. package/src/components/IconButton/index.ts +1 -0
  101. package/src/components/Input/Input.module.css +157 -0
  102. package/src/components/Input/Input.tsx +133 -0
  103. package/src/components/Input/index.ts +1 -0
  104. package/src/components/InputGroup/InputGroup.module.css +146 -0
  105. package/src/components/InputGroup/InputGroup.tsx +90 -0
  106. package/src/components/InputGroup/index.ts +1 -0
  107. package/src/components/Kbd/Kbd.module.css +28 -0
  108. package/src/components/Kbd/Kbd.tsx +38 -0
  109. package/src/components/Kbd/index.ts +1 -0
  110. package/src/components/Link/Link.module.css +65 -0
  111. package/src/components/Link/Link.tsx +41 -0
  112. package/src/components/Link/index.ts +1 -0
  113. package/src/components/LivePill/LivePill.module.css +207 -0
  114. package/src/components/LivePill/LivePill.tsx +182 -0
  115. package/src/components/LivePill/index.ts +1 -0
  116. package/src/components/Meter/Meter.module.css +91 -0
  117. package/src/components/Meter/Meter.tsx +109 -0
  118. package/src/components/Meter/index.ts +1 -0
  119. package/src/components/MorphButton/MorphButton.module.css +152 -0
  120. package/src/components/MorphButton/MorphButton.tsx +203 -0
  121. package/src/components/MorphButton/index.ts +1 -0
  122. package/src/components/NumberInput/NumberInput.module.css +104 -0
  123. package/src/components/NumberInput/NumberInput.tsx +252 -0
  124. package/src/components/NumberInput/index.ts +2 -0
  125. package/src/components/Pagination/Pagination.module.css +88 -0
  126. package/src/components/Pagination/Pagination.tsx +126 -0
  127. package/src/components/Pagination/index.ts +1 -0
  128. package/src/components/PasswordInput/PasswordInput.module.css +64 -0
  129. package/src/components/PasswordInput/PasswordInput.tsx +63 -0
  130. package/src/components/PasswordInput/index.ts +2 -0
  131. package/src/components/PickerWheel/PickerWheel.module.css +123 -0
  132. package/src/components/PickerWheel/PickerWheel.tsx +326 -0
  133. package/src/components/PickerWheel/index.ts +1 -0
  134. package/src/components/Popover/Popover.module.css +78 -0
  135. package/src/components/Popover/Popover.tsx +117 -0
  136. package/src/components/Popover/index.ts +1 -0
  137. package/src/components/ProgressBar/ProgressBar.module.css +61 -0
  138. package/src/components/ProgressBar/ProgressBar.tsx +48 -0
  139. package/src/components/ProgressBar/index.ts +1 -0
  140. package/src/components/Prose/Prose.module.css +115 -0
  141. package/src/components/Prose/Prose.tsx +14 -0
  142. package/src/components/Prose/index.ts +1 -0
  143. package/src/components/Radio/Radio.module.css +106 -0
  144. package/src/components/Radio/Radio.tsx +115 -0
  145. package/src/components/Radio/index.ts +1 -0
  146. package/src/components/Retime/Retime.tsx +116 -0
  147. package/src/components/Retime/index.ts +1 -0
  148. package/src/components/RulerScrubber/RulerScrubber.module.css +146 -0
  149. package/src/components/RulerScrubber/RulerScrubber.tsx +209 -0
  150. package/src/components/RulerScrubber/index.ts +1 -0
  151. package/src/components/ScrollArea/ScrollArea.module.css +72 -0
  152. package/src/components/ScrollArea/ScrollArea.tsx +172 -0
  153. package/src/components/ScrollArea/index.ts +1 -0
  154. package/src/components/SearchInput/SearchInput.module.css +53 -0
  155. package/src/components/SearchInput/SearchInput.tsx +104 -0
  156. package/src/components/SearchInput/index.ts +2 -0
  157. package/src/components/SegmentedControl/SegmentedControl.module.css +150 -0
  158. package/src/components/SegmentedControl/SegmentedControl.tsx +169 -0
  159. package/src/components/SegmentedControl/index.ts +1 -0
  160. package/src/components/Select/Select.module.css +204 -0
  161. package/src/components/Select/Select.tsx +254 -0
  162. package/src/components/Select/index.ts +1 -0
  163. package/src/components/Sheet/Sheet.module.css +228 -0
  164. package/src/components/Sheet/Sheet.tsx +449 -0
  165. package/src/components/Sheet/index.ts +1 -0
  166. package/src/components/Skeleton/Skeleton.module.css +56 -0
  167. package/src/components/Skeleton/Skeleton.tsx +37 -0
  168. package/src/components/Skeleton/index.ts +1 -0
  169. package/src/components/Slider/Slider.module.css +155 -0
  170. package/src/components/Slider/Slider.tsx +200 -0
  171. package/src/components/Slider/index.ts +1 -0
  172. package/src/components/Spinner/Spinner.module.css +50 -0
  173. package/src/components/Spinner/Spinner.tsx +29 -0
  174. package/src/components/Spinner/index.ts +1 -0
  175. package/src/components/Split/Split.module.css +29 -0
  176. package/src/components/Split/Split.tsx +33 -0
  177. package/src/components/Split/index.ts +1 -0
  178. package/src/components/SplitFlap/SplitFlap.module.css +107 -0
  179. package/src/components/SplitFlap/SplitFlap.tsx +225 -0
  180. package/src/components/SplitFlap/index.ts +1 -0
  181. package/src/components/Stack/Stack.module.css +17 -0
  182. package/src/components/Stack/Stack.tsx +19 -0
  183. package/src/components/Stack/index.ts +1 -0
  184. package/src/components/SwipeDeck/SwipeDeck.module.css +250 -0
  185. package/src/components/SwipeDeck/SwipeDeck.tsx +350 -0
  186. package/src/components/SwipeDeck/index.ts +1 -0
  187. package/src/components/Switch/Switch.module.css +97 -0
  188. package/src/components/Switch/Switch.tsx +147 -0
  189. package/src/components/Switch/index.ts +1 -0
  190. package/src/components/Table/Table.module.css +369 -0
  191. package/src/components/Table/Table.tsx +368 -0
  192. package/src/components/Table/index.ts +1 -0
  193. package/src/components/TableOfContents/TableOfContents.module.css +107 -0
  194. package/src/components/TableOfContents/TableOfContents.tsx +93 -0
  195. package/src/components/TableOfContents/index.ts +1 -0
  196. package/src/components/Tabs/Tabs.module.css +101 -0
  197. package/src/components/Tabs/Tabs.tsx +190 -0
  198. package/src/components/Tabs/index.ts +1 -0
  199. package/src/components/Tag/Tag.module.css +120 -0
  200. package/src/components/Tag/Tag.tsx +109 -0
  201. package/src/components/Tag/index.ts +1 -0
  202. package/src/components/Textarea/Textarea.module.css +79 -0
  203. package/src/components/Textarea/Textarea.tsx +130 -0
  204. package/src/components/Textarea/index.ts +1 -0
  205. package/src/components/ThemeToggle/ThemeToggle.module.css +21 -0
  206. package/src/components/ThemeToggle/ThemeToggle.tsx +69 -0
  207. package/src/components/ThemeToggle/index.ts +1 -0
  208. package/src/components/Toast/Toast.module.css +202 -0
  209. package/src/components/Toast/Toast.tsx +473 -0
  210. package/src/components/Toast/index.ts +1 -0
  211. package/src/components/Toggle/Toggle.module.css +94 -0
  212. package/src/components/Toggle/Toggle.tsx +50 -0
  213. package/src/components/Toggle/index.ts +1 -0
  214. package/src/components/Tooltip/Tooltip.module.css +34 -0
  215. package/src/components/Tooltip/Tooltip.tsx +154 -0
  216. package/src/components/Tooltip/index.ts +1 -0
  217. package/src/components/VisuallyHidden/VisuallyHidden.module.css +13 -0
  218. package/src/components/VisuallyHidden/VisuallyHidden.tsx +12 -0
  219. package/src/components/VisuallyHidden/index.ts +1 -0
  220. package/src/internal/FieldMessage.module.css +49 -0
  221. package/src/internal/FieldMessage.tsx +44 -0
  222. package/src/internal/Portal.tsx +7 -0
  223. package/src/internal/Roll.module.css +31 -0
  224. package/src/internal/Roll.tsx +20 -0
  225. package/src/internal/cx.ts +3 -0
  226. package/src/internal/feel.ts +355 -0
  227. package/src/internal/fling.ts +118 -0
  228. package/src/internal/focus.ts +94 -0
  229. package/src/internal/icons.module.css +62 -0
  230. package/src/internal/icons.tsx +511 -0
  231. package/src/internal/keyboard.ts +62 -0
  232. package/src/internal/layers.ts +85 -0
  233. package/src/internal/liquid.ts +248 -0
  234. package/src/internal/liquidMatter.ts +168 -0
  235. package/src/internal/liquidMore.ts +686 -0
  236. package/src/internal/liquidPath.ts +519 -0
  237. package/src/internal/mergeRefs.ts +10 -0
  238. package/src/internal/motion.ts +37 -0
  239. package/src/internal/relativeTime.ts +26 -0
  240. package/src/internal/scrollFrame.ts +157 -0
  241. package/src/internal/softPress.ts +299 -0
  242. package/src/internal/space.ts +6 -0
  243. package/src/internal/useControllable.ts +21 -0
  244. package/src/internal/useFloating.ts +85 -0
  245. package/src/internal/usePresence.ts +15 -0
  246. package/src/internal/useScrub.ts +160 -0
  247. package/src/tokens.css +727 -0
package/scripts/add.js ADDED
@@ -0,0 +1,533 @@
1
+ #!/usr/bin/env node
2
+ // The Gooee UI command line: sets a project up, lists what exists, and copies components, blocks,
3
+ // templates and themes (with everything they import) into it, then shows and takes later changes.
4
+ // Runs as `npx gooee <command>` from the npm package, or `npm run add -- <command>` in this repo.
5
+ // Plain JavaScript on purpose: the project has no Node type package.
6
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs'
7
+ import { basename, dirname, join, relative, resolve, sep } from 'node:path'
8
+ import { createInterface } from 'node:readline/promises'
9
+ import { fileURLToPath } from 'node:url'
10
+
11
+ const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..')
12
+ const SRC = join(ROOT, 'src')
13
+ const INTERNAL = join(SRC, 'internal')
14
+ const EXCLUDED = /(\.(test|spec|stories|demo)\.[jt]sx?$)|(^|\/)(docs|demos|__tests__)\//
15
+ const DEFAULT_TO = 'src/ui'
16
+ const CONFIG = 'gooee.json'
17
+ const SITE = 'https://gooee.dev'
18
+ const COMMANDS = ['init', 'add', 'list', 'diff', 'update']
19
+ const USAGE = `Usage: npx gooee <command> [options]
20
+
21
+ init Set a project up: tokens.css, base.css and ${CONFIG}
22
+ add <name> [<name>...] Copy components, blocks, templates or themes, with what they import
23
+ list [--kind <kind>] Show everything there is (kind: components, blocks, templates, themes)
24
+ diff <name> [<name>...] Show what changed between your copy and the latest version
25
+ update <name> [...] Show the changes, then replace your copy after you say yes
26
+
27
+ Options:
28
+ --to <folder> Where files go. Defaults to the folder in ${CONFIG}, else ${DEFAULT_TO}
29
+ --overwrite add: replace files that are already there
30
+ --with-base add: also copy base.css (init always does)
31
+ --yes update: replace without asking
32
+ --dry-run Show what would happen, write nothing
33
+
34
+ In this repo, run: npm run add -- <command> ...`
35
+
36
+ // A theme is one CSS file; every other kind is a folder per name. Each kind keeps its folder name in the target.
37
+ const KINDS = [
38
+ { key: 'component', plural: 'Components', folder: 'components', pro: false },
39
+ { key: 'block', plural: 'Blocks', folder: 'blocks', pro: true },
40
+ { key: 'template', plural: 'Templates', folder: 'templates', pro: true },
41
+ { key: 'theme', plural: 'Themes', folder: 'themes', pro: true, single: true },
42
+ ].map((k) => ({ ...k, dir: join(SRC, k.folder) }))
43
+
44
+ // The import lines as they read from the app's entry file. A folder inside src/ is written
45
+ // relative to src/ (Vite, Next and most setups keep the entry there), so it can be pasted as is.
46
+ function fromEntry(folder, both = true) {
47
+ const clean = folder.replace(/^\.\//, '').replace(/\/$/, '')
48
+ const inSrc = clean.startsWith('src/')
49
+ const rel = inSrc ? clean.slice(4) : clean
50
+ const where = inSrc ? 'in your entry file inside src/ (for example src/main.tsx):' : 'in a file at your project root:'
51
+ const lines = [`import './${rel}/tokens.css'`, ...(both ? [`import './${rel}/base.css'`] : [])]
52
+ return `${where}\n${lines.map((l) => ` ${l}`).join('\n')}`
53
+ }
54
+
55
+ function fail(message, usage = true) {
56
+ console.error(`Error: ${message}`)
57
+ if (usage) console.error(`\n${USAGE}`)
58
+ process.exit(1)
59
+ }
60
+
61
+ function parseArgs(argv) {
62
+ const opts = { command: 'add', names: [], to: '', kind: '', overwrite: false, dryRun: false, withBase: false, yes: false }
63
+ const rest = []
64
+ for (let i = 0; i < argv.length; i++) {
65
+ const arg = argv[i]
66
+ if (arg === '--help' || arg === '-h' || arg === 'help') {
67
+ console.log(USAGE)
68
+ console.log('\nA name can be a component (Button), a block (Dashboard), a template or a theme (forest).')
69
+ console.log(`A name can also be a shared helper, to build your own parts on it: ${Object.keys(HELPERS).join(', ')}.`)
70
+ console.log('When two kinds share a name, add the kind: blocks/Settings, templates/Settings.')
71
+ process.exit(0)
72
+ } else if (arg === '--to' || arg === '--kind') {
73
+ const value = argv[++i] ?? ''
74
+ if (!value || value.startsWith('--')) fail(arg === '--to' ? '--to needs a folder, for example --to src/ui' : '--kind needs a kind, for example --kind blocks')
75
+ opts[arg.slice(2)] = value
76
+ } else if (arg.startsWith('--to=')) opts.to = arg.slice(5)
77
+ else if (arg.startsWith('--kind=')) opts.kind = arg.slice(7)
78
+ else if (arg === '--overwrite') opts.overwrite = true
79
+ else if (arg === '--dry-run') opts.dryRun = true
80
+ else if (arg === '--with-base') opts.withBase = true
81
+ else if (arg === '--yes' || arg === '-y') opts.yes = true
82
+ else if (arg.startsWith('-')) fail(`Unknown option ${arg}.`)
83
+ else rest.push(arg)
84
+ }
85
+ // The command comes first, like shadcn. A bare name still means add, as before.
86
+ if (COMMANDS.includes(rest[0])) opts.command = rest.shift()
87
+ opts.names = rest
88
+ if (['add', 'diff', 'update'].includes(opts.command) && !opts.names.length) {
89
+ fail(`Name at least one component, block, template or theme, for example: npx gooee ${opts.command} button`)
90
+ }
91
+ return opts
92
+ }
93
+
94
+ function distance(a, b) {
95
+ const row = Array.from({ length: b.length + 1 }, (_, j) => j)
96
+ for (let i = 1; i <= a.length; i++) {
97
+ let prev = row[0]
98
+ row[0] = i
99
+ for (let j = 1; j <= b.length; j++) {
100
+ const next = Math.min(row[j] + 1, row[j - 1] + 1, prev + (a[i - 1] === b[j - 1] ? 0 : 1))
101
+ prev = row[j]
102
+ row[j] = next
103
+ }
104
+ }
105
+ return row[b.length]
106
+ }
107
+
108
+ function suggest(name, all) {
109
+ const low = name.toLowerCase()
110
+ return all
111
+ .map((item) => {
112
+ const l = item.name.toLowerCase()
113
+ const score = l === low ? -1 : l.includes(low) || low.includes(l) ? 0 : distance(low, l)
114
+ return { item, score }
115
+ })
116
+ .filter((s) => s.score <= Math.max(2, Math.floor(name.length / 3)))
117
+ .sort((a, b) => a.score - b.score)
118
+ .slice(0, 3)
119
+ .map((s) => label(s.item))
120
+ }
121
+
122
+ const isDir = (p) => existsSync(p) && statSync(p).isDirectory()
123
+ const isFile = (p) => existsSync(p) && statSync(p).isFile()
124
+ const rel = (p) => relative(SRC, p).split(sep).join('/')
125
+ const kindOf = (key) => KINDS.find((k) => k.key === key)
126
+ const keyOf = (item) => `${item.kind}:${item.name}`
127
+ const label = (item) => (item.kind === 'component' ? item.name : `${item.name} (${item.kind})`)
128
+ const kebab = (name) => name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()
129
+
130
+ // Shared helpers an app can add on its own, to build its own parts the way the library builds them.
131
+ // Each is a file in src/internal; what it imports from src/internal comes with it.
132
+ const HELPERS = { 'scroll-frame': 'scrollFrame.ts' }
133
+
134
+ // Every name that can be copied, in every kind.
135
+ function listItems() {
136
+ return KINDS.flatMap((k) => {
137
+ if (!isDir(k.dir)) return []
138
+ return readdirSync(k.dir, { withFileTypes: true })
139
+ .filter((d) => (k.single ? d.isFile() && d.name.endsWith('.css') : d.isDirectory()))
140
+ .map((d) => ({ kind: k.key, name: k.single ? d.name.slice(0, -4) : d.name }))
141
+ .sort((a, b) => a.name.localeCompare(b.name))
142
+ })
143
+ }
144
+
145
+ // "dashboard" finds the Dashboard block and "date-picker" finds DatePicker. "blocks/Settings" picks one kind when two share a name.
146
+ function lookup(raw, all) {
147
+ const slash = raw.indexOf('/')
148
+ const prefix = slash > 0 ? raw.slice(0, slash).toLowerCase() : ''
149
+ const name = (slash > 0 ? raw.slice(slash + 1) : raw).replace(/[-_]/g, '')
150
+ const kind = prefix ? KINDS.find((k) => k.folder === prefix || k.key === prefix) : undefined
151
+ if (prefix && !kind) fail(`"${prefix}" is not a kind. Use components/, blocks/, templates/ or themes/.`)
152
+ const pool = kind ? all.filter((i) => i.kind === kind.key) : all
153
+ const hits = pool.filter((i) => i.name.toLowerCase() === name.toLowerCase())
154
+ if (hits.length === 1) return hits[0]
155
+ if (hits.length > 1) {
156
+ fail(`"${raw}" is more than one thing: ${hits.map(label).join(', ')}. Add the kind, for example ${kindOf(hits[1].kind).folder}/${hits[1].name}.`)
157
+ }
158
+ const helper = Object.keys(HELPERS).find((h) => h.replace(/-/g, '') === name.toLowerCase())
159
+ if (helper && !prefix) return { kind: 'helper', name: helper, file: join(INTERNAL, HELPERS[helper]) }
160
+ const pro = proComponents().find((p) => p.toLowerCase() === name.toLowerCase())
161
+ if (pro) fail(`${pro} is in Gooee UI Pro, so it is not in this package. See ${SITE}/${raw.toLowerCase()}`, false)
162
+ const close = suggest(name, all)
163
+ fail(`There is no component, block, template or theme called "${raw}".${close.length ? ` Did you mean ${close.join(', ')}?` : ''}`, false)
164
+ }
165
+
166
+ // Only in the public package: the names of Pro components, so asking for one gets a clear answer.
167
+ function proComponents() {
168
+ const file = join(ROOT, 'scripts', 'pro-components.json')
169
+ return isFile(file) ? JSON.parse(readFileSync(file, 'utf8')) : []
170
+ }
171
+
172
+ // Only in this repo: the Pro component ids from src/docs/tiers.ts, so a Pro file gets the Pro credit line.
173
+ let proIds
174
+ function isPro(item) {
175
+ if (kindOf(item.kind).pro) return true
176
+ if (proIds === undefined) {
177
+ const tiers = join(SRC, 'docs', 'tiers.ts')
178
+ const src = isFile(tiers) ? readFileSync(tiers, 'utf8') : ''
179
+ const set = src.match(/proComponentIds = new Set\(\[([\s\S]*?)\]\)/)?.[1] ?? ''
180
+ proIds = new Set([...set.matchAll(/'([a-z0-9-]+)'/g)].map((m) => m[1]))
181
+ }
182
+ return proIds.has(kebab(item.name))
183
+ }
184
+
185
+ function listFiles(dir) {
186
+ return readdirSync(dir, { withFileTypes: true }).flatMap((d) => {
187
+ const p = join(dir, d.name)
188
+ if (EXCLUDED.test(rel(p) + (d.isDirectory() ? '/' : ''))) return []
189
+ return d.isDirectory() ? listFiles(p) : [p]
190
+ })
191
+ }
192
+
193
+ const filesOf = (item) => {
194
+ const k = kindOf(item.kind)
195
+ return k.single ? [join(k.dir, `${item.name}.css`)] : listFiles(join(k.dir, item.name))
196
+ }
197
+
198
+ function importsOf(file) {
199
+ if (!/\.(ts|tsx)$/.test(file)) return []
200
+ const code = readFileSync(file, 'utf8').replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/.*$/gm, '')
201
+ const found = []
202
+ const re = /(?:\bfrom\s*|\bimport\s*\(?\s*)['"]([^'"]+)['"]/g
203
+ for (let m; (m = re.exec(code)); ) if (m[1].startsWith('.')) found.push(m[1])
204
+ return found
205
+ }
206
+
207
+ function resolveImport(from, spec) {
208
+ const base = resolve(dirname(from), spec)
209
+ const tries = [base, `${base}.ts`, `${base}.tsx`, join(base, 'index.ts'), join(base, 'index.tsx')]
210
+ const hit = tries.find(isFile)
211
+ if (!hit) fail(`${rel(from)} imports "${spec}", but no such file exists.`, false)
212
+ return hit
213
+ }
214
+
215
+ // Which component, block, template or theme a file belongs to, or null for src/internal.
216
+ function ownerOf(file) {
217
+ if (file.startsWith(INTERNAL + sep)) return null
218
+ for (const k of KINDS) {
219
+ if (!file.startsWith(k.dir + sep)) continue
220
+ if (k.single) return { kind: k.key, name: basename(file, '.css') }
221
+ return { kind: k.key, name: relative(k.dir, file).split(sep)[0] }
222
+ }
223
+ fail(`${rel(file)} is outside src/components, src/blocks, src/templates, src/themes and src/internal, so it cannot be copied.`, false)
224
+ }
225
+
226
+ function plan(items) {
227
+ const queue = [...items]
228
+ const picked = new Map()
229
+ const internal = new Set()
230
+ const needs = new Map()
231
+ const seenInternal = []
232
+ const visitInternal = (file) => {
233
+ if (internal.has(file)) return
234
+ internal.add(file)
235
+ seenInternal.push(file)
236
+ }
237
+ while (queue.length) {
238
+ const item = queue.shift()
239
+ // A helper is one internal file: it travels with the internal files, not as an item.
240
+ if (item.kind === 'helper') {
241
+ visitInternal(item.file)
242
+ continue
243
+ }
244
+ const key = keyOf(item)
245
+ if (picked.has(key)) continue
246
+ picked.set(key, item)
247
+ for (const file of filesOf(item)) {
248
+ for (const spec of importsOf(file)) {
249
+ const target = resolveImport(file, spec)
250
+ const owner = ownerOf(target)
251
+ if (owner === null) visitInternal(target)
252
+ else if (keyOf(owner) !== key) {
253
+ if (!needs.has(key)) needs.set(key, { item, deps: new Map() })
254
+ needs.get(key).deps.set(keyOf(owner), owner)
255
+ queue.push(owner)
256
+ }
257
+ }
258
+ }
259
+ }
260
+ for (let i = 0; i < seenInternal.length; i++) {
261
+ for (const spec of importsOf(seenInternal[i])) {
262
+ const target = resolveImport(seenInternal[i], spec)
263
+ if (ownerOf(target) !== null) fail(`${rel(seenInternal[i])} imports from outside src/internal, which internal files must not do.`, false)
264
+ visitInternal(target)
265
+ }
266
+ }
267
+ return { items: [...picked.values()], internal: [...internal].sort(), needs }
268
+ }
269
+
270
+ // Every copied file starts with one credit line, so the MIT licence's notice travels with the code.
271
+ // It is left out when comparing, so it never counts as a change.
272
+ function credit(file, pro) {
273
+ const text = pro ? `Gooee UI Pro, see LICENSE-PRO.md. ${SITE}` : `Gooee UI, MIT licence. ${SITE}`
274
+ return file.endsWith('.css') ? `/* ${text} */\n` : `// ${text}\n`
275
+ }
276
+ // Copies made before the rename start with the old name, hlmnhkl/ui, so diff and update still see them as ours.
277
+ const withoutCredit = (text) => text.replace(/^(\/\/ (?:Gooee UI|hlmnhkl\/ui)[^\n]*|\/\* (?:Gooee UI|hlmnhkl\/ui)[^\n]*\*\/)\n/, '')
278
+
279
+ // The project folder (npm runs scripts from the repo root; INIT_CWD is where the command was typed).
280
+ const CWD = process.env.INIT_CWD ?? process.cwd()
281
+
282
+ function readConfig() {
283
+ const file = join(CWD, CONFIG)
284
+ if (!isFile(file)) return null
285
+ try {
286
+ return JSON.parse(readFileSync(file, 'utf8'))
287
+ } catch {
288
+ fail(`${CONFIG} is not valid JSON. Fix it or delete it, then run the command again.`, false)
289
+ }
290
+ }
291
+
292
+ function targetFolder(opts) {
293
+ const folder = opts.to || readConfig()?.to || DEFAULT_TO
294
+ const to = resolve(CWD, folder)
295
+ if (existsSync(to) && !isDir(to)) fail(`--to points at a file, not a folder: ${folder}`, false)
296
+ return { folder, to }
297
+ }
298
+
299
+ // Every file a set of items needs, with where it goes and which credit it gets.
300
+ function copiesFor(items, internal, to) {
301
+ const copies = []
302
+ for (const item of items) {
303
+ const k = kindOf(item.kind)
304
+ const pro = isPro(item)
305
+ for (const file of filesOf(item)) copies.push({ from: file, to: join(to, k.folder, relative(k.dir, file)), pro })
306
+ }
307
+ for (const file of internal) copies.push({ from: file, to: join(to, 'internal', relative(INTERNAL, file)), pro: false })
308
+ return copies
309
+ }
310
+
311
+ const fresh = (c) => credit(c.to, c.pro) + readFileSync(c.from, 'utf8')
312
+ const state = (c) => (!existsSync(c.to) ? 'missing' : withoutCredit(readFileSync(c.to, 'utf8')) === readFileSync(c.from, 'utf8') ? 'same' : 'changed')
313
+
314
+ function writeCopy(c, dryRun) {
315
+ if (dryRun) return
316
+ mkdirSync(dirname(c.to), { recursive: true })
317
+ writeFileSync(c.to, fresh(c))
318
+ }
319
+
320
+ const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`
321
+ const shown = (to, file) => relative(to, file).split(sep).join('/')
322
+
323
+ // The smallest set of changed lines, with two lines around each, like `git diff`.
324
+ function lineDiff(oldText, newText) {
325
+ const a = oldText.split('\n')
326
+ const b = newText.split('\n')
327
+ const n = a.length
328
+ const m = b.length
329
+ const lcs = Array.from({ length: n + 1 }, () => new Uint32Array(m + 1))
330
+ for (let i = n - 1; i >= 0; i--) for (let j = m - 1; j >= 0; j--) lcs[i][j] = a[i] === b[j] ? lcs[i + 1][j + 1] + 1 : Math.max(lcs[i + 1][j], lcs[i][j + 1])
331
+ const ops = []
332
+ let i = 0
333
+ let j = 0
334
+ while (i < n || j < m) {
335
+ if (i < n && j < m && a[i] === b[j]) ops.push([' ', a[i++], j++])
336
+ else if (j < m && (i === n || lcs[i][j + 1] >= lcs[i + 1][j])) ops.push(['+', b[j++]])
337
+ else ops.push(['-', a[i++]])
338
+ }
339
+ const keep = ops.map((op, k) => op[0] !== ' ' || ops.slice(Math.max(0, k - 2), k + 3).some((o) => o[0] !== ' '))
340
+ const out = []
341
+ ops.forEach((op, k) => {
342
+ if (keep[k]) out.push(`${op[0]} ${op[1]}`)
343
+ else if (keep[k - 1]) out.push(' ...')
344
+ })
345
+ return out
346
+ }
347
+
348
+ // --- Commands -------------------------------------------------------------------------------------
349
+
350
+ function runInit(opts) {
351
+ const { folder, to } = targetFolder(opts)
352
+ const sheets = ['tokens.css', 'base.css'].map((name) => ({ from: join(SRC, name), to: join(to, name), pro: false }))
353
+ console.log(`${opts.dryRun ? 'Dry run, nothing written. ' : ''}Setting up Gooee UI in ${folder}`)
354
+ for (const s of sheets) {
355
+ if (existsSync(s.to)) console.log(` ${basename(s.to)}: already there, kept (your theme edits stay)`)
356
+ else {
357
+ writeCopy(s, opts.dryRun)
358
+ console.log(` ${basename(s.to)}: added`)
359
+ }
360
+ }
361
+ const config = join(CWD, CONFIG)
362
+ if (isFile(config)) console.log(` ${CONFIG}: already there, kept`)
363
+ else {
364
+ if (!opts.dryRun) writeFileSync(config, `${JSON.stringify({ to: folder }, null, 2)}\n`)
365
+ console.log(` ${CONFIG}: added, so later commands put files in ${folder}`)
366
+ }
367
+ console.log(`\nNext:\n 1. Import both once, tokens first, ${fromEntry(folder)}`)
368
+ console.log(` 2. Add your first component: npx gooee add button`)
369
+ console.log(` See everything there is: npx gooee list, or ${SITE}`)
370
+ }
371
+
372
+ function runList(opts) {
373
+ const all = listItems()
374
+ const wanted = opts.kind ? KINDS.find((k) => k.folder === opts.kind.toLowerCase() || k.key === opts.kind.toLowerCase()) : null
375
+ if (opts.kind && !wanted) fail(`"${opts.kind}" is not a kind. Use components, blocks, templates or themes.`)
376
+ for (const k of KINDS) {
377
+ if (wanted && wanted !== k) continue
378
+ const names = all.filter((i) => i.kind === k.key)
379
+ const free = names.filter((i) => !isPro(i)).map((i) => i.name)
380
+ const pro = [...names.filter((i) => isPro(i)).map((i) => i.name), ...(k.key === 'component' ? proComponents() : [])]
381
+ if (!free.length && !pro.length) continue
382
+ console.log(`${k.plural} (${free.length + pro.length})`)
383
+ if (free.length) console.log(` ${free.join(', ')}`)
384
+ if (pro.length) console.log(` Pro: ${pro.join(', ')}`)
385
+ }
386
+ if (!wanted) console.log(`Helpers (${Object.keys(HELPERS).length})\n ${Object.keys(HELPERS).join(', ')}`)
387
+ console.log(`\nAdd one: npx gooee add <name>. Every page: ${SITE}`)
388
+ }
389
+
390
+ function runAdd(opts) {
391
+ const all = listItems()
392
+ const { to } = targetFolder(opts)
393
+ const { items, internal, needs } = plan(opts.names.map((n) => lookup(n, all)))
394
+ const copies = copiesFor(items, internal, to)
395
+ const sheets = [{ from: join(SRC, 'tokens.css'), to: join(to, 'tokens.css'), pro: false }]
396
+ if (opts.withBase) sheets.push({ from: join(SRC, 'base.css'), to: join(to, 'base.css'), pro: false })
397
+
398
+ const written = []
399
+ const skipped = []
400
+ const put = (c, allowOverwrite) => {
401
+ const s = state(c)
402
+ if (s !== 'missing' && !allowOverwrite) {
403
+ skipped.push(`${shown(to, c.to)} (already there, ${s === 'same' ? 'same' : 'different'})`)
404
+ return false
405
+ }
406
+ writeCopy(c, opts.dryRun)
407
+ written.push(shown(to, c.to))
408
+ return true
409
+ }
410
+ for (const c of copies) put(c, opts.overwrite)
411
+ // Stylesheets hold the app's own theme edits, so they are never replaced.
412
+ const tokensNew = put(sheets[0], false)
413
+ if (sheets[1]) put(sheets[1], false)
414
+
415
+ console.log(`${opts.dryRun ? 'Dry run, nothing written. ' : ''}Target: ${to}`)
416
+ console.log(`${opts.dryRun ? 'Would copy' : 'Copied'} ${plural(written.length, 'file')}.`)
417
+ for (const k of KINDS) {
418
+ const names = items.filter((i) => i.kind === k.key).map((i) => i.name)
419
+ if (names.length || k.key === 'component') console.log(`${k.plural}: ${names.length ? names.join(', ') : 'none'}`)
420
+ }
421
+ console.log(`Internal files: ${internal.length ? internal.map((f) => relative(INTERNAL, f)).join(', ') : 'none'}`)
422
+ if (needs.size) {
423
+ console.log('Dependencies:')
424
+ for (const { item, deps } of needs.values()) console.log(` ${item.name} needs ${[...deps.values()].map(label).join(', ')}`)
425
+ }
426
+ if (items.some(isPro)) console.log('Pro: part of Gooee UI Pro.')
427
+ if (skipped.length) {
428
+ console.log(`Skipped ${plural(skipped.length, 'existing file')}${opts.overwrite ? '' : ' (see what differs with diff, take the new version with update)'}:`)
429
+ for (const s of skipped) console.log(` ${s}`)
430
+ if (skipped.some((s) => /^(tokens|base)\.css /.test(s))) console.log(' tokens.css and base.css are never replaced, so your theme edits stay.')
431
+ }
432
+ if (tokensNew) console.log(`Next: import tokens.css once ${fromEntry(opts.to || readConfig()?.to || DEFAULT_TO, false)} (or run init).`)
433
+ if (items.some((i) => i.kind === 'theme')) console.log('Themes: import each one after tokens.css, then set data-theme-brand or data-density on <html>.')
434
+ }
435
+
436
+ // Compares the asked items (and what they import) with the copies in the project.
437
+ function compare(opts) {
438
+ const all = listItems()
439
+ const { to } = targetFolder(opts)
440
+ const { items, internal } = plan(opts.names.map((n) => lookup(n, all)))
441
+ const copies = copiesFor(items, internal, to).map((c) => ({ ...c, state: state(c) }))
442
+ return { to, items, copies }
443
+ }
444
+
445
+ function report(to, copies, withLines) {
446
+ const changed = copies.filter((c) => c.state === 'changed')
447
+ const missing = copies.filter((c) => c.state === 'missing')
448
+ for (const c of changed) {
449
+ console.log(`\nChanged: ${shown(to, c.to)}`)
450
+ if (withLines) for (const line of lineDiff(withoutCredit(readFileSync(c.to, 'utf8')), readFileSync(c.from, 'utf8'))) console.log(` ${line}`)
451
+ }
452
+ for (const c of missing) console.log(`New: ${shown(to, c.to)}`)
453
+ const same = copies.length - changed.length - missing.length
454
+ console.log(`\n${plural(changed.length, 'file')} changed, ${missing.length} new, ${same} up to date.`)
455
+ if (withLines && changed.length) console.log('Lines with "-" are in your copy, lines with "+" are in the latest version.')
456
+ return changed.length + missing.length
457
+ }
458
+
459
+ function runDiff(opts) {
460
+ const { to, copies } = compare(opts)
461
+ const count = report(to, copies, true)
462
+ if (count) console.log(`Take the latest version: npx gooee update ${opts.names.join(' ')}`)
463
+ }
464
+
465
+ async function runUpdate(opts) {
466
+ const { to, copies } = compare(opts)
467
+ const todo = copies.filter((c) => c.state !== 'same')
468
+ if (!todo.length) {
469
+ console.log(`Everything is up to date (${plural(copies.length, 'file')}).`)
470
+ return
471
+ }
472
+ report(to, copies, false)
473
+ if (opts.dryRun) {
474
+ console.log('Dry run, nothing written.')
475
+ return
476
+ }
477
+ if (!opts.yes) {
478
+ if (!process.stdin.isTTY) fail('update asks before replacing files. Run it in a terminal, or add --yes.', false)
479
+ console.log('Your own edits in the changed files will be replaced. See them first with diff.')
480
+ const rl = createInterface({ input: process.stdin, output: process.stdout })
481
+ const answer = (await rl.question(`Replace ${plural(todo.length, 'file')}? (y/N) `)).trim().toLowerCase()
482
+ rl.close()
483
+ if (answer !== 'y' && answer !== 'yes') {
484
+ console.log('Nothing changed.')
485
+ return
486
+ }
487
+ }
488
+ for (const c of todo) writeCopy(c, false)
489
+ console.log(`Updated ${plural(todo.length, 'file')}.`)
490
+ }
491
+
492
+ const tokenNames = (text) => new Set([...text.replace(/\/\*[\s\S]*?\*\//g, '').matchAll(/(--[\w-]+)\s*:/g)].map((m) => m[1]))
493
+
494
+ // tokens.css is never replaced, so a new component can read a token the project's copy does not have yet.
495
+ function warnMissingTokens(opts) {
496
+ const mine = join(targetFolder(opts).to, 'tokens.css')
497
+ if (!isFile(mine)) return
498
+ const latest = join(SRC, 'tokens.css')
499
+ const text = readFileSync(latest, 'utf8')
500
+ const have = tokenNames(readFileSync(mine, 'utf8'))
501
+ const missing = [...tokenNames(text)].filter((name) => !have.has(name))
502
+ if (!missing.length) return
503
+ console.log(`\nYour tokens.css is missing ${plural(missing.length, 'token')} that the latest components use: ${missing.join(', ')}`)
504
+ console.log(`Your file was not changed. Copy these lines from the latest tokens.css into ${shown(CWD, mine)}, each into the same block:`)
505
+ // A token can be set in more than one block (dark theme, reduced motion), so every line is listed under its block.
506
+ const blocks = new Map()
507
+ const stack = []
508
+ let selector = ''
509
+ for (const line of text.split('\n').map((l) => l.trim())) {
510
+ if (line.endsWith('{')) {
511
+ stack.push(`${selector}${line.slice(0, -1)}`.trim())
512
+ selector = ''
513
+ } else if (line.startsWith('}')) stack.pop()
514
+ else if (line.endsWith(',') && !line.includes(': ')) selector += `${line} `
515
+ else if (missing.some((name) => line.startsWith(`${name}:`))) {
516
+ const where = stack.join(' / ')
517
+ blocks.set(where, [...(blocks.get(where) ?? []), line])
518
+ }
519
+ }
520
+ for (const [where, found] of blocks) {
521
+ console.log(` In ${where}:`)
522
+ for (const line of found) console.log(` ${line}`)
523
+ }
524
+ console.log(`The latest file is at ${latest}`)
525
+ }
526
+
527
+ const opts = parseArgs(process.argv.slice(2))
528
+ if (opts.command === 'init') runInit(opts)
529
+ else if (opts.command === 'list') runList(opts)
530
+ else if (opts.command === 'diff') runDiff(opts)
531
+ else if (opts.command === 'update') await runUpdate(opts)
532
+ else runAdd(opts)
533
+ if (['add', 'diff', 'update'].includes(opts.command)) warnMissingTokens(opts)
@@ -0,0 +1,82 @@
1
+ [
2
+ "AddressFields",
3
+ "AssistantThread",
4
+ "AudioPlayer",
5
+ "BottomTabBar",
6
+ "Calendar",
7
+ "CalendarHeatmap",
8
+ "Carousel",
9
+ "Chart",
10
+ "ChatThread",
11
+ "ColorPicker",
12
+ "Combobox",
13
+ "CommandPalette",
14
+ "CommentThread",
15
+ "CompareSlider",
16
+ "ContextMenu",
17
+ "Countdown",
18
+ "CurrencyInput",
19
+ "DataGrid",
20
+ "DatePicker",
21
+ "DateRangePicker",
22
+ "DescriptionList",
23
+ "Drawer",
24
+ "EmojiPicker",
25
+ "FileUpload",
26
+ "GlassLens",
27
+ "HoverCard",
28
+ "IcInput",
29
+ "Image",
30
+ "ImageCropper",
31
+ "InlineEdit",
32
+ "KanbanBoard",
33
+ "Lightbox",
34
+ "Marquee",
35
+ "MasonryGrid",
36
+ "MentionInput",
37
+ "Menubar",
38
+ "MultiSelect",
39
+ "Navbar",
40
+ "NotificationInbox",
41
+ "OnionSkin",
42
+ "Parallax",
43
+ "PhoneInput",
44
+ "PinInput",
45
+ "ProgressRing",
46
+ "PromptBar",
47
+ "PullToRefresh",
48
+ "QrCode",
49
+ "RangeSlider",
50
+ "Rating",
51
+ "Register",
52
+ "RelativeTime",
53
+ "ResizablePanels",
54
+ "RichTextEditor",
55
+ "Route",
56
+ "ScrollDraft",
57
+ "ScrollExpand",
58
+ "ScrollStory",
59
+ "ScrollTone",
60
+ "ScrollTrack",
61
+ "Sidebar",
62
+ "SignaturePad",
63
+ "SortableList",
64
+ "SourceMark",
65
+ "Sparkline",
66
+ "StackScroll",
67
+ "Stat",
68
+ "Stepper",
69
+ "SwipeActions",
70
+ "TagInput",
71
+ "TextRise",
72
+ "TimePicker",
73
+ "Timeline",
74
+ "ToggleGroup",
75
+ "Toolbar",
76
+ "Tour",
77
+ "TreeView",
78
+ "VideoPlayer",
79
+ "VirtualList",
80
+ "WeekSchedule",
81
+ "WorkPill"
82
+ ]
package/src/base.css ADDED
@@ -0,0 +1,39 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ html {
8
+ -webkit-text-size-adjust: 100%;
9
+ text-size-adjust: 100%;
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ background: var(--gooee-color-bg);
15
+ color: var(--gooee-color-fg);
16
+ font-family: var(--gooee-font-sans);
17
+ font-size: var(--gooee-text-md);
18
+ line-height: var(--gooee-leading-normal);
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
21
+ transition: background-color var(--gooee-motion-base) var(--gooee-ease-out), color var(--gooee-motion-base) var(--gooee-ease-out);
22
+ }
23
+
24
+ button,
25
+ input,
26
+ select,
27
+ textarea {
28
+ font: inherit;
29
+ color: inherit;
30
+ }
31
+
32
+ img,
33
+ svg {
34
+ display: block;
35
+ }
36
+
37
+ :focus:not(:focus-visible) {
38
+ outline: none;
39
+ }