@sfgov/design-system 0.0.0-0969b8a

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 (157) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/css/base.css +2 -0
  4. package/css/base.css.map +1 -0
  5. package/css/components.css +2 -0
  6. package/css/components.css.map +1 -0
  7. package/css/fonts.css +2 -0
  8. package/css/fonts.css.map +1 -0
  9. package/css/icons.css +2 -0
  10. package/css/icons.css.map +1 -0
  11. package/css/overrides.css +2 -0
  12. package/css/overrides.css.map +1 -0
  13. package/css/sfds.css +2 -0
  14. package/css/sfds.css.map +1 -0
  15. package/css/src/base.css +26 -0
  16. package/css/src/components/button.css +61 -0
  17. package/css/src/components/details.css +10 -0
  18. package/css/src/components/grid.css +12 -0
  19. package/css/src/components/index.css +4 -0
  20. package/css/src/components/kbd.css +5 -0
  21. package/css/src/components.css +1 -0
  22. package/css/src/fonts.css +1 -0
  23. package/css/src/icons.css +7 -0
  24. package/css/src/overrides.css +3 -0
  25. package/css/src/sfds.css +6 -0
  26. package/css/src/theme.js +104 -0
  27. package/css/src/tokens/breakpoints.js +5 -0
  28. package/css/src/tokens/colors.js +116 -0
  29. package/css/src/tokens/index.js +8 -0
  30. package/css/src/tokens/spacing.js +27 -0
  31. package/css/src/tokens/typography.js +66 -0
  32. package/css/src/tokens/widths.js +11 -0
  33. package/css/src/typography.css +103 -0
  34. package/css/src/utilities.css +1 -0
  35. package/css/typography.css +2 -0
  36. package/css/typography.css.map +1 -0
  37. package/css/utilities.css +2 -0
  38. package/css/utilities.css.map +1 -0
  39. package/css/utilities.json +7350 -0
  40. package/elements/index.d.mts +30 -0
  41. package/elements/index.d.mts.map +1 -0
  42. package/elements/index.d.ts +30 -0
  43. package/elements/index.d.ts.map +1 -0
  44. package/elements/index.js +1 -0
  45. package/elements/index.mjs +1 -0
  46. package/elements/src/index.js +7 -0
  47. package/elements/src/sfgov-icon.js +109 -0
  48. package/icons/index.json +439 -0
  49. package/icons/svg/accessibility.svg +4 -0
  50. package/icons/svg/alert.svg +5 -0
  51. package/icons/svg/archive.svg +4 -0
  52. package/icons/svg/arrow-down.svg +3 -0
  53. package/icons/svg/arrow-left.svg +3 -0
  54. package/icons/svg/arrow-right.svg +3 -0
  55. package/icons/svg/arrow-up.svg +3 -0
  56. package/icons/svg/building.svg +7 -0
  57. package/icons/svg/calendar.svg +3 -0
  58. package/icons/svg/caution.svg +3 -0
  59. package/icons/svg/chart.svg +6 -0
  60. package/icons/svg/check.svg +3 -0
  61. package/icons/svg/chevron-down.svg +3 -0
  62. package/icons/svg/chevron-left.svg +3 -0
  63. package/icons/svg/chevron-right.svg +3 -0
  64. package/icons/svg/chevron-up.svg +3 -0
  65. package/icons/svg/clock.svg +4 -0
  66. package/icons/svg/close.svg +3 -0
  67. package/icons/svg/document.svg +3 -0
  68. package/icons/svg/globe.svg +3 -0
  69. package/icons/svg/hamburger-button.svg +5 -0
  70. package/icons/svg/index.json +346 -0
  71. package/icons/svg/info.svg +5 -0
  72. package/icons/svg/location.svg +4 -0
  73. package/icons/svg/mail.svg +3 -0
  74. package/icons/svg/minus.svg +3 -0
  75. package/icons/svg/pencil.svg +3 -0
  76. package/icons/svg/phone.svg +3 -0
  77. package/icons/svg/plus.svg +3 -0
  78. package/icons/svg/question.svg +4 -0
  79. package/icons/svg/search.svg +3 -0
  80. package/icons/svg/wip.svg +3 -0
  81. package/lib/markdownlint/frontmatter.js +51 -0
  82. package/lib/markdownlint/no-empty.js +19 -0
  83. package/lib/tailwind/details.js +14 -0
  84. package/package.json +359 -0
  85. package/react/README.md +36 -0
  86. package/react/index.d.mts +5725 -0
  87. package/react/index.d.mts.map +1 -0
  88. package/react/index.d.ts +5725 -0
  89. package/react/index.d.ts.map +1 -0
  90. package/react/index.js +1 -0
  91. package/react/index.mjs +1 -0
  92. package/react/src/components/Box.tsx +6 -0
  93. package/react/src/components/Button.tsx +94 -0
  94. package/react/src/components/Container.tsx +19 -0
  95. package/react/src/components/Flex.tsx +16 -0
  96. package/react/src/components/GlobalStyle.tsx +35 -0
  97. package/react/src/components/GoogleFonts.tsx +67 -0
  98. package/react/src/components/Grid.tsx +15 -0
  99. package/react/src/components/SSRStyle.tsx +47 -0
  100. package/react/src/components/SVGIcon.tsx +42 -0
  101. package/react/src/components/Text.tsx +78 -0
  102. package/react/src/components/Tile.tsx +93 -0
  103. package/react/src/components/index.ts +11 -0
  104. package/react/src/components/page/AboutSection.tsx +90 -0
  105. package/react/src/components/page/AgencyHeader.tsx +56 -0
  106. package/react/src/components/page/ArchiveInformation.tsx +43 -0
  107. package/react/src/components/page/ContactSection.tsx +92 -0
  108. package/react/src/components/page/Section.tsx +53 -0
  109. package/react/src/components/page/Spotlight.tsx +70 -0
  110. package/react/src/components/page/index.ts +6 -0
  111. package/react/src/constants.ts +48 -0
  112. package/react/src/icons/IconAccessibility.jsx +3 -0
  113. package/react/src/icons/IconAlert.jsx +3 -0
  114. package/react/src/icons/IconArchive.jsx +3 -0
  115. package/react/src/icons/IconArrowDown.jsx +3 -0
  116. package/react/src/icons/IconArrowLeft.jsx +3 -0
  117. package/react/src/icons/IconArrowRight.jsx +3 -0
  118. package/react/src/icons/IconArrowUp.jsx +3 -0
  119. package/react/src/icons/IconBuilding.jsx +3 -0
  120. package/react/src/icons/IconCalendar.jsx +3 -0
  121. package/react/src/icons/IconCaution.jsx +3 -0
  122. package/react/src/icons/IconChart.jsx +3 -0
  123. package/react/src/icons/IconCheck.jsx +3 -0
  124. package/react/src/icons/IconChevronDown.jsx +3 -0
  125. package/react/src/icons/IconChevronLeft.jsx +3 -0
  126. package/react/src/icons/IconChevronRight.jsx +3 -0
  127. package/react/src/icons/IconChevronUp.jsx +3 -0
  128. package/react/src/icons/IconClock.jsx +3 -0
  129. package/react/src/icons/IconClose.jsx +3 -0
  130. package/react/src/icons/IconDocument.jsx +3 -0
  131. package/react/src/icons/IconGlobe.jsx +3 -0
  132. package/react/src/icons/IconHamburgerButton.jsx +3 -0
  133. package/react/src/icons/IconInfo.jsx +3 -0
  134. package/react/src/icons/IconLocation.jsx +3 -0
  135. package/react/src/icons/IconMail.jsx +3 -0
  136. package/react/src/icons/IconMinus.jsx +3 -0
  137. package/react/src/icons/IconPencil.jsx +3 -0
  138. package/react/src/icons/IconPhone.jsx +3 -0
  139. package/react/src/icons/IconPlus.jsx +3 -0
  140. package/react/src/icons/IconQuestion.jsx +3 -0
  141. package/react/src/icons/IconSearch.jsx +3 -0
  142. package/react/src/icons/IconWIP.jsx +3 -0
  143. package/react/src/icons/index.js +31 -0
  144. package/react/src/icons/index.json +346 -0
  145. package/react/src/icons.tsx +34 -0
  146. package/react/src/index.ts +4 -0
  147. package/react/src/stitches.config.ts +85 -0
  148. package/react/src/theme/breakpoints.ts +14 -0
  149. package/react/src/theme/colors.ts +34 -0
  150. package/react/src/theme/index.tsx +31 -0
  151. package/react/src/theme/space.ts +16 -0
  152. package/react/src/theme/typography.ts +136 -0
  153. package/react/src/types.ts +31 -0
  154. package/react/src/utils.tsx +25 -0
  155. package/svgo.config.js +27 -0
  156. package/tailwind.config.js +5 -0
  157. package/tailwind.preset.js +128 -0
