|
| 1 | +'use client'; |
| 2 | + |
1 | 3 | import {colorSwatch, getColorScale} from './color.macro' with {type: 'macro'}; |
2 | 4 | import {Disclosure, DisclosurePanel, DisclosureTitle} from '@react-spectrum/s2'; |
3 | 5 | import React from 'react'; |
4 | 6 | import {style} from '@react-spectrum/s2/style' with {type: 'macro'}; |
5 | 7 |
|
6 | | -export function S2Colors() { |
| 8 | +export function BackgroundColorsDisclosure() { |
| 9 | + return ( |
| 10 | + <Disclosure isQuiet> |
| 11 | + <DisclosureTitle>Background colors</DisclosureTitle> |
| 12 | + <DisclosurePanel> |
| 13 | + <p>The backgroundColor property supports the following values, in addition to the semantic and global colors. These colors are specifically chosen to be used as backgrounds, so prefer them over global colors where possible.</p> |
| 14 | + <div className="sb-unstyled" style={{columnWidth: 120}}> |
| 15 | + <Color name="base" className={colorSwatch('base')} /> |
| 16 | + <Color name="layer-1" className={colorSwatch('layer-1')} /> |
| 17 | + <Color name="layer-2" className={colorSwatch('layer-2')} /> |
| 18 | + <Color name="pasteboard" className={colorSwatch('pasteboard')} /> |
| 19 | + <Color name="elevated" className={colorSwatch('elevated')} /> |
| 20 | + <Color name="accent" className={colorSwatch('accent')} /> |
| 21 | + <Color name="accent-subtle" className={colorSwatch('accent-subtle')} /> |
| 22 | + <Color name="neutral" className={colorSwatch('neutral')} /> |
| 23 | + <Color name="neutral-subdued" className={colorSwatch('neutral-subdued')} /> |
| 24 | + <Color name="neutral-subtle" className={colorSwatch('neutral-subtle')} /> |
| 25 | + <Color name="negative" className={colorSwatch('negative')} /> |
| 26 | + <Color name="negative-subtle" className={colorSwatch('negative-subtle')} /> |
| 27 | + <Color name="informative" className={colorSwatch('informative')} /> |
| 28 | + <Color name="informative-subtle" className={colorSwatch('informative-subtle')} /> |
| 29 | + <Color name="positive" className={colorSwatch('positive')} /> |
| 30 | + <Color name="positive-subtle" className={colorSwatch('positive-subtle')} /> |
| 31 | + <Color name="notice" className={colorSwatch('notice')} /> |
| 32 | + <Color name="notice-subtle" className={colorSwatch('notice-subtle')} /> |
| 33 | + <Color name="gray" className={colorSwatch('gray')} /> |
| 34 | + <Color name="gray-subtle" className={colorSwatch('gray-subtle')} /> |
| 35 | + <Color name="red" className={colorSwatch('red')} /> |
| 36 | + <Color name="red-subtle" className={colorSwatch('red-subtle')} /> |
| 37 | + <Color name="orange" className={colorSwatch('orange')} /> |
| 38 | + <Color name="orange-subtle" className={colorSwatch('orange-subtle')} /> |
| 39 | + <Color name="yellow" className={colorSwatch('yellow')} /> |
| 40 | + <Color name="yellow-subtle" className={colorSwatch('yellow-subtle')} /> |
| 41 | + <Color name="chartreuse" className={colorSwatch('chartreuse')} /> |
| 42 | + <Color name="chartreuse-subtle" className={colorSwatch('chartreuse-subtle')} /> |
| 43 | + <Color name="celery" className={colorSwatch('celery')} /> |
| 44 | + <Color name="celery-subtle" className={colorSwatch('celery-subtle')} /> |
| 45 | + <Color name="green" className={colorSwatch('green')} /> |
| 46 | + <Color name="green-subtle" className={colorSwatch('green-subtle')} /> |
| 47 | + <Color name="seafoam" className={colorSwatch('seafoam')} /> |
| 48 | + <Color name="seafoam-subtle" className={colorSwatch('seafoam-subtle')} /> |
| 49 | + <Color name="cyan" className={colorSwatch('cyan')} /> |
| 50 | + <Color name="cyan-subtle" className={colorSwatch('cyan-subtle')} /> |
| 51 | + <Color name="blue" className={colorSwatch('blue')} /> |
| 52 | + <Color name="blue-subtle" className={colorSwatch('blue-subtle')} /> |
| 53 | + <Color name="indigo" className={colorSwatch('indigo')} /> |
| 54 | + <Color name="indigo-subtle" className={colorSwatch('indigo-subtle')} /> |
| 55 | + <Color name="purple" className={colorSwatch('purple')} /> |
| 56 | + <Color name="purple-subtle" className={colorSwatch('purple-subtle')} /> |
| 57 | + <Color name="fuchsia" className={colorSwatch('fuchsia')} /> |
| 58 | + <Color name="fuchsia-subtle" className={colorSwatch('fuchsia-subtle')} /> |
| 59 | + <Color name="magenta" className={colorSwatch('magenta')} /> |
| 60 | + <Color name="magenta-subtle" className={colorSwatch('magenta-subtle')} /> |
| 61 | + <Color name="pink" className={colorSwatch('pink')} /> |
| 62 | + <Color name="pink-subtle" className={colorSwatch('pink-subtle')} /> |
| 63 | + <Color name="turquoise" className={colorSwatch('turquoise')} /> |
| 64 | + <Color name="turquoise-subtle" className={colorSwatch('turquoise-subtle')} /> |
| 65 | + <Color name="cinnamon" className={colorSwatch('cinnamon')} /> |
| 66 | + <Color name="cinnamon-subtle" className={colorSwatch('cinnamon-subtle')} /> |
| 67 | + <Color name="brown" className={colorSwatch('brown')} /> |
| 68 | + <Color name="brown-subtle" className={colorSwatch('brown-subtle')} /> |
| 69 | + <Color name="silver" className={colorSwatch('silver')} /> |
| 70 | + <Color name="silver-subtle" className={colorSwatch('silver-subtle')} /> |
| 71 | + <Color name="disabled" className={colorSwatch('disabled')} /> |
| 72 | + </div> |
| 73 | + </DisclosurePanel> |
| 74 | + </Disclosure> |
| 75 | + ); |
| 76 | +} |
| 77 | + |
| 78 | +export function TextColorsDisclosure() { |
| 79 | + return ( |
| 80 | + <Disclosure isQuiet> |
| 81 | + <DisclosureTitle>Text colors</DisclosureTitle> |
| 82 | + <DisclosurePanel> |
| 83 | + <p>The color property supports the following values, in addition to the semantic and global colors. These colors are specifically chosen to be used as text colors, so prefer them over global colors where possible.</p> |
| 84 | + <div className="sb-unstyled" style={{columnWidth: 120}}> |
| 85 | + <Color name="accent" className={colorSwatch('accent', 'color')} /> |
| 86 | + <Color name="neutral" className={colorSwatch('neutral', 'color')} /> |
| 87 | + <Color name="neutral-subdued" className={colorSwatch('neutral-subdued', 'color')} /> |
| 88 | + <Color name="negative" className={colorSwatch('negative', 'color')} /> |
| 89 | + <Color name="disabled" className={colorSwatch('disabled', 'color')} /> |
| 90 | + <Color name="heading" className={colorSwatch('heading', 'color')} /> |
| 91 | + <Color name="title" className={colorSwatch('title', 'color')} /> |
| 92 | + <Color name="body" className={colorSwatch('body', 'color')} /> |
| 93 | + <Color name="detail" className={colorSwatch('detail', 'color')} /> |
| 94 | + <Color name="code" className={colorSwatch('code', 'color')} /> |
| 95 | + </div> |
| 96 | + </DisclosurePanel> |
| 97 | + </Disclosure> |
| 98 | + ); |
| 99 | +} |
| 100 | + |
| 101 | +export function SemanticColorsDisclosure() { |
| 102 | + return ( |
| 103 | + <Disclosure isQuiet> |
| 104 | + <DisclosureTitle>Semantic colors</DisclosureTitle> |
| 105 | + <DisclosurePanel> |
| 106 | + <p>The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.</p> |
| 107 | + <div className="sb-unstyled" style={{columnWidth: 120}}> |
| 108 | + <ColorScale scale={getColorScale('accent-color')} /> |
| 109 | + <ColorScale scale={getColorScale('informative-color')} /> |
| 110 | + <ColorScale scale={getColorScale('negative-color')} /> |
| 111 | + <ColorScale scale={getColorScale('notice-color')} /> |
| 112 | + <ColorScale scale={getColorScale('positive-color')} /> |
| 113 | + </div> |
| 114 | + </DisclosurePanel> |
| 115 | + </Disclosure> |
| 116 | + ); |
| 117 | +} |
| 118 | + |
| 119 | +export function GlobalColorsDisclosure() { |
7 | 120 | return ( |
8 | | - <> |
9 | | - <Disclosure isQuiet> |
10 | | - <DisclosureTitle>Background colors</DisclosureTitle> |
11 | | - <DisclosurePanel> |
12 | | - <p>The backgroundColor property supports the following values, in addition to the semantic and global colors shown below. These colors are specifically chosen to be used as backgrounds, so prefer them over global colors where possible.</p> |
13 | | - <div className="sb-unstyled" style={{columnWidth: 120}}> |
14 | | - <Color name="base" className={colorSwatch('base')} /> |
15 | | - <Color name="layer-1" className={colorSwatch('layer-1')} /> |
16 | | - <Color name="layer-2" className={colorSwatch('layer-2')} /> |
17 | | - <Color name="pasteboard" className={colorSwatch('pasteboard')} /> |
18 | | - <Color name="elevated" className={colorSwatch('elevated')} /> |
19 | | - <Color name="accent" className={colorSwatch('accent')} /> |
20 | | - <Color name="accent-subtle" className={colorSwatch('accent-subtle')} /> |
21 | | - <Color name="neutral" className={colorSwatch('neutral')} /> |
22 | | - <Color name="neutral-subdued" className={colorSwatch('neutral-subdued')} /> |
23 | | - <Color name="neutral-subtle" className={colorSwatch('neutral-subtle')} /> |
24 | | - <Color name="negative" className={colorSwatch('negative')} /> |
25 | | - <Color name="negative-subtle" className={colorSwatch('negative-subtle')} /> |
26 | | - <Color name="informative" className={colorSwatch('informative')} /> |
27 | | - <Color name="informative-subtle" className={colorSwatch('informative-subtle')} /> |
28 | | - <Color name="positive" className={colorSwatch('positive')} /> |
29 | | - <Color name="positive-subtle" className={colorSwatch('positive-subtle')} /> |
30 | | - <Color name="notice" className={colorSwatch('notice')} /> |
31 | | - <Color name="notice-subtle" className={colorSwatch('notice-subtle')} /> |
32 | | - <Color name="gray" className={colorSwatch('gray')} /> |
33 | | - <Color name="gray-subtle" className={colorSwatch('gray-subtle')} /> |
34 | | - <Color name="red" className={colorSwatch('red')} /> |
35 | | - <Color name="red-subtle" className={colorSwatch('red-subtle')} /> |
36 | | - <Color name="orange" className={colorSwatch('orange')} /> |
37 | | - <Color name="orange-subtle" className={colorSwatch('orange-subtle')} /> |
38 | | - <Color name="yellow" className={colorSwatch('yellow')} /> |
39 | | - <Color name="yellow-subtle" className={colorSwatch('yellow-subtle')} /> |
40 | | - <Color name="chartreuse" className={colorSwatch('chartreuse')} /> |
41 | | - <Color name="chartreuse-subtle" className={colorSwatch('chartreuse-subtle')} /> |
42 | | - <Color name="celery" className={colorSwatch('celery')} /> |
43 | | - <Color name="celery-subtle" className={colorSwatch('celery-subtle')} /> |
44 | | - <Color name="green" className={colorSwatch('green')} /> |
45 | | - <Color name="green-subtle" className={colorSwatch('green-subtle')} /> |
46 | | - <Color name="seafoam" className={colorSwatch('seafoam')} /> |
47 | | - <Color name="seafoam-subtle" className={colorSwatch('seafoam-subtle')} /> |
48 | | - <Color name="cyan" className={colorSwatch('cyan')} /> |
49 | | - <Color name="cyan-subtle" className={colorSwatch('cyan-subtle')} /> |
50 | | - <Color name="blue" className={colorSwatch('blue')} /> |
51 | | - <Color name="blue-subtle" className={colorSwatch('blue-subtle')} /> |
52 | | - <Color name="indigo" className={colorSwatch('indigo')} /> |
53 | | - <Color name="indigo-subtle" className={colorSwatch('indigo-subtle')} /> |
54 | | - <Color name="purple" className={colorSwatch('purple')} /> |
55 | | - <Color name="purple-subtle" className={colorSwatch('purple-subtle')} /> |
56 | | - <Color name="fuchsia" className={colorSwatch('fuchsia')} /> |
57 | | - <Color name="fuchsia-subtle" className={colorSwatch('fuchsia-subtle')} /> |
58 | | - <Color name="magenta" className={colorSwatch('magenta')} /> |
59 | | - <Color name="magenta-subtle" className={colorSwatch('magenta-subtle')} /> |
60 | | - <Color name="pink" className={colorSwatch('pink')} /> |
61 | | - <Color name="pink-subtle" className={colorSwatch('pink-subtle')} /> |
62 | | - <Color name="turquoise" className={colorSwatch('turquoise')} /> |
63 | | - <Color name="turquoise-subtle" className={colorSwatch('turquoise-subtle')} /> |
64 | | - <Color name="cinnamon" className={colorSwatch('cinnamon')} /> |
65 | | - <Color name="cinnamon-subtle" className={colorSwatch('cinnamon-subtle')} /> |
66 | | - <Color name="brown" className={colorSwatch('brown')} /> |
67 | | - <Color name="brown-subtle" className={colorSwatch('brown-subtle')} /> |
68 | | - <Color name="silver" className={colorSwatch('silver')} /> |
69 | | - <Color name="silver-subtle" className={colorSwatch('silver-subtle')} /> |
70 | | - <Color name="disabled" className={colorSwatch('disabled')} /> |
71 | | - </div> |
72 | | - </DisclosurePanel> |
73 | | - </Disclosure> |
74 | | - <Disclosure isQuiet> |
75 | | - <DisclosureTitle>Text colors</DisclosureTitle> |
76 | | - <DisclosurePanel> |
77 | | - <p>The color property supports the following values, in addition to the semantic and global colors shown below. These colors are specifically chosen to be used as text colors, so prefer them over global colors where possible.</p> |
78 | | - <div className="sb-unstyled" style={{columnWidth: 120}}> |
79 | | - <Color name="accent" className={colorSwatch('accent', 'color')} /> |
80 | | - <Color name="neutral" className={colorSwatch('neutral', 'color')} /> |
81 | | - <Color name="neutral-subdued" className={colorSwatch('neutral-subdued', 'color')} /> |
82 | | - <Color name="negative" className={colorSwatch('negative', 'color')} /> |
83 | | - <Color name="disabled" className={colorSwatch('disabled', 'color')} /> |
84 | | - <Color name="heading" className={colorSwatch('heading', 'color')} /> |
85 | | - <Color name="title" className={colorSwatch('title', 'color')} /> |
86 | | - <Color name="body" className={colorSwatch('body', 'color')} /> |
87 | | - <Color name="detail" className={colorSwatch('detail', 'color')} /> |
88 | | - <Color name="code" className={colorSwatch('code', 'color')} /> |
89 | | - </div> |
90 | | - </DisclosurePanel> |
91 | | - </Disclosure> |
92 | | - <Disclosure isQuiet> |
93 | | - <DisclosureTitle>Semantic colors</DisclosureTitle> |
94 | | - <DisclosurePanel> |
95 | | - <p>The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.</p> |
96 | | - <div className="sb-unstyled" style={{columnWidth: 120}}> |
97 | | - <ColorScale scale={getColorScale('accent-color')} /> |
98 | | - <ColorScale scale={getColorScale('informative-color')} /> |
99 | | - <ColorScale scale={getColorScale('negative-color')} /> |
100 | | - <ColorScale scale={getColorScale('notice-color')} /> |
101 | | - <ColorScale scale={getColorScale('positive-color')} /> |
102 | | - </div> |
103 | | - </DisclosurePanel> |
104 | | - </Disclosure> |
105 | | - <Disclosure isQuiet styles={style({marginBottom: 16})}> |
106 | | - <DisclosureTitle>Global colors</DisclosureTitle> |
107 | | - <DisclosurePanel> |
108 | | - <p>The following values are available across all color properties.</p> |
109 | | - <div className="sb-unstyled" style={{columnWidth: 120}}> |
110 | | - <ColorScale scale={getColorScale('gray')} /> |
111 | | - <ColorScale scale={getColorScale('blue')} /> |
112 | | - <ColorScale scale={getColorScale('red')} /> |
113 | | - <ColorScale scale={getColorScale('orange')} /> |
114 | | - <ColorScale scale={getColorScale('yellow')} /> |
115 | | - <ColorScale scale={getColorScale('chartreuse')} /> |
116 | | - <ColorScale scale={getColorScale('celery')} /> |
117 | | - <ColorScale scale={getColorScale('green')} /> |
118 | | - <ColorScale scale={getColorScale('seafoam')} /> |
119 | | - <ColorScale scale={getColorScale('cyan')} /> |
120 | | - <ColorScale scale={getColorScale('indigo')} /> |
121 | | - <ColorScale scale={getColorScale('purple')} /> |
122 | | - <ColorScale scale={getColorScale('fuchsia')} /> |
123 | | - <ColorScale scale={getColorScale('magenta')} /> |
124 | | - <ColorScale scale={getColorScale('pink')} /> |
125 | | - <ColorScale scale={getColorScale('turquoise')} /> |
126 | | - <ColorScale scale={getColorScale('brown')} /> |
127 | | - <ColorScale scale={getColorScale('silver')} /> |
128 | | - <ColorScale scale={getColorScale('cinnamon')} /> |
129 | | - </div> |
130 | | - </DisclosurePanel> |
131 | | - </Disclosure> |
132 | | - </> |
| 121 | + <Disclosure isQuiet styles={style({marginBottom: 16})}> |
| 122 | + <DisclosureTitle>Global colors</DisclosureTitle> |
| 123 | + <DisclosurePanel> |
| 124 | + <p>The following values are available across all color properties.</p> |
| 125 | + <div className="sb-unstyled" style={{columnWidth: 120}}> |
| 126 | + <ColorScale scale={getColorScale('gray')} /> |
| 127 | + <ColorScale scale={getColorScale('blue')} /> |
| 128 | + <ColorScale scale={getColorScale('red')} /> |
| 129 | + <ColorScale scale={getColorScale('orange')} /> |
| 130 | + <ColorScale scale={getColorScale('yellow')} /> |
| 131 | + <ColorScale scale={getColorScale('chartreuse')} /> |
| 132 | + <ColorScale scale={getColorScale('celery')} /> |
| 133 | + <ColorScale scale={getColorScale('green')} /> |
| 134 | + <ColorScale scale={getColorScale('seafoam')} /> |
| 135 | + <ColorScale scale={getColorScale('cyan')} /> |
| 136 | + <ColorScale scale={getColorScale('indigo')} /> |
| 137 | + <ColorScale scale={getColorScale('purple')} /> |
| 138 | + <ColorScale scale={getColorScale('fuchsia')} /> |
| 139 | + <ColorScale scale={getColorScale('magenta')} /> |
| 140 | + <ColorScale scale={getColorScale('pink')} /> |
| 141 | + <ColorScale scale={getColorScale('turquoise')} /> |
| 142 | + <ColorScale scale={getColorScale('brown')} /> |
| 143 | + <ColorScale scale={getColorScale('silver')} /> |
| 144 | + <ColorScale scale={getColorScale('cinnamon')} /> |
| 145 | + </div> |
| 146 | + </DisclosurePanel> |
| 147 | + </Disclosure> |
133 | 148 | ); |
134 | 149 | } |
135 | 150 |
|
|
0 commit comments