@sfgov/design-system 0.0.1 → 2.0.0--canary.171.42084730475.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.
- package/README.md +96 -5
- package/dist/formio/factories/index.d.mts +23 -0
- package/dist/formio/factories/index.d.ts +23 -0
- package/dist/formio/factories/index.js +142938 -0
- package/dist/formio/factories/index.js.map +1 -0
- package/dist/formio/factories/index.mjs +142913 -0
- package/dist/formio/factories/index.mjs.map +1 -0
- package/dist/formio/index.d.mts +66 -0
- package/dist/formio/index.d.ts +66 -0
- package/dist/formio/index.js +2382 -0
- package/dist/formio/index.js.map +1 -0
- package/dist/formio/index.mjs +2341 -0
- package/dist/formio/index.mjs.map +1 -0
- package/dist/index-BS9wLSsa.d.mts +608 -0
- package/dist/index-BS9wLSsa.d.ts +608 -0
- package/dist/index-DYMbrQaa.d.mts +653 -0
- package/dist/index-DYMbrQaa.d.ts +653 -0
- package/dist/index-DsMhfRKm.d.mts +750 -0
- package/dist/index-DsMhfRKm.d.ts +750 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2236 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2204 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react/index.d.mts +5 -5725
- package/dist/react/index.d.ts +5 -5725
- package/dist/react/index.js +1709 -1
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +1543 -1
- package/dist/react/index.mjs.map +1 -0
- package/dist/tailwind-preset/index.d.mts +5 -0
- package/dist/tailwind-preset/index.d.ts +5 -0
- package/dist/tailwind-preset/index.js +1486 -0
- package/dist/tailwind-preset/index.js.map +1 -0
- package/dist/tailwind-preset/index.mjs +1489 -0
- package/dist/tailwind-preset/index.mjs.map +1 -0
- package/dist/tokens/index.d.mts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +675 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/index.mjs +645 -0
- package/dist/tokens/index.mjs.map +1 -0
- package/package.json +170 -331
- package/css/src/base.css +0 -26
- package/css/src/components/button.css +0 -61
- package/css/src/components/details.css +0 -10
- package/css/src/components/grid.css +0 -12
- package/css/src/components/index.css +0 -4
- package/css/src/components/kbd.css +0 -5
- package/css/src/components.css +0 -1
- package/css/src/fonts.css +0 -1
- package/css/src/icons.css +0 -7
- package/css/src/overrides.css +0 -3
- package/css/src/sfds.css +0 -6
- package/css/src/theme.js +0 -104
- package/css/src/tokens/breakpoints.js +0 -5
- package/css/src/tokens/colors.js +0 -116
- package/css/src/tokens/index.js +0 -8
- package/css/src/tokens/spacing.js +0 -27
- package/css/src/tokens/typography.js +0 -66
- package/css/src/tokens/widths.js +0 -11
- package/css/src/typography.css +0 -103
- package/css/src/utilities.css +0 -1
- package/dist/css/base.css +0 -2
- package/dist/css/base.css.map +0 -1
- package/dist/css/components.css +0 -2
- package/dist/css/components.css.map +0 -1
- package/dist/css/fonts.css +0 -2
- package/dist/css/fonts.css.map +0 -1
- package/dist/css/icons.css +0 -2
- package/dist/css/icons.css.map +0 -1
- package/dist/css/overrides.css +0 -2
- package/dist/css/overrides.css.map +0 -1
- package/dist/css/sfds.css +0 -2
- package/dist/css/sfds.css.map +0 -1
- package/dist/css/typography.css +0 -2
- package/dist/css/typography.css.map +0 -1
- package/dist/css/utilities.css +0 -2
- package/dist/css/utilities.css.map +0 -1
- package/dist/css/utilities.json +0 -7350
- package/dist/elements/index.d.mts +0 -30
- package/dist/elements/index.d.mts.map +0 -1
- package/dist/elements/index.d.ts +0 -30
- package/dist/elements/index.d.ts.map +0 -1
- package/dist/elements/index.js +0 -1
- package/dist/elements/index.mjs +0 -1
- package/dist/manifest.json +0 -45
- package/dist/react/index.d.mts.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/elements/index.js +0 -1
- package/elements/index.mjs +0 -1
- package/elements/src/index.js +0 -7
- package/elements/src/sfgov-icon.js +0 -109
- package/icons/index.json +0 -439
- package/icons/svg/accessibility.svg +0 -4
- package/icons/svg/alert.svg +0 -5
- package/icons/svg/archive.svg +0 -4
- package/icons/svg/arrow-down.svg +0 -3
- package/icons/svg/arrow-left.svg +0 -3
- package/icons/svg/arrow-right.svg +0 -3
- package/icons/svg/arrow-up.svg +0 -3
- package/icons/svg/building.svg +0 -7
- package/icons/svg/calendar.svg +0 -3
- package/icons/svg/caution.svg +0 -3
- package/icons/svg/chart.svg +0 -6
- package/icons/svg/check.svg +0 -3
- package/icons/svg/chevron-down.svg +0 -3
- package/icons/svg/chevron-left.svg +0 -3
- package/icons/svg/chevron-right.svg +0 -3
- package/icons/svg/chevron-up.svg +0 -3
- package/icons/svg/clock.svg +0 -4
- package/icons/svg/close.svg +0 -3
- package/icons/svg/document.svg +0 -3
- package/icons/svg/globe.svg +0 -3
- package/icons/svg/hamburger-button.svg +0 -5
- package/icons/svg/index.json +0 -346
- package/icons/svg/info.svg +0 -5
- package/icons/svg/location.svg +0 -4
- package/icons/svg/mail.svg +0 -3
- package/icons/svg/minus.svg +0 -3
- package/icons/svg/pencil.svg +0 -3
- package/icons/svg/phone.svg +0 -3
- package/icons/svg/plus.svg +0 -3
- package/icons/svg/question.svg +0 -4
- package/icons/svg/search.svg +0 -3
- package/icons/svg/wip.svg +0 -3
- package/lib/markdownlint/frontmatter.js +0 -51
- package/lib/markdownlint/no-empty.js +0 -19
- package/lib/tailwind/details.js +0 -14
- package/react/README.md +0 -36
- package/react/index.js +0 -1
- package/react/index.mjs +0 -1
- package/react/src/components/Box.tsx +0 -6
- package/react/src/components/Button.tsx +0 -94
- package/react/src/components/Container.tsx +0 -19
- package/react/src/components/Flex.tsx +0 -16
- package/react/src/components/GlobalStyle.tsx +0 -35
- package/react/src/components/GoogleFonts.tsx +0 -67
- package/react/src/components/Grid.tsx +0 -15
- package/react/src/components/SSRStyle.tsx +0 -47
- package/react/src/components/SVGIcon.tsx +0 -42
- package/react/src/components/Text.tsx +0 -78
- package/react/src/components/Tile.tsx +0 -93
- package/react/src/components/index.ts +0 -11
- package/react/src/components/page/AboutSection.tsx +0 -90
- package/react/src/components/page/AgencyHeader.tsx +0 -56
- package/react/src/components/page/ArchiveInformation.tsx +0 -43
- package/react/src/components/page/ContactSection.tsx +0 -92
- package/react/src/components/page/Section.tsx +0 -53
- package/react/src/components/page/Spotlight.tsx +0 -70
- package/react/src/components/page/index.ts +0 -6
- package/react/src/constants.ts +0 -48
- package/react/src/icons/IconAccessibility.jsx +0 -3
- package/react/src/icons/IconAlert.jsx +0 -3
- package/react/src/icons/IconArchive.jsx +0 -3
- package/react/src/icons/IconArrowDown.jsx +0 -3
- package/react/src/icons/IconArrowLeft.jsx +0 -3
- package/react/src/icons/IconArrowRight.jsx +0 -3
- package/react/src/icons/IconArrowUp.jsx +0 -3
- package/react/src/icons/IconBuilding.jsx +0 -3
- package/react/src/icons/IconCalendar.jsx +0 -3
- package/react/src/icons/IconCaution.jsx +0 -3
- package/react/src/icons/IconChart.jsx +0 -3
- package/react/src/icons/IconCheck.jsx +0 -3
- package/react/src/icons/IconChevronDown.jsx +0 -3
- package/react/src/icons/IconChevronLeft.jsx +0 -3
- package/react/src/icons/IconChevronRight.jsx +0 -3
- package/react/src/icons/IconChevronUp.jsx +0 -3
- package/react/src/icons/IconClock.jsx +0 -3
- package/react/src/icons/IconClose.jsx +0 -3
- package/react/src/icons/IconDocument.jsx +0 -3
- package/react/src/icons/IconGlobe.jsx +0 -3
- package/react/src/icons/IconHamburgerButton.jsx +0 -3
- package/react/src/icons/IconInfo.jsx +0 -3
- package/react/src/icons/IconLocation.jsx +0 -3
- package/react/src/icons/IconMail.jsx +0 -3
- package/react/src/icons/IconMinus.jsx +0 -3
- package/react/src/icons/IconPencil.jsx +0 -3
- package/react/src/icons/IconPhone.jsx +0 -3
- package/react/src/icons/IconPlus.jsx +0 -3
- package/react/src/icons/IconQuestion.jsx +0 -3
- package/react/src/icons/IconSearch.jsx +0 -3
- package/react/src/icons/IconWIP.jsx +0 -3
- package/react/src/icons/index.js +0 -31
- package/react/src/icons/index.json +0 -346
- package/react/src/icons.tsx +0 -34
- package/react/src/index.ts +0 -4
- package/react/src/stitches.config.ts +0 -85
- package/react/src/theme/breakpoints.ts +0 -14
- package/react/src/theme/colors.ts +0 -34
- package/react/src/theme/index.tsx +0 -31
- package/react/src/theme/space.ts +0 -16
- package/react/src/theme/typography.ts +0 -136
- package/react/src/types.ts +0 -31
- package/react/src/utils.tsx +0 -25
- package/svgo.config.js +0 -27
- package/tailwind.config.js +0 -5
- package/tailwind.preset.js +0 -128
package/README.md
CHANGED
|
@@ -1,7 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sf.gov design system
|
|
2
2
|
|
|
3
|
-
This is the design system for
|
|
4
|
-
|
|
3
|
+
This is the home of the design system for the City & County of San Francisco's
|
|
4
|
+
web site, [sf.gov](https://www.sf.gov/).
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
You can install the design system with [npm] or any npm-compatible package
|
|
9
|
+
manager ([pnpm], [yarn], etc.):
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @sfgov/design-system
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
The `@sfgov/design-system` package requires [Tailwind CSS v3] for styling and
|
|
18
|
+
[React] for rendering components. If you don't have them already, you can
|
|
19
|
+
install them with:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install tailwindcss@3 react@18 react-dom@18
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Entrypoints
|
|
26
|
+
|
|
27
|
+
The package provides the following entrypoints:
|
|
28
|
+
|
|
29
|
+
- `@sfgov/design-system` exports the `react` and `tokens` namespaces.
|
|
30
|
+
- `@sfgov/design-system/react` exports the React components and helpers,
|
|
31
|
+
including `classed()`.
|
|
32
|
+
- `@sfgov/design-system/tailwind-preset` is the [Tailwind preset](#tailwind).
|
|
33
|
+
- `@sfgov/design-system/tokens` exports the design tokens: `breakpoints`,
|
|
34
|
+
`colors`, `spacing`, and `widths`.
|
|
35
|
+
- `@sfgov/design-system/formio` exports the `FormioForm` React component and
|
|
36
|
+
other support code.
|
|
37
|
+
- `@sfgov/design-system/formio/factories` exports form.io-specific test
|
|
38
|
+
factories like `FormFactory` that are used by sf.gov's `FormPage` tests.
|
|
39
|
+
|
|
40
|
+
## React components
|
|
41
|
+
|
|
42
|
+
React components are exported from `@sfgov/design-system/react`:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Button, Container } from '@sfgov/design-system/react'
|
|
46
|
+
|
|
47
|
+
export function Greeting() {
|
|
48
|
+
return (
|
|
49
|
+
<Container>
|
|
50
|
+
<Button onClick={() => alert('hello!')}>Say hi</Button>
|
|
51
|
+
</Container>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### `classed()` components
|
|
57
|
+
|
|
58
|
+
The components entrypoint also exports a `classed()` function that can be used
|
|
59
|
+
to create new, higher order components:
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { classed, Button } from '@sfgov/design-system/react'
|
|
63
|
+
|
|
64
|
+
// renders <Button className="fancy">
|
|
65
|
+
export const FancyButton = classed(Button, 'fancy')
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Tailwind
|
|
69
|
+
|
|
70
|
+
The `@sfgov/design-system` package includes a [Tailwind preset] that you can use
|
|
71
|
+
in your own configuration. In order for Tailwind to include styles for the
|
|
72
|
+
included React components, you'll also need to add an entry to the [content
|
|
73
|
+
sources] option that tells Tailwind to look for class names in _this_ package:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
// tailwind.config.js
|
|
77
|
+
const sfgov = require('@sfgov/design-system/tailwind-preset')
|
|
78
|
+
const { dirname } = require('node:path')
|
|
79
|
+
|
|
80
|
+
const designSystemDist = dirname(require.resolve('@sfgov/design-system'))
|
|
81
|
+
|
|
82
|
+
/** @type {import('tailwindcss').Config} */
|
|
83
|
+
module.exports = {
|
|
84
|
+
presets: [sfgov],
|
|
85
|
+
content: [
|
|
86
|
+
'./src/**/*.tsx',
|
|
87
|
+
`${designSystemDist}/**/*.{js,mjs}`
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
[content sources]: https://v3.tailwindcss.com/docs/upgrade-guide#configure-content-sources
|
|
93
|
+
[npm]: https://www.npmjs.com/
|
|
94
|
+
[pnpm]: https://pnpm.io/
|
|
95
|
+
[react]: https://react.dev/
|
|
96
|
+
[tailwind css v3]: https://v3.tailwindcss.com/
|
|
97
|
+
[tailwind preset]: https://v3.tailwindcss.com/docs/presets
|
|
98
|
+
[yarn]: https://yarnpkg.com/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as node_factory from 'node-factory';
|
|
2
|
+
import { CheckboxSchema, ColumnsSchema, AnyComponentSchema, ContainerSchema, FieldsetSchema, FlatFormSchema, InputOption, PanelSchema, RadioSchema, SelectBoxesSchema, SelectSchema, WellSchema, WizardFormSchema } from '../index.mjs';
|
|
3
|
+
import 'formiojs';
|
|
4
|
+
import 'formiojs/types/eventEmitter';
|
|
5
|
+
import 'i18next';
|
|
6
|
+
import '@formio/choices.js';
|
|
7
|
+
|
|
8
|
+
declare const FormFactory: node_factory.Factory<FlatFormSchema> & node_factory.GenericExtension<FlatFormSchema>;
|
|
9
|
+
declare const WizardFactory: node_factory.Factory<WizardFormSchema> & node_factory.GenericExtension<WizardFormSchema>;
|
|
10
|
+
declare const ComponentFactory: node_factory.Factory<AnyComponentSchema> & node_factory.GenericExtension<AnyComponentSchema>;
|
|
11
|
+
declare const ContainerComponentFactory: node_factory.Factory<ContainerSchema> & node_factory.GenericExtension<ContainerSchema>;
|
|
12
|
+
declare const PageFactory: node_factory.Factory<PanelSchema> & node_factory.GenericExtension<PanelSchema>;
|
|
13
|
+
declare const WellFactory: node_factory.Factory<WellSchema> & node_factory.GenericExtension<WellSchema>;
|
|
14
|
+
declare const FieldsetFactory: node_factory.Factory<FieldsetSchema> & node_factory.GenericExtension<FieldsetSchema>;
|
|
15
|
+
declare const OptionFactory: node_factory.Factory<InputOption> & node_factory.GenericExtension<InputOption>;
|
|
16
|
+
declare const CheckboxFactory: node_factory.Factory<CheckboxSchema> & node_factory.GenericExtension<CheckboxSchema>;
|
|
17
|
+
declare const RadioFactory: node_factory.Factory<RadioSchema> & node_factory.GenericExtension<RadioSchema>;
|
|
18
|
+
declare const SelectBoxesFactory: node_factory.Factory<SelectBoxesSchema> & node_factory.GenericExtension<SelectBoxesSchema>;
|
|
19
|
+
declare const SelectFactory: node_factory.Factory<SelectSchema> & node_factory.GenericExtension<SelectSchema>;
|
|
20
|
+
declare const ColumnsFactory: node_factory.Factory<ColumnsSchema> & node_factory.GenericExtension<ColumnsSchema>;
|
|
21
|
+
declare const MailingAddressFactory: node_factory.Factory<ContainerSchema> & node_factory.GenericExtension<ContainerSchema>;
|
|
22
|
+
|
|
23
|
+
export { CheckboxFactory, ColumnsFactory, ComponentFactory, ContainerComponentFactory, FieldsetFactory, FormFactory, MailingAddressFactory, OptionFactory, PageFactory, RadioFactory, SelectBoxesFactory, SelectFactory, WellFactory, WizardFactory };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as node_factory from 'node-factory';
|
|
2
|
+
import { CheckboxSchema, ColumnsSchema, AnyComponentSchema, ContainerSchema, FieldsetSchema, FlatFormSchema, InputOption, PanelSchema, RadioSchema, SelectBoxesSchema, SelectSchema, WellSchema, WizardFormSchema } from '../index.js';
|
|
3
|
+
import 'formiojs';
|
|
4
|
+
import 'formiojs/types/eventEmitter';
|
|
5
|
+
import 'i18next';
|
|
6
|
+
import '@formio/choices.js';
|
|
7
|
+
|
|
8
|
+
declare const FormFactory: node_factory.Factory<FlatFormSchema> & node_factory.GenericExtension<FlatFormSchema>;
|
|
9
|
+
declare const WizardFactory: node_factory.Factory<WizardFormSchema> & node_factory.GenericExtension<WizardFormSchema>;
|
|
10
|
+
declare const ComponentFactory: node_factory.Factory<AnyComponentSchema> & node_factory.GenericExtension<AnyComponentSchema>;
|
|
11
|
+
declare const ContainerComponentFactory: node_factory.Factory<ContainerSchema> & node_factory.GenericExtension<ContainerSchema>;
|
|
12
|
+
declare const PageFactory: node_factory.Factory<PanelSchema> & node_factory.GenericExtension<PanelSchema>;
|
|
13
|
+
declare const WellFactory: node_factory.Factory<WellSchema> & node_factory.GenericExtension<WellSchema>;
|
|
14
|
+
declare const FieldsetFactory: node_factory.Factory<FieldsetSchema> & node_factory.GenericExtension<FieldsetSchema>;
|
|
15
|
+
declare const OptionFactory: node_factory.Factory<InputOption> & node_factory.GenericExtension<InputOption>;
|
|
16
|
+
declare const CheckboxFactory: node_factory.Factory<CheckboxSchema> & node_factory.GenericExtension<CheckboxSchema>;
|
|
17
|
+
declare const RadioFactory: node_factory.Factory<RadioSchema> & node_factory.GenericExtension<RadioSchema>;
|
|
18
|
+
declare const SelectBoxesFactory: node_factory.Factory<SelectBoxesSchema> & node_factory.GenericExtension<SelectBoxesSchema>;
|
|
19
|
+
declare const SelectFactory: node_factory.Factory<SelectSchema> & node_factory.GenericExtension<SelectSchema>;
|
|
20
|
+
declare const ColumnsFactory: node_factory.Factory<ColumnsSchema> & node_factory.GenericExtension<ColumnsSchema>;
|
|
21
|
+
declare const MailingAddressFactory: node_factory.Factory<ContainerSchema> & node_factory.GenericExtension<ContainerSchema>;
|
|
22
|
+
|
|
23
|
+
export { CheckboxFactory, ColumnsFactory, ComponentFactory, ContainerComponentFactory, FieldsetFactory, FormFactory, MailingAddressFactory, OptionFactory, PageFactory, RadioFactory, SelectBoxesFactory, SelectFactory, WellFactory, WizardFactory };
|