boreal-ui 0.0.896 → 0.0.897
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/core/Dropdown-CpVnd2Rl.cjs +1 -0
- package/dist/core/Dropdown-DJt7qBhC.js +482 -0
- package/dist/core/Dropdown.cjs.js +1 -1
- package/dist/core/Dropdown.css +1 -1
- package/dist/core/Dropdown.js +1 -1
- package/dist/core/Sidebar-C0HYR4mK.js +403 -0
- package/dist/core/Sidebar-DtZeE-tR.cjs +1 -0
- package/dist/core/Sidebar.cjs.js +1 -1
- package/dist/core/Sidebar.js +1 -1
- package/dist/core/index.cjs.js +3 -3
- package/dist/core/index.js +168 -15
- package/dist/generated-docs/Sidebar.props.js +153 -0
- package/dist/next/Dropdown-ghc8m7E8.js +486 -0
- package/dist/next/Dropdown.css +1 -1
- package/dist/next/Dropdown.js +1 -1
- package/dist/next/Sidebar-DBrOAu-S.js +408 -0
- package/dist/next/Sidebar.js +1 -1
- package/dist/next/index.js +165 -12
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +15 -0
- package/dist/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/dist/types/components/Dropdown/DropdownBase.d.ts.map +1 -1
- package/dist/types/components/Dropdown/core/Dropdown.d.ts.map +1 -1
- package/dist/types/components/Sidebar/Sidebar.types.d.ts +68 -0
- package/dist/types/components/Sidebar/Sidebar.types.d.ts.map +1 -1
- package/dist/types/components/Sidebar/SidebarBase.d.ts.map +1 -1
- package/dist/types/generated-docs/Sidebar.props.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/core/Dropdown-Bn5CJ_cq.js +0 -326
- package/dist/core/Dropdown-uphBEoU4.cjs +0 -1
- package/dist/core/Sidebar-BcSPbLsY.cjs +0 -1
- package/dist/core/Sidebar-Bh2jCCus.js +0 -331
- package/dist/next/Dropdown-tmE5RI-T.js +0 -330
- package/dist/next/Sidebar-DYNqARud.js +0 -336
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./Dropdown.css');const i=require("react/jsx-runtime"),We=require("./propAliases-Bfsf5cJN.cjs"),a=require("react"),$=require("./classNames-C7V3kfBj.cjs"),B=require("./capitalize-CnTiekgk.cjs"),I=require("./boreal-style-config-BB8MdwYx.cjs"),qe=require("./IconButton-O0x6cSnS.cjs"),He=o=>i.jsxs("svg",{width:"24px",height:"24px",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",...o,children:[i.jsx("path",{d:"M3 5H21",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M3 19H21",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),A="root",w=8,Te=(o,h)=>o?`${o}.${h}`:`${h}`,ae=o=>{const h=o.split(".");return h.length<=1?null:h.slice(0,-1).join(".")},Pe=(o,h)=>o===h||(o==null?void 0:o.startsWith(`${h}.`))===!0,se=o=>Array.isArray(o.items)&&o.items.length>0,ie=o=>o.getAttribute("aria-disabled")==="true"||o instanceof HTMLButtonElement&&o.disabled,ue=({triggerIcon:o,items:h,align:K="right",className:ce="",menuClassName:U="","aria-label":V="Dropdown menu","aria-labelledby":Y,"aria-describedby":fe,menuAriaLabel:we,menuAriaLabelledby:J,menuAriaDescribedby:he,menuId:be,triggerId:pe,focusFirstItemOnOpen:Q=!0,closeOnSelect:z=!0,theme:E=I.getDefaultTheme(),glass:R=I.getDefaultGlass(),toggleRounding:me=I.getDefaultRounding(),menuRounding:C=I.getDefaultRounding(),toggleShadow:ge=I.getDefaultShadow(),menuShadow:v=I.getDefaultShadow(),toggleOutline:ye=!1,state:S="",title:ke,triggerProps:xe,menuProps:b,"data-testid":_e,testId:W=_e??"dropdown",IconButton:Ie,classMap:r,...Ce})=>{const[f,X]=a.useState(!1),[Z,L]=a.useState(null),[ve,M]=a.useState({}),q=a.useRef(null),k=a.useRef(null),ee=a.useRef(null),Le=a.useId(),O=be??Le,De=o??He,x=a.useCallback(e=>e?Array.from(e.querySelectorAll('[data-dropdown-menu-item="true"]')).filter(t=>t.closest("[data-dropdown-panel]")===e&&!ie(t)):[],[]),H=a.useCallback(e=>{var t;(t=x(e)[0])==null||t.focus()},[x]),D=a.useCallback((e,t)=>{var s;const n=x(e);if(n.length===0)return;const p=(t+n.length)%n.length;(s=n[p])==null||s.focus()},[x]),te=a.useCallback(e=>{const t=()=>{const n=document.getElementById(e);n instanceof HTMLElement&&H(n)};window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t)},[H]),g=a.useCallback(()=>{if(!f||!k.current){M({});return}const e=window.innerWidth||document.documentElement.clientWidth||0,t=window.innerHeight||document.documentElement.clientHeight||0,n=`${Math.max(120,t-w*2)}px`,p=`${Math.max(160,e-w*2)}px`,s=[k.current,...Array.from(k.current.querySelectorAll("[data-dropdown-panel]"))],u={};s.forEach(d=>{const c=d.dataset.dropdownPanelPath??A,l=d.getBoundingClientRect(),N={"--dropdown-panel-max-height":n,"--dropdown-panel-max-width":p};if(c===A){u[c]={overflowLeft:l.left<w,overflowRight:l.right>e-w,style:N};return}const y=d.closest('[data-dropdown-item-wrapper="true"]'),_=y==null?void 0:y.getBoundingClientRect(),P=Math.max(l.width,d.offsetWidth,160),de=_?e-_.right-w:e-l.right-w,Re=_?_.left-w:l.left-w,Se=de>=P||de>=Re?"right":"left";let j=0;l.bottom>t-w&&(j-=l.bottom-(t-w)),l.top+j<w&&(j+=w-(l.top+j)),N["--dropdown-panel-offset-y"]=`${Math.round(j)}px`,u[c]={placement:Se,style:N}}),M(u)},[f]),Ne=()=>{X(e=>(e&&L(null),!e))},m=a.useCallback(()=>{var e,t;X(!1),L(null),(t=(e=ee.current)==null?void 0:e.focus)==null||t.call(e)},[]),T=a.useCallback(e=>{L(t=>t===e||t!=null&&t.startsWith(`${e}.`)?t:e)},[]),ne=a.useCallback(e=>{L(t=>t===e||t!=null&&t.startsWith(`${e}.`)?ae(e):e)},[]),je=a.useCallback(e=>{var t;e.disabled||se(e)||((t=e.onClick)==null||t.call(e),z&&m())},[m,z]);a.useLayoutEffect(()=>{f&&g()},[h,f,Z,g]),a.useEffect(()=>{if(f)return window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[f,g]),a.useEffect(()=>{f&&Q&&H(k.current)},[H,Q,f]),a.useEffect(()=>{const e=t=>{q.current&&!q.current.contains(t.target)&&m()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m]);const $e=a.useCallback(e=>{var u;if(!f)return;const t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=(t==null?void 0:t.closest("[data-dropdown-panel]"))??k.current;if(e.key==="Escape"){e.preventDefault(),m();return}if(e.key==="Tab"){m();return}const p=x(n),s=t?p.indexOf(t):-1;if(e.key==="ArrowDown"){e.preventDefault(),D(n,s+1);return}if(e.key==="ArrowUp"){e.preventDefault(),D(n,s<0?p.length-1:s-1);return}if(e.key==="Home"){e.preventDefault(),D(n,0);return}if(e.key==="End"){e.preventDefault(),D(n,p.length-1);return}if(e.key==="ArrowRight"){const d=t==null?void 0:t.dataset.dropdownItemPath,c=t==null?void 0:t.getAttribute("aria-controls");(t==null?void 0:t.dataset.dropdownHasSubmenu)==="true"&&d&&c&&(e.preventDefault(),T(d),te(c));return}if(e.key==="ArrowLeft"){const d=n==null?void 0:n.dataset.dropdownPanelPath;if(d&&d!==A){e.preventDefault();const c=ae(d);L(c);const l=(u=q.current)==null?void 0:u.querySelector(`[data-dropdown-item-path="${d}"][data-dropdown-menu-item="true"]`);l==null||l.focus()}return}if(e.key==="Enter"||e.key===" "){const d=(t==null?void 0:t.dataset.dropdownMenuItem)==="true"?t:null;if(!d||ie(d))return;if(e.preventDefault(),d.dataset.dropdownHasSubmenu==="true"){const c=d.dataset.dropdownItemPath;c&&ne(c);return}d.click()}},[m,D,te,x,f,T,ne]),Ae=a.useMemo(()=>$.combineClassNames(r.menu,K==="right"?r.alignRight:r.alignLeft,r[E],r[S],R&&r.glass,v&&r[`shadow${B.capitalize(v)}`],C&&r[`round${B.capitalize(C)}`],U,b==null?void 0:b.className),[r,K,E,S,R,v,C,U,b==null?void 0:b.className]),re=e=>{const t=ve[e];return{"data-overflow-left":t!=null&&t.overflowLeft?"true":void 0,"data-overflow-right":t!=null&&t.overflowRight?"true":void 0,"data-placement":t==null?void 0:t.placement,style:t==null?void 0:t.style}},Ee=e=>$.combineClassNames(r.menu,r.submenu,e&&r.submenuOpen,r[E],r[S],R&&r.glass,v&&r[`shadow${B.capitalize(v)}`],C&&r[`round${B.capitalize(C)}`]),F=(e,t)=>i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:r.itemContent,children:[e.icon&&i.jsx("span",{className:r.icon,"aria-hidden":"true",children:e.icon}),e.label]}),t&&i.jsx("span",{className:r.submenuIndicator,"aria-hidden":"true",children:"›"})]}),oe=(e,t="")=>e.map((n,p)=>{const s=Te(t,p),u=se(n),d=u&&Pe(Z,s),c=n["data-testid"]??n.testId,l=n.submenuId??`${O}-${s}-submenu`,N=$.combineClassNames(r.item,u&&r.submenuTrigger,n.disabled?r.disabled:""),y={id:n.id,className:N,"aria-label":n["aria-label"],"aria-describedby":n["aria-describedby"],"aria-current":n["aria-current"],"aria-disabled":n.disabled||void 0,"aria-haspopup":u?"menu":void 0,"aria-expanded":u?d:void 0,"aria-controls":u?l:void 0,title:n.title,"data-dropdown-menu-item":"true","data-dropdown-item-path":s,"data-dropdown-has-submenu":u?"true":void 0,"data-testid":c};return i.jsxs("div",{className:$.combineClassNames(r.itemWrapper,u&&r.hasSubmenu),"data-dropdown-item-wrapper":"true","data-dropdown-item-path":s,onMouseEnter:()=>{u&&!n.disabled&&T(s)},children:[u?i.jsx("button",{type:"button",disabled:n.disabled,...y,onClick:()=>{n.disabled||T(s)},children:F(n,!0)}):n.href?i.jsx("a",{href:n.disabled?void 0:n.href,target:n.disabled?void 0:n.target,rel:n.rel??(n.target==="_blank"?"noopener noreferrer":void 0),...y,onClick:_=>{var P;if(n.disabled){_.preventDefault();return}(P=n.onClick)==null||P.call(n),z&&m()},children:F(n,!1)}):i.jsx("button",{type:"button",disabled:n.disabled,...y,onClick:()=>je(n),children:F(n,!1)}),u&&d&&i.jsx("div",{id:l,className:Ee(d),"aria-label":n.submenuAriaLabel??n.label,"data-dropdown-panel":"true","data-dropdown-panel-path":s,"data-testid":c?`${c}-submenu`:`${W}-${s}-submenu`,...re(s),children:oe(n.items??[],s)})]},n.id??s)}),G=re(A);return i.jsxs("div",{ref:q,className:$.combineClassNames(r.wrapper,ce),onKeyDown:$e,"data-testid":W,...Ce,children:[i.jsx(Ie,{ref:ee,id:pe,icon:De,"aria-label":Y?void 0:V,"aria-labelledby":Y,"aria-describedby":fe,"aria-haspopup":"menu","aria-expanded":f,"aria-controls":O,rounding:me,shadow:ge,outline:ye,glass:R,theme:E,state:S,onClick:Ne,title:ke,"data-testid":`${W}-trigger`,...xe}),f&&i.jsx("div",{...b,id:O,ref:k,"aria-label":J?void 0:we??V,"aria-labelledby":J,"aria-describedby":he,className:Ae,"data-dropdown-panel":"true","data-dropdown-panel-path":A,"data-overflow-left":G["data-overflow-left"],"data-overflow-right":G["data-overflow-right"],"data-testid":`${W}-menu`,style:{...G.style,...b==null?void 0:b.style},children:oe(h)})]})};ue.displayName="BaseDropdown";const Be={wrapper:"dropdown",menu:"dropdown_menu",item:"dropdown_item",itemWrapper:"dropdown_itemWrapper",itemContent:"dropdown_itemContent",icon:"dropdown_icon",hasSubmenu:"dropdown_hasSubmenu",submenu:"dropdown_submenu",submenuOpen:"dropdown_submenu_open",submenuTrigger:"dropdown_submenuTrigger",submenuIndicator:"dropdown_submenuIndicator",alignRight:"dropdown_menu_right",alignLeft:"dropdown_menu_left",primary:"dropdown_primary",secondary:"dropdown_secondary",tertiary:"dropdown_tertiary",quaternary:"dropdown_quaternary",clear:"dropdown_clear",success:"dropdown_success",error:"dropdown_error",warning:"dropdown_warning",disabled:"dropdown_disabled",glass:"dropdown_glass",shadowNone:"menu_shadow-None",shadowLight:"menu_shadow-Light",shadowMedium:"menu_shadow-Medium",shadowStrong:"menu_shadow-Strong",shadowIntense:"menu_shadow-Intense",roundNone:"menu_round-None",roundSmall:"menu_round-Small",roundMedium:"menu_round-Medium",roundLarge:"menu_round-Large"},le=o=>i.jsx(ue,{...o,IconButton:qe.IconButton,classMap:We.expandClassMap(Be)});le.displayName="Dropdown";exports.Dropdown=le;
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import { jsxs as W, jsx as f, Fragment as Be } from "react/jsx-runtime";
|
|
2
|
+
import { e as Oe } from "./propAliases-XRHC6471.js";
|
|
3
|
+
import { useState as K, useRef as U, useId as je, useCallback as p, useLayoutEffect as ze, useEffect as V, useMemo as Fe } from "react";
|
|
4
|
+
import { c as $ } from "./classNames-Dz0_huu_.js";
|
|
5
|
+
import { c as O } from "./capitalize-D_pj4b3P.js";
|
|
6
|
+
import { g as Ge, f as Ke, b as ue, a as le } from "./boreal-style-config-rYvfCHLY.js";
|
|
7
|
+
import { I as Ue } from "./IconButton-Dq8m4yuP.js";
|
|
8
|
+
import './Dropdown.css';const Ve = (o) => /* @__PURE__ */ W(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
width: "24px",
|
|
12
|
+
height: "24px",
|
|
13
|
+
strokeWidth: "1.5",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
color: "currentColor",
|
|
18
|
+
...o,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ f(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
d: "M3 5H21",
|
|
24
|
+
stroke: "currentColor",
|
|
25
|
+
strokeWidth: "1.5",
|
|
26
|
+
strokeLinecap: "round",
|
|
27
|
+
strokeLinejoin: "round"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ f(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M3 12H21",
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
strokeWidth: "1.5",
|
|
36
|
+
strokeLinecap: "round",
|
|
37
|
+
strokeLinejoin: "round"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ f(
|
|
41
|
+
"path",
|
|
42
|
+
{
|
|
43
|
+
d: "M3 19H21",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "1.5",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
), A = "root", c = 8, Ye = (o, w) => o ? `${o}.${w}` : `${w}`, ce = (o) => {
|
|
53
|
+
const w = o.split(".");
|
|
54
|
+
return w.length <= 1 ? null : w.slice(0, -1).join(".");
|
|
55
|
+
}, Je = (o, w) => o === w || (o == null ? void 0 : o.startsWith(`${w}.`)) === !0, fe = (o) => Array.isArray(o.items) && o.items.length > 0, we = (o) => o.getAttribute("aria-disabled") === "true" || o instanceof HTMLButtonElement && o.disabled, he = ({
|
|
56
|
+
triggerIcon: o,
|
|
57
|
+
items: w,
|
|
58
|
+
align: Y = "right",
|
|
59
|
+
className: pe = "",
|
|
60
|
+
menuClassName: J = "",
|
|
61
|
+
"aria-label": Q = "Dropdown menu",
|
|
62
|
+
"aria-labelledby": X,
|
|
63
|
+
"aria-describedby": me,
|
|
64
|
+
menuAriaLabel: be,
|
|
65
|
+
menuAriaLabelledby: Z,
|
|
66
|
+
menuAriaDescribedby: ge,
|
|
67
|
+
menuId: ye,
|
|
68
|
+
triggerId: _e,
|
|
69
|
+
focusFirstItemOnOpen: M = !0,
|
|
70
|
+
closeOnSelect: j = !0,
|
|
71
|
+
theme: E = Ge(),
|
|
72
|
+
glass: H = Ke(),
|
|
73
|
+
toggleRounding: Ie = ue(),
|
|
74
|
+
menuRounding: v = ue(),
|
|
75
|
+
toggleShadow: ke = le(),
|
|
76
|
+
menuShadow: L = le(),
|
|
77
|
+
toggleOutline: ve = !1,
|
|
78
|
+
state: S = "",
|
|
79
|
+
title: Le,
|
|
80
|
+
triggerProps: De,
|
|
81
|
+
menuProps: h,
|
|
82
|
+
"data-testid": xe,
|
|
83
|
+
testId: R = xe ?? "dropdown",
|
|
84
|
+
IconButton: Ce,
|
|
85
|
+
classMap: r,
|
|
86
|
+
...Ne
|
|
87
|
+
}) => {
|
|
88
|
+
const [l, ee] = K(!1), [te, D] = K(null), [$e, ne] = K({}), T = U(null), _ = U(null), re = U(null), Ae = je(), z = ye ?? Ae, We = o ?? Ve, I = p((e) => e ? Array.from(
|
|
89
|
+
e.querySelectorAll('[data-dropdown-menu-item="true"]')
|
|
90
|
+
).filter((t) => t.closest("[data-dropdown-panel]") === e && !we(t)) : [], []), P = p(
|
|
91
|
+
(e) => {
|
|
92
|
+
var t;
|
|
93
|
+
(t = I(e)[0]) == null || t.focus();
|
|
94
|
+
},
|
|
95
|
+
[I]
|
|
96
|
+
), x = p(
|
|
97
|
+
(e, t) => {
|
|
98
|
+
var a;
|
|
99
|
+
const n = I(e);
|
|
100
|
+
if (n.length === 0) return;
|
|
101
|
+
const m = (t + n.length) % n.length;
|
|
102
|
+
(a = n[m]) == null || a.focus();
|
|
103
|
+
},
|
|
104
|
+
[I]
|
|
105
|
+
), oe = p(
|
|
106
|
+
(e) => {
|
|
107
|
+
const t = () => {
|
|
108
|
+
const n = document.getElementById(e);
|
|
109
|
+
n instanceof HTMLElement && P(n);
|
|
110
|
+
};
|
|
111
|
+
window.requestAnimationFrame ? window.requestAnimationFrame(t) : window.setTimeout(t);
|
|
112
|
+
},
|
|
113
|
+
[P]
|
|
114
|
+
), g = p(() => {
|
|
115
|
+
if (!l || !_.current) {
|
|
116
|
+
ne({});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const e = window.innerWidth || document.documentElement.clientWidth || 0, t = window.innerHeight || document.documentElement.clientHeight || 0, n = `${Math.max(120, t - c * 2)}px`, m = `${Math.max(160, e - c * 2)}px`, a = [
|
|
120
|
+
_.current,
|
|
121
|
+
...Array.from(
|
|
122
|
+
_.current.querySelectorAll("[data-dropdown-panel]")
|
|
123
|
+
)
|
|
124
|
+
], s = {};
|
|
125
|
+
a.forEach((d) => {
|
|
126
|
+
const u = d.dataset.dropdownPanelPath ?? A, i = d.getBoundingClientRect(), C = {
|
|
127
|
+
"--dropdown-panel-max-height": n,
|
|
128
|
+
"--dropdown-panel-max-width": m
|
|
129
|
+
};
|
|
130
|
+
if (u === A) {
|
|
131
|
+
s[u] = {
|
|
132
|
+
overflowLeft: i.left < c,
|
|
133
|
+
overflowRight: i.right > e - c,
|
|
134
|
+
style: C
|
|
135
|
+
};
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const y = d.closest(
|
|
139
|
+
'[data-dropdown-item-wrapper="true"]'
|
|
140
|
+
), k = y == null ? void 0 : y.getBoundingClientRect(), B = Math.max(i.width, d.offsetWidth, 160), ie = k ? e - k.right - c : e - i.right - c, Pe = k ? k.left - c : i.left - c, qe = ie >= B || ie >= Pe ? "right" : "left";
|
|
141
|
+
let N = 0;
|
|
142
|
+
i.bottom > t - c && (N -= i.bottom - (t - c)), i.top + N < c && (N += c - (i.top + N)), C["--dropdown-panel-offset-y"] = `${Math.round(N)}px`, s[u] = {
|
|
143
|
+
placement: qe,
|
|
144
|
+
style: C
|
|
145
|
+
};
|
|
146
|
+
}), ne(s);
|
|
147
|
+
}, [l]), Ee = () => {
|
|
148
|
+
ee((e) => (e && D(null), !e));
|
|
149
|
+
}, b = p(() => {
|
|
150
|
+
var e, t;
|
|
151
|
+
ee(!1), D(null), (t = (e = re.current) == null ? void 0 : e.focus) == null || t.call(e);
|
|
152
|
+
}, []), q = p((e) => {
|
|
153
|
+
D((t) => t === e || t != null && t.startsWith(`${e}.`) ? t : e);
|
|
154
|
+
}, []), de = p((e) => {
|
|
155
|
+
D((t) => t === e || t != null && t.startsWith(`${e}.`) ? ce(e) : e);
|
|
156
|
+
}, []), He = p(
|
|
157
|
+
(e) => {
|
|
158
|
+
var t;
|
|
159
|
+
e.disabled || fe(e) || ((t = e.onClick) == null || t.call(e), j && b());
|
|
160
|
+
},
|
|
161
|
+
[b, j]
|
|
162
|
+
);
|
|
163
|
+
ze(() => {
|
|
164
|
+
l && g();
|
|
165
|
+
}, [w, l, te, g]), V(() => {
|
|
166
|
+
if (l)
|
|
167
|
+
return window.addEventListener("resize", g), window.addEventListener("scroll", g, !0), () => {
|
|
168
|
+
window.removeEventListener("resize", g), window.removeEventListener("scroll", g, !0);
|
|
169
|
+
};
|
|
170
|
+
}, [l, g]), V(() => {
|
|
171
|
+
l && M && P(_.current);
|
|
172
|
+
}, [P, M, l]), V(() => {
|
|
173
|
+
const e = (t) => {
|
|
174
|
+
T.current && !T.current.contains(t.target) && b();
|
|
175
|
+
};
|
|
176
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
177
|
+
}, [b]);
|
|
178
|
+
const Se = p(
|
|
179
|
+
(e) => {
|
|
180
|
+
var s;
|
|
181
|
+
if (!l) return;
|
|
182
|
+
const t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = (t == null ? void 0 : t.closest("[data-dropdown-panel]")) ?? _.current;
|
|
183
|
+
if (e.key === "Escape") {
|
|
184
|
+
e.preventDefault(), b();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (e.key === "Tab") {
|
|
188
|
+
b();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const m = I(n), a = t ? m.indexOf(t) : -1;
|
|
192
|
+
if (e.key === "ArrowDown") {
|
|
193
|
+
e.preventDefault(), x(n, a + 1);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (e.key === "ArrowUp") {
|
|
197
|
+
e.preventDefault(), x(
|
|
198
|
+
n,
|
|
199
|
+
a < 0 ? m.length - 1 : a - 1
|
|
200
|
+
);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (e.key === "Home") {
|
|
204
|
+
e.preventDefault(), x(n, 0);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (e.key === "End") {
|
|
208
|
+
e.preventDefault(), x(n, m.length - 1);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (e.key === "ArrowRight") {
|
|
212
|
+
const d = t == null ? void 0 : t.dataset.dropdownItemPath, u = t == null ? void 0 : t.getAttribute("aria-controls");
|
|
213
|
+
(t == null ? void 0 : t.dataset.dropdownHasSubmenu) === "true" && d && u && (e.preventDefault(), q(d), oe(u));
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (e.key === "ArrowLeft") {
|
|
217
|
+
const d = n == null ? void 0 : n.dataset.dropdownPanelPath;
|
|
218
|
+
if (d && d !== A) {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
const u = ce(d);
|
|
221
|
+
D(u);
|
|
222
|
+
const i = (s = T.current) == null ? void 0 : s.querySelector(
|
|
223
|
+
`[data-dropdown-item-path="${d}"][data-dropdown-menu-item="true"]`
|
|
224
|
+
);
|
|
225
|
+
i == null || i.focus();
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
230
|
+
const d = (t == null ? void 0 : t.dataset.dropdownMenuItem) === "true" ? t : null;
|
|
231
|
+
if (!d || we(d)) return;
|
|
232
|
+
if (e.preventDefault(), d.dataset.dropdownHasSubmenu === "true") {
|
|
233
|
+
const u = d.dataset.dropdownItemPath;
|
|
234
|
+
u && de(u);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
d.click();
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
[
|
|
241
|
+
b,
|
|
242
|
+
x,
|
|
243
|
+
oe,
|
|
244
|
+
I,
|
|
245
|
+
l,
|
|
246
|
+
q,
|
|
247
|
+
de
|
|
248
|
+
]
|
|
249
|
+
), Re = Fe(
|
|
250
|
+
() => $(
|
|
251
|
+
r.menu,
|
|
252
|
+
Y === "right" ? r.alignRight : r.alignLeft,
|
|
253
|
+
r[E],
|
|
254
|
+
r[S],
|
|
255
|
+
H && r.glass,
|
|
256
|
+
L && r[`shadow${O(L)}`],
|
|
257
|
+
v && r[`round${O(v)}`],
|
|
258
|
+
J,
|
|
259
|
+
h == null ? void 0 : h.className
|
|
260
|
+
),
|
|
261
|
+
[
|
|
262
|
+
r,
|
|
263
|
+
Y,
|
|
264
|
+
E,
|
|
265
|
+
S,
|
|
266
|
+
H,
|
|
267
|
+
L,
|
|
268
|
+
v,
|
|
269
|
+
J,
|
|
270
|
+
h == null ? void 0 : h.className
|
|
271
|
+
]
|
|
272
|
+
), ae = (e) => {
|
|
273
|
+
const t = $e[e];
|
|
274
|
+
return {
|
|
275
|
+
"data-overflow-left": t != null && t.overflowLeft ? "true" : void 0,
|
|
276
|
+
"data-overflow-right": t != null && t.overflowRight ? "true" : void 0,
|
|
277
|
+
"data-placement": t == null ? void 0 : t.placement,
|
|
278
|
+
style: t == null ? void 0 : t.style
|
|
279
|
+
};
|
|
280
|
+
}, Te = (e) => $(
|
|
281
|
+
r.menu,
|
|
282
|
+
r.submenu,
|
|
283
|
+
e && r.submenuOpen,
|
|
284
|
+
r[E],
|
|
285
|
+
r[S],
|
|
286
|
+
H && r.glass,
|
|
287
|
+
L && r[`shadow${O(L)}`],
|
|
288
|
+
v && r[`round${O(v)}`]
|
|
289
|
+
), F = (e, t) => /* @__PURE__ */ W(Be, { children: [
|
|
290
|
+
/* @__PURE__ */ W("span", { className: r.itemContent, children: [
|
|
291
|
+
e.icon && /* @__PURE__ */ f("span", { className: r.icon, "aria-hidden": "true", children: e.icon }),
|
|
292
|
+
e.label
|
|
293
|
+
] }),
|
|
294
|
+
t && /* @__PURE__ */ f("span", { className: r.submenuIndicator, "aria-hidden": "true", children: "›" })
|
|
295
|
+
] }), se = (e, t = "") => e.map((n, m) => {
|
|
296
|
+
const a = Ye(t, m), s = fe(n), d = s && Je(te, a), u = n["data-testid"] ?? n.testId, i = n.submenuId ?? `${z}-${a}-submenu`, C = $(
|
|
297
|
+
r.item,
|
|
298
|
+
s && r.submenuTrigger,
|
|
299
|
+
n.disabled ? r.disabled : ""
|
|
300
|
+
), y = {
|
|
301
|
+
id: n.id,
|
|
302
|
+
className: C,
|
|
303
|
+
"aria-label": n["aria-label"],
|
|
304
|
+
"aria-describedby": n["aria-describedby"],
|
|
305
|
+
"aria-current": n["aria-current"],
|
|
306
|
+
"aria-disabled": n.disabled || void 0,
|
|
307
|
+
"aria-haspopup": s ? "menu" : void 0,
|
|
308
|
+
"aria-expanded": s ? d : void 0,
|
|
309
|
+
"aria-controls": s ? i : void 0,
|
|
310
|
+
title: n.title,
|
|
311
|
+
"data-dropdown-menu-item": "true",
|
|
312
|
+
"data-dropdown-item-path": a,
|
|
313
|
+
"data-dropdown-has-submenu": s ? "true" : void 0,
|
|
314
|
+
"data-testid": u
|
|
315
|
+
};
|
|
316
|
+
return /* @__PURE__ */ W(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
className: $(
|
|
320
|
+
r.itemWrapper,
|
|
321
|
+
s && r.hasSubmenu
|
|
322
|
+
),
|
|
323
|
+
"data-dropdown-item-wrapper": "true",
|
|
324
|
+
"data-dropdown-item-path": a,
|
|
325
|
+
onMouseEnter: () => {
|
|
326
|
+
s && !n.disabled && q(a);
|
|
327
|
+
},
|
|
328
|
+
children: [
|
|
329
|
+
s ? /* @__PURE__ */ f(
|
|
330
|
+
"button",
|
|
331
|
+
{
|
|
332
|
+
type: "button",
|
|
333
|
+
disabled: n.disabled,
|
|
334
|
+
...y,
|
|
335
|
+
onClick: () => {
|
|
336
|
+
n.disabled || q(a);
|
|
337
|
+
},
|
|
338
|
+
children: F(n, !0)
|
|
339
|
+
}
|
|
340
|
+
) : n.href ? /* @__PURE__ */ f(
|
|
341
|
+
"a",
|
|
342
|
+
{
|
|
343
|
+
href: n.disabled ? void 0 : n.href,
|
|
344
|
+
target: n.disabled ? void 0 : n.target,
|
|
345
|
+
rel: n.rel ?? (n.target === "_blank" ? "noopener noreferrer" : void 0),
|
|
346
|
+
...y,
|
|
347
|
+
onClick: (k) => {
|
|
348
|
+
var B;
|
|
349
|
+
if (n.disabled) {
|
|
350
|
+
k.preventDefault();
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
(B = n.onClick) == null || B.call(n), j && b();
|
|
354
|
+
},
|
|
355
|
+
children: F(n, !1)
|
|
356
|
+
}
|
|
357
|
+
) : /* @__PURE__ */ f(
|
|
358
|
+
"button",
|
|
359
|
+
{
|
|
360
|
+
type: "button",
|
|
361
|
+
disabled: n.disabled,
|
|
362
|
+
...y,
|
|
363
|
+
onClick: () => He(n),
|
|
364
|
+
children: F(n, !1)
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
s && d && /* @__PURE__ */ f(
|
|
368
|
+
"div",
|
|
369
|
+
{
|
|
370
|
+
id: i,
|
|
371
|
+
className: Te(d),
|
|
372
|
+
"aria-label": n.submenuAriaLabel ?? n.label,
|
|
373
|
+
"data-dropdown-panel": "true",
|
|
374
|
+
"data-dropdown-panel-path": a,
|
|
375
|
+
"data-testid": u ? `${u}-submenu` : `${R}-${a}-submenu`,
|
|
376
|
+
...ae(a),
|
|
377
|
+
children: se(n.items ?? [], a)
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
n.id ?? a
|
|
383
|
+
);
|
|
384
|
+
}), G = ae(A);
|
|
385
|
+
return /* @__PURE__ */ W(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
ref: T,
|
|
389
|
+
className: $(r.wrapper, pe),
|
|
390
|
+
onKeyDown: Se,
|
|
391
|
+
"data-testid": R,
|
|
392
|
+
...Ne,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ f(
|
|
395
|
+
Ce,
|
|
396
|
+
{
|
|
397
|
+
ref: re,
|
|
398
|
+
id: _e,
|
|
399
|
+
icon: We,
|
|
400
|
+
"aria-label": X ? void 0 : Q,
|
|
401
|
+
"aria-labelledby": X,
|
|
402
|
+
"aria-describedby": me,
|
|
403
|
+
"aria-haspopup": "menu",
|
|
404
|
+
"aria-expanded": l,
|
|
405
|
+
"aria-controls": z,
|
|
406
|
+
rounding: Ie,
|
|
407
|
+
shadow: ke,
|
|
408
|
+
outline: ve,
|
|
409
|
+
glass: H,
|
|
410
|
+
theme: E,
|
|
411
|
+
state: S,
|
|
412
|
+
onClick: Ee,
|
|
413
|
+
title: Le,
|
|
414
|
+
"data-testid": `${R}-trigger`,
|
|
415
|
+
...De
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
l && /* @__PURE__ */ f(
|
|
419
|
+
"div",
|
|
420
|
+
{
|
|
421
|
+
...h,
|
|
422
|
+
id: z,
|
|
423
|
+
ref: _,
|
|
424
|
+
"aria-label": Z ? void 0 : be ?? Q,
|
|
425
|
+
"aria-labelledby": Z,
|
|
426
|
+
"aria-describedby": ge,
|
|
427
|
+
className: Re,
|
|
428
|
+
"data-dropdown-panel": "true",
|
|
429
|
+
"data-dropdown-panel-path": A,
|
|
430
|
+
"data-overflow-left": G["data-overflow-left"],
|
|
431
|
+
"data-overflow-right": G["data-overflow-right"],
|
|
432
|
+
"data-testid": `${R}-menu`,
|
|
433
|
+
style: {
|
|
434
|
+
...G.style,
|
|
435
|
+
...h == null ? void 0 : h.style
|
|
436
|
+
},
|
|
437
|
+
children: se(w)
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
};
|
|
444
|
+
he.displayName = "BaseDropdown";
|
|
445
|
+
const Qe = {
|
|
446
|
+
wrapper: "dropdown",
|
|
447
|
+
menu: "dropdown_menu",
|
|
448
|
+
item: "dropdown_item",
|
|
449
|
+
itemWrapper: "dropdown_itemWrapper",
|
|
450
|
+
itemContent: "dropdown_itemContent",
|
|
451
|
+
icon: "dropdown_icon",
|
|
452
|
+
hasSubmenu: "dropdown_hasSubmenu",
|
|
453
|
+
submenu: "dropdown_submenu",
|
|
454
|
+
submenuOpen: "dropdown_submenu_open",
|
|
455
|
+
submenuTrigger: "dropdown_submenuTrigger",
|
|
456
|
+
submenuIndicator: "dropdown_submenuIndicator",
|
|
457
|
+
alignRight: "dropdown_menu_right",
|
|
458
|
+
alignLeft: "dropdown_menu_left",
|
|
459
|
+
primary: "dropdown_primary",
|
|
460
|
+
secondary: "dropdown_secondary",
|
|
461
|
+
tertiary: "dropdown_tertiary",
|
|
462
|
+
quaternary: "dropdown_quaternary",
|
|
463
|
+
clear: "dropdown_clear",
|
|
464
|
+
success: "dropdown_success",
|
|
465
|
+
error: "dropdown_error",
|
|
466
|
+
warning: "dropdown_warning",
|
|
467
|
+
disabled: "dropdown_disabled",
|
|
468
|
+
glass: "dropdown_glass",
|
|
469
|
+
shadowNone: "menu_shadow-None",
|
|
470
|
+
shadowLight: "menu_shadow-Light",
|
|
471
|
+
shadowMedium: "menu_shadow-Medium",
|
|
472
|
+
shadowStrong: "menu_shadow-Strong",
|
|
473
|
+
shadowIntense: "menu_shadow-Intense",
|
|
474
|
+
roundNone: "menu_round-None",
|
|
475
|
+
roundSmall: "menu_round-Small",
|
|
476
|
+
roundMedium: "menu_round-Medium",
|
|
477
|
+
roundLarge: "menu_round-Large"
|
|
478
|
+
}, Xe = (o) => /* @__PURE__ */ f(he, { ...o, IconButton: Ue, classMap: Oe(Qe) });
|
|
479
|
+
Xe.displayName = "Dropdown";
|
|
480
|
+
export {
|
|
481
|
+
Xe as D
|
|
482
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Dropdown-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Dropdown-CpVnd2Rl.cjs");exports.default=e.Dropdown;
|
package/dist/core/Dropdown.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";@layer boreal-ui.reset,boreal-ui.base,boreal-ui.components,boreal-ui.overrides;@layer boreal-ui.components{.dropdown{position:relative;display:inline-block;outline:none;font-family:var(--font-family-ui)}.dropdown_trigger{cursor:pointer;display:inline-flex;align-items:center}.dropdown_trigger:focus-visible{outline:2px solid var(--focus-outline-color, var(--primary-color));outline-offset:2px;border-radius:6px}.dropdown_menu{position:absolute;top:100%;overflow:
|
|
1
|
+
@charset "UTF-8";@layer boreal-ui.reset,boreal-ui.base,boreal-ui.components,boreal-ui.overrides;@layer boreal-ui.components{.dropdown{position:relative;display:inline-block;outline:none;font-family:var(--font-family-ui)}.dropdown_trigger{cursor:pointer;display:inline-flex;align-items:center}.dropdown_trigger:focus-visible{outline:2px solid var(--focus-outline-color, var(--primary-color));outline-offset:2px;border-radius:6px}.dropdown_menu{position:absolute;top:100%;overflow:visible;margin-top:var(--spacing-xs);background-color:var(--background-color-lighter);z-index:90;padding:var(--spacing-xs) 0;width:max-content;max-width:var(--dropdown-panel-max-width, calc(100vw - 1rem) );max-height:var(--dropdown-panel-max-height, calc(100vh - 1rem) );font-family:var(--font-family-ui);font-size:var(--font-size-label);font-weight:var(--font-weight-body);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-label);animation:fade-in .2s ease-in-out}.dropdown_menu_right{right:0;transform:translate(0)}.dropdown_menu_left{left:0;transform:translate(0)}.dropdown_menu[data-overflow-right=true]{left:auto;right:0}.dropdown_menu[data-overflow-left=true]{right:auto;left:0}@media(min-width:480px){.dropdown_menu[data-overflow-right=true]{left:auto;right:0}.dropdown_menu[data-overflow-left=true]{right:auto;left:0}}@media(max-width:479.98px){.dropdown_menu{min-width:100%;max-height:50vh;overflow:hidden auto;animation:slide-up .3s ease-in-out;padding-bottom:calc(env(safe-area-inset-bottom,0px) + var(--spacing-sm))}}@media(min-width:1024px){.dropdown_menu{min-width:100%}}.dropdown_menu:focus-visible{outline:2px solid var(--focus-outline-color, var(--primary-color));outline-offset:2px}.dropdown_menu.dropdown_primary{--dropdown-glass-bg: var(--primary-glass-background);--dropdown-glass-hover-bg: var(--primary-glass-background-hover);--dropdown-glass-border: var(--primary-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--primary-color)}.dropdown_menu.dropdown_secondary{--dropdown-glass-bg: var(--secondary-glass-background);--dropdown-glass-hover-bg: var(--secondary-glass-background-hover);--dropdown-glass-border: var(--secondary-glass-border);--dropdown-glass-text: var(--text-color-secondary);color:var(--text-color-secondary);border:1px solid var(--secondary-color)}.dropdown_menu.dropdown_tertiary{--dropdown-glass-bg: var(--tertiary-glass-background);--dropdown-glass-hover-bg: var(--tertiary-glass-background-hover);--dropdown-glass-border: var(--tertiary-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--tertiary-color)}.dropdown_menu.dropdown_quaternary{--dropdown-glass-bg: var(--quaternary-glass-background);--dropdown-glass-hover-bg: var(--quaternary-glass-background-hover);--dropdown-glass-border: var(--quaternary-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--quaternary-color)}.dropdown_menu.dropdown_clear{--dropdown-glass-bg: var(--clear-glass-background);--dropdown-glass-hover-bg: var(--clear-glass-background-hover);--dropdown-glass-border: var(--clear-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--text-color-primary)}.dropdown_menu.dropdown_success{--dropdown-glass-bg: var(--success-glass-background);--dropdown-glass-hover-bg: var(--success-glass-background-hover);--dropdown-glass-border: var(--success-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--success-color)}.dropdown_menu.dropdown_error{--dropdown-glass-bg: var(--error-glass-background);--dropdown-glass-hover-bg: var(--error-glass-background-hover);--dropdown-glass-border: var(--error-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--error-color)}.dropdown_menu.dropdown_warning{--dropdown-glass-bg: var(--warning-glass-background);--dropdown-glass-hover-bg: var(--warning-glass-background-hover);--dropdown-glass-border: var(--warning-glass-border);--dropdown-glass-text: var(--text-color-primary);color:var(--text-color-primary);border:1px solid var(--warning-color)}.dropdown_menu.dropdown_glass{background:var(--dropdown-glass-bg, rgba(255, 255, 255, .18));border:1px solid var(--dropdown-glass-border, rgba(255, 255, 255, .34));-webkit-backdrop-filter:blur(16px) saturate(var(--glass-saturate));backdrop-filter:blur(16px) saturate(var(--glass-saturate));color:var(--dropdown-glass-text, var(--text-color-primary));box-shadow:var(--box-shadow-md)}.dropdown_item{display:flex;align-items:center;justify-content:flex-start;gap:var(--spacing-sm);line-height:var(--line-height-label);width:100%;background:none;border:none;padding:var(--spacing-sm) var(--spacing-md);font-family:var(--font-family-ui);font-size:var(--font-size-label);font-weight:var(--font-weight-label);letter-spacing:var(--letter-spacing-label);color:var(--text-color-primary);cursor:pointer;text-align:left;transition:background-color var(--transition-default),transform var(--transition-default),box-shadow var(--transition-default)}.dropdown_item:hover,.dropdown_item:focus{background-color:var(--dropdown-item-hover-bg, var(--background-color-dark));color:var(--text-color-primary);outline:none}.dropdown_item:focus-visible{outline:2px solid var(--focus-outline-color, var(--primary-color));outline-offset:2px;border-radius:6px}@media(max-width:479.98px){.dropdown_item{font-size:var(--font-size-caption);padding:var(--spacing-md);gap:var(--spacing-xs)}}@media(min-width:1024px){.dropdown_item{font-size:var(--font-size-label);padding:var(--spacing-md) var(--spacing-lg);gap:var(--spacing-sm)}}.dropdown_item_icon{margin-right:var(--spacing-xs);display:flex;align-items:center}@media(max-width:479.98px){.dropdown_item_icon{margin-right:var(--spacing-xxs)}}@media(min-width:1024px){.dropdown_item_icon{margin-right:var(--spacing-sm)}}.dropdown_item[aria-disabled=true],.dropdown_item.is_disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.dropdown_itemWrapper{position:relative;min-width:100%}.dropdown_itemContent{display:inline-flex;align-items:center;gap:var(--spacing-sm);min-width:0;overflow-wrap:anywhere}.dropdown_icon{margin-right:var(--spacing-xs);display:flex;align-items:center}@media(max-width:479.98px){.dropdown_icon{margin-right:var(--spacing-xxs)}}@media(min-width:1024px){.dropdown_icon{margin-right:var(--spacing-sm)}}.dropdown_submenuTrigger{justify-content:space-between}.dropdown_submenuIndicator{margin-left:auto;padding-left:var(--spacing-sm);line-height:1}.dropdown_submenu{top:var(--dropdown-panel-offset-y, 0);left:100%;min-width:max(100%,12rem);margin-top:0;margin-left:var(--spacing-xs)}.dropdown_submenu[data-placement=left]{right:100%;left:auto;margin-right:var(--spacing-xs);margin-left:0}@media(max-width:479.98px){.dropdown_submenu{position:static;width:100%;min-width:100%;max-height:var(--dropdown-panel-max-height, 50vh);margin:var(--spacing-xxs) 0 0;box-shadow:none}}.dropdown_submenu_open,.dropdown_hasSubmenu{min-width:100%}.dropdown a.dropdown_item{text-decoration:none}.dropdown_menu.dropdown_glass .dropdown_item:hover,.dropdown_menu.dropdown_glass .dropdown_item:focus{--dropdown-item-hover-bg: var( --dropdown-glass-hover-bg, rgba(255, 255, 255, .24) )}.menu_round-None{border-radius:var(--border-radius-none)}.menu_round-Small{border-radius:var(--border-radius-sm)}.menu_round-Medium{border-radius:var(--border-radius-md)}.menu_round-Large{border-radius:var(--border-radius-lg)}.menu_round-Full{border-radius:var(--border-radius-full)}.menu_shadow-None{box-shadow:var(--box-shadow-none)}.menu_shadow-Light{box-shadow:var(--box-shadow-light)}.menu_shadow-Medium{box-shadow:var(--box-shadow-medium)}.menu_shadow-Strong{box-shadow:var(--box-shadow-heavy)}.menu_shadow-Intense{box-shadow:var(--box-shadow-intense)}@media(prefers-reduced-motion:reduce){.dropdown_menu,.dropdown_item{transition:none!important;animation:none!important}}@media(hover:none){.dropdown_item:hover{background-color:transparent;transform:none;box-shadow:none}}@media(forced-colors:active){.dropdown_menu.dropdown_glass{background:Canvas;color:CanvasText;border-color:ButtonText;-webkit-backdrop-filter:none;backdrop-filter:none}.dropdown_menu{background:Canvas;color:CanvasText;border:1px solid ButtonText;outline-color:Highlight}.dropdown_item{border:1px solid ButtonText}.dropdown_item:focus-visible{outline:2px solid Highlight;outline-offset:2px}}}
|
package/dist/core/Dropdown.js
CHANGED