package/package.json ADDED
@@ -0,0 +1,359 @@
1
+ {
2
+ "name": "@sfgov/design-system",
3
+ "version": "0.0.0-0969b8a",
4
+ "engines": {
5
+ "node": "16.x",
6
+ "npm": "8.x"
7
+ },
8
+ "config": {
9
+ "website_port": 3002,
10
+ "storybook_port": 3001
11
+ },
12
+ "repository": "SFDigitalServices/design-system",
13
+ "files": [
14
+ "css",
15
+ "elements",
16
+ "icons",
17
+ "react",
18
+ "dist",
19
+ "lib",
20
+ "tailwind.*",
21
+ "svgo.config.*",
22
+ "!website/**",
23
+ "!storybook/**",
24
+ "!**/.eslint*"
25
+ ],
26
+ "scripts": {
27
+ "build": "wireit",
28
+ "build:ci": "wireit",
29
+ "build:css": "wireit",
30
+ "build:css-manifest": "wireit",
31
+ "build:docs": "wireit",
32
+ "build:favicon": "mkdir -p public && curl -O https://sf.gov/favicon.ico --output-dir public",
33
+ "build:js": "wireit",
34
+ "build:manifest": "wireit",
35
+ "build:storybook": "wireit",
36
+ "build:urls": "wireit",
37
+ "build:website": "wireit",
38
+ "build:website-index": "wireit",
39
+ "figma-export": "env-cmd -f .env figma-export use-config",
40
+ "lint": "wireit",
41
+ "lint:css": "stylelint '**/src/*.css'",
42
+ "lint:js": "eslint --ext js,jsx,mjs,ts,tsx css elements icons react lib '*.{js,mjs}'",
43
+ "lint:docs": "markdownlint --rules './lib/markdownlint/*.js' --ignore '**/node_modules/**' '**/*.md'",
44
+ "lint:scripts": "shellcheck scripts/*.sh",
45
+ "lint:storybook": "eslint --ext js,jsx,ts,tsx stories .storybook",
46
+ "lint:website": "npx eslint --ext js,jsx,ts,tsx website",
47
+ "postbuild:website": "scripts/check-website.sh",
48
+ "postbuild:css": "npm run build:css-manifest",
49
+ "postfigma-export": "eslint --fix react/src/icons",
50
+ "prepublishOnly": "scripts/check-prepublish-files.sh",
51
+ "public-dir": "mkdir -p public",
52
+ "serve:docs": "docusaurus serve website --dir public",
53
+ "start": "wireit",
54
+ "start:website": "wireit",
55
+ "start:storybook": "wireit",
56
+ "swizzle": "docusaurus swizzle",
57
+ "watch": "wireit",
58
+ "watch:css": "wireit",
59
+ "watch:js": "wireit",
60
+ "watch:icons": "echo 'watch icons (noop)'"
61
+ },
62
+ "wireit": {
63
+ "build": {
64
+ "dependencies": [
65
+ "build:css",
66
+ "build:js",
67
+ "build:manifest",
68
+ "build:website",
69
+ "build:storybook"
70
+ ]
71
+ },
72
+ "build:ci": {
73
+ "dependencies": [
74
+ "build:css",
75
+ "build:js",
76
+ "build:manifest"
77
+ ]
78
+ },
79
+ "build:css": {
80
+ "command": "postcss --verbose -d css 'css/src/*.css'",
81
+ "files": [
82
+ "css/src/**",
83
+ "postcss.config.js",
84
+ "package.json"
85
+ ],
86
+ "output": [
87
+ "css/*.css{,.map,.json}"
88
+ ]
89
+ },
90
+ "build:css-manifest": {
91
+ "command": "node scripts/build-css-manifest.js",
92
+ "output": [
93
+ "css/utilties.json"
94
+ ],
95
+ "files": [
96
+ "css/*.css"
97
+ ],
98
+ "dependencies": [
99
+ "build:css"
100
+ ]
101
+ },
102
+ "build:docs": {
103
+ "command": "docusaurus build website --out-dir $(pwd)/public",
104
+ "dependencies": [
105
+ "build:css",
106
+ "build:js",
107
+ "build:manifest"
108
+ ],
109
+ "files": [
110
+ "website/**"
111
+ ],
112
+ "output": [
113
+ "public",
114
+ "!public/{index,urls}.txt",
115
+ "!public/storybook"
116
+ ]
117
+ },
118
+ "build:js": {
119
+ "command": "rollup -c",
120
+ "files": [
121
+ "{elements,react}/src/**",
122
+ "*.config.*",
123
+ "package.json"
124
+ ],
125
+ "output": [
126
+ "{elements,react}/*.{js,mjs,ts}{,.map}"
127
+ ]
128
+ },
129
+ "build:website-index": {
130
+ "command": "find public -type f | grep -v '^storybook/' | perl -pe 's#^public/#/#' | sort > public/index.txt",
131
+ "dependencies": [
132
+ "build:docs"
133
+ ],
134
+ "clean": true,
135
+ "files": [
136
+ "public/**",
137
+ "!public/storybook"
138
+ ],
139
+ "output": [
140
+ "public/index.txt"
141
+ ]
142
+ },
143
+ "build:manifest": {
144
+ "command": "scripts/manifest.mjs 'css/*.css' '{elements,react}/*.{js,mjs}' 'icons/svg/*.svg'",
145
+ "dependencies": [
146
+ "build:css",
147
+ "build:js",
148
+ "build:css-manifest"
149
+ ],
150
+ "output": [
151
+ "manifest.json"
152
+ ]
153
+ },
154
+ "build:storybook": {
155
+ "command": "build-storybook -o public/storybook",
156
+ "clean": true,
157
+ "files": [
158
+ "public/storybook"
159
+ ],
160
+ "dependencies": [
161
+ "public-dir",
162
+ "build:css",
163
+ "build:js"
164
+ ]
165
+ },
166
+ "build:urls": {
167
+ "command": "scripts/build-urls.sh",
168
+ "files": [
169
+ "public/index.txt"
170
+ ],
171
+ "output": [
172
+ "public/urls.txt"
173
+ ],
174
+ "dependencies": [
175
+ "build:website-index"
176
+ ]
177
+ },
178
+ "build:website": {
179
+ "dependencies": [
180
+ "build:docs",
181
+ "build:storybook",
182
+ "build:urls",
183
+ "build:favicon"
184
+ ]
185
+ },
186
+ "lint": {
187
+ "dependencies": [
188
+ "lint:css",
189
+ "lint:js",
190
+ "lint:docs",
191
+ "lint:scripts",
192
+ "lint:website",
193
+ "lint:storybook"
194
+ ]
195
+ },
196
+ "start": {
197
+ "dependencies": [
198
+ "watch",
199
+ "start:website",
200
+ "start:storybook"
201
+ ]
202
+ },
203
+ "start:website": {
204
+ "command": "docusaurus start website --port=3002",
205
+ "service": true,
206
+ "files": [
207
+ "website/*.js",
208
+ "package.json"
209
+ ],
210
+ "dependencies": [
211
+ "build:css",
212
+ "build:js",
213
+ "build:manifest"
214
+ ]
215
+ },
216
+ "start:storybook": {
217
+ "command": "start-storybook --port=3001",
218
+ "service": true,
219
+ "files": [
220
+ ".storybook/*",
221
+ "package.json"
222
+ ],
223
+ "dependencies": [
224
+ "build:css",
225
+ "build:js"
226
+ ]
227
+ },
228
+ "watch": {
229
+ "dependencies": [
230
+ "watch:css",
231
+ "watch:icons",
232
+ "watch:js"
233
+ ]
234
+ },
235
+ "watch:css": {
236
+ "command": "npm run build:css -- --watch",
237
+ "service": true,
238
+ "files": [
239
+ "postcss.config.js"
240
+ ]
241
+ },
242
+ "watch:js": {
243
+ "command": "rollup -c --watch",
244
+ "service": true,
245
+ "files": [
246
+ "rollup.config.*"
247
+ ]
248
+ }
249
+ },
250
+ "peerDependencies": {
251
+ "react": "^18.2.0",
252
+ "react-dom": "^18.2.0",
253
+ "tailwindcss": "^2.2.19"
254
+ },
255
+ "peerDependenciesMeta": {
256
+ "react": {
257
+ "optional": true
258
+ },
259
+ "react-dom": {
260
+ "optional": true
261
+ },
262
+ "tailwindcss": {
263
+ "optional": true
264
+ }
265
+ },
266
+ "devDependencies": {
267
+ "@babel/cli": "^7.20.7",
268
+ "@babel/core": "^7.20.12",
269
+ "@babel/preset-env": "^7.20.2",
270
+ "@babel/preset-react": "^7.18.6",
271
+ "@babel/preset-typescript": "^7.18.6",
272
+ "@docusaurus/core": "^2.2.0",
273
+ "@docusaurus/eslint-plugin": "^2.2.0",
274
+ "@docusaurus/module-type-aliases": "^2.2.0",
275
+ "@docusaurus/plugin-client-redirects": "^2.2.0",
276
+ "@docusaurus/preset-classic": "^2.2.0",
277
+ "@docusaurus/theme-live-codeblock": "^2.2.0",
278
+ "@figma-export/cli": "^4.5.0",
279
+ "@figma-export/output-components-as-svg": "^4.5.0",
280
+ "@figma-export/output-components-as-svgr": "^4.5.0",
281
+ "@figma-export/transform-svg-with-svgo": "^4.5.0",
282
+ "@figma-export/types": "^4.5.0",
283
+ "@mdx-js/react": "^1.6.22",
284
+ "@rollup/plugin-babel": "^6.0.3",
285
+ "@rollup/plugin-commonjs": "^24.0.0",
286
+ "@rollup/plugin-json": "^6.0.0",
287
+ "@rollup/plugin-node-resolve": "^15.0.1",
288
+ "@stitches/react": "^1.2.8",
289
+ "@storybook/addon-actions": "^6.5.15",
290
+ "@storybook/addon-essentials": "^6.5.15",
291
+ "@storybook/addon-interactions": "^6.5.15",
292
+ "@storybook/addon-links": "^6.5.15",
293
+ "@storybook/addon-storysource": "^6.5.15",
294
+ "@storybook/builder-webpack5": "^6.5.15",
295
+ "@storybook/manager-webpack5": "^6.5.15",
296
+ "@storybook/react": "^6.5.15",
297
+ "@storybook/testing-library": "^0.0.13",
298
+ "@tsconfig/docusaurus": "^1.0.6",
299
+ "@types/eslint": "^8.4.2",
300
+ "@types/node": "^16.18.6",
301
+ "@typescript-eslint/eslint-plugin": "^5.45.0",
302
+ "@typescript-eslint/parser": "^5.45.0",
303
+ "autoprefixer": "^10.4.7",
304
+ "babel-loader": "^8.2.5",
305
+ "clsx": "^1.1.0",
306
+ "core-js": "^3.27.1",
307
+ "cssnano": "^5.1.14",
308
+ "dedent": "^0.7.0",
309
+ "dotenv": "^16.0.3",
310
+ "env-cmd": "^10.1.0",
311
+ "eslint": "^8.24.0",
312
+ "eslint-plugin-html": "^6.2.0",
313
+ "eslint-plugin-import": "^2.26.0",
314
+ "eslint-plugin-n": "^15.5.1",
315
+ "eslint-plugin-promise": "^6.0.0",
316
+ "eslint-plugin-react": "^7.30.0",
317
+ "eslint-plugin-sfgov": "^2.0.0",
318
+ "eslint-plugin-storybook": "^0.6.4",
319
+ "eslint-plugin-unicorn": "^42.0.0",
320
+ "filesize": "^8.0.7",
321
+ "fs-extra": "^11.1.0",
322
+ "globby": "^13.1.3",
323
+ "js-yaml": "^4.1.0",
324
+ "lodash.startcase": "^4.4.0",
325
+ "markdownlint-cli": "^0.31.1",
326
+ "postcss": "^8.4.14",
327
+ "postcss-cli": "^10.1.0",
328
+ "postcss-import": "^15.1.0",
329
+ "postcss-nested": "^6.0.0",
330
+ "prettysize": "^2.0.0",
331
+ "prism-react-renderer": "^1.3.1",
332
+ "prop-types": "^15.8.1",
333
+ "raw-loader": "^4.0.2",
334
+ "react": "^18.2.0",
335
+ "react-copy-to-clipboard": "^5.1.0",
336
+ "react-dom": "^18.2.0",
337
+ "react-masonry-css": "^1.0.16",
338
+ "react-shadow": "^19.0.3",
339
+ "rollup": "^3.9.1",
340
+ "rollup-cache": "^1.2.0",
341
+ "rollup-plugin-peer-deps-external": "^2.2.4",
342
+ "rollup-plugin-terser": "^7.0.2",
343
+ "rollup-plugin-ts": "^3.1.1",
344
+ "shellcheck": "^1.1.0",
345
+ "storybook-addon-designs": "^6.3.1",
346
+ "storybook-source-link": "^2.0.4",
347
+ "stylelint": "^14.8.4",
348
+ "stylelint-config-standard": "^25.0.0",
349
+ "stylelint-config-tailwindcss": "^0.0.7",
350
+ "stylelint-expiring-todo-comments": "^0.0.1",
351
+ "svgo": "^3.0.2",
352
+ "tailwind-styled-components": "^2.2.0",
353
+ "tailwindcss": "^2.2.19",
354
+ "tailwindcss-interaction-variants": "^5.0.0",
355
+ "typescript": "^4.9.3",
356
+ "use-bus": "^2.5.1",
357
+ "wireit": "^0.9.3"
358
+ }
359
+ }
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: React
3
+ ---
4
+
5
+ ## @sfgov/design-system/react
6
+
7
+ This package provides the [SF.gov Design System's][website] React components.
8
+
9
+ ## Install
10
+
11
+ You can install the package via [npm] or a similar package manager. In addition
12
+ to the `@sfgov/design-system/react` package, you'll also need to install its
13
+ [peer dependencies]. (See the `peerDependencies` field in
14
+ [package.json](./package.json) for version requirements.)
15
+
16
+ ```sh
17
+ npm install @sfgov/design-system react
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Our styling library, [Stitches], exposes the `css` prop on our React components.
23
+
24
+ ```jsx
25
+ import { ThemeProvider } from '@sfgov/design-system/react'
26
+
27
+ const MyPage = () =>
28
+ <TitleXl css={{ color: 'red' }}>
29
+ A red title
30
+ </TitleXl>
31
+ ```
32
+
33
+ [npm]: https://npmjs.com
34
+ [peer dependencies]: https://nodejs.org/es/blog/npm/peer-dependencies/
35
+ [Stitches]: https://stitches.dev/
36
+ [website]: https://design-system.sf.gov