welcome-ui 7.0.1-alpha.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -0
- package/dist/{CustomInput-Cewo45Hd.mjs → CustomInput-BqaOGHm4.mjs} +1 -1
- package/dist/DatePicker.mjs +1 -1
- package/dist/DateTimePicker.mjs +1 -1
- package/dist/DateTimePickerCommon.mjs +1 -1
- package/dist/Search.mjs +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/TimePicker.mjs +1 -1
- package/dist/Toast.mjs +1 -1
- package/dist/WuiProvider.mjs +21 -20
- package/dist/{downshift.esm-BOfUfcgd.mjs → downshift.esm-CEHW4VDy.mjs} +1 -1
- package/dist/types/components/WuiProvider/index.d.ts +4 -0
- package/package.json +6 -6
- package/dist/AXB53BZF-KWM2jKTz.js +0 -1
- package/dist/Accordion.js +0 -75
- package/dist/Alert.js +0 -37
- package/dist/AspectRatio.js +0 -29
- package/dist/Avatar.js +0 -5
- package/dist/BYC7LY2E-BkAEL2VD.js +0 -1
- package/dist/Badge.js +0 -17
- package/dist/Box.js +0 -1
- package/dist/Breadcrumb.js +0 -54
- package/dist/Button.js +0 -78
- package/dist/ButtonGroup.js +0 -32
- package/dist/Card.js +0 -17
- package/dist/Checkbox.js +0 -1
- package/dist/ClearButton.js +0 -14
- package/dist/CloseButton.js +0 -6
- package/dist/CustomInput-DVH2rh9-.js +0 -1070
- package/dist/DatePicker.js +0 -1
- package/dist/DateTimePicker.js +0 -38
- package/dist/DateTimePickerCommon.js +0 -1
- package/dist/Drawer.js +0 -64
- package/dist/DropdownMenu.js +0 -45
- package/dist/Field.js +0 -72
- package/dist/FieldGroup.js +0 -13
- package/dist/FileDrop.js +0 -46
- package/dist/FileUpload.js +0 -3
- package/dist/Files.js +0 -1
- package/dist/Flex.js +0 -1
- package/dist/Grid.js +0 -1
- package/dist/Hint.js +0 -8
- package/dist/ITI7HKP4-BPa8qpnl.js +0 -1
- package/dist/Icon.js +0 -17
- package/dist/Icons.js +0 -40
- package/dist/IconsFont.js +0 -17
- package/dist/InputText.js +0 -8
- package/dist/JC64G2H7-YkBMNrtl.js +0 -1
- package/dist/KUU7WJ55-DN8gk6_R.js +0 -1
- package/dist/LVA2YJMS-B2HZjIhJ.js +0 -14
- package/dist/Label.js +0 -35
- package/dist/Link.js +0 -43
- package/dist/Loader.js +0 -30
- package/dist/Logo.js +0 -3
- package/dist/MTZPJQMC-5Xg78Uyy.js +0 -1
- package/dist/Modal.js +0 -181
- package/dist/NLEBE274-DvH3XTTw.js +0 -1
- package/dist/P2CTZE2T-q8vyaGc0.js +0 -1
- package/dist/P4IRICAX-nhgZ26A1.js +0 -1
- package/dist/Pagination.js +0 -46
- package/dist/PasswordInput.js +0 -1
- package/dist/Picker.js +0 -8
- package/dist/Popover.js +0 -31
- package/dist/QYJ6MIDR-CRK3satR.js +0 -1
- package/dist/Radio.js +0 -60
- package/dist/RadioGroup.js +0 -8
- package/dist/RadioTab.js +0 -61
- package/dist/SYRFVSLH-BpAfr7UE.js +0 -1
- package/dist/Search.js +0 -70
- package/dist/Select.js +0 -122
- package/dist/Shape.js +0 -23
- package/dist/Slider.js +0 -190
- package/dist/Stack.js +0 -1
- package/dist/Swiper.js +0 -141
- package/dist/System.js +0 -1
- package/dist/Table.js +0 -55
- package/dist/Tabs.js +0 -82
- package/dist/Tag.js +0 -78
- package/dist/Text.js +0 -46
- package/dist/Textarea.js +0 -6
- package/dist/TimePicker.js +0 -4
- package/dist/Toast.js +0 -42
- package/dist/Toggle.js +0 -75
- package/dist/Tooltip.js +0 -68
- package/dist/UniversalLink.js +0 -4
- package/dist/VEVQD5MH-mN1wMozH.js +0 -1
- package/dist/VGCJ63VH-BNLwLOaC.js +0 -1
- package/dist/VariantIcon.js +0 -8
- package/dist/WelcomeLoader.js +0 -11
- package/dist/WuiProvider.js +0 -407
- package/dist/X5NMLKT6-BzhcQu_I.js +0 -1
- package/dist/YV4JVR4I-DIthYWMj.js +0 -15
- package/dist/_commonjsHelpers-DvH0V_XJ.js +0 -1
- package/dist/create-event-YSlay9Ef.js +0 -1
- package/dist/downshift.esm-dvOEflhK.js +0 -1
- package/dist/field-styles-DYEc1l_A.js +0 -63
- package/dist/format-bytes-drUpnBnQ.js +0 -1
- package/dist/get-max-width-height-CDLBnp_J.js +0 -1
- package/dist/hex-to-rgba-cCYXRc5D.js +0 -1
- package/dist/hide-focus-rings-root-DGU4Klq5.js +0 -5
- package/dist/index-23RJrN0D.js +0 -1
- package/dist/index-BAD1dszB.js +0 -1
- package/dist/index-BHi0wohR.js +0 -142
- package/dist/index-BJzGkA7x.js +0 -1
- package/dist/index-BLom3M2B.js +0 -2
- package/dist/index-BNwz4P5j.js +0 -1
- package/dist/index-BPeIa2mR.js +0 -1
- package/dist/index-C1FV1q-F.js +0 -1
- package/dist/index-CxDKPhvU.js +0 -1
- package/dist/index-D6MJAN7T.js +0 -1
- package/dist/index-DTx8atxB.js +0 -1
- package/dist/index-Db47iJVz.js +0 -1
- package/dist/index-Dn-QEAu6.js +0 -56
- package/dist/index-_wqLxu7x.js +0 -1
- package/dist/overflow-ellipsis-C2ESrF8C.js +0 -5
- package/dist/radio-group-BpImAAmy.js +0 -1
- package/dist/theme.js +0 -18
- package/dist/throttle-BB1Y3bfD.js +0 -1
- package/dist/use-fork-ref-Bjf1e56Z.js +0 -1
- package/dist/use-isomorphic-layout-effect-C1_Gy5Nu.js +0 -1
- package/dist/use-viewport-BDDjd1nl.js +0 -1
- package/dist/utils.js +0 -1
- package/dist/wrap-children-BLDjJiiy.js +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Welcome UI
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Welcome to the _Welcome UI library_ created by [Welcome to the jungle](https://www.welcometothejungle.com), a customizable design system with react • typescript • styled-components • styled-system and ariakit.
|
|
6
|
+
|
|
7
|
+
Here you'll find all the core components you need to create a delightful webapp.
|
|
8
|
+
|
|
9
|
+
🌴 [Discover all the components](https://welcome-ui.com)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
[](https://github.com/WTTJ/welcome-ui/tree/main/LICENSE)   [](https://github.com/WTTJ/welcome-ui/tree/main/CONTRIBUTING.mdx) [](https://conventionalcommits.org)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
1 - Install the `welcome-ui` package and **peer dependencies** listed below:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add welcome-ui @xstyled/styled-components@^3.7.3 react@^18.0.0 styled-components@^5.3.9
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Import library & Theme
|
|
26
|
+
|
|
27
|
+
Getting started
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import React from 'react'
|
|
31
|
+
import { createTheme } from 'welcome-ui/theme'
|
|
32
|
+
import { WuiProvider } from 'welcome-ui/WuiProvider'
|
|
33
|
+
import { Button } from 'welcome-ui/Button'
|
|
34
|
+
|
|
35
|
+
// Add theme options (if you want)
|
|
36
|
+
const options = {
|
|
37
|
+
defaultFontFamily: 'Helvetica',
|
|
38
|
+
headingFontFamily: 'Georgia',
|
|
39
|
+
colors: {
|
|
40
|
+
primary: {
|
|
41
|
+
50: '#124C80',
|
|
42
|
+
},
|
|
43
|
+
green: {
|
|
44
|
+
50: '#32CD32',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Create your theme
|
|
50
|
+
const theme = createTheme(options)
|
|
51
|
+
export default function Root() {
|
|
52
|
+
return (
|
|
53
|
+
// Wrap your components with <WuiProvider /> with your theme
|
|
54
|
+
<WuiProvider
|
|
55
|
+
theme={theme}
|
|
56
|
+
// Will inject a CSS reset with normalizer
|
|
57
|
+
hasGlobalStyle
|
|
58
|
+
// Will show the focus ring on keyboard navigation only
|
|
59
|
+
shouldHideFocusRingOnClick
|
|
60
|
+
>
|
|
61
|
+
<Button>Welcome!</Button>
|
|
62
|
+
</WuiProvider>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Develop on local
|
|
68
|
+
|
|
69
|
+
1. Install
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
yarn
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
2. Start a watch on all packages to rebuild them easily
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
yarn start
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. Start documentation website
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
yarn website
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
4. and go to http://localhost:3020
|
|
88
|
+
|
|
89
|
+
## How to release
|
|
90
|
+
|
|
91
|
+
The release of the library is automated by the CI, you just need to bump package version and push git tags to initiate the process.
|
|
92
|
+
|
|
93
|
+
### Release process
|
|
94
|
+
|
|
95
|
+
**The commands listed below will only prompt for library to bump**. Then they will modify package version, commit changes and create the git tag to finally push everything to github. **No further actions are required once you have validated the packages to bump.**
|
|
96
|
+
|
|
97
|
+
#### How to release
|
|
98
|
+
|
|
99
|
+
##### Production
|
|
100
|
+
|
|
101
|
+
(ex: **7.1.0**):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
yarn release
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
##### Alpha
|
|
108
|
+
|
|
109
|
+
(ex: **7.1.0-alpha.0**)
|
|
110
|
+
|
|
111
|
+
Generate an alpha release for broader team testing:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
yarn release:alpha
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
##### Development
|
|
118
|
+
|
|
119
|
+
(ex: **dev.1738060597**)
|
|
120
|
+
|
|
121
|
+
Create a development release based on the current timestamp for quick testing of pre-release features:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
yarn release:dev
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### About the CI
|
|
128
|
+
|
|
129
|
+
The CI will trigger on tags to build the packages and then push them to the npm registry
|
|
@@ -9,7 +9,7 @@ import { StyledSelect as yo, Select as gn } from "./Select.mjs";
|
|
|
9
9
|
import { StyledButton as wo, Button as yn } from "./Button.mjs";
|
|
10
10
|
import vt, { css as gt, system as ca, th as Ht } from "@xstyled/styled-components";
|
|
11
11
|
import { d as ua, F as bo } from "./field-styles-DLIhqG_8.mjs";
|
|
12
|
-
import { _ as _o, a as x } from "./downshift.esm-
|
|
12
|
+
import { _ as _o, a as x } from "./downshift.esm-CEHW4VDy.mjs";
|
|
13
13
|
import { r as la, a as ko } from "./index-BYdkhqH4.mjs";
|
|
14
14
|
import { IconGroupWrapper as pa, IconWrapper as da } from "./Field.mjs";
|
|
15
15
|
import { shouldForwardProp as Do } from "./System.mjs";
|
package/dist/DatePicker.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import d, { useState as R, useRef as w, useEffect as I } from "react";
|
|
3
3
|
import { forwardRef as G } from "./System.mjs";
|
|
4
|
-
import { S as J, c as Q, b as V, C as W, D as P, g as X } from "./CustomInput-
|
|
4
|
+
import { S as J, c as Q, b as V, C as W, D as P, g as X } from "./CustomInput-BqaOGHm4.mjs";
|
|
5
5
|
const Z = G(
|
|
6
6
|
({
|
|
7
7
|
autoFocus: S,
|
package/dist/DateTimePicker.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import r, { Children as p, useState as E, useEffect as P, cloneElement as $ } from "react";
|
|
3
3
|
import x, { css as _, system as b } from "@xstyled/styled-components";
|
|
4
|
-
import { S as w, a as h, D as S, g as A } from "./CustomInput-
|
|
4
|
+
import { S as w, a as h, D as S, g as A } from "./CustomInput-BqaOGHm4.mjs";
|
|
5
5
|
import { DatePicker as N } from "./DatePicker.mjs";
|
|
6
6
|
import { TimePicker as R } from "./TimePicker.mjs";
|
|
7
7
|
import { forwardRef as C } from "./System.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { C as a, c as t, b as r, D as o, S as i, a as g, f as m, g as u, d as D, e as c } from "./CustomInput-
|
|
2
|
+
import { C as a, c as t, b as r, D as o, S as i, a as g, f as m, g as u, d as D, e as c } from "./CustomInput-BqaOGHm4.mjs";
|
|
3
3
|
export {
|
|
4
4
|
a as CustomHeader,
|
|
5
5
|
t as CustomInput,
|
package/dist/Search.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import t, { useState as me, useCallback as pe, useMemo as fe, Fragment as ue } from "react";
|
|
3
|
-
import { D as H } from "./downshift.esm-
|
|
3
|
+
import { D as H } from "./downshift.esm-CEHW4VDy.mjs";
|
|
4
4
|
import { c as he } from "./create-event-rXDe5aCQ.mjs";
|
|
5
5
|
import { d as ge, F as Ee } from "./field-styles-DLIhqG_8.mjs";
|
|
6
6
|
import { t as $e } from "./throttle-BDBzFeFj.mjs";
|
package/dist/Select.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import m, { useMemo as Ze, useState as P, useEffect as he, Fragment as Qe } from "react";
|
|
3
|
-
import { D as pe } from "./downshift.esm-
|
|
3
|
+
import { D as pe } from "./downshift.esm-CEHW4VDy.mjs";
|
|
4
4
|
import { g as Xe } from "./_commonjsHelpers-CXJ7dpIk.mjs";
|
|
5
5
|
import { c as Ge } from "./create-event-rXDe5aCQ.mjs";
|
|
6
6
|
import { d as Je, F as qe } from "./field-styles-DLIhqG_8.mjs";
|
package/dist/TimePicker.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import c, { useState as T, useEffect as E } from "react";
|
|
3
3
|
import M from "@xstyled/styled-components";
|
|
4
|
-
import { f as Y, a as w, c as I, b as L, D as O, g as U } from "./CustomInput-
|
|
4
|
+
import { f as Y, a as w, c as I, b as L, D as O, g as U } from "./CustomInput-BqaOGHm4.mjs";
|
|
5
5
|
import { forwardRef as W } from "./System.mjs";
|
|
6
6
|
const $ = M.div`
|
|
7
7
|
position: relative;
|
package/dist/Toast.mjs
CHANGED
|
@@ -231,7 +231,7 @@ G.displayName = "Snackbar";
|
|
|
231
231
|
const xt = ({ pauseOnHover: t = !0 }) => {
|
|
232
232
|
const e = H(L), s = st(), { handlers: a, toasts: r } = et(), { calculateOffset: o, endPause: i, startPause: n, updateHeight: c } = a, f = t ? n : void 0, p = t ? i : void 0;
|
|
233
233
|
return /* @__PURE__ */ d.createElement(W, { theme: e }, r.length > 0 && s(
|
|
234
|
-
/* @__PURE__ */ d.createElement("div", { onMouseEnter: f, onMouseLeave: p }, r.map((g) => /* @__PURE__ */ d.createElement(
|
|
234
|
+
/* @__PURE__ */ d.createElement("div", { "data-wui-persistent": !0, onMouseEnter: f, onMouseLeave: p }, r.map((g) => /* @__PURE__ */ d.createElement(
|
|
235
235
|
dt,
|
|
236
236
|
{
|
|
237
237
|
calculateOffset: o,
|
package/dist/WuiProvider.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import a, { useState as
|
|
3
|
-
import { css as i, createGlobalStyle as p, th as
|
|
4
|
-
function
|
|
2
|
+
import a, { useState as d, useEffect as m } from "react";
|
|
3
|
+
import { css as i, createGlobalStyle as p, th as f, ThemeProvider as g } from "@xstyled/styled-components";
|
|
4
|
+
function h(e, o, n) {
|
|
5
5
|
return n ? o.map((t) => `url('${e}.${t}') format('${t}-variations')`).join(", ") : o.map((t) => `url('${e}.${t}') format('${t}')`).join(", ");
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function y({
|
|
8
8
|
name: e,
|
|
9
9
|
variation: {
|
|
10
10
|
display: o = "swap",
|
|
@@ -19,7 +19,7 @@ function h({
|
|
|
19
19
|
return i`
|
|
20
20
|
@font-face {
|
|
21
21
|
font-family: ${e};
|
|
22
|
-
src: ${
|
|
22
|
+
src: ${h(l, n, t)};
|
|
23
23
|
font-display: ${o};
|
|
24
24
|
${c && i`
|
|
25
25
|
font-weight: ${c};
|
|
@@ -33,9 +33,9 @@ function h({
|
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
([o, n]) => n.map((t) =>
|
|
38
|
-
),
|
|
36
|
+
const w = () => ({ theme: e }) => !e || !e.fontFaces ? null : Object.entries(e.fontFaces).map(
|
|
37
|
+
([o, n]) => n.map((t) => y({ name: o, variation: t }))
|
|
38
|
+
), x = i`
|
|
39
39
|
html,
|
|
40
40
|
body,
|
|
41
41
|
div,
|
|
@@ -189,7 +189,7 @@ const y = () => ({ theme: e }) => !e || !e.fontFaces ? null : Object.entries(e.f
|
|
|
189
189
|
padding-top: 1px;
|
|
190
190
|
margin-top: -1px;
|
|
191
191
|
}
|
|
192
|
-
`,
|
|
192
|
+
`, k = i`
|
|
193
193
|
html {
|
|
194
194
|
line-height: 1.15;
|
|
195
195
|
-webkit-text-size-adjust: 100%;
|
|
@@ -371,7 +371,7 @@ const y = () => ({ theme: e }) => !e || !e.fontFaces ? null : Object.entries(e.f
|
|
|
371
371
|
[hidden] {
|
|
372
372
|
display: none;
|
|
373
373
|
}
|
|
374
|
-
`,
|
|
374
|
+
`, v = i`
|
|
375
375
|
* {
|
|
376
376
|
&,
|
|
377
377
|
&::before,
|
|
@@ -380,7 +380,7 @@ const y = () => ({ theme: e }) => !e || !e.fontFaces ? null : Object.entries(e.f
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
`;
|
|
383
|
-
function
|
|
383
|
+
function z() {
|
|
384
384
|
return i`
|
|
385
385
|
body,
|
|
386
386
|
button,
|
|
@@ -395,19 +395,19 @@ function v() {
|
|
|
395
395
|
}
|
|
396
396
|
`;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const b = p(
|
|
399
399
|
({ useReset: e }) => i`
|
|
400
|
-
${
|
|
401
|
-
${
|
|
402
|
-
${
|
|
403
|
-
${e ?
|
|
400
|
+
${k};
|
|
401
|
+
${w()};
|
|
402
|
+
${z()};
|
|
403
|
+
${e ? x : v};
|
|
404
404
|
|
|
405
405
|
html {
|
|
406
406
|
color: neutral-60;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
::selection {
|
|
410
|
-
${
|
|
410
|
+
${f("selection")};
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
/* for firefox */
|
|
@@ -438,8 +438,8 @@ const z = p(
|
|
|
438
438
|
children: e,
|
|
439
439
|
reactRootId: o
|
|
440
440
|
}) => {
|
|
441
|
-
const [n, t] =
|
|
442
|
-
return
|
|
441
|
+
const [n, t] = d(!1);
|
|
442
|
+
return m(() => {
|
|
443
443
|
const r = n ? "keydown" : "mousemove", s = () => t((c) => !c);
|
|
444
444
|
window.addEventListener(r, s);
|
|
445
445
|
const l = document.getElementById(o);
|
|
@@ -454,8 +454,9 @@ const z = p(
|
|
|
454
454
|
shouldHideFocusRingOnClick: t = !0,
|
|
455
455
|
theme: r,
|
|
456
456
|
useReset: s
|
|
457
|
-
}) => /* @__PURE__ */ a.createElement(
|
|
457
|
+
}) => /* @__PURE__ */ a.createElement(g, { theme: r }, /* @__PURE__ */ a.createElement(a.Fragment, null, o && /* @__PURE__ */ a.createElement(b, { useReset: s }), t ? /* @__PURE__ */ a.createElement(F, { reactRootId: n }, e) : e)), R = b;
|
|
458
458
|
E.displayName = "WuiProvider";
|
|
459
459
|
export {
|
|
460
|
+
R as GlobalStyle,
|
|
460
461
|
E as WuiProvider
|
|
461
462
|
};
|
|
@@ -9,3 +9,7 @@ export interface WuiProviderProps {
|
|
|
9
9
|
useReset?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const WuiProvider: React.FC<WuiProviderProps>;
|
|
12
|
+
declare const GlobalStyle: import('styled-components').GlobalStyleComponent<{
|
|
13
|
+
useReset?: boolean;
|
|
14
|
+
}, import('styled-components').DefaultTheme>;
|
|
15
|
+
export { GlobalStyle };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "welcome-ui",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Customizable design system with react • styled-components • styled-system and ariakit.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"./theme": {
|
|
11
11
|
"types": "./dist/types/theme/index.d.ts",
|
|
12
12
|
"import": "./dist/theme.mjs",
|
|
13
|
-
"require": "./dist/theme.
|
|
13
|
+
"require": "./dist/theme.mjs"
|
|
14
14
|
},
|
|
15
15
|
"./utils": {
|
|
16
16
|
"types": "./dist/types/utils/index.d.ts",
|
|
17
17
|
"import": "./dist/utils.mjs",
|
|
18
|
-
"require": "./dist/utils.
|
|
18
|
+
"require": "./dist/utils.mjs"
|
|
19
19
|
},
|
|
20
20
|
"./*": {
|
|
21
21
|
"types": "./dist/types/components/*/index.d.ts",
|
|
22
22
|
"import": "./dist/*.mjs",
|
|
23
|
-
"require": "./dist/*.
|
|
23
|
+
"require": "./dist/*.mjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@babel/eslint-parser": "^7.25.1",
|
|
72
72
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
73
73
|
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
74
|
-
"@babel/plugin-transform-modules-commonjs": "7.
|
|
74
|
+
"@babel/plugin-transform-modules-commonjs": "7.26.3",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.25.4",
|
|
76
76
|
"@babel/preset-env": "^7.26.0",
|
|
77
77
|
"@babel/preset-react": "^7.26.3",
|
|
78
78
|
"@babel/preset-typescript": "^7.22.11",
|
|
79
79
|
"@testing-library/dom": "^10.4.0",
|
|
80
80
|
"@testing-library/jest-dom": "^6.6.3",
|
|
81
|
-
"@testing-library/react": "^16.0
|
|
81
|
+
"@testing-library/react": "^16.2.0",
|
|
82
82
|
"@testing-library/user-event": "^14.5.2",
|
|
83
83
|
"@types/jest": "^29.5.13",
|
|
84
84
|
"@types/lodash.capitalize": "^4.2.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const c=require("./P4IRICAX-nhgZ26A1.js"),l=require("./VGCJ63VH-BNLwLOaC.js"),e=require("./LVA2YJMS-B2HZjIhJ.js");var D="button",i=e.createHook(function(t){var s=t,{store:o}=s,r=e.__objRest(s,["store"]);const n=l.useDialogProviderContext();o=o||n,e.invariant(o,process.env.NODE_ENV!=="production"&&"DialogDisclosure must receive a `store` prop or be wrapped in a DialogProvider component.");const u=o.useState("contentElement");return r=e.__spreadValues({"aria-haspopup":e.getPopupRole(u,"dialog")},r),r=c.useDisclosure(e.__spreadValues({store:o},r)),r}),p=e.forwardRef2(function(t){const s=i(t);return e.createElement(D,s)});exports.DialogDisclosure=p;exports.useDialogDisclosure=i;
|
package/dist/Accordion.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=require("@xstyled/styled-components"),u=require("./P4IRICAX-nhgZ26A1.js"),c=require("./VGCJ63VH-BNLwLOaC.js");require("./Icon.js");const m=require("./index-BNwz4P5j.js"),p=require("./System.js"),g=e.div`
|
|
2
|
-
${e.th("accordions.wrapper")};
|
|
3
|
-
${e.system};
|
|
4
|
-
transition: medium;
|
|
5
|
-
|
|
6
|
-
&:hover {
|
|
7
|
-
border-color: neutral-50;
|
|
8
|
-
}
|
|
9
|
-
`,r=e.divBox`
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
${e.th("accordions.icon")};
|
|
12
|
-
transform: rotate3d(0);
|
|
13
|
-
transition: medium;
|
|
14
|
-
width: 24;
|
|
15
|
-
height: 24;
|
|
16
|
-
color: inherit;
|
|
17
|
-
display: flex;
|
|
18
|
-
border-radius: 12;
|
|
19
|
-
|
|
20
|
-
& *:first-child {
|
|
21
|
-
margin: auto;
|
|
22
|
-
}
|
|
23
|
-
`,f=e(u.Disclosure)`
|
|
24
|
-
${e.th("accordions.title")};
|
|
25
|
-
width: 100%;
|
|
26
|
-
padding: ${e.th("accordions.padding")};
|
|
27
|
-
background-color: transparent;
|
|
28
|
-
border: 0;
|
|
29
|
-
display: flex;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
align-items: center;
|
|
32
|
-
gap: xxl;
|
|
33
|
-
|
|
34
|
-
&[aria-expanded='true'] {
|
|
35
|
-
${r} {
|
|
36
|
-
transform: rotate3d(0, 0, 1, 90deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:focus,
|
|
41
|
-
&:hover {
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
${r} {
|
|
44
|
-
background-color: neutral-30;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:focus {
|
|
49
|
-
outline: 0;
|
|
50
|
-
${r} {
|
|
51
|
-
color: inherit;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`,h=e(c.DisclosureContent)`
|
|
55
|
-
display: grid;
|
|
56
|
-
grid-template-rows: 0fr;
|
|
57
|
-
transition-property: grid-template-rows;
|
|
58
|
-
transition-timing-function: linear;
|
|
59
|
-
transition-duration: 200ms;
|
|
60
|
-
animation-duration: 200ms;
|
|
61
|
-
|
|
62
|
-
> * {
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
padding: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&[data-enter] {
|
|
68
|
-
grid-template-rows: 1fr;
|
|
69
|
-
}
|
|
70
|
-
`,$=e.div`
|
|
71
|
-
${e.th("accordions.content")};
|
|
72
|
-
padding: ${e.th("accordions.padding")};
|
|
73
|
-
padding-top: 0;
|
|
74
|
-
color: neutral-70;
|
|
75
|
-
`,y=p.forwardRef(({children:o,dataTestId:n,icon:d=t.createElement(m.RightIcon,null),store:i,title:a,...s},l)=>t.createElement(g,{"data-testid":n,ref:l,...s},t.createElement(f,{"data-testid":n?`${n}-title`:void 0,store:i},a,t.createElement(r,null,t.cloneElement(d,{size:"sm"}))),t.createElement(h,{"data-testid":n?`${n}-content`:void 0,store:i},t.createElement("div",null,t.createElement($,null,o)))));function w(o){return c.useDisclosureStore({animated:!0,...o})}exports.Accordion=y;exports.useAccordion=w;
|
package/dist/Alert.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("@xstyled/styled-components"),v=require("./Text.js"),I=require("./VariantIcon.js"),T=require("./CloseButton.js"),x=require("./Button.js"),f=require("./System.js"),u=require("./Box.js"),m=t.divBox`
|
|
2
|
-
flex: 1;
|
|
3
|
-
`,y=t(I.VariantIcon)`
|
|
4
|
-
position: absolute;
|
|
5
|
-
align-self: flex-start;
|
|
6
|
-
`,R=t.divBox(({icon:r,isFullWidth:o,size:s,variant:a})=>t.css`
|
|
7
|
-
position: relative;
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: flex-start;
|
|
10
|
-
width: 100%;
|
|
11
|
-
max-width: ${o?"100%":"max-content"};
|
|
12
|
-
${t.th("alerts.default")};
|
|
13
|
-
${t.th(`alerts.${a}`)};
|
|
14
|
-
${t.th(`alerts.sizes.${s}`)};
|
|
15
|
-
${t.system};
|
|
16
|
-
|
|
17
|
-
${r!==null&&s==="sm"&&t.css`
|
|
18
|
-
${m} {
|
|
19
|
-
margin-left: calc(${t.th("icons.sm")} + ${t.th("space.md")});
|
|
20
|
-
}
|
|
21
|
-
`}
|
|
22
|
-
|
|
23
|
-
${r!==null&&s==="md"&&t.css`
|
|
24
|
-
${m} {
|
|
25
|
-
margin-left: calc(${t.th("icons.md")} + ${t.th("space.lg")});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
${y} {
|
|
29
|
-
margin-top: -3;
|
|
30
|
-
}
|
|
31
|
-
`}
|
|
32
|
-
`),V=t(v.Text)(({variant:r})=>t.css`
|
|
33
|
-
font-weight: medium;
|
|
34
|
-
${t.th("alerts.title.default")};
|
|
35
|
-
${t.th(`alerts.title.sizes.${r}`)};
|
|
36
|
-
${t.system};
|
|
37
|
-
`),g=({children:r,dataTestId:o,variant:s})=>e.createElement(V,{"data-testid":o,variant:s},r),j=f.forwardRef(({children:r,cta:o,dataTestId:s,handleClose:a,icon:c,isFullWidth:w,size:l="sm",variant:i="default",...b},h)=>{const q=s?`${s}-close-button`:void 0,A=i==="beige"?"default":i,C=e.Children.toArray(r).map(n=>n.type===g?e.cloneElement(n,{variant:l}):n),p=n=>{var $;if(n){if(n.type===B)return e.cloneElement(n,{size:l});if(n.type===E)return e.cloneElement(n,{size:l});if(($=n.props)!=null&&$.children)return e.cloneElement(n,{...n.props,children:e.Children.map(n.props.children,S=>p(S))})}return n},d=e.isValidElement(o)?p(o):o;return e.createElement(R,{"data-testid":s,icon:c,isFullWidth:w,ref:h,size:l,variant:i,...b},!!a&&e.createElement(T.CloseButton,{dataTestId:q,onClick:a,position:"absolute",right:"sm",size:"xs",top:"sm"}),c!==null&&e.createElement(y,{icon:c,size:l,variant:A}),e.createElement(m,null,e.createElement(u.Box,{alignItems:"flex-start",display:"flex",flexDirection:"column",gap:"md",justifyContent:"space-between"},e.createElement(u.Box,{flex:1},C),!!d&&e.createElement(u.Box,{alignItems:"center",display:"flex",gap:"sm"},d))))}),B=f.forwardRef((r,o)=>e.createElement(x.Button,{flexShrink:0,ref:o,w:"fit-content",...r,variant:"secondary"})),E=f.forwardRef((r,o)=>e.createElement(x.Button,{flexShrink:0,ref:o,w:"fit-content",...r,variant:"tertiary"})),k=Object.assign(j,{Title:g,Button:B,SecondaryButton:E});exports.Alert=k;
|
package/dist/AspectRatio.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),t=require("@xstyled/styled-components"),r=require("./System.js"),n=t.divBox(({ratio:e})=>t.css`
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
& > * {
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
right: 0;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
align-items: center;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
& > img,
|
|
19
|
-
& > video {
|
|
20
|
-
object-fit: cover;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&:before {
|
|
24
|
-
height: 0;
|
|
25
|
-
content: '';
|
|
26
|
-
display: block;
|
|
27
|
-
padding-bottom: ${1/e*100}%;
|
|
28
|
-
}
|
|
29
|
-
`),o=r.forwardRef(({ratio:e=4/3,...i},s)=>c.createElement(n,{ratio:e,ref:s,...i}));o.displayName="AspectRatio";exports.AspectRatio=o;
|
package/dist/Avatar.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),s=require("@xstyled/styled-components"),y=require("./Shape.js"),x=require("./Text.js"),S=require("./System.js"),b=require("./Box.js");function q(o,e=""){const t=Object.keys(o).filter(r=>r.startsWith("secondary-")),n=e.length%t.length;return t[n]}function A(o=""){const[e,t]=o.split(" ");return e&&t?`${e.charAt(0).toUpperCase()}${t.charAt(0).toUpperCase()}`:e.substring(0,2).toUpperCase()}const C=s(y.Shape)`
|
|
2
|
-
flex-shrink: 0;
|
|
3
|
-
`,$=s(x.Text)`
|
|
4
|
-
${s.th("avatars.text")};
|
|
5
|
-
`,h=a.memo(S.forwardRef(({color:o,fontSize:e,getInitials:t=A,h:n,name:r,shape:m="circle",size:g="md",src:c,w:i,...d},p)=>{const l=s.useTheme(),f=o||q(l.colors,r),u=l.avatars.sizes[g],v=e||`calc(${i?l.toRem(i):u} / 2.5)`;return a.createElement(C,{"aria-label":r,backgroundColor:f,h:n||u,ref:p,role:"img",shape:m,w:i||u,...d},c&&a.createElement("img",{alt:r,src:c}),!c&&a.createElement(b.Box,null,a.createElement($,{fontSize:v,m:0},t(r))))}));h.displayName="Avatar";exports.Avatar=h;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const de=require("./JC64G2H7-YkBMNrtl.js"),D=require("./YV4JVR4I-DIthYWMj.js"),c=require("./LVA2YJMS-B2HZjIhJ.js"),ce=require("./MTZPJQMC-5Xg78Uyy.js"),C=require("react");function Je(e={}){var n=e,{popover:o}=n,t=c.__objRest$1(n,["popover"]);const i=D.mergeStore(t.store,D.omit2(o,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));D.throwOnConflictingProps(t,i);const r=i==null?void 0:i.getState(),u=de.createDialogStore(c.__spreadProps$1(c.__spreadValues$1({},t),{store:i})),a=c.defaultValue(t.placement,r==null?void 0:r.placement,"bottom"),l=c.__spreadProps$1(c.__spreadValues$1({},u.getState()),{placement:a,currentPlacement:a,anchorElement:c.defaultValue(r==null?void 0:r.anchorElement,null),popoverElement:c.defaultValue(r==null?void 0:r.popoverElement,null),arrowElement:c.defaultValue(r==null?void 0:r.arrowElement,null),rendered:Symbol("rendered")}),s=D.createStore(l,u,i);return c.__spreadProps$1(c.__spreadValues$1(c.__spreadValues$1({},u),s),{setAnchorElement:d=>s.setState("anchorElement",d),setPopoverElement:d=>s.setState("popoverElement",d),setArrowElement:d=>s.setState("arrowElement",d),render:()=>s.setState("rendered",Symbol("rendered"))})}function Ue(e,n,o){return c.useUpdateEffect(n,[o.popover]),D.useStoreProps(e,o,"placement"),de.useDialogStoreProps(e,n,o)}function gt(e={}){const[n,o]=D.useStore(Je,e);return Ue(n,o,e)}function ue(e){return e.split("-")[1]}function Te(e){return e==="y"?"height":"width"}function q(e){return e.split("-")[0]}function ee(e){return["top","bottom"].includes(q(e))?"x":"y"}function ke(e,n,o){let{reference:t,floating:i}=e;const r=t.x+t.width/2-i.width/2,u=t.y+t.height/2-i.height/2,a=ee(n),l=Te(a),s=t[l]/2-i[l]/2,d=a==="x";let f;switch(q(n)){case"top":f={x:r,y:t.y-i.height};break;case"bottom":f={x:r,y:t.y+t.height};break;case"right":f={x:t.x+t.width,y:u};break;case"left":f={x:t.x-i.width,y:u};break;default:f={x:t.x,y:t.y}}switch(ue(n)){case"start":f[a]-=s*(o&&d?-1:1);break;case"end":f[a]+=s*(o&&d?-1:1)}return f}const vt=async(e,n,o)=>{const{placement:t="bottom",strategy:i="absolute",middleware:r=[],platform:u}=o,a=r.filter(Boolean),l=await(u.isRTL==null?void 0:u.isRTL(n));let s=await u.getElementRects({reference:e,floating:n,strategy:i}),{x:d,y:f}=ke(s,t,l),h=t,m={},p=0;for(let g=0;g<a.length;g++){const{name:v,fn:x}=a[g],{x:w,y:b,data:E,reset:y}=await x({x:d,y:f,initialPlacement:t,placement:h,strategy:i,middlewareData:m,rects:s,platform:u,elements:{reference:e,floating:n}});d=w??d,f=b??f,m={...m,[v]:{...m[v],...E}},y&&p<=50&&(p++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(s=y.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:i}):y.rects),{x:d,y:f}=ke(s,h,l)),g=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:m}};function X(e,n){return typeof e=="function"?e(n):e}function Ze(e){return typeof e!="number"?function(n){return{top:0,right:0,bottom:0,left:0,...n}}(e):{top:e,right:e,bottom:e,left:e}}function xe(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function $e(e,n){var o;n===void 0&&(n={});const{x:t,y:i,platform:r,rects:u,elements:a,strategy:l}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=X(n,e),p=Ze(m),g=a[h?f==="floating"?"reference":"floating":f],v=xe(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(g)))==null||o?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:s,rootBoundary:d,strategy:l})),x=f==="floating"?{...u.floating,x:t,y:i}:u.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),b=await(r.isElement==null?void 0:r.isElement(w))&&await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1},E=xe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-E.top+p.top)/b.y,bottom:(E.bottom-v.bottom+p.bottom)/b.y,left:(v.left-E.left+p.left)/b.x,right:(E.right-v.right+p.right)/b.x}}const ae=Math.min,Z=Math.max;function _e(e,n,o){return Z(e,ae(n,o))}const xt=e=>({name:"arrow",options:e,async fn(n){const{x:o,y:t,placement:i,rects:r,platform:u,elements:a}=n,{element:l,padding:s=0}=X(e,n)||{};if(l==null)return{};const d=Ze(s),f={x:o,y:t},h=ee(i),m=Te(h),p=await u.getDimensions(l),g=h==="y",v=g?"top":"left",x=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=r.reference[m]+r.reference[h]-f[h]-r.floating[m],E=f[h]-r.reference[h],y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l));let S=y?y[w]:0;S&&await(u.isElement==null?void 0:u.isElement(y))||(S=a.floating[w]||r.floating[m]);const $=b/2-E/2,H=S/2-p[m]/2-1,L=ae(d[v],H),_=ae(d[x],H),A=L,M=S-p[m]-_,P=S/2-p[m]/2+$,O=_e(A,P,M),R=ue(i)!=null&&P!=O&&r.reference[m]/2-(P<A?L:_)-p[m]/2<0?P<A?A-P:M-P:0;return{[h]:f[h]-R,data:{[h]:O,centerOffset:P-O+R}}}}),wt=["top","right","bottom","left"];wt.reduce((e,n)=>e.concat(n,n+"-start",n+"-end"),[]);const yt={left:"right",right:"left",bottom:"top",top:"bottom"};function we(e){return e.replace(/left|right|bottom|top/g,n=>yt[n])}function Pt(e,n,o){o===void 0&&(o=!1);const t=ue(e),i=ee(e),r=Te(i);let u=i==="x"?t===(o?"end":"start")?"right":"left":t==="start"?"bottom":"top";return n.reference[r]>n.floating[r]&&(u=we(u)),{main:u,cross:we(u)}}const bt={start:"end",end:"start"};function Se(e){return e.replace(/start|end/g,n=>bt[n])}const Et=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var o;const{placement:t,middlewareData:i,rects:r,initialPlacement:u,platform:a,elements:l}=n,{mainAxis:s=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=X(e,n),v=q(t),x=q(u)===u,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=f||(x||!p?[we(u)]:function(A){const M=we(A);return[Se(A),M,Se(M)]}(u));f||m==="none"||b.push(...function(A,M,P,O){const R=ue(A);let T=function(V,k,G){const j=["left","right"],B=["right","left"],U=["top","bottom"],te=["bottom","top"];switch(V){case"top":case"bottom":return G?k?B:j:k?j:B;case"left":case"right":return k?U:te;default:return[]}}(q(A),P==="start",O);return R&&(T=T.map(V=>V+"-"+R),M&&(T=T.concat(T.map(Se)))),T}(u,p,m,w));const E=[u,...b],y=await $e(n,g),S=[];let $=((o=i.flip)==null?void 0:o.overflows)||[];if(s&&S.push(y[v]),d){const{main:A,cross:M}=Pt(t,r,w);S.push(y[A],y[M])}if($=[...$,{placement:t,overflows:S}],!S.every(A=>A<=0)){var H,L;const A=(((H=i.flip)==null?void 0:H.index)||0)+1,M=E[A];if(M)return{data:{index:A,overflows:$},reset:{placement:M}};let P=(L=$.filter(O=>O.overflows[0]<=0).sort((O,R)=>O.overflows[1]-R.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(h){case"bestFit":{var _;const O=(_=$.map(R=>[R.placement,R.overflows.filter(T=>T>0).reduce((T,V)=>T+V,0)]).sort((R,T)=>R[1]-T[1])[0])==null?void 0:_[0];O&&(P=O);break}case"initialPlacement":P=u}if(t!==P)return{reset:{placement:P}}}return{}}}},St=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){const{x:o,y:t}=n,i=await async function(r,u){const{placement:a,platform:l,elements:s}=r,d=await(l.isRTL==null?void 0:l.isRTL(s.floating)),f=q(a),h=ue(a),m=ee(a)==="x",p=["left","top"].includes(f)?-1:1,g=d&&m?-1:1,v=X(u,r);let{mainAxis:x,crossAxis:w,alignmentAxis:b}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...v};return h&&typeof b=="number"&&(w=h==="end"?-1*b:b),m?{x:w*g,y:x*p}:{x:x*p,y:w*g}}(n,e);return{x:o+i.x,y:t+i.y,data:i}}}};function Qe(e){return e==="x"?"y":"x"}const Rt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:o,y:t,placement:i}=n,{mainAxis:r=!0,crossAxis:u=!1,limiter:a={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=X(e,n),s={x:o,y:t},d=await $e(n,l),f=ee(q(i)),h=Qe(f);let m=s[f],p=s[h];if(r){const v=f==="y"?"bottom":"right";m=_e(m+d[f==="y"?"top":"left"],m,m-d[v])}if(u){const v=h==="y"?"bottom":"right";p=_e(p+d[h==="y"?"top":"left"],p,p-d[v])}const g=a.fn({...n,[f]:m,[h]:p});return{...g,data:{x:g.x-o,y:g.y-t}}}}},_t=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:o,y:t,placement:i,rects:r,middlewareData:u}=n,{offset:a=0,mainAxis:l=!0,crossAxis:s=!0}=X(e,n),d={x:o,y:t},f=ee(i),h=Qe(f);let m=d[f],p=d[h];const g=X(a,n),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=f==="y"?"height":"width",E=r.reference[f]-r.floating[b]+v.mainAxis,y=r.reference[f]+r.reference[b]-v.mainAxis;m<E?m=E:m>y&&(m=y)}if(s){var x,w;const b=f==="y"?"width":"height",E=["top","left"].includes(q(i)),y=r.reference[h]-r.floating[b]+(E&&((x=u.offset)==null?void 0:x[h])||0)+(E?0:v.crossAxis),S=r.reference[h]+r.reference[b]+(E?0:((w=u.offset)==null?void 0:w[h])||0)-(E?v.crossAxis:0);p<y?p=y:p>S&&(p=S)}return{[f]:m,[h]:p}}}},At=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:o,rects:t,platform:i,elements:r}=n,{apply:u=()=>{},...a}=X(e,n),l=await $e(n,a),s=q(o),d=ue(o),f=ee(o)==="x",{width:h,height:m}=t.floating;let p,g;s==="top"||s==="bottom"?(p=s,g=d===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(g=s,p=d==="end"?"top":"bottom");const v=m-l[p],x=h-l[g],w=!n.middlewareData.shift;let b=v,E=x;if(f){const S=h-l.left-l.right;E=d||w?ae(x,S):S}else{const S=m-l.top-l.bottom;b=d||w?ae(v,S):S}if(w&&!d){const S=Z(l.left,0),$=Z(l.right,0),H=Z(l.top,0),L=Z(l.bottom,0);f?E=h-2*(S!==0||$!==0?S+$:Z(l.left,l.right)):b=m-2*(H!==0||L!==0?H+L:Z(l.top,l.bottom))}await u({...n,availableWidth:E,availableHeight:b});const y=await i.getDimensions(r.floating);return h!==y.width||m!==y.height?{reset:{rects:!0}}:{}}}};function F(e){var n;return((n=e.ownerDocument)==null?void 0:n.defaultView)||window}function N(e){return F(e).getComputedStyle(e)}function Ke(e){return e instanceof F(e).Node}function J(e){return Ke(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){return e instanceof F(e).HTMLElement}function I(e){return e instanceof F(e).Element}function Ne(e){return typeof ShadowRoot<"u"&&(e instanceof F(e).ShadowRoot||e instanceof ShadowRoot)}function fe(e){const{overflow:n,overflowX:o,overflowY:t,display:i}=N(e);return/auto|scroll|overlay|hidden|clip/.test(n+t+o)&&!["inline","contents"].includes(i)}function Ot(e){return["table","td","th"].includes(J(e))}function Ae(e){const n=He(),o=N(e);return o.transform!=="none"||o.perspective!=="none"||!n&&!!o.backdropFilter&&o.backdropFilter!=="none"||!n&&!!o.filter&&o.filter!=="none"||["transform","perspective","filter"].some(t=>(o.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(o.contain||"").includes(t))}function He(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function be(e){return["html","body","#document"].includes(J(e))}const Oe=Math.min,re=Math.max,ye=Math.round,ve=Math.floor,Q=e=>({x:e,y:e});function et(e){const n=N(e);let o=parseFloat(n.width)||0,t=parseFloat(n.height)||0;const i=W(e),r=i?e.offsetWidth:o,u=i?e.offsetHeight:t,a=ye(o)!==r||ye(t)!==u;return a&&(o=r,t=u),{width:o,height:t,$:a}}function Ce(e){return I(e)?e:e.contextElement}function ie(e){const n=Ce(e);if(!W(n))return Q(1);const o=n.getBoundingClientRect(),{width:t,height:i,$:r}=et(n);let u=(r?ye(o.width):o.width)/t,a=(r?ye(o.height):o.height)/i;return u&&Number.isFinite(u)||(u=1),a&&Number.isFinite(a)||(a=1),{x:u,y:a}}const We=Q(0);function tt(e,n,o){var t,i;if(n===void 0&&(n=!0),!He())return We;const r=e?F(e):window;return!o||n&&o!==r?We:{x:((t=r.visualViewport)==null?void 0:t.offsetLeft)||0,y:((i=r.visualViewport)==null?void 0:i.offsetTop)||0}}function K(e,n,o,t){n===void 0&&(n=!1),o===void 0&&(o=!1);const i=e.getBoundingClientRect(),r=Ce(e);let u=Q(1);n&&(t?I(t)&&(u=ie(t)):u=ie(e));const a=tt(r,o,t);let l=(i.left+a.x)/u.x,s=(i.top+a.y)/u.y,d=i.width/u.x,f=i.height/u.y;if(r){const h=F(r),m=t&&I(t)?F(t):t;let p=h.frameElement;for(;p&&t&&m!==h;){const g=ie(p),v=p.getBoundingClientRect(),x=getComputedStyle(p),w=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,b=v.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,s*=g.y,d*=g.x,f*=g.y,l+=w,s+=b,p=F(p).frameElement}}return xe({width:d,height:f,x:l,y:s})}function Y(e){return((Ke(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ee(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nt(e){return K(Y(e)).left+Ee(e).scrollLeft}function se(e){if(J(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Ne(e)&&e.host||Y(e);return Ne(n)?n.host:n}function ot(e){const n=se(e);return be(n)?e.ownerDocument?e.ownerDocument.body:e.body:W(n)&&fe(n)?n:ot(n)}function Pe(e,n){var o;n===void 0&&(n=[]);const t=ot(e),i=t===((o=e.ownerDocument)==null?void 0:o.body),r=F(t);return i?n.concat(r,r.visualViewport||[],fe(t)?t:[]):n.concat(t,Pe(t))}function je(e,n,o){let t;if(n==="viewport")t=function(i,r){const u=F(i),a=Y(i),l=u.visualViewport;let s=a.clientWidth,d=a.clientHeight,f=0,h=0;if(l){s=l.width,d=l.height;const m=He();(!m||m&&r==="fixed")&&(f=l.offsetLeft,h=l.offsetTop)}return{width:s,height:d,x:f,y:h}}(e,o);else if(n==="document")t=function(i){const r=Y(i),u=Ee(i),a=i.ownerDocument.body,l=re(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),s=re(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let d=-u.scrollLeft+nt(i);const f=-u.scrollTop;return N(a).direction==="rtl"&&(d+=re(r.clientWidth,a.clientWidth)-l),{width:l,height:s,x:d,y:f}}(Y(e));else if(I(n))t=function(i,r){const u=K(i,!0,r==="fixed"),a=u.top+i.clientTop,l=u.left+i.clientLeft,s=W(i)?ie(i):Q(1);return{width:i.clientWidth*s.x,height:i.clientHeight*s.y,x:l*s.x,y:a*s.y}}(n,o);else{const i=tt(e);t={...n,x:n.x-i.x,y:n.y-i.y}}return xe(t)}function rt(e,n){const o=se(e);return!(o===n||!I(o)||be(o))&&(N(o).position==="fixed"||rt(o,n))}function Be(e,n){return W(e)&&N(e).position!=="fixed"?n?n(e):e.offsetParent:null}function ze(e,n){const o=F(e);if(!W(e))return o;let t=Be(e,n);for(;t&&Ot(t)&&N(t).position==="static";)t=Be(t,n);return t&&(J(t)==="html"||J(t)==="body"&&N(t).position==="static"&&!Ae(t))?o:t||function(i){let r=se(i);for(;W(r)&&!be(r);){if(Ae(r))return r;r=se(r)}return null}(e)||o}function Tt(e,n,o){const t=W(n),i=Y(n),r=o==="fixed",u=K(e,!0,r,n);let a={scrollLeft:0,scrollTop:0};const l=Q(0);if(t||!t&&!r)if((J(n)!=="body"||fe(i))&&(a=Ee(n)),W(n)){const s=K(n,!0,r,n);l.x=s.x+n.clientLeft,l.y=s.y+n.clientTop}else i&&(l.x=nt(i));return{x:u.left+a.scrollLeft-l.x,y:u.top+a.scrollTop-l.y,width:u.width,height:u.height}}const $t={getClippingRect:function(e){let{element:n,boundary:o,rootBoundary:t,strategy:i}=e;const r=o==="clippingAncestors"?function(s,d){const f=d.get(s);if(f)return f;let h=Pe(s).filter(v=>I(v)&&J(v)!=="body"),m=null;const p=N(s).position==="fixed";let g=p?se(s):s;for(;I(g)&&!be(g);){const v=N(g),x=Ae(g);x||v.position!=="fixed"||(m=null),(p?!x&&!m:!x&&v.position==="static"&&m&&["absolute","fixed"].includes(m.position)||fe(g)&&!x&&rt(s,g))?h=h.filter(w=>w!==g):m=v,g=se(g)}return d.set(s,h),h}(n,this._c):[].concat(o),u=[...r,t],a=u[0],l=u.reduce((s,d)=>{const f=je(n,d,i);return s.top=re(f.top,s.top),s.right=Oe(f.right,s.right),s.bottom=Oe(f.bottom,s.bottom),s.left=re(f.left,s.left),s},je(n,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:n,offsetParent:o,strategy:t}=e;const i=W(o),r=Y(o);if(o===r)return n;let u={scrollLeft:0,scrollTop:0},a=Q(1);const l=Q(0);if((i||!i&&t!=="fixed")&&((J(o)!=="body"||fe(r))&&(u=Ee(o)),W(o))){const s=K(o);a=ie(o),l.x=s.x+o.clientLeft,l.y=s.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+l.x,y:n.y*a.y-u.scrollTop*a.y+l.y}},isElement:I,getDimensions:function(e){return et(e)},getOffsetParent:ze,getDocumentElement:Y,getScale:ie,async getElementRects(e){let{reference:n,floating:o,strategy:t}=e;const i=this.getOffsetParent||ze,r=this.getDimensions;return{reference:Tt(n,await i(o),t),floating:{x:0,y:0,...await r(o)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>N(e).direction==="rtl"};function Ht(e,n,o,t){t===void 0&&(t={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:u=!0,layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,s=Ce(e),d=i||r?[...s?Pe(s):[],...Pe(n)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",o,{passive:!0}),r&&g.addEventListener("resize",o)});const f=s&&a?function(g,v){let x,w=null;const b=Y(g);function E(){clearTimeout(x),w&&w.disconnect(),w=null}return function y(S,$){S===void 0&&(S=!1),$===void 0&&($=1),E();const{left:H,top:L,width:_,height:A}=g.getBoundingClientRect();if(S||v(),!_||!A)return;const M=ve(L),P=ve(b.clientWidth-(H+_)),O=ve(b.clientHeight-(L+A)),R=ve(H);let T=!0;w=new IntersectionObserver(V=>{const k=V[0].intersectionRatio;if(k!==$){if(!T)return y();k?y(!1,k):x=setTimeout(()=>{y(!1,1e-7)},100)}T=!1},{rootMargin:-M+"px "+-P+"px "+-O+"px "+-R+"px",threshold:re(0,Oe(1,$))||1}),w.observe(g)}(!0),E}(s,o):null;let h,m=null;u&&(m=new ResizeObserver(o),s&&!l&&m.observe(s),m.observe(n));let p=l?K(e):null;return l&&function g(){const v=K(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||o(),p=v,h=requestAnimationFrame(g)}(),o(),()=>{d.forEach(g=>{i&&g.removeEventListener("scroll",o),r&&g.removeEventListener("resize",o)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(h)}}const Ct=(e,n,o)=>{const t=new Map,i={platform:$t,...o},r={...i.platform,_c:t};return vt(e,n,{...i,platform:r})};var Mt="div";function qe(e=0,n=0,o=0,t=0){if(typeof DOMRect=="function")return new DOMRect(e,n,o,t);const i={x:e,y:n,width:o,height:t,top:n,right:e+o,bottom:n+t,left:e};return c.__spreadProps(c.__spreadValues({},i),{toJSON:()=>i})}function Vt(e){if(!e)return qe();const{x:n,y:o,width:t,height:i}=e;return qe(n,o,t,i)}function Lt(e,n){return{contextElement:e||void 0,getBoundingClientRect:()=>{const t=e,i=n==null?void 0:n(t);return i||!t?Vt(i):t.getBoundingClientRect()}}}function Dt(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Ie(e){const n=window.devicePixelRatio||1;return Math.round(e*n)/n}function Ft(e,n){return St(({placement:o})=>{var t;const i=((e==null?void 0:e.clientHeight)||0)/2,r=typeof n.gutter=="number"?n.gutter+i:(t=n.gutter)!=null?t:i;return{crossAxis:!!o.split("-")[1]?void 0:n.shift,mainAxis:r,alignmentAxis:n.shift}})}function kt(e){if(e.flip===!1)return;const n=typeof e.flip=="string"?e.flip.split(" "):void 0;return c.invariant(!n||n.every(Dt),process.env.NODE_ENV!=="production"&&"`flip` expects a spaced-delimited list of placements"),Et({padding:e.overflowPadding,fallbackPlacements:n})}function Nt(e){if(!(!e.slide&&!e.overlap))return Rt({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:_t()})}function Wt(e){return At({padding:e.overflowPadding,apply({elements:n,availableWidth:o,availableHeight:t,rects:i}){const r=n.floating,u=Math.round(i.reference.width);o=Math.floor(o),t=Math.floor(t),r.style.setProperty("--popover-anchor-width",`${u}px`),r.style.setProperty("--popover-available-width",`${o}px`),r.style.setProperty("--popover-available-height",`${t}px`),e.sameWidth&&(r.style.width=`${u}px`),e.fitViewport&&(r.style.maxWidth=`${o}px`,r.style.maxHeight=`${t}px`)}})}function jt(e,n){if(e)return xt({element:e,padding:n.arrowPadding})}var it=c.createHook(function(n){var o=n,{store:t,modal:i=!1,portal:r=!!i,preserveTabOrder:u=!0,autoFocusOnShow:a=!0,wrapperProps:l,fixed:s=!1,flip:d=!0,shift:f=0,slide:h=!0,overlap:m=!1,sameWidth:p=!1,fitViewport:g=!1,gutter:v,arrowPadding:x=4,overflowPadding:w=8,getAnchorRect:b,updatePosition:E}=o,y=c.__objRest(o,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const S=ce.usePopoverProviderContext();t=t||S,c.invariant(t,process.env.NODE_ENV!=="production"&&"Popover must receive a `store` prop or be wrapped in a PopoverProvider component.");const $=t.useState("arrowElement"),H=t.useState("anchorElement"),L=t.useState("disclosureElement"),_=t.useState("popoverElement"),A=t.useState("contentElement"),M=t.useState("placement"),P=t.useState("mounted"),O=t.useState("rendered"),R=C.useRef(null),[T,V]=C.useState(!1),{portalRef:k,domReady:G}=c.usePortalRef(r,y.portalRef),j=c.useEvent(b),B=c.useEvent(E),U=!!E;c.useSafeLayoutEffect(()=>{if(!(_!=null&&_.isConnected))return;_.style.setProperty("--popover-overflow-padding",`${w}px`);const z=Lt(H,j),le=async()=>{if(!P)return;$||(R.current=R.current||document.createElement("div"));const ne=$||R.current,pt=[Ft(ne,{gutter:v,shift:f}),kt({flip:d,overflowPadding:w}),Nt({slide:h,shift:f,overlap:m,overflowPadding:w}),jt(ne,{arrowPadding:x}),Wt({sameWidth:p,fitViewport:g,overflowPadding:w})],oe=await Ct(z,_,{placement:M,strategy:s?"fixed":"absolute",middleware:pt});t==null||t.setState("currentPlacement",oe.placement),V(!0);const mt=Ie(oe.x),ht=Ie(oe.y);if(Object.assign(_.style,{top:"0",left:"0",transform:`translate3d(${mt}px,${ht}px,0)`}),ne&&oe.middlewareData.arrow){const{x:pe,y:me}=oe.middlewareData.arrow,Le=oe.placement.split("-")[0],he=ne.clientWidth/2,ge=ne.clientHeight/2,De=pe!=null?pe+he:-he,Fe=me!=null?me+ge:-ge;_.style.setProperty("--popover-transform-origin",{top:`${De}px calc(100% + ${ge}px)`,bottom:`${De}px ${-ge}px`,left:`calc(100% + ${he}px) ${Fe}px`,right:`${-he}px ${Fe}px`}[Le]),Object.assign(ne.style,{left:pe!=null?`${pe}px`:"",top:me!=null?`${me}px`:"",[Le]:"100%"})}},dt=Ht(z,_,async()=>{U?(await B({updatePosition:le}),V(!0)):await le()},{elementResize:typeof ResizeObserver=="function"});return()=>{V(!1),dt()}},[t,O,_,$,H,_,M,P,G,s,d,f,h,m,p,g,v,x,w,j,U,B]),c.useSafeLayoutEffect(()=>{if(!P||!G||!(_!=null&&_.isConnected)||!(A!=null&&A.isConnected))return;const z=()=>{_.style.zIndex=getComputedStyle(A).zIndex};z();let le=requestAnimationFrame(()=>{le=requestAnimationFrame(z)});return()=>cancelAnimationFrame(le)},[P,G,_,A]);const te=s?"fixed":"absolute";return y=c.useWrapElement(y,z=>c.jsxRuntimeExports.jsx("div",c.__spreadProps(c.__spreadValues({},l),{style:c.__spreadValues({position:te,top:0,left:0,width:"max-content"},l==null?void 0:l.style),ref:t==null?void 0:t.setPopoverElement,children:z})),[t,te,l]),y=c.useWrapElement(y,z=>c.jsxRuntimeExports.jsx(ce.PopoverScopedContextProvider,{value:t,children:z}),[t]),y=c.__spreadProps(c.__spreadValues({"data-placing":!T||void 0},y),{style:c.__spreadValues({position:"relative"},y.style)}),y=de.useDialog(c.__spreadProps(c.__spreadValues({store:t,modal:i,portal:r,preserveTabOrder:u,preserveTabOrderAnchor:L||H,autoFocusOnShow:T&&a},y),{portalRef:k})),y}),Bt=de.createDialogComponent(c.forwardRef2(function(n){const o=it(n);return c.createElement(Mt,o)}),ce.usePopoverProviderContext),Me=c.createStoreContext([ce.PopoverContextProvider],[ce.PopoverScopedContextProvider]),Ve=Me.useProviderContext,zt=Me.ContextProvider,st=Me.ScopedContextProvider;function ut(e={}){var n;const o=(n=e.store)==null?void 0:n.getState(),t=Je(c.__spreadProps$1(c.__spreadValues$1({},e),{placement:c.defaultValue(e.placement,o==null?void 0:o.placement,"bottom")})),i=c.defaultValue(e.timeout,o==null?void 0:o.timeout,500),r=c.__spreadProps$1(c.__spreadValues$1({},t.getState()),{timeout:i,showTimeout:c.defaultValue(e.showTimeout,o==null?void 0:o.showTimeout),hideTimeout:c.defaultValue(e.hideTimeout,o==null?void 0:o.hideTimeout),autoFocusOnShow:c.defaultValue(o==null?void 0:o.autoFocusOnShow,!1)}),u=D.createStore(r,t,e.store);return c.__spreadProps$1(c.__spreadValues$1(c.__spreadValues$1({},t),u),{setAutoFocusOnShow:a=>u.setState("autoFocusOnShow",a)})}function lt(e,n,o){return D.useStoreProps(e,o,"timeout"),D.useStoreProps(e,o,"showTimeout"),D.useStoreProps(e,o,"hideTimeout"),Ue(e,n,o)}function qt(e={}){const[n,o]=D.useStore(ut,e);return lt(n,o,e)}function Re(e){return[e.clientX,e.clientY]}function Ye(e,n){const[o,t]=e;let i=!1;const r=n.length;for(let u=r,a=0,l=u-1;a<u;l=a++){const[s,d]=n[a],[f,h]=n[l],[,m]=n[l===0?u-1:l-1]||[0,0],p=(d-h)*(o-s)-(s-f)*(t-d);if(h<d){if(t>=h&&t<d){if(p===0)return!0;p>0&&(t===h?t>m&&(i=!i):i=!i)}}else if(d<h){if(t>d&&t<=h){if(p===0)return!0;p<0&&(t===h?t<m&&(i=!i):i=!i)}}else if(t===d&&(o>=f&&o<=s||o>=s&&o<=f))return!0}return i}function It(e,n){const{top:o,right:t,bottom:i,left:r}=n,[u,a]=e,l=u<r?"left":u>t?"right":null,s=a<o?"top":a>i?"bottom":null;return[l,s]}function Ge(e,n){const o=e.getBoundingClientRect(),{top:t,right:i,bottom:r,left:u}=o,[a,l]=It(n,o),s=[n];return a?(l!=="top"&&s.push([a==="left"?u:i,t]),s.push([a==="left"?i:u,t]),s.push([a==="left"?i:u,r]),l!=="bottom"&&s.push([a==="left"?u:i,r])):l==="top"?(s.push([u,t]),s.push([u,r]),s.push([i,r]),s.push([i,t])):(s.push([u,r]),s.push([u,t]),s.push([i,t]),s.push([i,r])),s}var Yt="div";function ct(e,n,o,t){return c.hasFocusWithin(n)?!0:e?!!(c.contains(n,e)||o&&c.contains(o,e)||t!=null&&t.some(i=>ct(e,i,o))):!1}function Gt(e){var n=e,{store:o}=n,t=c.__objRest(n,["store"]);const[i,r]=C.useState(!1),u=o.useState("mounted");C.useEffect(()=>{u||r(!1)},[u]);const a=t.onFocus,l=c.useEvent(d=>{a==null||a(d),!d.defaultPrevented&&r(!0)}),s=C.useRef(null);return C.useEffect(()=>D.sync(o,["anchorElement"],d=>{s.current=d.anchorElement}),[]),t=c.__spreadProps(c.__spreadValues({autoFocusOnHide:i,finalFocus:s},t),{onFocus:l}),t}var Xe=C.createContext(null),at=c.createHook(function(n){var o=n,{store:t,modal:i=!1,portal:r=!!i,hideOnEscape:u=!0,hideOnHoverOutside:a=!0,disablePointerEventsOnApproach:l=!!a}=o,s=c.__objRest(o,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const d=Ve();t=t||d,c.invariant(t,process.env.NODE_ENV!=="production"&&"Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component.");const f=C.useRef(null),[h,m]=C.useState([]),p=C.useRef(0),g=C.useRef(null),{portalRef:v,domReady:x}=c.usePortalRef(r,s.portalRef),w=c.useIsMouseMoving(),b=!!a,E=c.useBooleanEvent(a),y=!!l,S=c.useBooleanEvent(l),$=t.useState("open"),H=t.useState("mounted");C.useEffect(()=>{if(!x||!H||!b&&!y)return;const P=f.current;if(!P)return;const O=R=>{if(!t||!w())return;const{anchorElement:T,hideTimeout:V,timeout:k}=t.getState(),G=g.current,[j]=R.composedPath(),B=T;if(ct(j,P,B,h)){g.current=j&&B&&c.contains(B,j)?Re(R):null,window.clearTimeout(p.current),p.current=0;return}if(!p.current){if(G){const U=Re(R),te=Ge(P,G);if(Ye(U,te)){if(g.current=U,!S(R))return;R.preventDefault(),R.stopPropagation();return}}E(R)&&(p.current=window.setTimeout(()=>{p.current=0,t==null||t.hide()},V??k))}};return c.chain(c.addGlobalEventListener("mousemove",O,!0),()=>clearTimeout(p.current))},[t,w,x,H,b,y,h,S,E]),C.useEffect(()=>{if(!x||!H||!y)return;const P=O=>{const R=f.current;if(!R)return;const T=g.current;if(!T)return;const V=Ge(R,T);if(Ye(Re(O),V)){if(!S(O))return;O.preventDefault(),O.stopPropagation()}};return c.chain(c.addGlobalEventListener("mouseenter",P,!0),c.addGlobalEventListener("mouseover",P,!0),c.addGlobalEventListener("mouseout",P,!0),c.addGlobalEventListener("mouseleave",P,!0))},[x,H,y,S]),C.useEffect(()=>{x&&($||t==null||t.setAutoFocusOnShow(!1))},[t,x,$]);const L=c.useLiveRef($);C.useEffect(()=>{if(x)return()=>{L.current||t==null||t.setAutoFocusOnShow(!1)}},[t,x]);const _=C.useContext(Xe);c.useSafeLayoutEffect(()=>{if(i||!r||!H||!x)return;const P=f.current;if(P)return _==null?void 0:_(P)},[i,r,H,x]);const A=C.useCallback(P=>{m(R=>[...R,P]);const O=_==null?void 0:_(P);return()=>{m(R=>R.filter(T=>T!==P)),O==null||O()}},[_]);s=c.useWrapElement(s,P=>c.jsxRuntimeExports.jsx(st,{value:t,children:c.jsxRuntimeExports.jsx(Xe.Provider,{value:A,children:P})}),[t,A]),s=c.__spreadProps(c.__spreadValues({},s),{ref:c.useMergeRefs(f,s.ref)}),s=Gt(c.__spreadValues({store:t},s));const M=t.useState(P=>i||P.autoFocusOnShow);return s=it(c.__spreadProps(c.__spreadValues({store:t,modal:i,portal:r,autoFocusOnShow:M},s),{portalRef:v,hideOnEscape(P){return c.isFalsyBooleanCallback(u,P)?!1:(requestAnimationFrame(()=>{requestAnimationFrame(()=>{t==null||t.hide()})}),!0)}})),s}),Xt=de.createDialogComponent(c.forwardRef2(function(n){const o=at(n);return c.createElement(Yt,o)}),Ve),Jt="a",ft=c.createHook(function(n){var o=n,{store:t,showOnHover:i=!0}=o,r=c.__objRest(o,["store","showOnHover"]);const u=Ve();t=t||u,c.invariant(t,process.env.NODE_ENV!=="production"&&"HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component.");const a=c.disabledFromProps(r),l=C.useRef(0);C.useEffect(()=>()=>window.clearTimeout(l.current),[]),C.useEffect(()=>{const v=x=>{if(!t)return;const{anchorElement:w}=t.getState();w&&x.target===w&&(window.clearTimeout(l.current),l.current=0)};return c.addGlobalEventListener("mouseleave",v,!0)},[t]);const s=r.onMouseMove,d=c.useBooleanEvent(i),f=c.useIsMouseMoving(),h=c.useEvent(v=>{if(s==null||s(v),a||!t||v.defaultPrevented||l.current||!f()||!d(v))return;const x=v.currentTarget;t.setAnchorElement(x),t.setDisclosureElement(x);const{showTimeout:w,timeout:b}=t.getState(),E=()=>{l.current=0,f()&&(t==null||t.setAnchorElement(x),t==null||t.show(),queueMicrotask(()=>{t==null||t.setDisclosureElement(x)}))},y=w??b;y===0?E():l.current=window.setTimeout(E,y)}),m=r.onClick,p=c.useEvent(v=>{m==null||m(v),t&&(window.clearTimeout(l.current),l.current=0)}),g=C.useCallback(v=>{if(!t)return;const{anchorElement:x}=t.getState();x!=null&&x.isConnected||t.setAnchorElement(v)},[t]);return r=c.__spreadProps(c.__spreadValues({},r),{ref:c.useMergeRefs(g,r.ref),onMouseMove:h,onClick:p}),r=c.useFocusable(r),r}),Ut=c.forwardRef2(function(n){const o=ft(n);return c.createElement(Jt,o)});exports.Hovercard=Xt;exports.HovercardAnchor=Ut;exports.HovercardContextProvider=zt;exports.HovercardScopedContextProvider=st;exports.Popover=Bt;exports.createHovercardStore=ut;exports.useHovercard=at;exports.useHovercardAnchor=ft;exports.useHovercardStore=qt;exports.useHovercardStoreProps=lt;exports.usePopoverStore=gt;
|
package/dist/Badge.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),e=require("@xstyled/styled-components"),b=require("./System.js"),f=e.div(({disabled:t,length:d,size:s,variant:a})=>e.css`
|
|
2
|
-
${e.th("badges.default")};
|
|
3
|
-
${e.th(`badges.variants.${a}`)};
|
|
4
|
-
${e.th(`badges.sizes.${s}`)};
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
${e.system};
|
|
9
|
-
|
|
10
|
-
${t&&e.css`
|
|
11
|
-
${e.th(`badges.disabled.${a}`)};
|
|
12
|
-
`}
|
|
13
|
-
|
|
14
|
-
${d===1&&e.css`
|
|
15
|
-
width: ${e.th(`badges.sizes.${s}.height`)};
|
|
16
|
-
`}
|
|
17
|
-
`),n=b.forwardRef(({children:t,dataTestId:d,disabled:s,size:a="md",variant:g="default",withNumberAbbreviation:r,...l},c)=>{let i;const o=Number.isInteger(t),u=t.toString().length;return o&&r&&t>99?i="99+":i=t,$.createElement(f,{"data-testid":d,disabled:s,length:u,ref:c,size:a,variant:g,...l},i)});n.displayName="Badge";exports.Badge=n;
|
package/dist/Box.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),o=require("@xstyled/styled-components"),c=require("./System.js"),n=c.forwardRef((e,t)=>r.createElement(o.x.div,{ref:t,...e}));exports.Box=n;
|