@vinyasa/overlay 1.0.23

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.
@@ -0,0 +1,346 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ Dialog: ()=>Dialog,
32
+ DialogBody: ()=>DialogBody,
33
+ DialogClose: ()=>DialogClose,
34
+ DialogContent: ()=>DialogContent,
35
+ DialogDescription: ()=>DialogDescription,
36
+ DialogFooter: ()=>DialogFooter,
37
+ DialogHeader: ()=>DialogHeader,
38
+ DialogTitle: ()=>DialogTitle,
39
+ DialogTrigger: ()=>DialogTrigger
40
+ });
41
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
42
+ const react_dialog_namespaceObject = require("@radix-ui/react-dialog");
43
+ const icons_namespaceObject = require("@vinyasa/icons");
44
+ const external_react_namespaceObject = require("react");
45
+ var body = '_13owy337';
46
+ var closeButton = '_13owy336';
47
+ var descriptionText = '_13owy335';
48
+ var footer = '_13owy338';
49
+ var header = '_13owy333';
50
+ var scrim = '_13owy332';
51
+ var titleText = '_13owy334';
52
+ function toPrimitive(t, r) {
53
+ if ("object" != typeof t || !t) return t;
54
+ var e = t[Symbol.toPrimitive];
55
+ if (void 0 !== e) {
56
+ var i = e.call(t, r || "default");
57
+ if ("object" != typeof i) return i;
58
+ throw new TypeError("@@toPrimitive must return a primitive value.");
59
+ }
60
+ return ("string" === r ? String : Number)(t);
61
+ }
62
+ function toPropertyKey(t) {
63
+ var i = toPrimitive(t, "string");
64
+ return "symbol" == typeof i ? i : String(i);
65
+ }
66
+ function _defineProperty(obj, key, value) {
67
+ key = toPropertyKey(key);
68
+ if (key in obj) Object.defineProperty(obj, key, {
69
+ value: value,
70
+ enumerable: true,
71
+ configurable: true,
72
+ writable: true
73
+ });
74
+ else obj[key] = value;
75
+ return obj;
76
+ }
77
+ function createRuntimeFn_62c9670f_esm_ownKeys(e, r) {
78
+ var t = Object.keys(e);
79
+ if (Object.getOwnPropertySymbols) {
80
+ var o = Object.getOwnPropertySymbols(e);
81
+ r && (o = o.filter(function(r) {
82
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
83
+ })), t.push.apply(t, o);
84
+ }
85
+ return t;
86
+ }
87
+ function _objectSpread2(e) {
88
+ for(var r = 1; r < arguments.length; r++){
89
+ var t = null != arguments[r] ? arguments[r] : {};
90
+ r % 2 ? createRuntimeFn_62c9670f_esm_ownKeys(Object(t), !0).forEach(function(r) {
91
+ _defineProperty(e, r, t[r]);
92
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : createRuntimeFn_62c9670f_esm_ownKeys(Object(t)).forEach(function(r) {
93
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
94
+ });
95
+ }
96
+ return e;
97
+ }
98
+ function mapValues(input, fn) {
99
+ var result = {};
100
+ for(var _key in input)result[_key] = fn(input[_key], _key);
101
+ return result;
102
+ }
103
+ var shouldApplyCompound = (compoundCheck, selections, defaultVariants)=>{
104
+ for (var key of Object.keys(compoundCheck)){
105
+ var _selections$key;
106
+ if (compoundCheck[key] !== (null != (_selections$key = selections[key]) ? _selections$key : defaultVariants[key])) return false;
107
+ }
108
+ return true;
109
+ };
110
+ var createRuntimeFn = (config)=>{
111
+ var runtimeFn = (options)=>{
112
+ var className = config.defaultClassName;
113
+ var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
114
+ for(var variantName in selections){
115
+ var _selections$variantNa;
116
+ var variantSelection = null != (_selections$variantNa = selections[variantName]) ? _selections$variantNa : config.defaultVariants[variantName];
117
+ if (null != variantSelection) {
118
+ var selection = variantSelection;
119
+ if ('boolean' == typeof selection) selection = true === selection ? 'true' : 'false';
120
+ var selectionClassName = config.variantClassNames[variantName][selection];
121
+ if (selectionClassName) className += ' ' + selectionClassName;
122
+ }
123
+ }
124
+ for (var [compoundCheck, compoundClassName] of config.compoundVariants)if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += ' ' + compoundClassName;
125
+ return className;
126
+ };
127
+ runtimeFn.variants = ()=>Object.keys(config.variantClassNames);
128
+ runtimeFn.classNames = {
129
+ get base () {
130
+ return config.defaultClassName.split(' ')[0];
131
+ },
132
+ get variants () {
133
+ return mapValues(config.variantClassNames, (classNames)=>mapValues(classNames, (className)=>className.split(' ')[0]));
134
+ }
135
+ };
136
+ return runtimeFn;
137
+ };
138
+ var closeButtonPosition = 'pchuwx7';
139
+ var content = createRuntimeFn({
140
+ defaultClassName: 'pchuwx2',
141
+ variantClassNames: {
142
+ size: {
143
+ sm: 'pchuwx3',
144
+ md: 'pchuwx4',
145
+ lg: 'pchuwx5',
146
+ xl: 'pchuwx6'
147
+ }
148
+ },
149
+ defaultVariants: {
150
+ size: 'md'
151
+ },
152
+ compoundVariants: []
153
+ });
154
+ function _define_property(obj, key, value) {
155
+ if (key in obj) Object.defineProperty(obj, key, {
156
+ value: value,
157
+ enumerable: true,
158
+ configurable: true,
159
+ writable: true
160
+ });
161
+ else obj[key] = value;
162
+ return obj;
163
+ }
164
+ function _object_spread(target) {
165
+ for(var i = 1; i < arguments.length; i++){
166
+ var source = null != arguments[i] ? arguments[i] : {};
167
+ var ownKeys = Object.keys(source);
168
+ if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
169
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
170
+ }));
171
+ ownKeys.forEach(function(key) {
172
+ _define_property(target, key, source[key]);
173
+ });
174
+ }
175
+ return target;
176
+ }
177
+ function Dialog_ownKeys(object, enumerableOnly) {
178
+ var keys = Object.keys(object);
179
+ if (Object.getOwnPropertySymbols) {
180
+ var symbols = Object.getOwnPropertySymbols(object);
181
+ if (enumerableOnly) symbols = symbols.filter(function(sym) {
182
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
183
+ });
184
+ keys.push.apply(keys, symbols);
185
+ }
186
+ return keys;
187
+ }
188
+ function _object_spread_props(target, source) {
189
+ source = null != source ? source : {};
190
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
191
+ else Dialog_ownKeys(Object(source)).forEach(function(key) {
192
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
193
+ });
194
+ return target;
195
+ }
196
+ function _object_without_properties(source, excluded) {
197
+ if (null == source) return {};
198
+ var target = {}, sourceKeys, key, i;
199
+ if ("u" > typeof Reflect && Reflect.ownKeys) {
200
+ sourceKeys = Reflect.ownKeys(Object(source));
201
+ for(i = 0; i < sourceKeys.length; i++){
202
+ key = sourceKeys[i];
203
+ if (!(excluded.indexOf(key) >= 0)) {
204
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
205
+ }
206
+ }
207
+ return target;
208
+ }
209
+ target = _object_without_properties_loose(source, excluded);
210
+ if (Object.getOwnPropertySymbols) {
211
+ sourceKeys = Object.getOwnPropertySymbols(source);
212
+ for(i = 0; i < sourceKeys.length; i++){
213
+ key = sourceKeys[i];
214
+ if (!(excluded.indexOf(key) >= 0)) {
215
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
216
+ }
217
+ }
218
+ }
219
+ return target;
220
+ }
221
+ function _object_without_properties_loose(source, excluded) {
222
+ if (null == source) return {};
223
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
224
+ for(i = 0; i < sourceKeys.length; i++){
225
+ key = sourceKeys[i];
226
+ if (!(excluded.indexOf(key) >= 0)) {
227
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
228
+ }
229
+ }
230
+ return target;
231
+ }
232
+ const Dialog = react_dialog_namespaceObject.Root;
233
+ const DialogTrigger = react_dialog_namespaceObject.Trigger;
234
+ const DialogClose = react_dialog_namespaceObject.Close;
235
+ const DialogContent = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
236
+ let _ref = [
237
+ _0,
238
+ _1
239
+ ], [_ref1, ..._rest] = _ref, { size = 'md', hideCloseButton = false, className, children } = _ref1, rest = _object_without_properties(_ref1, [
240
+ "size",
241
+ "hideCloseButton",
242
+ "className",
243
+ "children"
244
+ ]), [ref] = _rest;
245
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
246
+ children: [
247
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Overlay, {
248
+ className: scrim
249
+ }),
250
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Content, _object_spread_props(_object_spread({
251
+ ref: ref,
252
+ className: className ? `${content({
253
+ size
254
+ })} ${className}` : content({
255
+ size
256
+ })
257
+ }, rest), {
258
+ children: [
259
+ children,
260
+ hideCloseButton ? null : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Close, {
261
+ className: `${closeButton} ${closeButtonPosition}`,
262
+ "aria-label": "Close",
263
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.XIcon, {})
264
+ })
265
+ ]
266
+ }))
267
+ ]
268
+ });
269
+ });
270
+ DialogContent.displayName = 'DialogContent';
271
+ const DialogHeader = (_0)=>{
272
+ let { className } = _0, rest = _object_without_properties(_0, [
273
+ "className"
274
+ ]);
275
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({
276
+ className: className ? `${header} ${className}` : header
277
+ }, rest));
278
+ };
279
+ DialogHeader.displayName = 'DialogHeader';
280
+ const DialogBody = (_0)=>{
281
+ let { className } = _0, rest = _object_without_properties(_0, [
282
+ "className"
283
+ ]);
284
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({
285
+ className: className ? `${body} ${className}` : body
286
+ }, rest));
287
+ };
288
+ DialogBody.displayName = 'DialogBody';
289
+ const DialogFooter = (_0)=>{
290
+ let { className } = _0, rest = _object_without_properties(_0, [
291
+ "className"
292
+ ]);
293
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({
294
+ className: className ? `${footer} ${className}` : footer
295
+ }, rest));
296
+ };
297
+ DialogFooter.displayName = 'DialogFooter';
298
+ const DialogTitle = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
299
+ let _ref = [
300
+ _0,
301
+ _1
302
+ ], [_ref1, ..._rest] = _ref, { className } = _ref1, rest = _object_without_properties(_ref1, [
303
+ "className"
304
+ ]), [ref] = _rest;
305
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Title, _object_spread({
306
+ ref: ref,
307
+ className: className ? `${titleText} ${className}` : titleText
308
+ }, rest));
309
+ });
310
+ DialogTitle.displayName = 'DialogTitle';
311
+ const DialogDescription = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
312
+ let _ref = [
313
+ _0,
314
+ _1
315
+ ], [_ref1, ..._rest] = _ref, { className } = _ref1, rest = _object_without_properties(_ref1, [
316
+ "className"
317
+ ]), [ref] = _rest;
318
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Description, _object_spread({
319
+ ref: ref,
320
+ className: className ? `${descriptionText} ${className}` : descriptionText
321
+ }, rest));
322
+ });
323
+ DialogDescription.displayName = "DialogDescription";
324
+ exports.Dialog = __webpack_exports__.Dialog;
325
+ exports.DialogBody = __webpack_exports__.DialogBody;
326
+ exports.DialogClose = __webpack_exports__.DialogClose;
327
+ exports.DialogContent = __webpack_exports__.DialogContent;
328
+ exports.DialogDescription = __webpack_exports__.DialogDescription;
329
+ exports.DialogFooter = __webpack_exports__.DialogFooter;
330
+ exports.DialogHeader = __webpack_exports__.DialogHeader;
331
+ exports.DialogTitle = __webpack_exports__.DialogTitle;
332
+ exports.DialogTrigger = __webpack_exports__.DialogTrigger;
333
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
334
+ "Dialog",
335
+ "DialogBody",
336
+ "DialogClose",
337
+ "DialogContent",
338
+ "DialogDescription",
339
+ "DialogFooter",
340
+ "DialogHeader",
341
+ "DialogTitle",
342
+ "DialogTrigger"
343
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
344
+ Object.defineProperty(exports, '__esModule', {
345
+ value: true
346
+ });
@@ -0,0 +1,174 @@
1
+ @keyframes _13owy330 {
2
+ from {
3
+ opacity: 0;
4
+ }
5
+
6
+ to {
7
+ opacity: 1;
8
+ }
9
+ }
10
+
11
+ @keyframes _13owy331 {
12
+ from {
13
+ opacity: 1;
14
+ }
15
+
16
+ to {
17
+ opacity: 0;
18
+ }
19
+ }
20
+
21
+ ._13owy332 {
22
+ z-index: var(--vinyasa-z-index-overlay);
23
+ background-color: rgba(0, 0, 0, .5);
24
+ position: fixed;
25
+ top: 0;
26
+ bottom: 0;
27
+ left: 0;
28
+ right: 0;
29
+ }
30
+
31
+ ._13owy332[data-state="open"] {
32
+ animation: _13owy330 var(--vinyasa-motion-duration-normal) var(--vinyasa-motion-easing-out);
33
+ }
34
+
35
+ ._13owy332[data-state="closed"] {
36
+ animation: _13owy331 var(--vinyasa-motion-duration-fast) var(--vinyasa-motion-easing-in);
37
+ }
38
+
39
+ ._13owy333 {
40
+ gap: var(--vinyasa-space1);
41
+ padding: var(--vinyasa-space4);
42
+ border-bottom: var(--vinyasa-border-width-thin) solid var(--vinyasa-border-color-default);
43
+ flex-direction: column;
44
+ padding-right: 2.75rem;
45
+ display: flex;
46
+ }
47
+
48
+ ._13owy334 {
49
+ font-size: var(--vinyasa-font-size-lg);
50
+ font-weight: var(--vinyasa-font-weight-semibold);
51
+ color: var(--vinyasa-on-secondary);
52
+ margin: 0;
53
+ }
54
+
55
+ ._13owy335 {
56
+ font-size: var(--vinyasa-font-size-sm);
57
+ color: var(--vinyasa-text-muted);
58
+ margin: 0;
59
+ }
60
+
61
+ ._13owy336 {
62
+ border-radius: var(--vinyasa-radius-sm);
63
+ width: 1.75rem;
64
+ height: 1.75rem;
65
+ color: var(--vinyasa-text-muted);
66
+ cursor: pointer;
67
+ background-color: rgba(0, 0, 0, 0);
68
+ border: none;
69
+ flex-shrink: 0;
70
+ justify-content: center;
71
+ align-items: center;
72
+ display: inline-flex;
73
+ }
74
+
75
+ ._13owy336:hover {
76
+ background-color: var(--vinyasa-secondary);
77
+ color: var(--vinyasa-on-secondary);
78
+ }
79
+
80
+ ._13owy336:focus-visible {
81
+ border-color: var(--vinyasa-focus);
82
+ box-shadow: 0 0 0 1px var(--vinyasa-focus), 0 0 0 4px color-mix(in srgb, var(--vinyasa-focus) 16%, transparent);
83
+ outline: none;
84
+ }
85
+
86
+ ._13owy337 {
87
+ padding: var(--vinyasa-space4);
88
+ font-size: var(--vinyasa-font-size-sm);
89
+ color: var(--vinyasa-on-secondary);
90
+ overflow-y: auto;
91
+ }
92
+
93
+ ._13owy338 {
94
+ justify-content: flex-end;
95
+ gap: var(--vinyasa-space2);
96
+ padding: var(--vinyasa-space4);
97
+ border-top: var(--vinyasa-border-width-thin) solid var(--vinyasa-border-color-default);
98
+ display: flex;
99
+ }
100
+
101
+ @keyframes pchuwx0 {
102
+ from {
103
+ opacity: 0;
104
+ transform: translate(-50%, -48%) scale(.96);
105
+ }
106
+
107
+ to {
108
+ opacity: 1;
109
+ transform: translate(-50%, -50%) scale(1);
110
+ }
111
+ }
112
+
113
+ @keyframes pchuwx1 {
114
+ from {
115
+ opacity: 1;
116
+ transform: translate(-50%, -50%) scale(1);
117
+ }
118
+
119
+ to {
120
+ opacity: 0;
121
+ transform: translate(-50%, -48%) scale(.96);
122
+ }
123
+ }
124
+
125
+ .pchuwx2 {
126
+ z-index: var(--vinyasa-z-index-modal);
127
+ background-color: var(--vinyasa-surface);
128
+ border-radius: var(--vinyasa-radius-md);
129
+ width: calc(100vw - 2rem);
130
+ max-height: 85vh;
131
+ box-shadow: var(--vinyasa-elevation-modal);
132
+ flex-direction: column;
133
+ display: flex;
134
+ position: fixed;
135
+ top: 50%;
136
+ left: 50%;
137
+ overflow: hidden;
138
+ transform: translate(-50%, -50%);
139
+ }
140
+
141
+ .pchuwx2:focus-visible {
142
+ outline: none;
143
+ }
144
+
145
+ .pchuwx2[data-state="open"] {
146
+ animation: pchuwx0 var(--vinyasa-motion-duration-normal) var(--vinyasa-motion-easing-out);
147
+ }
148
+
149
+ .pchuwx2[data-state="closed"] {
150
+ animation: pchuwx1 var(--vinyasa-motion-duration-fast) var(--vinyasa-motion-easing-in);
151
+ }
152
+
153
+ .pchuwx3 {
154
+ max-width: 24rem;
155
+ }
156
+
157
+ .pchuwx4 {
158
+ max-width: 28rem;
159
+ }
160
+
161
+ .pchuwx5 {
162
+ max-width: 36rem;
163
+ }
164
+
165
+ .pchuwx6 {
166
+ max-width: 48rem;
167
+ }
168
+
169
+ .pchuwx7 {
170
+ top: var(--vinyasa-space3);
171
+ right: var(--vinyasa-space3);
172
+ position: absolute;
173
+ }
174
+