@react-spectrum/color 3.0.0-nightly.4567 → 3.0.0-nightly.4582
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/dist/ColorArea.main.js +11 -10
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +12 -11
- package/dist/ColorArea.module.js +12 -11
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorEditor.32e497e8.css +20 -0
- package/dist/ColorEditor.32e497e8.css.map +1 -0
- package/dist/ColorEditor.main.js +116 -0
- package/dist/ColorEditor.main.js.map +1 -0
- package/dist/ColorEditor.mjs +111 -0
- package/dist/ColorEditor.module.js +111 -0
- package/dist/ColorEditor.module.js.map +1 -0
- package/dist/ColorField.main.js +44 -6
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +46 -8
- package/dist/ColorField.module.js +46 -8
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.ab9f47c0.css +204 -0
- package/dist/ColorPicker.ab9f47c0.css.map +1 -0
- package/dist/ColorPicker.main.js +125 -0
- package/dist/ColorPicker.main.js.map +1 -0
- package/dist/ColorPicker.mjs +116 -0
- package/dist/ColorPicker.module.js +116 -0
- package/dist/ColorPicker.module.js.map +1 -0
- package/dist/ColorSlider.main.js +8 -4
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +9 -5
- package/dist/ColorSlider.module.js +9 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.f6e6f811.css +260 -0
- package/dist/ColorSwatch.f6e6f811.css.map +1 -0
- package/dist/ColorSwatch.main.js +94 -0
- package/dist/ColorSwatch.main.js.map +1 -0
- package/dist/ColorSwatch.mjs +84 -0
- package/dist/ColorSwatch.module.js +84 -0
- package/dist/ColorSwatch.module.js.map +1 -0
- package/dist/ColorSwatchPicker.1575be06.css +356 -0
- package/dist/ColorSwatchPicker.1575be06.css.map +1 -0
- package/dist/ColorSwatchPicker.main.js +115 -0
- package/dist/ColorSwatchPicker.main.js.map +1 -0
- package/dist/ColorSwatchPicker.mjs +106 -0
- package/dist/ColorSwatchPicker.module.js +106 -0
- package/dist/ColorSwatchPicker.module.js.map +1 -0
- package/dist/ColorThumb.main.js +57 -7
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +59 -9
- package/dist/ColorThumb.module.js +59 -9
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +6 -2
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +7 -3
- package/dist/ColorWheel.module.js +7 -3
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/colorarea_vars_css.main.js +0 -3
- package/dist/colorarea_vars_css.main.js.map +1 -1
- package/dist/colorarea_vars_css.mjs +0 -3
- package/dist/colorarea_vars_css.module.js +0 -3
- package/dist/colorarea_vars_css.module.js.map +1 -1
- package/dist/en-US.main.js +10 -0
- package/dist/en-US.main.js.map +1 -0
- package/dist/en-US.mjs +12 -0
- package/dist/en-US.module.js +12 -0
- package/dist/en-US.module.js.map +1 -0
- package/dist/import.mjs +11 -1
- package/dist/intlStrings.main.js +9 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +11 -0
- package/dist/intlStrings.module.js +11 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/main.js +16 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +11 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +75 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.08ba4b4c.css → vars.53b417c1.css} +2 -3
- package/dist/vars.53b417c1.css.map +1 -0
- package/dist/{vars.6f3d3943.css → vars.6fa9fa04.css} +6 -18
- package/dist/vars.6fa9fa04.css.map +1 -0
- package/dist/{vars.571f903e.css → vars.aa07b6d2.css} +2 -2
- package/dist/{vars.571f903e.css.map → vars.aa07b6d2.css.map} +1 -1
- package/dist/{vars.ef2c01b8.css → vars.cc682729.css} +4 -4
- package/dist/{vars.ef2c01b8.css.map → vars.cc682729.css.map} +1 -1
- package/package.json +23 -17
- package/src/ColorArea.tsx +7 -6
- package/src/ColorEditor.tsx +63 -0
- package/src/ColorField.tsx +67 -14
- package/src/ColorPicker.tsx +122 -0
- package/src/ColorSlider.tsx +6 -4
- package/src/ColorSwatch.tsx +102 -0
- package/src/ColorSwatchPicker.tsx +118 -0
- package/src/ColorThumb.tsx +72 -25
- package/src/ColorWheel.tsx +5 -2
- package/src/index.ts +10 -0
- package/dist/vars.08ba4b4c.css.map +0 -1
- package/dist/vars.6f3d3943.css.map +0 -1
@@ -0,0 +1,260 @@
|
|
1
|
+
@layer a {
|
2
|
+
.oe {
|
3
|
+
width: calc(1rem * var(--spectrum-global-dimension-scale-factor));
|
4
|
+
}
|
5
|
+
|
6
|
+
.og {
|
7
|
+
width: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));
|
8
|
+
}
|
9
|
+
|
10
|
+
.oi {
|
11
|
+
width: calc(2rem * var(--spectrum-global-dimension-scale-factor));
|
12
|
+
}
|
13
|
+
|
14
|
+
.ok {
|
15
|
+
width: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));
|
16
|
+
}
|
17
|
+
|
18
|
+
.ne {
|
19
|
+
height: calc(1rem * var(--spectrum-global-dimension-scale-factor));
|
20
|
+
}
|
21
|
+
|
22
|
+
.ng {
|
23
|
+
height: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));
|
24
|
+
}
|
25
|
+
|
26
|
+
.ni {
|
27
|
+
height: calc(2rem * var(--spectrum-global-dimension-scale-factor));
|
28
|
+
}
|
29
|
+
|
30
|
+
.nk {
|
31
|
+
height: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));
|
32
|
+
}
|
33
|
+
|
34
|
+
._pc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
35
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
36
|
+
}
|
37
|
+
|
38
|
+
._pc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
39
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
40
|
+
}
|
41
|
+
|
42
|
+
._pc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
43
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
44
|
+
}
|
45
|
+
|
46
|
+
._pc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
47
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
48
|
+
}
|
49
|
+
|
50
|
+
._pa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
51
|
+
border-top-left-radius: 0;
|
52
|
+
}
|
53
|
+
|
54
|
+
._pa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
55
|
+
border-top-left-radius: 0;
|
56
|
+
}
|
57
|
+
|
58
|
+
._pa:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
59
|
+
border-top-right-radius: 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
._pa:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
63
|
+
border-top-right-radius: 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
._pf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
67
|
+
border-top-left-radius: 9999px;
|
68
|
+
}
|
69
|
+
|
70
|
+
._pf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
71
|
+
border-top-left-radius: 9999px;
|
72
|
+
}
|
73
|
+
|
74
|
+
._pf:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
75
|
+
border-top-right-radius: 9999px;
|
76
|
+
}
|
77
|
+
|
78
|
+
._pf:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
79
|
+
border-top-right-radius: 9999px;
|
80
|
+
}
|
81
|
+
|
82
|
+
._qc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
83
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
84
|
+
}
|
85
|
+
|
86
|
+
._qc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
87
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
88
|
+
}
|
89
|
+
|
90
|
+
._qc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
91
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
92
|
+
}
|
93
|
+
|
94
|
+
._qc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
95
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
96
|
+
}
|
97
|
+
|
98
|
+
._qa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
99
|
+
border-top-right-radius: 0;
|
100
|
+
}
|
101
|
+
|
102
|
+
._qa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
103
|
+
border-top-right-radius: 0;
|
104
|
+
}
|
105
|
+
|
106
|
+
._qa:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
107
|
+
border-top-left-radius: 0;
|
108
|
+
}
|
109
|
+
|
110
|
+
._qa:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
111
|
+
border-top-left-radius: 0;
|
112
|
+
}
|
113
|
+
|
114
|
+
._qf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
115
|
+
border-top-right-radius: 9999px;
|
116
|
+
}
|
117
|
+
|
118
|
+
._qf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
119
|
+
border-top-right-radius: 9999px;
|
120
|
+
}
|
121
|
+
|
122
|
+
._qf:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
123
|
+
border-top-left-radius: 9999px;
|
124
|
+
}
|
125
|
+
|
126
|
+
._qf:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
127
|
+
border-top-left-radius: 9999px;
|
128
|
+
}
|
129
|
+
|
130
|
+
._rc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
131
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
132
|
+
}
|
133
|
+
|
134
|
+
._rc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
135
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
136
|
+
}
|
137
|
+
|
138
|
+
._rc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
139
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
140
|
+
}
|
141
|
+
|
142
|
+
._rc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
143
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
144
|
+
}
|
145
|
+
|
146
|
+
._ra:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
147
|
+
border-bottom-left-radius: 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
._ra:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
151
|
+
border-bottom-left-radius: 0;
|
152
|
+
}
|
153
|
+
|
154
|
+
._ra:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
155
|
+
border-bottom-right-radius: 0;
|
156
|
+
}
|
157
|
+
|
158
|
+
._ra:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
159
|
+
border-bottom-right-radius: 0;
|
160
|
+
}
|
161
|
+
|
162
|
+
._rf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
163
|
+
border-bottom-left-radius: 9999px;
|
164
|
+
}
|
165
|
+
|
166
|
+
._rf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
167
|
+
border-bottom-left-radius: 9999px;
|
168
|
+
}
|
169
|
+
|
170
|
+
._rf:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
171
|
+
border-bottom-right-radius: 9999px;
|
172
|
+
}
|
173
|
+
|
174
|
+
._rf:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
175
|
+
border-bottom-right-radius: 9999px;
|
176
|
+
}
|
177
|
+
|
178
|
+
._sc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
179
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
180
|
+
}
|
181
|
+
|
182
|
+
._sc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
183
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
184
|
+
}
|
185
|
+
|
186
|
+
._sc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
187
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
188
|
+
}
|
189
|
+
|
190
|
+
._sc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
191
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
192
|
+
}
|
193
|
+
|
194
|
+
._sa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
195
|
+
border-bottom-right-radius: 0;
|
196
|
+
}
|
197
|
+
|
198
|
+
._sa:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
199
|
+
border-bottom-right-radius: 0;
|
200
|
+
}
|
201
|
+
|
202
|
+
._sa:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
203
|
+
border-bottom-left-radius: 0;
|
204
|
+
}
|
205
|
+
|
206
|
+
._sa:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
207
|
+
border-bottom-left-radius: 0;
|
208
|
+
}
|
209
|
+
|
210
|
+
._sf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
211
|
+
border-bottom-right-radius: 9999px;
|
212
|
+
}
|
213
|
+
|
214
|
+
._sf:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
215
|
+
border-bottom-right-radius: 9999px;
|
216
|
+
}
|
217
|
+
|
218
|
+
._sf:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
219
|
+
border-bottom-left-radius: 9999px;
|
220
|
+
}
|
221
|
+
|
222
|
+
._sf:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
223
|
+
border-bottom-left-radius: 9999px;
|
224
|
+
}
|
225
|
+
|
226
|
+
.c-1n5whoe {
|
227
|
+
border-color: color-mix(in srgb, var(--spectrum-gray-900), transparent 49%);
|
228
|
+
}
|
229
|
+
|
230
|
+
.wb {
|
231
|
+
border-top-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
232
|
+
}
|
233
|
+
|
234
|
+
.xb {
|
235
|
+
border-bottom-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
236
|
+
}
|
237
|
+
|
238
|
+
.ub {
|
239
|
+
border-inline-start-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
240
|
+
}
|
241
|
+
|
242
|
+
.vb {
|
243
|
+
border-inline-end-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
244
|
+
}
|
245
|
+
|
246
|
+
.Aa {
|
247
|
+
border-style: solid;
|
248
|
+
}
|
249
|
+
|
250
|
+
.__ka {
|
251
|
+
box-sizing: border-box;
|
252
|
+
}
|
253
|
+
|
254
|
+
._tb {
|
255
|
+
forced-color-adjust: none;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
@layer b;
|
260
|
+
/*# sourceMappingURL=ColorSwatch.f6e6f811.css.map */
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":"AAAA;EAGE;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;;AArKF","sources":["packages/@react-spectrum/color/src/ColorSwatch.tsx"],"sourcesContent":["@layer a, b;\n\n@layer a {\n .oe {\n width: calc(1rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .og {\n width: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .oi {\n width: calc(2rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .ok {\n width: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .ne {\n height: calc(1rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .ng {\n height: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .ni {\n height: calc(2rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .nk {\n height: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n ._pc {\n border-start-start-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n ._pa {\n border-start-start-radius: 0px;\n }\n}\n\n@layer a {\n ._pf {\n border-start-start-radius: 9999px;\n }\n}\n\n@layer a {\n ._qc {\n border-start-end-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n ._qa {\n border-start-end-radius: 0px;\n }\n}\n\n@layer a {\n ._qf {\n border-start-end-radius: 9999px;\n }\n}\n\n@layer a {\n ._rc {\n border-end-start-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n ._ra {\n border-end-start-radius: 0px;\n }\n}\n\n@layer a {\n ._rf {\n border-end-start-radius: 9999px;\n }\n}\n\n@layer a {\n ._sc {\n border-end-end-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n ._sa {\n border-end-end-radius: 0px;\n }\n}\n\n@layer a {\n ._sf {\n border-end-end-radius: 9999px;\n }\n}\n\n@layer a {\n .c-1n5whoe {\n border-color: color-mix(in srgb, var(--spectrum-gray-900), transparent 49%);\n }\n}\n\n@layer a {\n .wb {\n border-top-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .xb {\n border-bottom-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .ub {\n border-inline-start-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .vb {\n border-inline-end-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .Aa {\n border-style: solid;\n }\n}\n\n@layer a {\n .__ka {\n box-sizing: border-box;\n }\n}\n\n@layer a {\n ._tb {\n forced-color-adjust: none;\n }\n}\n\n"],"names":[],"version":3,"file":"ColorSwatch.f6e6f811.css.map"}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require("./ColorSwatch.f6e6f811.css");
|
2
|
+
var $ikjCA$reactariacolor = require("@react-aria/color");
|
3
|
+
var $ikjCA$reactariacomponents = require("react-aria-components");
|
4
|
+
var $ikjCA$react = require("react");
|
5
|
+
var $ikjCA$reactspectrumutils = require("@react-spectrum/utils");
|
6
|
+
|
7
|
+
|
8
|
+
function $parcel$interopDefault(a) {
|
9
|
+
return a && a.__esModule ? a.default : a;
|
10
|
+
}
|
11
|
+
|
12
|
+
function $parcel$export(e, n, v, s) {
|
13
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
14
|
+
}
|
15
|
+
|
16
|
+
$parcel$export(module.exports, "SpectrumColorSwatchContext", () => $f076f5c85640192a$export$8529d7908a78c058);
|
17
|
+
$parcel$export(module.exports, "ColorSwatch", () => $f076f5c85640192a$export$cae13e90592f246a);
|
18
|
+
/*
|
19
|
+
* Copyright 2024 Adobe. All rights reserved.
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
21
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
22
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
23
|
+
*
|
24
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
25
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
26
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
27
|
+
* governing permissions and limitations under the License.
|
28
|
+
*/
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
const $f076f5c85640192a$export$8529d7908a78c058 = /*#__PURE__*/ (0, $ikjCA$react.createContext)(null);
|
33
|
+
function $f076f5c85640192a$var$ColorSwatch(props, ref) {
|
34
|
+
let domRef = (0, $ikjCA$reactspectrumutils.useDOMRef)(ref);
|
35
|
+
[props, domRef] = (0, $ikjCA$reactariacomponents.useContextProps)(props, domRef, (0, $ikjCA$reactariacomponents.ColorSwatchContext));
|
36
|
+
let { colorSwatchProps: colorSwatchProps, color: color } = (0, $ikjCA$reactariacolor.useColorSwatch)(props);
|
37
|
+
let { styleProps: styleProps } = (0, $ikjCA$reactspectrumutils.useStyleProps)(props);
|
38
|
+
let ctx = (0, $ikjCA$react.useContext)($f076f5c85640192a$export$8529d7908a78c058);
|
39
|
+
let { size: size = (ctx === null || ctx === void 0 ? void 0 : ctx.size) || "M", rounding: rounding = (ctx === null || ctx === void 0 ? void 0 : ctx.rounding) || "default" } = props;
|
40
|
+
let swatch = /*#__PURE__*/ (0, ($parcel$interopDefault($ikjCA$react))).createElement("div", {
|
41
|
+
...colorSwatchProps,
|
42
|
+
...styleProps,
|
43
|
+
ref: domRef,
|
44
|
+
style: {
|
45
|
+
...styleProps.style,
|
46
|
+
// TODO: should there be a distinction between transparent and no value (e.g. null)?
|
47
|
+
background: color.getChannelValue("alpha") > 0 ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px` : "linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat"
|
48
|
+
},
|
49
|
+
className: function anonymous(props) {
|
50
|
+
let rules = "";
|
51
|
+
if (props.size === "L") rules += " ok";
|
52
|
+
else if (props.size === "M") rules += " oi";
|
53
|
+
else if (props.size === "S") rules += " og";
|
54
|
+
else if (props.size === "XS") rules += " oe";
|
55
|
+
if (props.size === "L") rules += " nk";
|
56
|
+
else if (props.size === "M") rules += " ni";
|
57
|
+
else if (props.size === "S") rules += " ng";
|
58
|
+
else if (props.size === "XS") rules += " ne";
|
59
|
+
if (props.rounding === "full") rules += " _pf";
|
60
|
+
else if (props.rounding === "none") rules += " _pa";
|
61
|
+
else if (props.rounding === "default") rules += " _pc";
|
62
|
+
if (props.rounding === "full") rules += " _qf";
|
63
|
+
else if (props.rounding === "none") rules += " _qa";
|
64
|
+
else if (props.rounding === "default") rules += " _qc";
|
65
|
+
if (props.rounding === "full") rules += " _rf";
|
66
|
+
else if (props.rounding === "none") rules += " _ra";
|
67
|
+
else if (props.rounding === "default") rules += " _rc";
|
68
|
+
if (props.rounding === "full") rules += " _sf";
|
69
|
+
else if (props.rounding === "none") rules += " _sa";
|
70
|
+
else if (props.rounding === "default") rules += " _sc";
|
71
|
+
rules += " c-1n5whoe";
|
72
|
+
rules += " wb";
|
73
|
+
rules += " xb";
|
74
|
+
rules += " ub";
|
75
|
+
rules += " vb";
|
76
|
+
rules += " Aa";
|
77
|
+
rules += " __ka";
|
78
|
+
rules += " _tb";
|
79
|
+
return rules;
|
80
|
+
}({
|
81
|
+
size: size,
|
82
|
+
rounding: rounding
|
83
|
+
})
|
84
|
+
});
|
85
|
+
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
86
|
+
if (ctx) return ctx.useWrapper(swatch, color, rounding);
|
87
|
+
return swatch;
|
88
|
+
}
|
89
|
+
/**
|
90
|
+
* A ColorSwatch displays a preview of a selected color.
|
91
|
+
*/ let $f076f5c85640192a$export$cae13e90592f246a = /*#__PURE__*/ (0, $ikjCA$react.forwardRef)($f076f5c85640192a$var$ColorSwatch);
|
92
|
+
|
93
|
+
|
94
|
+
//# sourceMappingURL=ColorSwatch.main.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EAA0C;AAEhG,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,6CAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,oCAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,QACF,OAAO,CAAA,gBAAA,0BAAA,IAAK,IAAI,KAAI,eACpB,WAAW,CAAA,gBAAA,0BAAA,IAAK,QAAQ,KAAI,WAC7B,GAAG;IAEJ,IAAI,uBACF,0DAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YAAY,MAAM,eAAe,CAAC,WAAW,IACzC,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACN;QACA,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBR;kBAAC;sBAAM;QAAQ;;IAGtB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/color/src/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaColorSwatchProps, useColorSwatch} from '@react-aria/color';\nimport {Color} from '@react-types/color';\nimport {ColorSwatchContext, useContextProps} from 'react-aria-components';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef, useStyleProps} from '@react-spectrum/utils';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L',\n /**\n * The corner rounding of the ColorSwatch.\n * @default \"default\"\n */\n rounding?: 'default' | 'none' | 'full'\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<SpectrumColorSwatchProps, 'size' | 'rounding'> {\n useWrapper: (swatch: ReactElement, color: Color, rounding: SpectrumColorSwatchProps['rounding']) => JSX.Element\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);\n\nfunction ColorSwatch(props: SpectrumColorSwatchProps, ref: DOMRef<HTMLDivElement>): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {\n size = ctx?.size || 'M',\n rounding = ctx?.rounding || 'default'\n } = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background: color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n // Red slash to indicate there is no selected color.\n : 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})} />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n}\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nlet _ColorSwatch = forwardRef(ColorSwatch);\nexport {_ColorSwatch as ColorSwatch};\n"],"names":[],"version":3,"file":"ColorSwatch.main.js.map"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import "./ColorSwatch.f6e6f811.css";
|
2
|
+
import {useColorSwatch as $5Pjc1$useColorSwatch} from "@react-aria/color";
|
3
|
+
import {useContextProps as $5Pjc1$useContextProps, ColorSwatchContext as $5Pjc1$ColorSwatchContext} from "react-aria-components";
|
4
|
+
import $5Pjc1$react, {createContext as $5Pjc1$createContext, useContext as $5Pjc1$useContext, forwardRef as $5Pjc1$forwardRef} from "react";
|
5
|
+
import {useDOMRef as $5Pjc1$useDOMRef, useStyleProps as $5Pjc1$useStyleProps} from "@react-spectrum/utils";
|
6
|
+
|
7
|
+
/*
|
8
|
+
* Copyright 2024 Adobe. All rights reserved.
|
9
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
11
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
14
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
15
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
16
|
+
* governing permissions and limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
const $d68786ae409fa722$export$8529d7908a78c058 = /*#__PURE__*/ (0, $5Pjc1$createContext)(null);
|
22
|
+
function $d68786ae409fa722$var$ColorSwatch(props, ref) {
|
23
|
+
let domRef = (0, $5Pjc1$useDOMRef)(ref);
|
24
|
+
[props, domRef] = (0, $5Pjc1$useContextProps)(props, domRef, (0, $5Pjc1$ColorSwatchContext));
|
25
|
+
let { colorSwatchProps: colorSwatchProps, color: color } = (0, $5Pjc1$useColorSwatch)(props);
|
26
|
+
let { styleProps: styleProps } = (0, $5Pjc1$useStyleProps)(props);
|
27
|
+
let ctx = (0, $5Pjc1$useContext)($d68786ae409fa722$export$8529d7908a78c058);
|
28
|
+
let { size: size = (ctx === null || ctx === void 0 ? void 0 : ctx.size) || "M", rounding: rounding = (ctx === null || ctx === void 0 ? void 0 : ctx.rounding) || "default" } = props;
|
29
|
+
let swatch = /*#__PURE__*/ (0, $5Pjc1$react).createElement("div", {
|
30
|
+
...colorSwatchProps,
|
31
|
+
...styleProps,
|
32
|
+
ref: domRef,
|
33
|
+
style: {
|
34
|
+
...styleProps.style,
|
35
|
+
// TODO: should there be a distinction between transparent and no value (e.g. null)?
|
36
|
+
background: color.getChannelValue("alpha") > 0 ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px` : "linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat"
|
37
|
+
},
|
38
|
+
className: function anonymous(props) {
|
39
|
+
let rules = "";
|
40
|
+
if (props.size === "L") rules += " ok";
|
41
|
+
else if (props.size === "M") rules += " oi";
|
42
|
+
else if (props.size === "S") rules += " og";
|
43
|
+
else if (props.size === "XS") rules += " oe";
|
44
|
+
if (props.size === "L") rules += " nk";
|
45
|
+
else if (props.size === "M") rules += " ni";
|
46
|
+
else if (props.size === "S") rules += " ng";
|
47
|
+
else if (props.size === "XS") rules += " ne";
|
48
|
+
if (props.rounding === "full") rules += " _pf";
|
49
|
+
else if (props.rounding === "none") rules += " _pa";
|
50
|
+
else if (props.rounding === "default") rules += " _pc";
|
51
|
+
if (props.rounding === "full") rules += " _qf";
|
52
|
+
else if (props.rounding === "none") rules += " _qa";
|
53
|
+
else if (props.rounding === "default") rules += " _qc";
|
54
|
+
if (props.rounding === "full") rules += " _rf";
|
55
|
+
else if (props.rounding === "none") rules += " _ra";
|
56
|
+
else if (props.rounding === "default") rules += " _rc";
|
57
|
+
if (props.rounding === "full") rules += " _sf";
|
58
|
+
else if (props.rounding === "none") rules += " _sa";
|
59
|
+
else if (props.rounding === "default") rules += " _sc";
|
60
|
+
rules += " c-1n5whoe";
|
61
|
+
rules += " wb";
|
62
|
+
rules += " xb";
|
63
|
+
rules += " ub";
|
64
|
+
rules += " vb";
|
65
|
+
rules += " Aa";
|
66
|
+
rules += " __ka";
|
67
|
+
rules += " _tb";
|
68
|
+
return rules;
|
69
|
+
}({
|
70
|
+
size: size,
|
71
|
+
rounding: rounding
|
72
|
+
})
|
73
|
+
});
|
74
|
+
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
75
|
+
if (ctx) return ctx.useWrapper(swatch, color, rounding);
|
76
|
+
return swatch;
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* A ColorSwatch displays a preview of a selected color.
|
80
|
+
*/ let $d68786ae409fa722$export$cae13e90592f246a = /*#__PURE__*/ (0, $5Pjc1$forwardRef)($d68786ae409fa722$var$ColorSwatch);
|
81
|
+
|
82
|
+
|
83
|
+
export {$d68786ae409fa722$export$8529d7908a78c058 as SpectrumColorSwatchContext, $d68786ae409fa722$export$cae13e90592f246a as ColorSwatch};
|
84
|
+
//# sourceMappingURL=ColorSwatch.mjs.map
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import "./ColorSwatch.f6e6f811.css";
|
2
|
+
import {useColorSwatch as $5Pjc1$useColorSwatch} from "@react-aria/color";
|
3
|
+
import {useContextProps as $5Pjc1$useContextProps, ColorSwatchContext as $5Pjc1$ColorSwatchContext} from "react-aria-components";
|
4
|
+
import $5Pjc1$react, {createContext as $5Pjc1$createContext, useContext as $5Pjc1$useContext, forwardRef as $5Pjc1$forwardRef} from "react";
|
5
|
+
import {useDOMRef as $5Pjc1$useDOMRef, useStyleProps as $5Pjc1$useStyleProps} from "@react-spectrum/utils";
|
6
|
+
|
7
|
+
/*
|
8
|
+
* Copyright 2024 Adobe. All rights reserved.
|
9
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
11
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
14
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
15
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
16
|
+
* governing permissions and limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
const $d68786ae409fa722$export$8529d7908a78c058 = /*#__PURE__*/ (0, $5Pjc1$createContext)(null);
|
22
|
+
function $d68786ae409fa722$var$ColorSwatch(props, ref) {
|
23
|
+
let domRef = (0, $5Pjc1$useDOMRef)(ref);
|
24
|
+
[props, domRef] = (0, $5Pjc1$useContextProps)(props, domRef, (0, $5Pjc1$ColorSwatchContext));
|
25
|
+
let { colorSwatchProps: colorSwatchProps, color: color } = (0, $5Pjc1$useColorSwatch)(props);
|
26
|
+
let { styleProps: styleProps } = (0, $5Pjc1$useStyleProps)(props);
|
27
|
+
let ctx = (0, $5Pjc1$useContext)($d68786ae409fa722$export$8529d7908a78c058);
|
28
|
+
let { size: size = (ctx === null || ctx === void 0 ? void 0 : ctx.size) || "M", rounding: rounding = (ctx === null || ctx === void 0 ? void 0 : ctx.rounding) || "default" } = props;
|
29
|
+
let swatch = /*#__PURE__*/ (0, $5Pjc1$react).createElement("div", {
|
30
|
+
...colorSwatchProps,
|
31
|
+
...styleProps,
|
32
|
+
ref: domRef,
|
33
|
+
style: {
|
34
|
+
...styleProps.style,
|
35
|
+
// TODO: should there be a distinction between transparent and no value (e.g. null)?
|
36
|
+
background: color.getChannelValue("alpha") > 0 ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px` : "linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat"
|
37
|
+
},
|
38
|
+
className: function anonymous(props) {
|
39
|
+
let rules = "";
|
40
|
+
if (props.size === "L") rules += " ok";
|
41
|
+
else if (props.size === "M") rules += " oi";
|
42
|
+
else if (props.size === "S") rules += " og";
|
43
|
+
else if (props.size === "XS") rules += " oe";
|
44
|
+
if (props.size === "L") rules += " nk";
|
45
|
+
else if (props.size === "M") rules += " ni";
|
46
|
+
else if (props.size === "S") rules += " ng";
|
47
|
+
else if (props.size === "XS") rules += " ne";
|
48
|
+
if (props.rounding === "full") rules += " _pf";
|
49
|
+
else if (props.rounding === "none") rules += " _pa";
|
50
|
+
else if (props.rounding === "default") rules += " _pc";
|
51
|
+
if (props.rounding === "full") rules += " _qf";
|
52
|
+
else if (props.rounding === "none") rules += " _qa";
|
53
|
+
else if (props.rounding === "default") rules += " _qc";
|
54
|
+
if (props.rounding === "full") rules += " _rf";
|
55
|
+
else if (props.rounding === "none") rules += " _ra";
|
56
|
+
else if (props.rounding === "default") rules += " _rc";
|
57
|
+
if (props.rounding === "full") rules += " _sf";
|
58
|
+
else if (props.rounding === "none") rules += " _sa";
|
59
|
+
else if (props.rounding === "default") rules += " _sc";
|
60
|
+
rules += " c-1n5whoe";
|
61
|
+
rules += " wb";
|
62
|
+
rules += " xb";
|
63
|
+
rules += " ub";
|
64
|
+
rules += " vb";
|
65
|
+
rules += " Aa";
|
66
|
+
rules += " __ka";
|
67
|
+
rules += " _tb";
|
68
|
+
return rules;
|
69
|
+
}({
|
70
|
+
size: size,
|
71
|
+
rounding: rounding
|
72
|
+
})
|
73
|
+
});
|
74
|
+
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
75
|
+
if (ctx) return ctx.useWrapper(swatch, color, rounding);
|
76
|
+
return swatch;
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* A ColorSwatch displays a preview of a selected color.
|
80
|
+
*/ let $d68786ae409fa722$export$cae13e90592f246a = /*#__PURE__*/ (0, $5Pjc1$forwardRef)($d68786ae409fa722$var$ColorSwatch);
|
81
|
+
|
82
|
+
|
83
|
+
export {$d68786ae409fa722$export$8529d7908a78c058 as SpectrumColorSwatchContext, $d68786ae409fa722$export$cae13e90592f246a as ColorSwatch};
|
84
|
+
//# sourceMappingURL=ColorSwatch.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EAA0C;AAEhG,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,yBAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,QACF,OAAO,CAAA,gBAAA,0BAAA,IAAK,IAAI,KAAI,eACpB,WAAW,CAAA,gBAAA,0BAAA,IAAK,QAAQ,KAAI,WAC7B,GAAG;IAEJ,IAAI,uBACF,gCAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YAAY,MAAM,eAAe,CAAC,WAAW,IACzC,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACN;QACA,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuBR;kBAAC;sBAAM;QAAQ;;IAGtB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/color/src/ColorSwatch.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaColorSwatchProps, useColorSwatch} from '@react-aria/color';\nimport {Color} from '@react-types/color';\nimport {ColorSwatchContext, useContextProps} from 'react-aria-components';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef, useStyleProps} from '@react-spectrum/utils';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L',\n /**\n * The corner rounding of the ColorSwatch.\n * @default \"default\"\n */\n rounding?: 'default' | 'none' | 'full'\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<SpectrumColorSwatchProps, 'size' | 'rounding'> {\n useWrapper: (swatch: ReactElement, color: Color, rounding: SpectrumColorSwatchProps['rounding']) => JSX.Element\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);\n\nfunction ColorSwatch(props: SpectrumColorSwatchProps, ref: DOMRef<HTMLDivElement>): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {\n size = ctx?.size || 'M',\n rounding = ctx?.rounding || 'default'\n } = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background: color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n // Red slash to indicate there is no selected color.\n : 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})} />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n}\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nlet _ColorSwatch = forwardRef(ColorSwatch);\nexport {_ColorSwatch as ColorSwatch};\n"],"names":[],"version":3,"file":"ColorSwatch.module.js.map"}
|