@solibo/solibo-ui 1.0.23 → 1.0.25
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/assets/index18.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +72 -72
- package/dist/components/editor/index.cjs +24 -24
- package/dist/components/editor/index.cjs.map +1 -1
- package/dist/components/editor/index.js +2245 -2239
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +4 -4
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +23 -23
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.js +19 -19
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/dist/assets/index18.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_ct7nd_1{color:var(--colors-semantic-content-secondary);display:grid;font-weight:var(--font-font-weight-bold);gap:var(--shape-spacing-3xs) var(--shape-spacing-xs);grid-template-columns:1fr;margin:var(--shape-spacing-md) 0;position:relative}._header_ct7nd_1>*{grid-column:1;min-width:0}._header_ct7nd_1 :is(h1,h2,h3,h4,h5,h6){color:var(--colors-semantic-content-primary);margin:0;overflow-wrap:break-word}._header_ct7nd_1 h1{font-size:var(--typography-font-sizes-h1);letter-spacing:-1.2px}._header_ct7nd_1 h2,._header_ct7nd_1 sup{font-size:var(--typography-font-sizes-h2)}._header_ct7nd_1 h3{font-size:var(--typography-font-sizes-h3)}._header_ct7nd_1 p{font-size:var(--typography-font-sizes-body-lg);font-weight:var(--font-font-weight-regular);margin:var(--shape-spacing-xs) 0 0!important}._header_ct7nd_1 sub{font-weight:var(--font-font-weight-regular)}._header_ct7nd_1 sub[data-clipboard]{align-items:center;cursor:copy;display:flex;gap:var(--scale-8);padding:var(--scale-8) 0}._header_ct7nd_1 sub,._header_ct7nd_1 sup{font-size:var(--typography-font-sizes-body-sm)}._header_ct7nd_1:has([data-component=badge]) h1,._header_ct7nd_1:has([data-component=badge]) h2,._header_ct7nd_1:has([data-component=badge]) h3,._header_ct7nd_1:has([data-component=badge]) h4{display:inline-block}._header_ct7nd_1 ._controls_ct7nd_67{display:grid;grid-template-columns:minmax(25ch,1fr) minmax(0,-webkit-max-content);grid-template-columns:minmax(25ch,1fr) minmax(0,max-content);flex:1 0 auto;gap:var(--shape-spacing-xs);justify-content:space-between;max-width:100%}._header_ct7nd_1 ._controls_ct7nd_67 h1,._header_ct7nd_1 ._controls_ct7nd_67 h2,._header_ct7nd_1 ._controls_ct7nd_67 h3,._header_ct7nd_1 ._controls_ct7nd_67 h4,._header_ct7nd_1 ._controls_ct7nd_67 h5,._header_ct7nd_1 ._controls_ct7nd_67 h6,._header_ct7nd_1 ._controls_ct7nd_67 sub,._header_ct7nd_1 ._controls_ct7nd_67 sup{grid-column:1}._header_ct7nd_1 ._controls_ct7nd_67 [data-component=controls]{align-self:center;grid-column:2;height:-webkit-max-content;height:-moz-max-content;height:max-content;margin-top:0}._header_ct7nd_1 ._cta_ct7nd_94{display:flex;flex-wrap:wrap;gap:var(--shape-spacing-xs);justify-content:space-between}._header_ct7nd_1 ._cta_ct7nd_94 [data-component=button]{height:-webkit-max-content;height:-moz-max-content;height:max-content;align-self:center}._header_ct7nd_1 ._header-content_ct7nd_106{display:flex;flex-direction:column;gap:var(--shape-spacing-3xs)}._header_ct7nd_1 ._header-content_ct7nd_106>a{color:inherit;font-size:var(--typography-font-sizes-label-lg);text-decoration:none;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media (width < 480px){._header_ct7nd_1 ._cta_ct7nd_94{flex-direction:column}._header_ct7nd_1 ._cta_ct7nd_94 [data-component=button]{width:100%}._header_ct7nd_1 ._controls_ct7nd_67:not(:has([data-adaptive=true])){grid-template-columns:1fr;gap:var(--shape-spacing-3xs)}._header_ct7nd_1 ._controls_ct7nd_67:not(:has([data-adaptive=true])) [data-component=controls]{grid-column:1;margin-top:var(--shape-spacing-md)}}@media (width >= 960px){._jumbo_ct7nd_143{margin:calc(var(--utils-tokens-unit) * 3) 0}._jumbo_ct7nd_143 h1{font-size:var(--typography-font-sizes-display-sm)}}
|
package/dist/assets/index21.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._form_13ccq_1{cursor:default;display:flex;flex-direction:column;gap:var(--utils-tokens-unit)}._form_13ccq_1 button{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._form_13ccq_1 input,._form_13ccq_1 select{max-width:100%;width:100%}._form_13ccq_1 label{max-width:100%}._form_13ccq_1 label>span{margin-bottom:var(--scale-8)}._form_13ccq_1>section{margin:var(--utils-tokens-unit) 0}._inline_13ccq_30 input,._inline_13ccq_30 textarea{border:none;border-radius:inherit;box-shadow:none;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;outline:0;padding:0}._fill_13ccq_45{gap:0;height:100%;min-height:0}
|
package/dist/assets/index37.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._combobox_vg3rv_3{align-items:center;display:flex;flex-wrap:wrap;gap:var(--shape-spacing-2xs);min-height:calc(var(--scale-32) + var(--scale-8));padding:var(--shape-spacing-2xs) 0}._combobox-input_vg3rv_12{background-color:transparent;border:0;box-shadow:none;color:var(--colors-semantic-content-primary);flex:1 1 calc(10 * var(--utils-tokens-unit));font:inherit;min-width:calc(10 * var(--utils-tokens-unit));padding:var(--utils-tokens-unit)}._combobox-input_vg3rv_12::-moz-placeholder{color:var(--colors-semantic-content-tertiary)}._combobox-input_vg3rv_12::placeholder{color:var(--colors-semantic-content-tertiary)}._dropdown_vg3rv_27{min-width:0;position:relative;width:100%}._dropdown_vg3rv_27 ._empty_vg3rv_32,._dropdown_vg3rv_27 ._group_vg3rv_33,._dropdown_vg3rv_27 ._placeholder_vg3rv_34{color:var(--colors-semantic-content-secondary)}._dropdown_vg3rv_27 ._empty_vg3rv_32{padding:var(--scale-4) var(--scale-8)}._dropdown_vg3rv_27 ._filter_vg3rv_42{font-size:var(--typography-font-sizes-label-sm);margin:var(--scale-4);margin-bottom:var(--utils-tokens-unit);width:calc(100% - var(--shape-spacing-xs))}._dropdown_vg3rv_27 ._group_vg3rv_33{flex-shrink:0}._dropdown_vg3rv_27 ._native_vg3rv_53{height:var(--scale-1);left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:var(--scale-1)}._dropdown_vg3rv_27 ._option_vg3rv_63{align-items:center;background-color:transparent;border:0;border-radius:var(--shape-border-radius-radius-md);color:inherit;display:flex;font-weight:var(--font-font-weight-regular);gap:var(--scale-8);justify-content:space-between;overflow:hidden;padding:var(--scale-4);text-align:left;white-space:nowrap;width:100%}._dropdown_vg3rv_27 ._option_vg3rv_63:disabled{color:var(--colors-neutral-300);cursor:not-allowed}._dropdown_vg3rv_27 ._options_vg3rv_85{margin:0;max-height:calc(var(--scale-32) * 8);overflow-y:auto;padding-right:var(--scale-4);scrollbar-color:var(--colors-semantic-border-default) transparent;scrollbar-width:thin}._dropdown_vg3rv_27 ._options_vg3rv_85::-webkit-scrollbar{width:var(--scale-8)}._dropdown_vg3rv_27 ._options_vg3rv_85::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:var(--colors-semantic-bg-surface);border:var(--scale-2) solid transparent;border-radius:var(--shape-border-radius-radius-md)}._dropdown_vg3rv_27 ._options_vg3rv_85::-webkit-scrollbar-track{background:transparent}._dropdown_vg3rv_27 ._panel_vg3rv_109{background-color:var(--colors-semantic-bg-surface);border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-md);box-shadow:var(--shape-box-shadow-sm-position-x) var(--shape-box-shadow-sm-position-y) var(--shape-box-shadow-sm-blur) var(--shape-box-shadow-sm-spread) var(--shape-box-shadow-sm-color);display:grid;left:0;margin-top:var(--shape-spacing-2xs);max-height:80vh;max-width:min(95vw,var(--shape-width-max));min-width:100%;overflow:hidden;padding:var(--scale-4);position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:var(--utils-tokens-z-max)}._dropdown_vg3rv_27 ._placeholder_vg3rv_34{color:var(--colors-semantic-content-primary);font-weight:var(--font-font-weight-regular)}._dropdown_vg3rv_27 ._selected_vg3rv_134{font-weight:var(--font-font-weight-semibold)}._dropdown_vg3rv_27 ._text_vg3rv_138{flex:1 1 auto;font-size:var(--typography-font-sizes-label-sm);line-height:var(--typography-font-sizes-label-lg);min-width:0;white-space:pre-wrap}._dropdown_vg3rv_27 ._trigger_vg3rv_146{border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-md);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color);color:var(--colors-semantic-content-primary);font-size:var(--typography-font-sizes-body-md);padding:var(--utils-tokens-unit);transition:border var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);align-items:center;background-color:var(--colors-semantic-bg-surface);display:flex;font-weight:var(--font-font-weight-regular);max-width:100%;min-height:calc(var(--scale-32) + var(--scale-8));overflow:hidden;padding-right:var(--scale-32);padding-top:calc(var(--utils-tokens-unit) - var(--scale-1));position:relative;text-align:left;width:100%}._dropdown_vg3rv_27 ._trigger_vg3rv_146::-moz-placeholder{color:var(--colors-semantic-content-tertiary)}._dropdown_vg3rv_27 ._trigger_vg3rv_146::placeholder{color:var(--colors-semantic-content-tertiary)}._dropdown_vg3rv_27 ._trigger_vg3rv_146:disabled{background-color:var(--colors-semantic-interactive-disabled);color:var(--colors-semantic-content-primary);pointer-events:none}._dropdown_vg3rv_27 ._trigger_vg3rv_146:after{background-image:var(--icon-svg);background-position:center;background-repeat:no-repeat;background-size:contain;content:"";height:var(--utils-tokens-icon-medium);position:absolute;right:var(--scale-8);top:50%;transform:translateY(-50%);transition:transform var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:var(--utils-tokens-icon-medium)}._dropdown_vg3rv_27 ._trigger_vg3rv_146[data-open=true]:after{transform:translateY(-50%) rotate(180deg)}._dropdown_vg3rv_27._minimal_vg3rv_183{--dropdown-background: rgb(0 0 0 / 85%);--dropdown-muted: rgb(255 255 255 / 65%);--dropdown-placeholder: rgb(255 255 255 / 65%)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._empty_vg3rv_32,._dropdown_vg3rv_27._minimal_vg3rv_183 ._group_vg3rv_33{color:var(--dropdown-muted)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._filter_vg3rv_42{border:0;box-shadow:none;padding:var(--scale-4);padding-left:calc(var(--scale-32) - var(--scale-4))}._dropdown_vg3rv_27._minimal_vg3rv_183 ._option_vg3rv_63{color:var(--colors-semantic-bg-surface)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._option_vg3rv_63:disabled{color:#ffffff73}._dropdown_vg3rv_27._minimal_vg3rv_183 ._panel_vg3rv_109{background-color:var(--dropdown-background);border:none;color:var(--colors-semantic-bg-surface);margin-top:calc(var(--scale-12) * -1)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._panel_vg3rv_109 input{background-color:transparent;border-color:var(--colors-neutral-300);color:var(--colors-semantic-bg-surface)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._panel_vg3rv_109 input::-moz-placeholder{color:var(--dropdown-muted)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._panel_vg3rv_109 input::placeholder{color:var(--dropdown-muted)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._placeholder_vg3rv_34{color:var(--dropdown-placeholder)}._dropdown_vg3rv_27._minimal_vg3rv_183 ._trigger_vg3rv_146{background-color:var(--dropdown-background);border:none;color:var(--colors-semantic-bg-surface);margin-bottom:var(--utils-tokens-unit);padding:0 var(--shape-spacing-xs)}._dropdown_vg3rv_27._inline_vg3rv_238{flex:1 1 auto;min-width:0}._dropdown_vg3rv_27._inline_vg3rv_238 ._combobox_vg3rv_3{border:0;border-radius:0;box-shadow:none;outline:0;min-height:calc(var(--scale-32) + var(--scale-8));padding:0}._dropdown_vg3rv_27._inline_vg3rv_238 ._combobox-input_vg3rv_12{border:0;border-radius:0;box-shadow:none;outline:0;padding:var(--shape-spacing-xs) 0}._dropdown_vg3rv_27._inline_vg3rv_238 ._text_vg3rv_138{font-size:var(--typography-font-sizes-body-md)}._dropdown_vg3rv_27._inline_vg3rv_238 ._trigger_vg3rv_146{border:0;border-radius:0;box-shadow:none;outline:0;min-height:calc(var(--scale-32) + var(--scale-8));padding-bottom:var(--shape-spacing-xs);padding-left:0;padding-top:var(--shape-spacing-xs)}._label_vg3rv_270{display:grid;gap:var(--scale-8);width:100%}._inline-field_vg3rv_276{align-items:center;border-bottom:var(--scale-1) solid var(--colors-semantic-border-default);display:flex;gap:var(--shape-spacing-sm);min-height:calc(var(--scale-32) + var(--scale-8));transition:border-color var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:100%}._inline-field_vg3rv_276:focus-within{border-bottom-color:var(--colors-semantic-primary-primary)}._inline-field_vg3rv_276>span{color:var(--colors-semantic-content-tertiary);flex:none;margin-bottom:0!important}
|
package/dist/assets/index39.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._field_x33uk_3{min-width:0;width:100%}._editor_x33uk_8{background-color:var(--colors-semantic-bg-surface);border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-md);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color)}._editor_x33uk_8 [role=textbox]{border-radius:0 0 var(--shape-border-radius-radius-md) var(--shape-border-radius-radius-md);box-sizing:border-box;line-height:1.25;max-height:var(--editor-max-height);min-height:var(--editor-min-height);overflow-y:auto;padding:var(--scale-8) var(--utils-tokens-unit)}._editor_x33uk_8 img{max-width:100%}@media (width <= 370px){._editor_x33uk_8 button{padding-inline:var(--scale-12)}}._has-files_x33uk_38 [role=textbox]{border-radius:0}._invalid_x33uk_42{border-color:var(--colors-semantic-status-error-border)}._error_x33uk_46{color:var(--colors-semantic-status-error-content);font-size:var(--typography-font-sizes-body-sm);margin-top:var(--scale-4)}._content_x33uk_52{position:relative}._files_x33uk_56{border-top:var(--scale-1) solid var(--colors-semantic-border-default);display:flex;flex-wrap:wrap;gap:var(--scale-8);padding:var(--scale-8) var(--utils-tokens-unit)}._placeholder_x33uk_64{color:var(--colors-semantic-content-secondary);left:var(--utils-tokens-unit);pointer-events:none;position:absolute;top:var(--scale-8)}._fill_x33uk_72{display:grid;grid-template-rows:minmax(0,1fr) auto;height:100%;min-height:0}._fill-editor_x33uk_79{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0}._fill-editor_x33uk_79 ._content_x33uk_52{min-height:0}._fill-editor_x33uk_79 [role=textbox]{height:100%;max-height:none}._meta_x33uk_95{align-items:center;display:grid;flex-basis:100%;grid-template-columns:1fr auto auto;opacity:0;transition:all var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._meta_x33uk_95._active_x33uk_104{border-top:var(--scale-1) solid var(--colors-semantic-border-default);height:auto;opacity:1}._meta_x33uk_95 input{border-radius:0;width:100%}._submit_x33uk_116{margin-left:auto}._bold_x33uk_120{font-weight:700}._italic_x33uk_124{font-style:italic}._link_x33uk_128{color:var(--colors-semantic-primary-primary);cursor:pointer;text-decoration:underline}._list_x33uk_134,._paragraph_x33uk_135{margin:var(--scale-8) 0}._paragraph_x33uk_135:first-child{margin-top:0}._list_x33uk_134{list-style-type:disc!important}._list_x33uk_134 li{list-style:inherit;margin-bottom:var(--scale-8);margin-left:var(--scale-16)}
|
package/dist/assets/index47.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._controls_17ti2_1{margin-top:var(--shape-spacing-xs);padding-left:var(--shape-spacing-md)}._horizontal_17ti2_6{display:block}._horizontal_17ti2_6 li{display:inline-block;margin-right:var(--utils-tokens-unit);max-width:100%;min-width:0}._list_17ti2_17{display:block;list-style-type:none;min-width:0;padding-left:0}._list_17ti2_17 li{-moz-column-break-inside:avoid;break-inside:avoid;list-style:none;margin-bottom:var(--utils-tokens-unit);max-width:100%;min-width:0;padding-left:0}._list_17ti2_17 li>li,._list_17ti2_17 li>details li{margin-left:var(--utils-tokens-unit)}._list_17ti2_17 li>section{border-bottom:var(--scale-1) solid var(--colors-semantic-border-default)}._list_17ti2_17 li>section:first-child{border-top:var(--scale-1) solid var(--colors-semantic-border-default)}._list_17ti2_17 li>section:last-of-type{border-bottom:none}._list_17ti2_17 li:has([data-span=all]){grid-column:1 / -1}._list_17ti2_17 li:last-child{margin-bottom:0}._list_17ti2_17._columns_17ti2_57{display:grid;grid-template-columns:repeat(var(--list-columns, 2),minmax(0,1fr));-moz-column-gap:var(--utils-tokens-unit);column-gap:var(--utils-tokens-unit)}._list_17ti2_17._columns_17ti2_57 li{display:grid}._compact_17ti2_68 li{margin-bottom:var(--shape-spacing-xs)}@media (width <= 768px){._columns_17ti2_57{grid-template-columns:1fr}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),b=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-Lq3pr85X.cjs"),X=require("../../index-BOiGSTKz.cjs"),pe=require("../list/index.cjs"),V=require("../../index-BlnG4Rbh.cjs");function L(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(L).join(" "):a.isValidElement(t)?L(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function ve(t){return a.isValidElement(t)&&t.type===a.Fragment}function ge(t){return a.isValidElement(t)&&t.type===V.Select}function W(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(ve(n))s.push(...W(n.props.children,i,r));else if(fe(n)){const c=L(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function _e(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function he(t,i){const r=_e(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function xe(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function be(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function ye(t){if(ge(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const je="_combobox_vg3rv_3",we="_dropdown_vg3rv_27",Se="_empty_vg3rv_32",Ne="_group_vg3rv_33",Ce="_placeholder_vg3rv_34",Ee="_filter_vg3rv_42",Ve="_native_vg3rv_53",Le="_option_vg3rv_63",Re="_options_vg3rv_85",$e="_panel_vg3rv_109",Be="_selected_vg3rv_134",Ie="_text_vg3rv_138",qe="_trigger_vg3rv_146",Pe="_minimal_vg3rv_183",De="_inline_vg3rv_238",ke="_label_vg3rv_270",o={combobox:je,"combobox-input":"_combobox-input_vg3rv_12",dropdown:we,empty:Se,group:Ne,placeholder:Ce,filter:Ee,native:Ve,option:Le,options:Re,panel:$e,selected:Be,text:Ie,trigger:qe,minimal:Pe,inline:De,label:ke,"inline-field":"_inline-field_vg3rv_276"};function Y(t,i){return{"--icon-svg":de.iconSVG(t).replace("currentColor",i)}}const Fe=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:R="Filter",selectedItems:Z,variant:_="default",...ee})=>{const $=ye(t),{defaultValue:te,onChange:B,value:I,...ne}=$.props,y=V.sanitizeSelectProps(ne),{className:re,...se}=y,M=a.useRef(null),Q=a.useRef(null),j=a.useId(),z=a.useRef(null),m=a.useRef(null),h=W($.children),x=I!=null,q=be(h,I,te),[P,D]=a.useState(()=>q),[u,p]=a.useState(!1),[w,S]=a.useState(""),N=x?String(I):P,O={default:V.resolveColor("--colors-semantic-content-secondary"),white:V.resolveColor("--color-white","white")},T=_==="minimal"?O.white:O.default,C=xe(h,N),le=Y("chevron",T),oe=Y("search",T),A=he(h,w),v=w.trim(),E=!!(r&&s&&v&&s.isValid(v)),ie=c&&_==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===N,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!h.some(e=>e.value===P)&&D(q)},[q,P,x,h]),a.useEffect(()=>{var e;if(!u){S("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var g;(g=Q.current)!=null&&g.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{x||D(e.target.value),B==null||B(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;S(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!E||(s.onCreate(v),K())},ce=e=>{var U;x||D(e);const d=z.current;if(!d){k();return}const g=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;g==null||g.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ue=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&E&&(e.preventDefault(),H())},J=l.jsxs("div",{className:b.t(o.dropdown,_==="inline"&&o.inline,_==="minimal"&&o.minimal,i),onKeyDown:ue,ref:Q,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:b.t(o.native,re),onChange:ae,ref:z,tabIndex:-1,value:N,children:$.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":y["aria-label"]??c??R,className:o["combobox-input"],disabled:y.disabled,onChange:e=>{S(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:R||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${j} ${j}-value`:void 0,className:b.t(o.trigger,(C==null?void 0:C.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:y.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${j}-value`,children:G(C)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>S(e.target.value),placeholder:R,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===N;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:b.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),E&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":L(s.render(v))||v,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(v)})})}),A.length===0&&!E&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:b.t(o.label,_==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:j,children:ie}),J]}):J};exports.Dropdown=Fe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as me, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
2
|
+
import { t as y } from "../../classix-DG18itHa.js";
|
|
3
|
+
import ve, { Children as ge, isValidElement as x, useRef as L, useId as he, useState as Q, useEffect as z } from "react";
|
|
4
4
|
import { Button as M } from "../button/index.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
5
|
+
import { i as _e } from "../../icons-BkaMeh-J.js";
|
|
6
|
+
import { f as be, I as ye } from "../../index-DMGGDV9J.js";
|
|
7
7
|
import { List as xe } from "../list/index.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import '../../assets/index37.css';function
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
8
|
+
import { S as we, s as Ne, r as ee } from "../../index-BAxpgMzb.js";
|
|
9
|
+
import '../../assets/index37.css';function $(t) {
|
|
10
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map($).join(" ") : x(t) ? $(t.props.children) : "";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Se(t) {
|
|
13
13
|
return x(t) && t.type === "option";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Ce(t) {
|
|
16
16
|
return x(t) && t.type === "optgroup";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return x(t) && t.type ===
|
|
18
|
+
function Ee(t) {
|
|
19
|
+
return x(t) && t.type === ve.Fragment;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return x(t) && t.type ===
|
|
21
|
+
function Ve(t) {
|
|
22
|
+
return x(t) && t.type === we;
|
|
23
23
|
}
|
|
24
24
|
function A(t, s, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
26
|
+
return ge.forEach(t, (n) => {
|
|
27
|
+
if (Ee(n))
|
|
28
28
|
l.push(...A(n.props.children, s, r));
|
|
29
|
-
else if (
|
|
30
|
-
const a =
|
|
29
|
+
else if (Se(n)) {
|
|
30
|
+
const a = $(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
|
|
31
31
|
l.push({
|
|
32
32
|
disabled: r || !!n.props.disabled,
|
|
33
33
|
groupLabel: s,
|
|
@@ -38,28 +38,28 @@ function A(t, s, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else
|
|
41
|
+
} else Ce(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ie(t) {
|
|
45
45
|
const s = t.trim();
|
|
46
46
|
if (!s) return null;
|
|
47
47
|
const l = [.../[*?]/.test(s) ? s : `*${s}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
48
48
|
return new RegExp(`^${l}$`, "i");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const r =
|
|
50
|
+
function Le(t, s) {
|
|
51
|
+
const r = Ie(s), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
|
|
52
52
|
return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function $e(t, s) {
|
|
55
55
|
return t.find((r) => r.value === s) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Be(t, s, r) {
|
|
58
58
|
var l, n;
|
|
59
59
|
return s != null ? String(s) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
61
|
+
function Pe(t) {
|
|
62
|
+
if (Ve(t)) {
|
|
63
63
|
const {
|
|
64
64
|
children: s,
|
|
65
65
|
placeholder: r,
|
|
@@ -78,12 +78,12 @@ function $e(t) {
|
|
|
78
78
|
props: t.props
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
combobox:
|
|
83
|
-
"combobox-input": "_combobox-
|
|
84
|
-
dropdown:
|
|
85
|
-
empty:
|
|
86
|
-
group:
|
|
81
|
+
const ke = "_combobox_vg3rv_3", De = "_dropdown_vg3rv_27", Re = "_empty_vg3rv_32", je = "_group_vg3rv_33", Fe = "_placeholder_vg3rv_34", We = "_filter_vg3rv_42", Qe = "_native_vg3rv_53", ze = "_option_vg3rv_63", Me = "_options_vg3rv_85", Ae = "_panel_vg3rv_109", Ge = "_selected_vg3rv_134", Ke = "_text_vg3rv_138", Oe = "_trigger_vg3rv_146", Te = "_minimal_vg3rv_183", qe = "_inline_vg3rv_238", He = "_label_vg3rv_270", o = {
|
|
82
|
+
combobox: ke,
|
|
83
|
+
"combobox-input": "_combobox-input_vg3rv_12",
|
|
84
|
+
dropdown: De,
|
|
85
|
+
empty: Re,
|
|
86
|
+
group: je,
|
|
87
87
|
placeholder: Fe,
|
|
88
88
|
filter: We,
|
|
89
89
|
native: Qe,
|
|
@@ -96,11 +96,11 @@ const Be = "_combobox_jkdyb_3", Pe = "_dropdown_jkdyb_27", De = "_empty_jkdyb_30
|
|
|
96
96
|
minimal: Te,
|
|
97
97
|
inline: qe,
|
|
98
98
|
label: He,
|
|
99
|
-
"inline-field": "_inline-
|
|
99
|
+
"inline-field": "_inline-field_vg3rv_276"
|
|
100
100
|
};
|
|
101
101
|
function te(t, s) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": _e(t).replace("currentColor", s)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const rt = ({
|
|
@@ -111,101 +111,101 @@ const rt = ({
|
|
|
111
111
|
emptyLabel: n = "No matches found",
|
|
112
112
|
label: a,
|
|
113
113
|
renderOption: f,
|
|
114
|
-
searchPlaceholder:
|
|
114
|
+
searchPlaceholder: B = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: h = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
|
-
const
|
|
119
|
+
const P = Pe(t), {
|
|
120
120
|
defaultValue: le,
|
|
121
|
-
onChange:
|
|
122
|
-
value:
|
|
121
|
+
onChange: k,
|
|
122
|
+
value: D,
|
|
123
123
|
...oe
|
|
124
|
-
} =
|
|
124
|
+
} = P.props, w = Ne(oe), {
|
|
125
125
|
className: se,
|
|
126
126
|
...ie
|
|
127
|
-
} =
|
|
127
|
+
} = w, G = L(null), K = L(null), N = he(), O = L(null), m = L(null), _ = A(P.children), b = D != null, R = Be(_, D, le), [j, F] = Q(() => R), [c, d] = Q(!1), [S, C] = Q(""), E = b ? String(D) : j, T = {
|
|
128
128
|
default: ee("--colors-semantic-content-secondary"),
|
|
129
129
|
white: ee("--color-white", "white")
|
|
130
|
-
}, q =
|
|
130
|
+
}, q = h === "minimal" ? T.white : T.default, V = $e(_, E), ae = te("chevron", q), ce = te("search", q), H = Le(_, S), v = S.trim(), I = !!(r && l && v && l.isValid(v)), ue = a && h === "inline" ? be(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
131
131
|
groupLabel: e.groupLabel,
|
|
132
|
-
isSelected: e.value ===
|
|
132
|
+
isSelected: e.value === E,
|
|
133
133
|
label: e.label,
|
|
134
134
|
text: e.text,
|
|
135
135
|
value: e.value
|
|
136
136
|
})) ?? e.label : "Select an option";
|
|
137
137
|
z(() => {
|
|
138
|
-
!
|
|
139
|
-
}, [
|
|
138
|
+
!b && !_.some((e) => e.value === j) && F(R);
|
|
139
|
+
}, [R, j, b, _]), z(() => {
|
|
140
140
|
var e;
|
|
141
141
|
if (!c) {
|
|
142
|
-
|
|
142
|
+
C("");
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
(e = m.current) == null || e.focus();
|
|
146
146
|
}, [c]), z(() => {
|
|
147
147
|
if (!c)
|
|
148
148
|
return;
|
|
149
|
-
const e = (
|
|
150
|
-
var
|
|
151
|
-
(
|
|
149
|
+
const e = (u) => {
|
|
150
|
+
var g;
|
|
151
|
+
(g = K.current) != null && g.contains(u.target) || d(!1);
|
|
152
152
|
};
|
|
153
153
|
return document.addEventListener("mousedown", e), () => {
|
|
154
154
|
document.removeEventListener("mousedown", e);
|
|
155
155
|
};
|
|
156
156
|
}, [c]);
|
|
157
|
-
const
|
|
158
|
-
|
|
157
|
+
const de = (e) => {
|
|
158
|
+
b || F(e.target.value), k == null || k(e);
|
|
159
159
|
}, W = () => {
|
|
160
160
|
var e;
|
|
161
|
-
|
|
161
|
+
d(!1), r || (e = G.current) == null || e.focus();
|
|
162
162
|
}, U = () => {
|
|
163
163
|
var e;
|
|
164
|
-
|
|
164
|
+
C(""), d(!0), (e = m.current) == null || e.focus();
|
|
165
165
|
}, X = () => {
|
|
166
|
-
!l || !
|
|
166
|
+
!l || !I || (l.onCreate(v), U());
|
|
167
167
|
}, pe = (e) => {
|
|
168
168
|
var Z;
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
169
|
+
b || F(e);
|
|
170
|
+
const u = O.current;
|
|
171
|
+
if (!u) {
|
|
172
172
|
W();
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
|
|
175
|
+
const g = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
176
|
+
g == null || g.call(u, e), u.dispatchEvent(new Event("change", {
|
|
177
177
|
bubbles: !0
|
|
178
178
|
})), r ? U() : W();
|
|
179
179
|
}, fe = (e) => {
|
|
180
|
-
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current &&
|
|
181
|
-
}, Y = /* @__PURE__ */ p("div", { className:
|
|
182
|
-
/* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className:
|
|
180
|
+
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && I && (e.preventDefault(), X());
|
|
181
|
+
}, Y = /* @__PURE__ */ p("div", { className: y(o.dropdown, h === "inline" && o.inline, h === "minimal" && o.minimal, s), onKeyDown: fe, ref: K, ...re, children: [
|
|
182
|
+
/* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className: y(o.native, se), onChange: de, ref: O, tabIndex: -1, value: E, children: P.children }),
|
|
183
183
|
r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
|
|
184
184
|
var e;
|
|
185
185
|
return (e = m.current) == null ? void 0 : e.focus();
|
|
186
186
|
}, children: [
|
|
187
187
|
ne,
|
|
188
|
-
/* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label":
|
|
189
|
-
|
|
190
|
-
}, onClick: () =>
|
|
191
|
-
] }) : /* @__PURE__ */ i(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${
|
|
188
|
+
/* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": w["aria-label"] ?? a ?? B, className: o["combobox-input"], disabled: w.disabled, onChange: (e) => {
|
|
189
|
+
C(e.target.value), d(!0);
|
|
190
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: B || void 0, ref: m, role: "combobox", type: "text", value: S })
|
|
191
|
+
] }) : /* @__PURE__ */ i(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${N} ${N}-value` : void 0, className: y(o.trigger, (V == null ? void 0 : V.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: w.disabled, onClick: () => d((e) => !e), ref: G, style: ae, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, id: `${N}-value`, children: J(V) }) }),
|
|
192
192
|
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
193
|
-
!r && /* @__PURE__ */ i(
|
|
193
|
+
!r && /* @__PURE__ */ i(ye, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => C(e.target.value), placeholder: B, ref: m, style: ce, type: "search", value: S }),
|
|
194
194
|
/* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, children: [
|
|
195
195
|
H.map((e) => {
|
|
196
|
-
const
|
|
197
|
-
return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label":
|
|
196
|
+
const u = e.value === E;
|
|
197
|
+
return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className: y(o.option, u && o.selected), disabled: e.disabled, onClick: () => pe(e.value), variant: "tertiary", children: [
|
|
198
198
|
/* @__PURE__ */ i("span", { className: o.text, children: J(e) }),
|
|
199
199
|
e.groupLabel && /* @__PURE__ */ i("small", { className: o.group, children: e.groupLabel })
|
|
200
200
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
201
201
|
}),
|
|
202
|
-
|
|
203
|
-
H.length === 0 && !
|
|
202
|
+
I && l && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(M, { "aria-label": $(l.render(v)) || v, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, children: l.render(v) }) }) }),
|
|
203
|
+
H.length === 0 && !I && /* @__PURE__ */ i("li", { className: o.empty, children: n })
|
|
204
204
|
] })
|
|
205
205
|
] })
|
|
206
206
|
] });
|
|
207
|
-
return a ? /* @__PURE__ */ p("div", { className:
|
|
208
|
-
/* @__PURE__ */ i("span", { id:
|
|
207
|
+
return a ? /* @__PURE__ */ p("div", { className: y(o.label, h === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
208
|
+
/* @__PURE__ */ i("span", { id: N, children: ue }),
|
|
209
209
|
Y
|
|
210
210
|
] }) : Y;
|
|
211
211
|
};
|