@react-spectrum/s2 3.0.0-nightly-101d0772b-250113 → 3.0.0-nightly-1b425caa2-250114
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/ActionBar.cjs +11 -8
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +15 -32
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +12 -9
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/Modal.cjs +15 -21
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +22 -46
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +15 -21
- package/dist/Modal.mjs.map +1 -1
- package/dist/Popover.cjs +19 -37
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +28 -99
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +19 -37
- package/dist/Popover.mjs.map +1 -1
- package/dist/Tabs.cjs +177 -414
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +120 -208
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +179 -416
- package/dist/Tabs.mjs.map +1 -1
- package/dist/Tooltip.cjs +19 -16
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +25 -40
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +19 -16
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/en-US.cjs +0 -1
- package/dist/en-US.cjs.map +1 -1
- package/dist/en-US.mjs +0 -1
- package/dist/en-US.mjs.map +1 -1
- package/dist/he-IL.cjs +0 -1
- package/dist/he-IL.cjs.map +1 -1
- package/dist/he-IL.mjs +0 -1
- package/dist/he-IL.mjs.map +1 -1
- package/dist/types.d.ts +7 -11
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/ActionBar.tsx +15 -18
- package/src/Modal.tsx +17 -44
- package/src/Popover.tsx +21 -89
- package/src/Tabs.tsx +156 -427
- package/src/Tooltip.tsx +25 -42
- package/dist/TabsPicker.cjs +0 -388
- package/dist/TabsPicker.cjs.map +0 -1
- package/dist/TabsPicker.css +0 -440
- package/dist/TabsPicker.css.map +0 -1
- package/dist/TabsPicker.mjs +0 -382
- package/dist/TabsPicker.mjs.map +0 -1
- package/src/TabsPicker.tsx +0 -341
package/src/Tooltip.tsx
CHANGED
|
@@ -24,7 +24,6 @@ import {ColorScheme} from '@react-types/provider';
|
|
|
24
24
|
import {ColorSchemeContext} from './Provider';
|
|
25
25
|
import {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';
|
|
26
26
|
import {DOMRef} from '@react-types/shared';
|
|
27
|
-
import {keyframes} from '../style/style-macro' with {type: 'macro'};
|
|
28
27
|
import {style} from '../style' with {type: 'macro'};
|
|
29
28
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
30
29
|
|
|
@@ -44,18 +43,6 @@ export interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'class
|
|
|
44
43
|
children?: ReactNode
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
const slide = keyframes(`
|
|
48
|
-
from {
|
|
49
|
-
transform: translate(var(--originX), var(--originY));
|
|
50
|
-
opacity: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
to {
|
|
54
|
-
transform: translateY(0);
|
|
55
|
-
opacity: 1;
|
|
56
|
-
}
|
|
57
|
-
`);
|
|
58
|
-
|
|
59
46
|
const tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({
|
|
60
47
|
...colorScheme(),
|
|
61
48
|
justifyContent: 'center',
|
|
@@ -82,42 +69,38 @@ const tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light da
|
|
|
82
69
|
paddingX: 'edge-to-text',
|
|
83
70
|
paddingY: centerPadding(),
|
|
84
71
|
margin: 8,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
animationDuration: {
|
|
90
|
-
isEntering: 200,
|
|
91
|
-
isExiting: 200
|
|
92
|
-
},
|
|
93
|
-
animationDirection: {
|
|
94
|
-
isEntering: 'normal',
|
|
95
|
-
isExiting: 'reverse'
|
|
96
|
-
},
|
|
97
|
-
animationTimingFunction: {
|
|
72
|
+
transition: 'default',
|
|
73
|
+
transitionDuration: 200,
|
|
74
|
+
transitionTimingFunction: {
|
|
98
75
|
isExiting: 'in'
|
|
99
76
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
77
|
+
translateX: {
|
|
78
|
+
placement: {
|
|
79
|
+
left: {
|
|
80
|
+
isEntering: 4,
|
|
81
|
+
isExiting: 4
|
|
82
|
+
},
|
|
83
|
+
right: {
|
|
84
|
+
isEntering: -4,
|
|
85
|
+
isExiting: -4
|
|
108
86
|
}
|
|
109
87
|
}
|
|
110
88
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
89
|
+
translateY: {
|
|
90
|
+
placement: {
|
|
91
|
+
top: {
|
|
92
|
+
isEntering: 4,
|
|
93
|
+
isExiting: 4
|
|
94
|
+
},
|
|
95
|
+
bottom: {
|
|
96
|
+
isEntering: -4,
|
|
97
|
+
isExiting: -4
|
|
119
98
|
}
|
|
120
99
|
}
|
|
100
|
+
},
|
|
101
|
+
opacity: {
|
|
102
|
+
isEntering: 0,
|
|
103
|
+
isExiting: 0
|
|
121
104
|
}
|
|
122
105
|
});
|
|
123
106
|
|
package/dist/TabsPicker.cjs
DELETED
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
require("./TabsPicker.css");
|
|
2
|
-
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
|
|
3
|
-
var $e741ea6b88ce4866$exports = require("./Menu.cjs");
|
|
4
|
-
var $dba2b18fc5727f9b$exports = require("./Checkmark.cjs");
|
|
5
|
-
var $1df9f1c9262ce5df$exports = require("./Chevron.cjs");
|
|
6
|
-
var $a0b996a550bb0891$exports = require("./Field.cjs");
|
|
7
|
-
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
|
|
8
|
-
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
|
|
9
|
-
var $4526404114e78c80$exports = require("./intlStrings.cjs");
|
|
10
|
-
var $493371ef39bf7a55$exports = require("./Popover.cjs");
|
|
11
|
-
var $2061c83559b50a66$exports = require("./pressScale.cjs");
|
|
12
|
-
var $bfa4962d90c8af48$exports = require("./Form.cjs");
|
|
13
|
-
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
|
|
14
|
-
var $7pV4n$reactjsxruntime = require("react/jsx-runtime");
|
|
15
|
-
var $7pV4n$reactariacomponents = require("react-aria-components");
|
|
16
|
-
var $7pV4n$react = require("react");
|
|
17
|
-
var $7pV4n$reactspectrumutils = require("@react-spectrum/utils");
|
|
18
|
-
var $7pV4n$reactariai18n = require("@react-aria/i18n");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function $parcel$interopDefault(a) {
|
|
22
|
-
return a && a.__esModule ? a.default : a;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function $parcel$export(e, n, v, s) {
|
|
26
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
$parcel$export(module.exports, "Picker", () => $9d2c38978395d44a$export$ba25329847403e11);
|
|
30
|
-
$parcel$export(module.exports, "PickerItem", () => $9d2c38978395d44a$export$d601881f38163e28);
|
|
31
|
-
/*
|
|
32
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
33
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
34
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
35
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
38
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
39
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
40
|
-
* governing permissions and limitations under the License.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const $9d2c38978395d44a$export$b72b8dade9393cd5 = /*#__PURE__*/ (0, $7pV4n$react.createContext)(null);
|
|
59
|
-
const $9d2c38978395d44a$var$inputButton = function anonymous(props) {
|
|
60
|
-
let rules = " .";
|
|
61
|
-
if (props.isFocusVisible) rules += ' _Mb';
|
|
62
|
-
else rules += ' _Ma';
|
|
63
|
-
rules += ' da_____M';
|
|
64
|
-
rules += ' dx';
|
|
65
|
-
rules += ' _Oc';
|
|
66
|
-
rules += ' _N-3t1z';
|
|
67
|
-
rules += ' __b-g2ozi1';
|
|
68
|
-
rules += ' __c-g2ozi1';
|
|
69
|
-
rules += ' __d-g2ozi1';
|
|
70
|
-
rules += ' __e-g2ozi1';
|
|
71
|
-
if (props.size === "XL") rules += ' qj';
|
|
72
|
-
else if (props.size === "L") rules += ' qi';
|
|
73
|
-
else if (props.size === "S") rules += ' qh';
|
|
74
|
-
else if (props.size === "XS") rules += ' qg';
|
|
75
|
-
else rules += ' qf';
|
|
76
|
-
if (props.isQuiet) rules += ' __na';
|
|
77
|
-
else rules += ' __n-1s8glxue';
|
|
78
|
-
if (props.size === "XL") rules += ' -usygro_l-____g';
|
|
79
|
-
else if (props.size === "L") rules += ' -usygro_l-___0';
|
|
80
|
-
else if (props.size === "S") rules += ' -usygro_l-___u';
|
|
81
|
-
else rules += ' -usygro_l-___K';
|
|
82
|
-
rules += ' m-rwozxi';
|
|
83
|
-
rules += ' Vc';
|
|
84
|
-
rules += ' _d-bc1l9oh';
|
|
85
|
-
rules += ' _d-1uotwbwg';
|
|
86
|
-
rules += ' _d-eo0c6sf';
|
|
87
|
-
rules += ' _d-enzzrge';
|
|
88
|
-
rules += ' _d-enzykdd';
|
|
89
|
-
rules += ' _d-enzwzjc';
|
|
90
|
-
rules += ' _d-enzrfpb';
|
|
91
|
-
rules += ' _da';
|
|
92
|
-
rules += ' _ebf';
|
|
93
|
-
rules += ' _ee';
|
|
94
|
-
rules += ' _fb';
|
|
95
|
-
rules += ' _g-1x99dlob';
|
|
96
|
-
rules += ' _ga';
|
|
97
|
-
if (props.isDisabled) rules += ' aj';
|
|
98
|
-
else {
|
|
99
|
-
if (props.isPressed) rules += ' ao';
|
|
100
|
-
else if (props.isFocusVisible) rules += ' ao';
|
|
101
|
-
else if (props.isHovered) rules += ' ao';
|
|
102
|
-
else rules += ' an';
|
|
103
|
-
}
|
|
104
|
-
rules += ' _0d';
|
|
105
|
-
rules += ' _ka';
|
|
106
|
-
rules += ' wf';
|
|
107
|
-
rules += ' _wb';
|
|
108
|
-
rules += ' _xb';
|
|
109
|
-
rules += ' _yb';
|
|
110
|
-
rules += ' _zb';
|
|
111
|
-
rules += ' _2c';
|
|
112
|
-
rules += ' _Pa';
|
|
113
|
-
rules += ' _R-375x7f';
|
|
114
|
-
rules += ' _Sa';
|
|
115
|
-
rules += ' jbH';
|
|
116
|
-
rules += ' jG';
|
|
117
|
-
rules += ' C-375tnm';
|
|
118
|
-
rules += ' D-375tnn';
|
|
119
|
-
rules += ' ba';
|
|
120
|
-
if (props.isQuiet) rules += ' rd';
|
|
121
|
-
rules += ' __S-yksgrp';
|
|
122
|
-
if (props.density === "compact") rules += ' kU';
|
|
123
|
-
else rules += ' k_a';
|
|
124
|
-
rules += ' __oa';
|
|
125
|
-
rules += ' -_375tnm_C-a';
|
|
126
|
-
rules += ' -_375tnn_D-a';
|
|
127
|
-
return rules;
|
|
128
|
-
};
|
|
129
|
-
let $9d2c38978395d44a$export$b1e5508a851be14d = function anonymous(props) {
|
|
130
|
-
let rules = " .";
|
|
131
|
-
rules += ' _Ma';
|
|
132
|
-
rules += ' _0f';
|
|
133
|
-
rules += ' __i-n6rb9a';
|
|
134
|
-
rules += ' __oa';
|
|
135
|
-
rules += ' p-17zqamw';
|
|
136
|
-
rules += ' __wa';
|
|
137
|
-
rules += ' __xa';
|
|
138
|
-
rules += ' Ed';
|
|
139
|
-
rules += ' Fd';
|
|
140
|
-
rules += ' Cd';
|
|
141
|
-
rules += ' Dd';
|
|
142
|
-
rules += ' _d-bc1l9oh';
|
|
143
|
-
rules += ' _d-1uotwbwg';
|
|
144
|
-
rules += ' _d-eo0c6sf';
|
|
145
|
-
rules += ' _d-enzzrge';
|
|
146
|
-
rules += ' _d-enzykdd';
|
|
147
|
-
rules += ' _d-enzwzjc';
|
|
148
|
-
rules += ' _d-enzrfpb';
|
|
149
|
-
rules += ' _da';
|
|
150
|
-
if (props.size === "XL") {
|
|
151
|
-
rules += ' _ebj';
|
|
152
|
-
rules += ' _ei';
|
|
153
|
-
} else if (props.size === "L") {
|
|
154
|
-
rules += ' _ebh';
|
|
155
|
-
rules += ' _eg';
|
|
156
|
-
} else if (props.size === "S") {
|
|
157
|
-
rules += ' _ebd';
|
|
158
|
-
rules += ' _ec';
|
|
159
|
-
} else if (props.size === "XS") {
|
|
160
|
-
rules += ' _ebb';
|
|
161
|
-
rules += ' _ea';
|
|
162
|
-
} else {
|
|
163
|
-
rules += ' _ebf';
|
|
164
|
-
rules += ' _ee';
|
|
165
|
-
}
|
|
166
|
-
return rules;
|
|
167
|
-
};
|
|
168
|
-
const $9d2c38978395d44a$var$valueStyles = " . __a-3t1x __wb __xb _na _qb _0d _2c kb";
|
|
169
|
-
const $9d2c38978395d44a$var$iconStyles = " . _9-3t1x R-3hn0u -rwx0fg_e-b";
|
|
170
|
-
const $9d2c38978395d44a$var$iconCenterWrapper = function anonymous(props) {
|
|
171
|
-
let rules = " .";
|
|
172
|
-
rules += ' _0d';
|
|
173
|
-
rules += ' __b-qb5q8i';
|
|
174
|
-
rules += ' __c-qb5q8i';
|
|
175
|
-
rules += ' __d-qb5q8i';
|
|
176
|
-
rules += ' __e-qb5q8i';
|
|
177
|
-
if (props.labelBehavior === "hide") rules += ' C-ve8p9e';
|
|
178
|
-
return rules;
|
|
179
|
-
};
|
|
180
|
-
let $9d2c38978395d44a$var$InsideSelectValueContext = /*#__PURE__*/ (0, $7pV4n$react.createContext)(false);
|
|
181
|
-
function $9d2c38978395d44a$var$Picker(props1, ref) {
|
|
182
|
-
let stringFormatter = (0, $7pV4n$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($4526404114e78c80$exports))), '@react-spectrum/s2');
|
|
183
|
-
[props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $9d2c38978395d44a$export$b72b8dade9393cd5);
|
|
184
|
-
let domRef = (0, $7pV4n$reactspectrumutils.useFocusableRef)(ref);
|
|
185
|
-
props1 = (0, $bfa4962d90c8af48$exports.useFormProps)(props1);
|
|
186
|
-
let { direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, children: children, items: items, placeholder: placeholder = stringFormatter.format('picker.placeholder'), density: density, labelBehavior: labelBehavior = 'show', ...pickerProps } = props1;
|
|
187
|
-
let isQuiet = true;
|
|
188
|
-
const menuOffset = 6;
|
|
189
|
-
const size = 'M';
|
|
190
|
-
return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Select), {
|
|
191
|
-
...pickerProps,
|
|
192
|
-
placeholder: placeholder,
|
|
193
|
-
children: ({ isOpen: isOpen })=>/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)((0, $7pV4n$reactjsxruntime.Fragment), {
|
|
194
|
-
children: [
|
|
195
|
-
/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
|
|
196
|
-
isQuiet: isQuiet
|
|
197
|
-
}),
|
|
198
|
-
/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)((0, $7pV4n$reactariacomponents.Button), {
|
|
199
|
-
ref: domRef,
|
|
200
|
-
style: (renderProps)=>(0, $2061c83559b50a66$exports.pressScale)(domRef)(renderProps),
|
|
201
|
-
// Prevent press scale from sticking while Picker is open.
|
|
202
|
-
// @ts-ignore
|
|
203
|
-
isPressed: false,
|
|
204
|
-
className: (renderProps)=>$9d2c38978395d44a$var$inputButton({
|
|
205
|
-
...renderProps,
|
|
206
|
-
size: 'M',
|
|
207
|
-
isOpen: isOpen,
|
|
208
|
-
isQuiet: isQuiet,
|
|
209
|
-
density: density
|
|
210
|
-
}),
|
|
211
|
-
children: [
|
|
212
|
-
/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.SelectValue), {
|
|
213
|
-
className: $9d2c38978395d44a$var$valueStyles + ' ' + "-u6zm92",
|
|
214
|
-
children: ({ defaultChildren: defaultChildren })=>{
|
|
215
|
-
return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Provider), {
|
|
216
|
-
values: [
|
|
217
|
-
[
|
|
218
|
-
(0, $bde97c91243ed164$exports.IconContext),
|
|
219
|
-
{
|
|
220
|
-
slots: {
|
|
221
|
-
icon: {
|
|
222
|
-
render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
|
|
223
|
-
slot: 'icon',
|
|
224
|
-
styles: $9d2c38978395d44a$var$iconCenterWrapper({
|
|
225
|
-
labelBehavior: labelBehavior
|
|
226
|
-
})
|
|
227
|
-
}),
|
|
228
|
-
styles: (0, $e741ea6b88ce4866$exports.icon)
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
[
|
|
234
|
-
(0, $6367bc87eb7d24ad$exports.TextContext),
|
|
235
|
-
{
|
|
236
|
-
slots: {
|
|
237
|
-
// Default slot is useful when converting other collections to PickerItems.
|
|
238
|
-
[(0, $7pV4n$reactariacomponents.DEFAULT_SLOT)]: {
|
|
239
|
-
styles: function anonymous(props) {
|
|
240
|
-
let rules = " .";
|
|
241
|
-
if (props.labelBehavior === "hide") rules += ' _0j';
|
|
242
|
-
else rules += ' _0a';
|
|
243
|
-
rules += ' __a-3t1y';
|
|
244
|
-
rules += ' __wb';
|
|
245
|
-
rules += ' __xb';
|
|
246
|
-
rules += ' _na';
|
|
247
|
-
rules += ' _qb';
|
|
248
|
-
return rules;
|
|
249
|
-
}({
|
|
250
|
-
labelBehavior: labelBehavior
|
|
251
|
-
})
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
],
|
|
256
|
-
[
|
|
257
|
-
$9d2c38978395d44a$var$InsideSelectValueContext,
|
|
258
|
-
true
|
|
259
|
-
]
|
|
260
|
-
],
|
|
261
|
-
children: defaultChildren
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}),
|
|
265
|
-
/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $1df9f1c9262ce5df$exports.default), {
|
|
266
|
-
size: size,
|
|
267
|
-
className: $9d2c38978395d44a$var$iconStyles
|
|
268
|
-
})
|
|
269
|
-
]
|
|
270
|
-
}),
|
|
271
|
-
/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.PopoverBase), {
|
|
272
|
-
hideArrow: true,
|
|
273
|
-
offset: menuOffset,
|
|
274
|
-
placement: `${direction} ${align}`,
|
|
275
|
-
shouldFlip: shouldFlip,
|
|
276
|
-
styles: " . y-375tp4 q___u l-13f72lm -_375tp4_y-M",
|
|
277
|
-
children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Provider), {
|
|
278
|
-
values: [
|
|
279
|
-
[
|
|
280
|
-
(0, $6367bc87eb7d24ad$exports.HeaderContext),
|
|
281
|
-
{
|
|
282
|
-
styles: (0, $e741ea6b88ce4866$exports.sectionHeader)({
|
|
283
|
-
size: size
|
|
284
|
-
})
|
|
285
|
-
}
|
|
286
|
-
],
|
|
287
|
-
[
|
|
288
|
-
(0, $6367bc87eb7d24ad$exports.HeadingContext),
|
|
289
|
-
{
|
|
290
|
-
styles: (0, $e741ea6b88ce4866$exports.sectionHeading)
|
|
291
|
-
}
|
|
292
|
-
],
|
|
293
|
-
[
|
|
294
|
-
(0, $6367bc87eb7d24ad$exports.TextContext),
|
|
295
|
-
{
|
|
296
|
-
slots: {
|
|
297
|
-
description: {
|
|
298
|
-
styles: (0, $e741ea6b88ce4866$exports.description)({
|
|
299
|
-
size: size
|
|
300
|
-
})
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
]
|
|
305
|
-
],
|
|
306
|
-
children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.ListBox), {
|
|
307
|
-
items: items,
|
|
308
|
-
className: $9d2c38978395d44a$export$b1e5508a851be14d,
|
|
309
|
-
children: children
|
|
310
|
-
})
|
|
311
|
-
})
|
|
312
|
-
})
|
|
313
|
-
]
|
|
314
|
-
})
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Pickers allow users to choose a single option from a collapsible list of options when space is limited.
|
|
319
|
-
*/ let $9d2c38978395d44a$export$ba25329847403e11 = /*#__PURE__*/ (0, $7pV4n$react.forwardRef)($9d2c38978395d44a$var$Picker);
|
|
320
|
-
function $9d2c38978395d44a$export$d601881f38163e28(props) {
|
|
321
|
-
let ref = (0, $7pV4n$react.useRef)(null);
|
|
322
|
-
let isLink = props.href != null;
|
|
323
|
-
const size = 'M';
|
|
324
|
-
return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.ListBoxItem), {
|
|
325
|
-
...props,
|
|
326
|
-
ref: ref,
|
|
327
|
-
textValue: props.textValue || (typeof props.children === 'string' ? props.children : undefined),
|
|
328
|
-
style: (0, $2061c83559b50a66$exports.pressScale)(ref, props.UNSAFE_style),
|
|
329
|
-
className: (renderProps)=>(props.UNSAFE_className || '') + (0, $e741ea6b88ce4866$exports.menuitem)({
|
|
330
|
-
...renderProps,
|
|
331
|
-
size: size,
|
|
332
|
-
isLink: isLink
|
|
333
|
-
}, props.styles),
|
|
334
|
-
children: (renderProps)=>{
|
|
335
|
-
let { children: children } = props;
|
|
336
|
-
return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)($9d2c38978395d44a$var$DefaultProvider, {
|
|
337
|
-
context: (0, $bde97c91243ed164$exports.IconContext),
|
|
338
|
-
value: {
|
|
339
|
-
slots: {
|
|
340
|
-
icon: {
|
|
341
|
-
render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
|
|
342
|
-
slot: 'icon',
|
|
343
|
-
styles: $9d2c38978395d44a$var$iconCenterWrapper({})
|
|
344
|
-
}),
|
|
345
|
-
styles: (0, $e741ea6b88ce4866$exports.icon)
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)($9d2c38978395d44a$var$DefaultProvider, {
|
|
350
|
-
context: (0, $6367bc87eb7d24ad$exports.TextContext),
|
|
351
|
-
value: {
|
|
352
|
-
slots: {
|
|
353
|
-
[(0, $7pV4n$reactariacomponents.DEFAULT_SLOT)]: {
|
|
354
|
-
styles: (0, $e741ea6b88ce4866$exports.label)({
|
|
355
|
-
size: size
|
|
356
|
-
})
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
children: [
|
|
361
|
-
!isLink && /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $dba2b18fc5727f9b$exports.default), {
|
|
362
|
-
size: size,
|
|
363
|
-
className: (0, $e741ea6b88ce4866$exports.checkmark)({
|
|
364
|
-
...renderProps,
|
|
365
|
-
size: size
|
|
366
|
-
})
|
|
367
|
-
}),
|
|
368
|
-
typeof children === 'string' ? /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
|
|
369
|
-
children: children
|
|
370
|
-
}) : children
|
|
371
|
-
]
|
|
372
|
-
})
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
// A Context.Provider that only sets a value if not inside SelectValue.
|
|
378
|
-
function $9d2c38978395d44a$var$DefaultProvider({ context: context, value: value, children: children }) {
|
|
379
|
-
let inSelectValue = (0, $7pV4n$react.useContext)($9d2c38978395d44a$var$InsideSelectValueContext);
|
|
380
|
-
if (inSelectValue) return children;
|
|
381
|
-
return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)(context.Provider, {
|
|
382
|
-
value: value,
|
|
383
|
-
children: children
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
//# sourceMappingURL=TabsPicker.cjs.map
|
package/dist/TabsPicker.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAqFM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiF;AAE1H,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYX,MAAM;AAQN,MAAM;AASN,MAAM;;;;;;;;;;AAUN,IAAI,+DAA2B,CAAA,GAAA,0BAAY,EAAE;AAE7C,SAAS,6BAAyB,MAAqB,EAAE,GAAoC;IAC3F,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG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,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,CAAA,GAAA,kCAAO,EAAE;gBAAC,GAAG,WAAW;sBAAE;wBAAM;YAAM,GAAG,MAAM,MAAM;kBAC/G,CAAC;YACA,IAAI,YAAC,QAAQ,EAAC,GAAG;YACjB,qBACE,gCAAC;gBACC,SAAS,CAAA,GAAA,qCAAU;gBACnB,OAAO;oBAAC,OAAO;wBACb,MAAM;4BAAC,QAAQ,CAAA,GAAA,wCAAa,EAAE;gCAAC,MAAM;gCAAQ,QAAQ,wCAAkB,CAAC;4BAAE;4BAAI,QAAQ,CAAA,GAAA,8BAAG;wBAAC;oBAC5F;gBAAC;0BACD,cAAA,iCAAC;oBACC,SAAS,CAAA,GAAA,qCAAU;oBACnB,OAAO;wBACL,OAAO;4BACL,CAAC,CAAA,GAAA,uCAAW,EAAE,EAAE;gCAAC,QAAQ,CAAA,GAAA,+BAAI,EAAE;0CAAC;gCAAI;4BAAE;wBACxC;oBACF;;wBACC,CAAC,wBAAU,gCAAC,CAAA,GAAA,iCAAY;4BAAE,MAAM;4BAAM,WAAW,CAAA,GAAA,mCAAQ,EAAE;gCAAC,GAAG,WAAW;sCAAE;4BAAI;;wBAChF,OAAO,aAAa,yBAAW,gCAAC,CAAA,GAAA,8BAAG;sCAAG;6BAAmB;;;;QAIlE;;AAGN;AAEA,uEAAuE;AACvE,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,YAAE,QAAQ,EAA2D;IAC3G,IAAI,gBAAgB,CAAA,GAAA,uBAAS,EAAE;IAC/B,IAAI,eACF,OAAO;IAGT,qBAAO,gCAAC,QAAQ,QAAQ;QAAC,OAAO;kBAAQ;;AAC1C","sources":["packages/@react-spectrum/s2/src/TabsPicker.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 {\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n Button,\n ContextValue,\n DEFAULT_SLOT,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SelectValue\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n icon,\n label,\n menuitem,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {edgeToText, focusRing, size, style} from '../style' with {type: 'macro'};\nimport {fieldInput, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldLabel\n} from './Field';\nimport {FocusableRef, FocusableRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface PickerStyleProps {\n}\n\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number,\n /** Density of the tabs, affects the height of the picker. */\n density: 'compact' | 'regular',\n /**\n * If the tab picker should only display icon and no text for the button label.\n * @default 'show\n */\n labelBehavior?: 'show' | 'hide'\n}\n\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\n\nconst inputButton = style({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n position: 'relative',\n font: 'ui',\n display: 'flex',\n textAlign: 'start',\n borderStyle: 'none',\n borderRadius: 'sm',\n alignItems: 'center',\n transition: 'default',\n columnGap: 'text-to-visual',\n paddingX: 0,\n backgroundColor: 'transparent',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true,\n height: {\n default: 48,\n density: {\n compact: 32\n }\n },\n boxSizing: 'border-box'\n});\n\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\n\nconst valueStyles = style({\n flexGrow: 0,\n truncate: true,\n display: 'flex',\n alignItems: 'center',\n height: 'full'\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst iconCenterWrapper = style({\n display: 'flex',\n gridArea: 'icon',\n paddingStart: {\n labelBehavior: {\n hide: size(6)\n }\n }\n});\n\nlet InsideSelectValueContext = createContext(false);\n\nfunction Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n children,\n items,\n placeholder = stringFormatter.format('picker.placeholder'),\n density,\n labelBehavior = 'show',\n ...pickerProps\n } = props;\n let isQuiet = true;\n\n const menuOffset: number = 6;\n const size = 'M';\n\n return (\n <AriaSelect\n {...pickerProps}\n placeholder={placeholder}>\n {({isOpen}) => (\n <>\n <FieldLabel isQuiet={isQuiet} />\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: 'M',\n isOpen,\n isQuiet,\n density\n })}>\n <SelectValue className={valueStyles + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper({labelBehavior})}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n // Default slot is useful when converting other collections to PickerItems.\n [DEFAULT_SLOT]: {styles: style({\n display: {\n default: 'block',\n labelBehavior: {\n hide: 'none'\n }\n },\n flexGrow: 1,\n truncate: true\n })({labelBehavior})}\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n <ChevronIcon\n size={size}\n className={iconStyles} />\n </Button>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n styles={style({\n marginStart: -12,\n minWidth: 192,\n width: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n })}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </>\n )}\n </AriaSelect>\n );\n}\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nlet _Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(Picker);\nexport {_Picker as Picker};\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n const size = 'M';\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper({})}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n [DEFAULT_SLOT]: {styles: label({size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={size} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n"],"names":[],"version":3,"file":"TabsPicker.cjs.map"}
|