@solibo/solibo-ui 2.2.16 → 2.2.17
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/index41.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +195 -184
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +78 -70
- package/dist/index.d.ts +5 -3
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/dist/assets/index41.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._combobox_10eim_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_10eim_12{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-border-strong);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-primary);border:var(--control-border-width) solid var(--control-border);border-radius:var(--shape-border-radius-radius-lg);color:var(--control-color);font-size:var(--typography-font-sizes-body-md);line-height:1.1;min-height:var(--input-height);padding:var(--shape-spacing-sm);transition:border var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:100%;background-color:var(--control-bg);flex:1 1 calc(10 * var(--utils-tokens-unit));min-width:calc(10 * var(--utils-tokens-unit))}._combobox-input_10eim_12:disabled{pointer-events:none}._combobox-input_10eim_12::-moz-placeholder{color:var(--input-placeholder);opacity:1}._combobox-input_10eim_12::placeholder{color:var(--input-placeholder);opacity:1}._combobox-input_10eim_12:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._dropdown_10eim_21{--input-height: calc(var(--scale-48) + 2 * var(--shape-border-width-default));--input-placeholder: var(--colors-semantic-content-tertiary);min-width:0;position:relative;width:100%}._dropdown_10eim_21 ._empty_10eim_29,._dropdown_10eim_21 ._group_10eim_30,._dropdown_10eim_21 ._placeholder_10eim_31{color:var(--colors-semantic-content-secondary)}._dropdown_10eim_21 ._empty_10eim_29{padding:var(--scale-4) var(--scale-8)}._dropdown_10eim_21 ._filter_10eim_39{font-size:var(--typography-font-sizes-label-sm);margin:var(--scale-4);width:calc(100% - var(--shape-spacing-xs))}._dropdown_10eim_21 ._group_10eim_30{flex-shrink:0}._dropdown_10eim_21 ._native_10eim_49{height:var(--scale-1);left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:var(--scale-1)}._dropdown_10eim_21 ._option_10eim_59{align-items:center;background-color:transparent;border:0;border-radius:var(--shape-border-radius-radius-lg);color:var(--colors-semantic-content-secondary);display:flex;font-weight:var(--font-font-weight-regular);gap:var(--scale-8);justify-content:space-between;overflow:hidden;padding:var(--shape-spacing-md) var(--shape-spacing-sm);text-align:left;white-space:nowrap;width:100%}._dropdown_10eim_21 ._option_10eim_59:where(:not(:disabled)):active{box-shadow:none}._dropdown_10eim_21 ._option_10eim_59:disabled{color:var(--colors-semantic-content-disabled);cursor:not-allowed}._dropdown_10eim_21 ._options_10eim_85{display:flex;flex-direction:column;gap:var(--shape-spacing-2xs);margin:0;max-height:calc(var(--scale-48) * 8);overflow-y:auto;padding:0}._dropdown_10eim_21 ._panel_10eim_95{background-color:var(--colors-semantic-bg-surface);border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-lg);box-shadow:var(--shape-box-shadow-md-position-x) var(--shape-box-shadow-md-position-y) var(--shape-box-shadow-md-blur) var(--shape-box-shadow-md-spread) var(--shape-box-shadow-md-color);display:grid;left:0;margin-top:var(--shape-spacing-xs);max-height:80vh;max-width:min(95vw,var(--shape-width-max));min-width:100%;overflow:hidden;padding:var(--scale-4);position:absolute;width:-moz-max-content;width:max-content;z-index:var(--utils-tokens-z-max)}._dropdown_10eim_21 ._placeholder_10eim_31{color:var(--colors-semantic-content-primary);font-weight:var(--font-font-weight-regular)}._dropdown_10eim_21 ._selected_10eim_120{font-weight:var(--font-font-weight-semibold)}._dropdown_10eim_21 ._text_10eim_124{flex:1 1 auto;font-size:var(--typography-font-sizes-label-lg);line-height:1.1;min-width:0;white-space:pre-wrap}._dropdown_10eim_21 ._trigger_10eim_132{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-border-strong);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-primary);border:var(--control-border-width) solid var(--control-border);border-radius:var(--shape-border-radius-radius-lg);color:var(--control-color);font-size:var(--typography-font-sizes-body-md);line-height:1.1;min-height:var(--input-height);padding:var(--shape-spacing-sm);transition:border var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);align-items:center;background-color:var(--control-bg);display:flex;font-weight:var(--font-font-weight-regular);max-width:100%;min-height:calc(var(--scale-48) + 2 * var(--shape-border-width-default));overflow:hidden;padding-right:var(--scale-48);position:relative;text-align:left;width:100%}._dropdown_10eim_21 ._trigger_10eim_132:disabled{pointer-events:none}._dropdown_10eim_21 ._trigger_10eim_132::-moz-placeholder{color:var(--input-placeholder);opacity:1}._dropdown_10eim_21 ._trigger_10eim_132::placeholder{color:var(--input-placeholder);opacity:1}._dropdown_10eim_21 ._trigger_10eim_132:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._dropdown_10eim_21 ._trigger_10eim_132>._text_10eim_124{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere}._dropdown_10eim_21 ._trigger_10eim_132: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(--shape-spacing-sm);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_10eim_21 ._trigger_10eim_132[data-open=true]:after{transform:translateY(-50%) rotate(180deg)}._dropdown_10eim_21._minimal_10eim_177{--dropdown-background: var(--colors-semantic-bg-backdrop);--dropdown-content: var(--colors-neutral-0);--dropdown-muted: rgb(255 255 255 / 65%);--dropdown-placeholder: rgb(255 255 255 / 65%)}._dropdown_10eim_21._minimal_10eim_177 ._empty_10eim_29,._dropdown_10eim_21._minimal_10eim_177 ._group_10eim_30{color:var(--dropdown-muted)}._dropdown_10eim_21._minimal_10eim_177 ._filter_10eim_39{border:0;box-shadow:none;padding:var(--scale-4);padding-left:calc(var(--scale-32) - var(--scale-4))}._dropdown_10eim_21._minimal_10eim_177 ._option_10eim_59{color:var(--dropdown-content)}._dropdown_10eim_21._minimal_10eim_177 ._option_10eim_59:disabled{color:#ffffff73}._dropdown_10eim_21._minimal_10eim_177 ._option_10eim_59:not([disabled]):hover{background-color:#ffffff1a}._dropdown_10eim_21._minimal_10eim_177 ._panel_10eim_95{background-color:var(--dropdown-background);border:none;color:var(--dropdown-content);margin-top:calc(var(--scale-12) * -1)}._dropdown_10eim_21._minimal_10eim_177 ._panel_10eim_95 input{background-color:transparent;border-color:var(--colors-semantic-border-strong);color:var(--dropdown-content)}._dropdown_10eim_21._minimal_10eim_177 ._panel_10eim_95 input::-moz-placeholder{color:var(--dropdown-muted)}._dropdown_10eim_21._minimal_10eim_177 ._panel_10eim_95 input::placeholder{color:var(--dropdown-muted)}._dropdown_10eim_21._minimal_10eim_177 ._placeholder_10eim_31{color:var(--dropdown-placeholder)}._dropdown_10eim_21._minimal_10eim_177 ._trigger_10eim_132{background-color:var(--dropdown-background);border:none;color:var(--dropdown-content);margin-bottom:var(--utils-tokens-unit);padding:0 var(--scale-48) 0 var(--shape-spacing-xs)}._dropdown_10eim_21._inline_10eim_237{flex:1 1 auto;min-width:0}._dropdown_10eim_21._inline_10eim_237 ._combobox_10eim_3{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;min-height:calc(var(--scale-32) + var(--scale-8));padding:0}._dropdown_10eim_21._inline_10eim_237 ._combobox-input_10eim_12{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;background-color:transparent;min-height:0;padding:var(--shape-spacing-xs) 0}._dropdown_10eim_21._inline_10eim_237 ._text_10eim_124{font-size:var(--typography-font-sizes-body-md)}._dropdown_10eim_21._inline_10eim_237 ._trigger_10eim_132{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;min-height:calc(var(--scale-32) + var(--scale-8));padding-bottom:var(--shape-spacing-xs);padding-left:0;padding-top:var(--shape-spacing-xs)}._field_10eim_271{width:100%}._label_10eim_275{color:var(--colors-semantic-content-primary);width:100%}._inline-field_10eim_280{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_10eim_280:focus-within{border-bottom-color:var(--colors-semantic-primary-primary)}._inline-field_10eim_280>span{color:var(--colors-semantic-content-tertiary);flex:none;margin-bottom:0!important}._label_10eim_275:has(._native_10eim_49:disabled){--control-color: var(--colors-semantic-content-disabled);--label-description-color: var(--control-color)}._dropdown_10eim_21 :is(._trigger_10eim_132,._combobox-input_10eim_12):hover:not(:disabled){--control-bg: var(--colors-semantic-interactive-hover)}._dropdown_10eim_21 :is(._trigger_10eim_132,._combobox-input_10eim_12):focus{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-primary-primary-active);--control-border-width: var(--shape-border-width-thick)}._dropdown_10eim_21 :is(._trigger_10eim_132,._combobox-input_10eim_12)[aria-invalid=true]{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-status-error-border);--control-border-width: var(--shape-border-width-default)}._dropdown_10eim_21 :is(._trigger_10eim_132,._combobox-input_10eim_12):disabled{--control-bg: var(--colors-semantic-bg-disabled);--control-border: var(--colors-semantic-border-disabled);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-disabled);--input-placeholder: var(--colors-semantic-content-disabled);opacity:1}._dropdown_10eim_21 ._option_10eim_59:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._inline-field_10eim_280:has([aria-invalid=true]){border-bottom-color:var(--colors-semantic-status-error-border)}
|
|
1
|
+
._combobox_7iy0q_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_7iy0q_12{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-border-strong);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-primary);border:var(--control-border-width) solid var(--control-border);border-radius:var(--shape-border-radius-radius-lg);color:var(--control-color);font-size:var(--typography-font-sizes-body-md);line-height:1.1;min-height:var(--input-height);padding:var(--shape-spacing-sm);transition:border var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:100%;background-color:var(--control-bg);flex:1 1 calc(10 * var(--utils-tokens-unit));min-width:calc(10 * var(--utils-tokens-unit))}._combobox-input_7iy0q_12:disabled{pointer-events:none}._combobox-input_7iy0q_12::-moz-placeholder{color:var(--input-placeholder);opacity:1}._combobox-input_7iy0q_12::placeholder{color:var(--input-placeholder);opacity:1}._combobox-input_7iy0q_12:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._dropdown_7iy0q_21{--input-height: calc(var(--scale-48) + 2 * var(--shape-border-width-default));--input-placeholder: var(--colors-semantic-content-tertiary);min-width:0;position:relative;width:100%}._dropdown_7iy0q_21 ._empty_7iy0q_29,._dropdown_7iy0q_21 ._group_7iy0q_30,._dropdown_7iy0q_21 ._placeholder_7iy0q_31{color:var(--colors-semantic-content-secondary)}._dropdown_7iy0q_21 ._empty_7iy0q_29{padding:var(--scale-4) var(--scale-8)}._dropdown_7iy0q_21 ._filter_7iy0q_39{flex:1;font-size:var(--typography-font-sizes-label-sm);margin:var(--scale-4);min-width:0}._dropdown_7iy0q_21 ._filter-controls_7iy0q_46{align-items:center;display:flex;gap:var(--shape-spacing-xs)}._dropdown_7iy0q_21 ._filter-controls_7iy0q_46>[data-component=input]{flex:1;min-width:0}._dropdown_7iy0q_21 ._loading-status_7iy0q_57{align-items:center;display:flex;flex:0 0 var(--utils-tokens-icon-small);height:var(--utils-tokens-icon-small);justify-content:center;margin-right:var(--shape-spacing-xs);width:var(--utils-tokens-icon-small)}._dropdown_7iy0q_21 ._group_7iy0q_30{flex-shrink:0}._dropdown_7iy0q_21 ._native_7iy0q_71{height:var(--scale-1);left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:var(--scale-1)}._dropdown_7iy0q_21 ._option_7iy0q_81{align-items:center;background-color:transparent;border:0;border-radius:var(--shape-border-radius-radius-lg);color:var(--colors-semantic-content-secondary);display:flex;font-weight:var(--font-font-weight-regular);gap:var(--scale-8);justify-content:space-between;overflow:hidden;padding:var(--shape-spacing-md) var(--shape-spacing-sm);text-align:left;white-space:nowrap;width:100%}._dropdown_7iy0q_21 ._option_7iy0q_81:where(:not(:disabled)):active{box-shadow:none}._dropdown_7iy0q_21 ._option_7iy0q_81:disabled{color:var(--colors-semantic-content-disabled);cursor:not-allowed}._dropdown_7iy0q_21 ._options_7iy0q_107{display:flex;flex-direction:column;gap:var(--shape-spacing-2xs);margin:0;max-height:calc(var(--scale-48) * 8);overflow-y:auto;padding:0}._dropdown_7iy0q_21 ._panel_7iy0q_117{background-color:var(--colors-semantic-bg-surface);border:var(--scale-1) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-lg);box-shadow:var(--shape-box-shadow-md-position-x) var(--shape-box-shadow-md-position-y) var(--shape-box-shadow-md-blur) var(--shape-box-shadow-md-spread) var(--shape-box-shadow-md-color);display:grid;left:0;margin-top:var(--shape-spacing-xs);max-height:80vh;max-width:min(95vw,var(--shape-width-max));min-width:100%;overflow:hidden;padding:var(--scale-4);position:absolute;width:-moz-max-content;width:max-content;z-index:var(--utils-tokens-z-max)}._dropdown_7iy0q_21 ._placeholder_7iy0q_31{color:var(--colors-semantic-content-primary);font-weight:var(--font-font-weight-regular)}._dropdown_7iy0q_21 ._selected_7iy0q_142{font-weight:var(--font-font-weight-semibold)}._dropdown_7iy0q_21 ._text_7iy0q_146{flex:1 1 auto;font-size:var(--typography-font-sizes-label-lg);line-height:1.1;min-width:0;white-space:pre-wrap}._dropdown_7iy0q_21 ._trigger_7iy0q_154{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-border-strong);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-primary);border:var(--control-border-width) solid var(--control-border);border-radius:var(--shape-border-radius-radius-lg);color:var(--control-color);font-size:var(--typography-font-sizes-body-md);line-height:1.1;min-height:var(--input-height);padding:var(--shape-spacing-sm);transition:border var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);align-items:center;background-color:var(--control-bg);display:flex;font-weight:var(--font-font-weight-regular);max-width:100%;min-height:calc(var(--scale-48) + 2 * var(--shape-border-width-default));overflow:hidden;padding-right:var(--scale-48);position:relative;text-align:left;width:100%}._dropdown_7iy0q_21 ._trigger_7iy0q_154:disabled{pointer-events:none}._dropdown_7iy0q_21 ._trigger_7iy0q_154::-moz-placeholder{color:var(--input-placeholder);opacity:1}._dropdown_7iy0q_21 ._trigger_7iy0q_154::placeholder{color:var(--input-placeholder);opacity:1}._dropdown_7iy0q_21 ._trigger_7iy0q_154:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._dropdown_7iy0q_21 ._trigger_7iy0q_154>._text_7iy0q_146{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere}._dropdown_7iy0q_21 ._trigger_7iy0q_154: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(--shape-spacing-sm);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_7iy0q_21 ._trigger_7iy0q_154[data-open=true]:after{transform:translateY(-50%) rotate(180deg)}._dropdown_7iy0q_21._minimal_7iy0q_199{--dropdown-background: var(--colors-semantic-bg-backdrop);--dropdown-content: var(--colors-neutral-0);--dropdown-muted: rgb(255 255 255 / 65%);--dropdown-placeholder: rgb(255 255 255 / 65%)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._empty_7iy0q_29,._dropdown_7iy0q_21._minimal_7iy0q_199 ._group_7iy0q_30{color:var(--dropdown-muted)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._filter_7iy0q_39{border:0;box-shadow:none;padding:var(--scale-4);padding-left:calc(var(--scale-32) - var(--scale-4))}._dropdown_7iy0q_21._minimal_7iy0q_199 ._option_7iy0q_81{color:var(--dropdown-content)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._option_7iy0q_81:disabled{color:#ffffff73}._dropdown_7iy0q_21._minimal_7iy0q_199 ._option_7iy0q_81:not([disabled]):hover{background-color:#ffffff1a}._dropdown_7iy0q_21._minimal_7iy0q_199 ._panel_7iy0q_117{background-color:var(--dropdown-background);border:none;color:var(--dropdown-content);margin-top:calc(var(--scale-12) * -1)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._panel_7iy0q_117 input{background-color:transparent;border-color:var(--colors-semantic-border-strong);color:var(--dropdown-content)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._panel_7iy0q_117 input::-moz-placeholder{color:var(--dropdown-muted)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._panel_7iy0q_117 input::placeholder{color:var(--dropdown-muted)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._placeholder_7iy0q_31{color:var(--dropdown-placeholder)}._dropdown_7iy0q_21._minimal_7iy0q_199 ._trigger_7iy0q_154{background-color:var(--dropdown-background);border:none;color:var(--dropdown-content);margin-bottom:var(--utils-tokens-unit);padding:0 var(--scale-48) 0 var(--shape-spacing-xs)}._dropdown_7iy0q_21._inline_7iy0q_259{flex:1 1 auto;min-width:0}._dropdown_7iy0q_21._inline_7iy0q_259 ._combobox_7iy0q_3{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;min-height:calc(var(--scale-32) + var(--scale-8));padding:0}._dropdown_7iy0q_21._inline_7iy0q_259 ._combobox-input_7iy0q_12{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;background-color:transparent;min-height:0;padding:var(--shape-spacing-xs) 0}._dropdown_7iy0q_21._inline_7iy0q_259 ._text_7iy0q_146{font-size:var(--typography-font-sizes-body-md)}._dropdown_7iy0q_21._inline_7iy0q_259 ._trigger_7iy0q_154{border:0;border-radius:var(--shape-border-radius-radius-md);box-shadow:none;min-height:calc(var(--scale-32) + var(--scale-8));padding-bottom:var(--shape-spacing-xs);padding-left:0;padding-top:var(--shape-spacing-xs)}._field_7iy0q_293{width:100%}._label_7iy0q_297{color:var(--colors-semantic-content-primary);width:100%}._inline-field_7iy0q_302{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_7iy0q_302:focus-within{border-bottom-color:var(--colors-semantic-primary-primary)}._inline-field_7iy0q_302>span{color:var(--colors-semantic-content-tertiary);flex:none;margin-bottom:0!important}._label_7iy0q_297:has(._native_7iy0q_71:disabled){--control-color: var(--colors-semantic-content-disabled);--label-description-color: var(--control-color)}._dropdown_7iy0q_21 :is(._trigger_7iy0q_154,._combobox-input_7iy0q_12):hover:not(:disabled){--control-bg: var(--colors-semantic-interactive-hover)}._dropdown_7iy0q_21 :is(._trigger_7iy0q_154,._combobox-input_7iy0q_12):focus{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-primary-primary-active);--control-border-width: var(--shape-border-width-thick)}._dropdown_7iy0q_21 :is(._trigger_7iy0q_154,._combobox-input_7iy0q_12)[aria-invalid=true]{--control-bg: var(--colors-semantic-bg-surface);--control-border: var(--colors-semantic-status-error-border);--control-border-width: var(--shape-border-width-default)}._dropdown_7iy0q_21 :is(._trigger_7iy0q_154,._combobox-input_7iy0q_12):disabled{--control-bg: var(--colors-semantic-bg-disabled);--control-border: var(--colors-semantic-border-disabled);--control-border-width: var(--shape-border-width-default);--control-color: var(--colors-semantic-content-disabled);--input-placeholder: var(--colors-semantic-content-disabled);opacity:1}._dropdown_7iy0q_21 ._option_7iy0q_81:focus-visible{outline:solid var(--scale-2) var(--colors-semantic-border-focus);outline-offset:var(--shape-outline-offset, calc(var(--scale-2) * -1))}._inline-field_7iy0q_302:has([aria-invalid=true]){border-bottom-color:var(--colors-semantic-status-error-border)}
|
package/dist/assets/index9.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._search_1r1ik_3{display:flex;flex-direction:column;gap:var(--shape-spacing-xs);margin-bottom:var(--shape-spacing-lg);width:100%}._search_1r1ik_3 [data-component=input]{max-width:var(--shape-width-max)}._controls_1r1ik_15{align-items:stretch;display:flex;gap:var(--shape-spacing-xs)}._controls_1r1ik_15 label{flex:1}._controls_1r1ik_15 button{white-space:nowrap}@media (width < 480px){._controls_1r1ik_15[data-with-filters]{flex-direction:column}}._actions_1r1ik_36{display:flex;flex-shrink:0;gap:var(--shape-spacing-xs)}._actions_1r1ik_36 button{flex:1}._loading-status_1r1ik_46{align-items:center;align-self:center;display:flex;flex:0 0 var(--utils-tokens-icon-small);height:var(--utils-tokens-icon-small);justify-content:center;width:var(--utils-tokens-icon-small)}._chips_1r1ik_56{align-items:center;display:flex;flex-wrap:wrap;gap:var(--shape-spacing-xs)}._filter-dialog_1r1ik_63[open]{max-height:calc(100vh - var(--shape-spacing-lg) - var(--shape-spacing-lg));max-height:calc(100dvh - var(--shape-spacing-lg) - var(--shape-spacing-lg))}._filter-groups_1r1ik_68{display:grid;gap:var(--shape-spacing-lg)}._filter-groups_1r1ik_68[data-columns="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}@media (width < 480px){._filter-groups_1r1ik_68[data-columns="2"]{grid-template-columns:1fr;min-width:min(24rem,75vw)}}._filter-group_1r1ik_68{display:flex;flex-direction:column;gap:var(--shape-spacing-sm)}._filter-group_1r1ik_68[data-column-span="2"]{grid-column:1 / -1}@media (width < 480px){._filter-group_1r1ik_68[data-column-span="2"]{grid-column:auto}}._filter-group_1r1ik_68 h3{font-size:var(--typography-font-sizes-label-lg);font-weight:var(--font-font-weight-semibold);margin:0 0 var(--shape-spacing-xs)}._filter-option_1r1ik_104>label{align-items:flex-start}._option-copy_1r1ik_110{display:flex;flex-direction:column;gap:var(--shape-spacing-2xs)}._option-copy_1r1ik_110 sub{color:var(--colors-semantic-content-secondary);font-size:var(--typography-font-sizes-body-sm);line-height:normal}._radio_1r1ik_122{position:relative;align-items:center;cursor:pointer;display:inline-flex;gap:var(--shape-spacing-xs)}._radio_1r1ik_122:after{content:"";inset:var(--utils-tokens-negative-unit);position:absolute}._radio_1r1ik_122 input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:solid var(--scale-1) var(--colors-semantic-border-default);border-radius:50%;box-shadow:1px 1px 2px 0 var(--shape-box-shadow-xs-color) inset;height:var(--utils-tokens-unit);margin:0;width:var(--utils-tokens-unit)}._radio_1r1ik_122 input:checked{border:calc(var(--scale-1) * 5) solid var(--colors-semantic-primary-primary)}._collapsible-options_1r1ik_145{display:flex;flex-direction:column;gap:var(--shape-spacing-sm);padding-block-start:var(--shape-spacing-sm)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const n=require("react/jsx-runtime"),V=require("classix"),s=require("react"),B=require("../button/index.cjs"),Ze=require("../form/index.cjs"),et=require("../../icons-BIdcCH-v.cjs"),we=require("../../index-DEQcFR32.cjs"),tt=require("../label/index.cjs"),nt=require("../list/index.cjs"),Ee=require("../loading/index.cjs"),$=require("../../index-BQoXmNo3.cjs");function G(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(G).join(" "):s.isValidElement(t)?G(t.props.children):""}function st(t){return s.isValidElement(t)&&t.type==="option"}function it(t){return s.isValidElement(t)&&t.type==="optgroup"}function lt(t){return s.isValidElement(t)&&t.type===s.Fragment}function rt(t){return s.isValidElement(t)&&t.type===$.Select}function le(t,o,r=!1){const a=[];return s.Children.forEach(t,i=>{if(lt(i))a.push(...le(i.props.children,o,r));else if(st(i)){const x=G(i.props.children).trim(),k=i.props.value!=null?String(i.props.value):x;a.push({disabled:r||!!i.props.disabled,groupLabel:o,hidden:!!i.props.hidden,isPlaceholder:!!(i.props.hidden&&k===""),label:i.props.children,selected:!!i.props.selected,text:x,value:k})}else it(i)&&a.push(...le(i.props.children,i.props.label,r||!!i.props.disabled))}),a}function ot(t){const o=t.trim();if(!o)return null;const a=[.../[*?]/.test(o)?o:`*${o}*`].map(i=>i==="*"?".*":i==="?"?".":i.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${a}$`,"i")}function at(t,o){const r=ot(o),a=t.filter(i=>!i.hidden&&!i.isPlaceholder);return r?a.filter(i=>r.test([i.groupLabel,i.text,i.value].filter(Boolean).join(" "))):a}function ct(t,o){return t.find(r=>r.value===o)??t.find(r=>r.isPlaceholder)??t[0]}function ut(t,o,r){var a,i;return o!=null?String(o):r!=null?String(r):((a=t.find(x=>x.selected))==null?void 0:a.value)??((i=t[0])==null?void 0:i.value)??""}function dt(t){if(rt(t)){const{children:o,placeholder:r,...a}=t.props;return{children:n.jsxs(n.Fragment,{children:[r&&n.jsx("option",{hidden:!0,value:"",children:r}),o]}),props:a}}return{children:t.props.children,props:t.props}}const ft="_combobox_7iy0q_3",pt="_dropdown_7iy0q_21",mt="_empty_7iy0q_29",_t="_group_7iy0q_30",bt="_placeholder_7iy0q_31",yt="_filter_7iy0q_39",vt="_native_7iy0q_71",xt="_option_7iy0q_81",ht="_options_7iy0q_107",jt="_panel_7iy0q_117",qt="_selected_7iy0q_142",gt="_text_7iy0q_146",wt="_trigger_7iy0q_154",Et="_minimal_7iy0q_199",St="_inline_7iy0q_259",Rt="_field_7iy0q_293",Nt="_label_7iy0q_297",l={combobox:ft,"combobox-input":"_combobox-input_7iy0q_12",dropdown:pt,empty:mt,group:_t,placeholder:bt,filter:yt,"filter-controls":"_filter-controls_7iy0q_46","loading-status":"_loading-status_7iy0q_57",native:vt,option:xt,options:ht,panel:jt,selected:qt,text:gt,trigger:wt,minimal:Et,inline:St,field:Rt,label:Nt,"inline-field":"_inline-field_7iy0q_302"};function Se(t,o){return{"--icon-svg":et.iconSVG(t,o)}}const It=({children:t,className:o,combobox:r=!1,description:a,errorMessage:i,invalid:x=!1,searchable:k,createOption:h,emptyLabel:Re="No matches found",errorLabel:m,onRetry:re,retryLabel:Ne="Retry",label:y,filterOptions:Ie=!0,hasNextPage:b=!1,loading:d=!1,loadingLabel:oe="Loading",loadMoreLabel:Ce="Load more",onLoadMore:R,onOpenChange:D,onSearchChange:F,searchValue:M,renderOption:A,searchPlaceholder:L="Filter",selectedItems:Ve,variant:j="default",...Be})=>{const O=dt(t),{defaultValue:$e,onChange:T,value:K,...ke}=O.props,c=$.sanitizeSelectProps(ke),{className:De,...Fe}=c,ae=s.useRef(null),ce=s.useRef(null),q=s.useId(),H=x&&i?`${q}-error`:void 0,ue=a?`${q}-description`:void 0,de=[c["aria-describedby"],ue,H].filter(Boolean).join(" ")||void 0,fe=x?!0:c["aria-invalid"],pe=s.useRef(null),g=s.useRef(null),P=s.useRef(null),me=s.useRef(null),J=s.useRef(!1),U=s.useRef(!1),X=s.useRef(R),_e=!!R,w=le(O.children),N=K!=null,Y=ut(w,K,$e),[Z,ee]=s.useState(()=>Y),[u,We]=s.useState(!1),[ze,be]=s.useState(!1),[Qe,Ge]=s.useState(null),[Me,Ae]=s.useState(""),v=M??Me,te=w.filter(e=>!e.hidden).length,Le=Qe??(d||!!m||b||te>8),E=k??(Le||ze||v.length>0),I=s.useCallback(e=>{M===void 0&&Ae(e),F==null||F(e)},[F,M]),_=s.useCallback(e=>{J.current===e||e&&c.disabled||(J.current=e,We(e),D==null||D(e),e||I(""))},[D,c.disabled,I]),W=N?String(K):Z,ye={default:$.resolveColor("--colors-semantic-content-secondary"),white:$.resolveColor("--color-white","white")},ve=c.disabled?$.resolveColor("--colors-semantic-content-disabled"):j==="minimal"?ye.white:ye.default,z=ct(w,W),Oe=Se("CaretDown",ve),Te=Se("MagnifyingGlass",ve),ne=at(w,Ie?v:""),S=v.trim(),Q=!!(r&&h&&S&&h.isValid(S)),Ke=y&&j==="inline"?we.formatInlineLabel(y):y,xe=e=>e?(A==null?void 0:A({groupLabel:e.groupLabel,isSelected:e.value===W,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";s.useEffect(()=>{u&&!v&&!d&&!m&&Ge(b||te>8)},[u,v,d,m,b,te]),s.useEffect(()=>{!N&&!w.some(e=>e.value===Z)&&ee(Y)},[Y,Z,N,w]),s.useEffect(()=>{u?E&&be(!0):be(!1)},[u,E]),s.useEffect(()=>{var e,f,p;u&&(r||E?(e=g.current)==null||e.focus():(p=(f=P.current)==null?void 0:f.querySelector("button:not(:disabled)"))==null||p.focus())},[u,r,E]),s.useEffect(()=>{if(!u)return;const e=f=>{var p;(p=ce.current)!=null&&p.contains(f.target)||_(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[_,u]),s.useEffect(()=>{X.current=R},[R]),s.useEffect(()=>{c.disabled&&_(!1)},[_,c.disabled]);const se=s.useCallback(()=>{!J.current||c.disabled||d||m||!b||!X.current||U.current||(U.current=!0,X.current())},[m,b,d,c.disabled]);s.useEffect(()=>{if(U.current=!1,!u||c.disabled||d||m||!b||!_e)return;const e=me.current,f=P.current;if(!e||!f||typeof IntersectionObserver>"u")return;let p=!0;const C=new IntersectionObserver(Xe=>{p&&Xe.some(Ye=>Ye.isIntersecting)&&se()},{root:f});return C.observe(e),()=>{p=!1,C.disconnect()}},[u,d,m,b,_e,se,ne.length,v,c.disabled]);const He=e=>{N||ee(e.target.value),T==null||T(e)},ie=()=>{var e;_(!1),r||(e=ae.current)==null||e.focus()},he=()=>{var e;I(""),_(!0),(e=g.current)==null||e.focus()},je=()=>{!h||!Q||(h.onCreate(S),he())},Pe=e=>{var C;N||ee(e);const f=pe.current;if(!f){ie();return}const p=(C=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:C.set;p==null||p.call(f,e),f.dispatchEvent(new Event("change",{bubbles:!0})),r?he():ie()},Je=e=>{e.key==="Escape"&&ie(),e.key==="Enter"&&e.target===g.current&&Q&&(e.preventDefault(),je())},qe=n.jsx("div",{"aria-hidden":!d,"aria-label":oe,className:l["loading-status"],role:"status",children:d&&n.jsx(Ee.Loading,{size:"small"})}),ge=n.jsxs("div",{className:V(l.dropdown,j==="inline"&&l.inline,j==="minimal"&&l.minimal,o),onKeyDown:Je,ref:ce,...Be,children:[n.jsx("select",{...Fe,"aria-hidden":"true",className:V(l.native,De),onChange:He,ref:pe,tabIndex:-1,value:W,children:O.children}),r?n.jsxs("div",{className:l.combobox,onClick:()=>{var e;return(e=g.current)==null?void 0:e.focus()},children:[Ve,n.jsx("input",{"aria-describedby":de,"aria-invalid":fe,"aria-autocomplete":"list","aria-expanded":u,"aria-label":c["aria-label"]??y??L,className:l["combobox-input"],disabled:c.disabled,onChange:e=>{I(e.target.value),_(!0)},onClick:()=>_(!0),onFocus:()=>_(!0),placeholder:L||void 0,ref:g,role:"combobox",type:"text",value:v}),qe]}):n.jsx(B.Button,{"aria-describedby":de,"aria-invalid":fe,"aria-label":y?void 0:c["aria-label"],"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":y?`${q} ${q}-value`:void 0,className:V(l.trigger,(z==null?void 0:z.isPlaceholder)&&l.placeholder),"data-open":u?"true":void 0,disabled:c.disabled,onClick:()=>_(!u),ref:ae,style:Oe,variant:"simple",children:n.jsx("span",{className:l.text,id:`${q}-value`,children:xe(z)})}),u&&n.jsxs("div",{className:l.panel,children:[!r&&E&&n.jsxs("div",{className:l["filter-controls"],children:[n.jsx(we.Input,{"aria-label":"Filter",className:l.filter,icon:"MagnifyingGlass",onChange:e=>I(e.target.value),placeholder:L,ref:g,style:Te,type:"search",value:v}),qe]}),n.jsxs(nt.List,{"aria-label":"Dropdown","aria-busy":d||void 0,className:l.options,ref:P,children:[ne.map(e=>{const f=e.value===W;return n.jsx("li",{"data-component":"dropdown",children:n.jsxs(B.Button,{"aria-label":f?`${e.text}, selected`:e.text,className:V(l.option,f&&l.selected),disabled:e.disabled,onClick:()=>Pe(e.value),variant:"tertiary",children:[n.jsx("span",{className:l.text,children:xe(e)}),e.groupLabel&&n.jsx("small",{className:l.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),Q&&h&&n.jsx("li",{children:n.jsx(B.Button,{"aria-label":G(h.render(S))||S,className:l.option,onClick:je,variant:"tertiary",children:n.jsx("span",{className:l.text,children:h.render(S)})})}),ne.length===0&&!Q&&!d&&!m&&!b&&n.jsx("li",{className:l.empty,children:Re}),m&&n.jsxs("li",{className:l.empty,children:[n.jsx("span",{role:"alert",children:m}),re&&n.jsx(B.Button,{disabled:d,onClick:re,variant:"tertiary",children:Ne})]}),d&&!r&&!E&&n.jsx("li",{"aria-label":oe,className:l.empty,role:"status",children:n.jsx(Ee.Loading,{size:"small"})}),b&&R&&!m&&n.jsx("li",{ref:me,children:n.jsx(B.Button,{className:l.option,disabled:d,onClick:se,variant:"tertiary",children:Ce})})]})]})]}),Ue=y||a?n.jsxs("div",{className:V(l.label,j==="inline"&&l["inline-field"]),children:[n.jsx(tt.Label,{label:Ke,labelId:y?q:void 0,description:a,descriptionId:ue,inline:j==="inline"}),ge]}):ge;return n.jsxs("div",{className:l.field,"data-component":"dropdown",children:[Ue,H&&n.jsx(Ze.FieldError,{errorId:H,errorMessage:i})]})};exports.Dropdown=It;
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsxs as b, Fragment as
|
|
1
|
+
import { jsxs as b, Fragment as it, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import k from "classix";
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { FieldError as
|
|
6
|
-
import { i as
|
|
7
|
-
import { f as
|
|
8
|
-
import { Label as
|
|
9
|
-
import { List as
|
|
10
|
-
import { Loading as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/index41.css';function
|
|
13
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
3
|
+
import rt, { Children as lt, isValidElement as F, useRef as _, useId as st, useState as D, useCallback as oe, useEffect as g } from "react";
|
|
4
|
+
import { Button as j } from "../button/index.js";
|
|
5
|
+
import { FieldError as at } from "../form/index.js";
|
|
6
|
+
import { i as ot } from "../../icons-DVeBguFb.js";
|
|
7
|
+
import { f as ct, I as dt } from "../../index-6TyCExT0.js";
|
|
8
|
+
import { Label as ut } from "../label/index.js";
|
|
9
|
+
import { List as ft } from "../list/index.js";
|
|
10
|
+
import { Loading as Re } from "../loading/index.js";
|
|
11
|
+
import { S as pt, s as mt, r as ce } from "../../index-GPsHvb4d.js";
|
|
12
|
+
import '../../assets/index41.css';function K(t) {
|
|
13
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(K).join(" ") : F(t) ? K(t.props.children) : "";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function bt(t) {
|
|
16
|
+
return F(t) && t.type === "option";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function yt(t) {
|
|
19
|
+
return F(t) && t.type === "optgroup";
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
21
|
+
function _t(t) {
|
|
22
|
+
return F(t) && t.type === rt.Fragment;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function vt(t) {
|
|
25
|
+
return F(t) && t.type === pt;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
else if (
|
|
33
|
-
const
|
|
34
|
-
|
|
27
|
+
function de(t, s, r = !1) {
|
|
28
|
+
const a = [];
|
|
29
|
+
return lt.forEach(t, (n) => {
|
|
30
|
+
if (_t(n))
|
|
31
|
+
a.push(...de(n.props.children, s, r));
|
|
32
|
+
else if (bt(n)) {
|
|
33
|
+
const w = K(n.props.children).trim(), W = n.props.value != null ? String(n.props.value) : w;
|
|
34
|
+
a.push({
|
|
35
35
|
disabled: r || !!n.props.disabled,
|
|
36
36
|
groupLabel: s,
|
|
37
37
|
hidden: !!n.props.hidden,
|
|
38
|
-
isPlaceholder: !!(n.props.hidden &&
|
|
38
|
+
isPlaceholder: !!(n.props.hidden && W === ""),
|
|
39
39
|
label: n.props.children,
|
|
40
40
|
selected: !!n.props.selected,
|
|
41
|
-
text:
|
|
42
|
-
value:
|
|
41
|
+
text: w,
|
|
42
|
+
value: W
|
|
43
43
|
});
|
|
44
|
-
} else
|
|
45
|
-
}),
|
|
44
|
+
} else yt(n) && a.push(...de(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
45
|
+
}), a;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ht(t) {
|
|
48
48
|
const s = t.trim();
|
|
49
49
|
if (!s) return null;
|
|
50
|
-
const
|
|
51
|
-
return new RegExp(`^${
|
|
50
|
+
const a = [.../[*?]/.test(s) ? s : `*${s}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
51
|
+
return new RegExp(`^${a}$`, "i");
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const r =
|
|
55
|
-
return r ?
|
|
53
|
+
function gt(t, s) {
|
|
54
|
+
const r = ht(s), a = t.filter((n) => !n.hidden && !n.isPlaceholder);
|
|
55
|
+
return r ? a.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : a;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function wt(t, s) {
|
|
58
58
|
return t.find((r) => r.value === s) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
var
|
|
62
|
-
return s != null ? String(s) : r != null ? String(r) : ((
|
|
60
|
+
function qt(t, s, r) {
|
|
61
|
+
var a, n;
|
|
62
|
+
return s != null ? String(s) : r != null ? String(r) : ((a = t.find((w) => w.selected)) == null ? void 0 : a.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
if (
|
|
64
|
+
function St(t) {
|
|
65
|
+
if (vt(t)) {
|
|
66
66
|
const {
|
|
67
67
|
children: s,
|
|
68
68
|
placeholder: r,
|
|
69
|
-
...
|
|
69
|
+
...a
|
|
70
70
|
} = t.props;
|
|
71
71
|
return {
|
|
72
|
-
children: /* @__PURE__ */ b(
|
|
72
|
+
children: /* @__PURE__ */ b(it, { children: [
|
|
73
73
|
r && /* @__PURE__ */ l("option", { hidden: !0, value: "", children: r }),
|
|
74
74
|
s
|
|
75
75
|
] }),
|
|
76
|
-
props:
|
|
76
|
+
props: a
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
return {
|
|
@@ -81,183 +81,194 @@ function bt(t) {
|
|
|
81
81
|
props: t.props
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
combobox:
|
|
86
|
-
"combobox-input": "_combobox-
|
|
87
|
-
dropdown:
|
|
88
|
-
empty:
|
|
89
|
-
group:
|
|
90
|
-
placeholder:
|
|
91
|
-
filter:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
const It = "_combobox_7iy0q_3", Nt = "_dropdown_7iy0q_21", xt = "_empty_7iy0q_29", Et = "_group_7iy0q_30", Ct = "_placeholder_7iy0q_31", Rt = "_filter_7iy0q_39", Vt = "_native_7iy0q_71", $t = "_option_7iy0q_81", Bt = "_options_7iy0q_107", kt = "_panel_7iy0q_117", Dt = "_selected_7iy0q_142", jt = "_text_7iy0q_146", Ft = "_trigger_7iy0q_154", Wt = "_minimal_7iy0q_199", zt = "_inline_7iy0q_259", Qt = "_field_7iy0q_293", Gt = "_label_7iy0q_297", i = {
|
|
85
|
+
combobox: It,
|
|
86
|
+
"combobox-input": "_combobox-input_7iy0q_12",
|
|
87
|
+
dropdown: Nt,
|
|
88
|
+
empty: xt,
|
|
89
|
+
group: Et,
|
|
90
|
+
placeholder: Ct,
|
|
91
|
+
filter: Rt,
|
|
92
|
+
"filter-controls": "_filter-controls_7iy0q_46",
|
|
93
|
+
"loading-status": "_loading-status_7iy0q_57",
|
|
94
|
+
native: Vt,
|
|
95
|
+
option: $t,
|
|
96
|
+
options: Bt,
|
|
97
|
+
panel: kt,
|
|
98
|
+
selected: Dt,
|
|
99
|
+
text: jt,
|
|
100
|
+
trigger: Ft,
|
|
101
|
+
minimal: Wt,
|
|
102
|
+
inline: zt,
|
|
103
|
+
field: Qt,
|
|
104
|
+
label: Gt,
|
|
105
|
+
"inline-field": "_inline-field_7iy0q_302"
|
|
104
106
|
};
|
|
105
|
-
function
|
|
107
|
+
function Ve(t, s) {
|
|
106
108
|
return {
|
|
107
|
-
"--icon-svg":
|
|
109
|
+
"--icon-svg": ot(t, s)
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
|
-
const
|
|
112
|
+
const Yt = ({
|
|
111
113
|
children: t,
|
|
112
114
|
className: s,
|
|
113
115
|
combobox: r = !1,
|
|
114
|
-
description:
|
|
116
|
+
description: a,
|
|
115
117
|
errorMessage: n,
|
|
116
|
-
invalid:
|
|
117
|
-
searchable:
|
|
118
|
-
createOption:
|
|
119
|
-
emptyLabel:
|
|
120
|
-
errorLabel:
|
|
121
|
-
onRetry:
|
|
122
|
-
retryLabel:
|
|
123
|
-
label:
|
|
124
|
-
filterOptions:
|
|
125
|
-
hasNextPage:
|
|
126
|
-
loading:
|
|
127
|
-
|
|
118
|
+
invalid: w = !1,
|
|
119
|
+
searchable: W,
|
|
120
|
+
createOption: q,
|
|
121
|
+
emptyLabel: $e = "No matches found",
|
|
122
|
+
errorLabel: p,
|
|
123
|
+
onRetry: ue,
|
|
124
|
+
retryLabel: Be = "Retry",
|
|
125
|
+
label: v,
|
|
126
|
+
filterOptions: ke = !0,
|
|
127
|
+
hasNextPage: y = !1,
|
|
128
|
+
loading: d = !1,
|
|
129
|
+
loadingLabel: fe = "Loading",
|
|
130
|
+
loadMoreLabel: De = "Load more",
|
|
128
131
|
onLoadMore: R,
|
|
129
|
-
onOpenChange:
|
|
132
|
+
onOpenChange: z,
|
|
130
133
|
onSearchChange: Q,
|
|
131
|
-
searchValue:
|
|
132
|
-
renderOption:
|
|
133
|
-
searchPlaceholder:
|
|
134
|
-
selectedItems:
|
|
135
|
-
variant:
|
|
136
|
-
...
|
|
134
|
+
searchValue: L,
|
|
135
|
+
renderOption: O,
|
|
136
|
+
searchPlaceholder: T = "Filter",
|
|
137
|
+
selectedItems: je,
|
|
138
|
+
variant: S = "default",
|
|
139
|
+
...Fe
|
|
137
140
|
}) => {
|
|
138
|
-
const
|
|
139
|
-
defaultValue:
|
|
140
|
-
onChange:
|
|
141
|
-
value:
|
|
142
|
-
...
|
|
143
|
-
} =
|
|
144
|
-
className:
|
|
145
|
-
...
|
|
146
|
-
} =
|
|
147
|
-
|
|
148
|
-
}, [Q,
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
default:
|
|
152
|
-
white:
|
|
153
|
-
},
|
|
141
|
+
const H = St(t), {
|
|
142
|
+
defaultValue: We,
|
|
143
|
+
onChange: J,
|
|
144
|
+
value: P,
|
|
145
|
+
...ze
|
|
146
|
+
} = H.props, o = mt(ze), {
|
|
147
|
+
className: Qe,
|
|
148
|
+
...Ge
|
|
149
|
+
} = o, pe = _(null), me = _(null), I = st(), U = w && n ? `${I}-error` : void 0, be = a ? `${I}-description` : void 0, ye = [o["aria-describedby"], be, U].filter(Boolean).join(" ") || void 0, _e = w ? !0 : o["aria-invalid"], ve = _(null), N = _(null), X = _(null), he = _(null), Y = _(!1), Z = _(!1), ee = _(R), ge = !!R, x = de(H.children), V = P != null, te = qt(x, P, We), [ne, ie] = D(() => te), [c, Ae] = D(!1), [Me, we] = D(!1), [Ke, Le] = D(null), [Oe, Te] = D(""), h = L ?? Oe, re = x.filter((e) => !e.hidden).length, He = Ke ?? (d || !!p || y || re > 8), E = W ?? (He || Me || h.length > 0), $ = oe((e) => {
|
|
150
|
+
L === void 0 && Te(e), Q == null || Q(e);
|
|
151
|
+
}, [Q, L]), m = oe((e) => {
|
|
152
|
+
Y.current === e || e && o.disabled || (Y.current = e, Ae(e), z == null || z(e), e || $(""));
|
|
153
|
+
}, [z, o.disabled, $]), G = V ? String(P) : ne, qe = {
|
|
154
|
+
default: ce("--colors-semantic-content-secondary"),
|
|
155
|
+
white: ce("--color-white", "white")
|
|
156
|
+
}, Se = o.disabled ? ce("--colors-semantic-content-disabled") : S === "minimal" ? qe.white : qe.default, A = wt(x, G), Je = Ve("CaretDown", Se), Pe = Ve("MagnifyingGlass", Se), le = gt(x, ke ? h : ""), C = h.trim(), M = !!(r && q && C && q.isValid(C)), Ue = v && S === "inline" ? ct(v) : v, Ie = (e) => e ? (O == null ? void 0 : O({
|
|
154
157
|
groupLabel: e.groupLabel,
|
|
155
|
-
isSelected: e.value ===
|
|
158
|
+
isSelected: e.value === G,
|
|
156
159
|
label: e.label,
|
|
157
160
|
text: e.text,
|
|
158
161
|
value: e.value
|
|
159
162
|
})) ?? e.label : "Select an option";
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
g(() => {
|
|
164
|
+
c && !h && !d && !p && Le(y || re > 8);
|
|
165
|
+
}, [c, h, d, p, y, re]), g(() => {
|
|
166
|
+
!V && !x.some((e) => e.value === ne) && ie(te);
|
|
167
|
+
}, [te, ne, V, x]), g(() => {
|
|
168
|
+
c ? E && we(!0) : we(!1);
|
|
169
|
+
}, [c, E]), g(() => {
|
|
170
|
+
var e, u, f;
|
|
171
|
+
c && (r || E ? (e = N.current) == null || e.focus() : (f = (u = X.current) == null ? void 0 : u.querySelector("button:not(:disabled)")) == null || f.focus());
|
|
172
|
+
}, [c, r, E]), g(() => {
|
|
173
|
+
if (!c)
|
|
167
174
|
return;
|
|
168
|
-
const e = (
|
|
169
|
-
var
|
|
170
|
-
(
|
|
175
|
+
const e = (u) => {
|
|
176
|
+
var f;
|
|
177
|
+
(f = me.current) != null && f.contains(u.target) || m(!1);
|
|
171
178
|
};
|
|
172
179
|
return document.addEventListener("mousedown", e), () => {
|
|
173
180
|
document.removeEventListener("mousedown", e);
|
|
174
181
|
};
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
}, [R]),
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
const
|
|
181
|
-
!
|
|
182
|
-
}, [
|
|
183
|
-
|
|
184
|
-
if (
|
|
185
|
-
const e =
|
|
186
|
-
if (!e || !
|
|
187
|
-
let
|
|
188
|
-
const
|
|
189
|
-
|
|
182
|
+
}, [m, c]), g(() => {
|
|
183
|
+
ee.current = R;
|
|
184
|
+
}, [R]), g(() => {
|
|
185
|
+
o.disabled && m(!1);
|
|
186
|
+
}, [m, o.disabled]);
|
|
187
|
+
const se = oe(() => {
|
|
188
|
+
!Y.current || o.disabled || d || p || !y || !ee.current || Z.current || (Z.current = !0, ee.current());
|
|
189
|
+
}, [p, y, d, o.disabled]);
|
|
190
|
+
g(() => {
|
|
191
|
+
if (Z.current = !1, !c || o.disabled || d || p || !y || !ge) return;
|
|
192
|
+
const e = he.current, u = X.current;
|
|
193
|
+
if (!e || !u || typeof IntersectionObserver > "u") return;
|
|
194
|
+
let f = !0;
|
|
195
|
+
const B = new IntersectionObserver((tt) => {
|
|
196
|
+
f && tt.some((nt) => nt.isIntersecting) && se();
|
|
190
197
|
}, {
|
|
191
|
-
root:
|
|
198
|
+
root: u
|
|
192
199
|
});
|
|
193
|
-
return
|
|
194
|
-
|
|
200
|
+
return B.observe(e), () => {
|
|
201
|
+
f = !1, B.disconnect();
|
|
195
202
|
};
|
|
196
|
-
}, [
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
var e;
|
|
201
|
-
f(!1), r || (e = ue.current) == null || e.focus();
|
|
202
|
-
}, xe = () => {
|
|
203
|
+
}, [c, d, p, y, ge, se, le.length, h, o.disabled]);
|
|
204
|
+
const Xe = (e) => {
|
|
205
|
+
V || ie(e.target.value), J == null || J(e);
|
|
206
|
+
}, ae = () => {
|
|
203
207
|
var e;
|
|
204
|
-
|
|
208
|
+
m(!1), r || (e = pe.current) == null || e.focus();
|
|
205
209
|
}, Ne = () => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
var e;
|
|
211
|
+
$(""), m(!0), (e = N.current) == null || e.focus();
|
|
212
|
+
}, xe = () => {
|
|
213
|
+
!q || !M || (q.onCreate(C), Ne());
|
|
214
|
+
}, Ye = (e) => {
|
|
215
|
+
var B;
|
|
216
|
+
V || ie(e);
|
|
217
|
+
const u = ve.current;
|
|
218
|
+
if (!u) {
|
|
219
|
+
ae();
|
|
213
220
|
return;
|
|
214
221
|
}
|
|
215
|
-
const
|
|
216
|
-
|
|
222
|
+
const f = (B = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : B.set;
|
|
223
|
+
f == null || f.call(u, e), u.dispatchEvent(new Event("change", {
|
|
217
224
|
bubbles: !0
|
|
218
|
-
})), r ?
|
|
219
|
-
},
|
|
220
|
-
e.key === "Escape" &&
|
|
221
|
-
},
|
|
222
|
-
/* @__PURE__ */ l("select", { ...
|
|
225
|
+
})), r ? Ne() : ae();
|
|
226
|
+
}, Ze = (e) => {
|
|
227
|
+
e.key === "Escape" && ae(), e.key === "Enter" && e.target === N.current && M && (e.preventDefault(), xe());
|
|
228
|
+
}, Ee = /* @__PURE__ */ l("div", { "aria-hidden": !d, "aria-label": fe, className: i["loading-status"], role: "status", children: d && /* @__PURE__ */ l(Re, { size: "small" }) }), Ce = /* @__PURE__ */ b("div", { className: k(i.dropdown, S === "inline" && i.inline, S === "minimal" && i.minimal, s), onKeyDown: Ze, ref: me, ...Fe, children: [
|
|
229
|
+
/* @__PURE__ */ l("select", { ...Ge, "aria-hidden": "true", className: k(i.native, Qe), onChange: Xe, ref: ve, tabIndex: -1, value: G, children: H.children }),
|
|
223
230
|
r ? /* @__PURE__ */ b("div", { className: i.combobox, onClick: () => {
|
|
224
231
|
var e;
|
|
225
232
|
return (e = N.current) == null ? void 0 : e.focus();
|
|
226
233
|
}, children: [
|
|
227
|
-
|
|
228
|
-
/* @__PURE__ */ l("input", { "aria-describedby":
|
|
229
|
-
|
|
230
|
-
}, onClick: () =>
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
/* @__PURE__ */ b(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
234
|
+
je,
|
|
235
|
+
/* @__PURE__ */ l("input", { "aria-describedby": ye, "aria-invalid": _e, "aria-autocomplete": "list", "aria-expanded": c, "aria-label": o["aria-label"] ?? v ?? T, className: i["combobox-input"], disabled: o.disabled, onChange: (e) => {
|
|
236
|
+
$(e.target.value), m(!0);
|
|
237
|
+
}, onClick: () => m(!0), onFocus: () => m(!0), placeholder: T || void 0, ref: N, role: "combobox", type: "text", value: h }),
|
|
238
|
+
Ee
|
|
239
|
+
] }) : /* @__PURE__ */ l(j, { "aria-describedby": ye, "aria-invalid": _e, "aria-label": v ? void 0 : o["aria-label"], "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": v ? `${I} ${I}-value` : void 0, className: k(i.trigger, (A == null ? void 0 : A.isPlaceholder) && i.placeholder), "data-open": c ? "true" : void 0, disabled: o.disabled, onClick: () => m(!c), ref: pe, style: Je, variant: "simple", children: /* @__PURE__ */ l("span", { className: i.text, id: `${I}-value`, children: Ie(A) }) }),
|
|
240
|
+
c && /* @__PURE__ */ b("div", { className: i.panel, children: [
|
|
241
|
+
!r && E && /* @__PURE__ */ b("div", { className: i["filter-controls"], children: [
|
|
242
|
+
/* @__PURE__ */ l(dt, { "aria-label": "Filter", className: i.filter, icon: "MagnifyingGlass", onChange: (e) => $(e.target.value), placeholder: T, ref: N, style: Pe, type: "search", value: h }),
|
|
243
|
+
Ee
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ b(ft, { "aria-label": "Dropdown", "aria-busy": d || void 0, className: i.options, ref: X, children: [
|
|
246
|
+
le.map((e) => {
|
|
247
|
+
const u = e.value === G;
|
|
248
|
+
return /* @__PURE__ */ l("li", { "data-component": "dropdown", children: /* @__PURE__ */ b(j, { "aria-label": u ? `${e.text}, selected` : e.text, className: k(i.option, u && i.selected), disabled: e.disabled, onClick: () => Ye(e.value), variant: "tertiary", children: [
|
|
249
|
+
/* @__PURE__ */ l("span", { className: i.text, children: Ie(e) }),
|
|
239
250
|
e.groupLabel && /* @__PURE__ */ l("small", { className: i.group, children: e.groupLabel })
|
|
240
251
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
241
252
|
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */ l("span", { role: "alert", children:
|
|
246
|
-
|
|
253
|
+
M && q && /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(j, { "aria-label": K(q.render(C)) || C, className: i.option, onClick: xe, variant: "tertiary", children: /* @__PURE__ */ l("span", { className: i.text, children: q.render(C) }) }) }),
|
|
254
|
+
le.length === 0 && !M && !d && !p && !y && /* @__PURE__ */ l("li", { className: i.empty, children: $e }),
|
|
255
|
+
p && /* @__PURE__ */ b("li", { className: i.empty, children: [
|
|
256
|
+
/* @__PURE__ */ l("span", { role: "alert", children: p }),
|
|
257
|
+
ue && /* @__PURE__ */ l(j, { disabled: d, onClick: ue, variant: "tertiary", children: Be })
|
|
247
258
|
] }),
|
|
248
|
-
|
|
249
|
-
|
|
259
|
+
d && !r && !E && /* @__PURE__ */ l("li", { "aria-label": fe, className: i.empty, role: "status", children: /* @__PURE__ */ l(Re, { size: "small" }) }),
|
|
260
|
+
y && R && !p && /* @__PURE__ */ l("li", { ref: he, children: /* @__PURE__ */ l(j, { className: i.option, disabled: d, onClick: se, variant: "tertiary", children: De }) })
|
|
250
261
|
] })
|
|
251
262
|
] })
|
|
252
|
-
] }),
|
|
253
|
-
/* @__PURE__ */ l(
|
|
254
|
-
|
|
255
|
-
] }) :
|
|
263
|
+
] }), et = v || a ? /* @__PURE__ */ b("div", { className: k(i.label, S === "inline" && i["inline-field"]), children: [
|
|
264
|
+
/* @__PURE__ */ l(ut, { label: Ue, labelId: v ? I : void 0, description: a, descriptionId: be, inline: S === "inline" }),
|
|
265
|
+
Ce
|
|
266
|
+
] }) : Ce;
|
|
256
267
|
return /* @__PURE__ */ b("div", { className: i.field, "data-component": "dropdown", children: [
|
|
257
|
-
|
|
258
|
-
|
|
268
|
+
et,
|
|
269
|
+
U && /* @__PURE__ */ l(at, { errorId: U, errorMessage: n })
|
|
259
270
|
] });
|
|
260
271
|
};
|
|
261
272
|
export {
|
|
262
|
-
|
|
273
|
+
Yt as Dropdown
|
|
263
274
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),h=require("../button/index.cjs"),z=require("../checkbox/index.cjs"),H=require("../chip/index.cjs"),P=require("../collapsible/index.cjs"),A=require("../../index-BwfsmdF6.cjs"),E=require("../dialog/index.cjs"),J=require("../header/index.cjs"),K=require("../../index-DEQcFR32.cjs"),Q=require("../loading/index.cjs"),S="_search_1r1ik_3",U="_controls_1r1ik_15",V="_actions_1r1ik_36",W="_chips_1r1ik_56",X="_radio_1r1ik_122",n={search:S,controls:U,actions:V,"loading-status":"_loading-status_1r1ik_46",chips:W,"filter-dialog":"_filter-dialog_1r1ik_63","filter-groups":"_filter-groups_1r1ik_68","filter-group":"_filter-group_1r1ik_68","filter-option":"_filter-option_1r1ik_104","option-copy":"_option-copy_1r1ik_110",radio:X,"collapsible-options":"_collapsible-options_1r1ik_145"},Y=({filterButtonLabel:j="Filters",filterDialogColumns:f=1,filterDialogTitle:M="Filters",filterGroups:t=[],isLoading:d,loadingLabel:$="Loading results",onChange:w,onSelectedFiltersChange:l,removeFilterLabel:O=o=>`Remove ${o.label} filter`,resetLabel:v="Reset",searchLabel:B="Search",searchPlaceholder:D="Search",selectedFilters:r=[],showResultsLabel:R="Show results",value:I=""})=>{const o=b.useId(),[u,_]=b.useState(!1),T=b.useMemo(()=>new Map(t.flatMap(s=>{var i;return[...s.options,...((i=s.collapsible)==null?void 0:i.options)??[]]}).map(s=>[s.value,s])),[t]),p=r.flatMap(s=>{const i=T.get(s);return i?[i]:[]}),m=(s,i,e)=>{var q;if(!l)return;const x=new Set([...(e==null?void 0:e.options.map(c=>c.value))??[],...((q=e==null?void 0:e.collapsible)==null?void 0:q.options.map(c=>c.value))??[]]),N=r.filter(c=>!x.has(c));if(i&&(e==null?void 0:e.defaultValue)===s){l(N);return}l(i?(e==null?void 0:e.control)==="radio"||(e==null?void 0:e.selectionMode)==="single"?[...N,s]:[...new Set([...r,s])]:r.filter(c=>c!==s))},k=(s,i)=>{var e;return r.includes(s)||i.defaultValue===s&&![...i.options,...((e=i.collapsible)==null?void 0:e.options)??[]].some(x=>r.includes(x.value))},y=(s,i)=>a.jsx("div",{className:n["filter-option"],"data-component":"renderfilter",children:i.control==="radio"?a.jsxs("label",{className:n.radio,children:[a.jsx("input",{checked:k(s.value,i),name:`${o}-filter-${i.label??"group"}`,onChange:e=>m(s.value,e.target.checked,i),type:"radio"}),a.jsxs("span",{className:n["option-copy"],children:[s.label,s.description&&a.jsx("sub",{children:s.description})]})]}):a.jsx(z.Checkbox,{checked:k(s.value,i),label:a.jsxs("span",{className:n["option-copy"],children:[s.label,s.description&&a.jsx("sub",{children:s.description})]}),onChange:e=>m(s.value,e.target.checked,i)})},s.value);return a.jsxs("div",{className:n.search,"data-component":"search",children:[a.jsxs("div",{className:n.controls,"data-with-filters":t.length>0||void 0,children:[a.jsx(K.Input,{"aria-label":B,icon:"MagnifyingGlass",onChange:s=>w(s.target.value),placeholder:D,type:"search",value:I}),(t.length>0||d!==void 0)&&a.jsxs("div",{className:n.actions,children:[t.length>0&&a.jsx(h.Button,{"aria-expanded":u,"aria-haspopup":"dialog",badge:p.length,icon:"Funnel",onClick:()=>_(!0),variant:"tertiary",children:j}),d!==void 0&&a.jsx("div",{"aria-hidden":!d,"aria-label":$,className:n["loading-status"],role:"status",children:d&&a.jsx(Q.Loading,{size:"small"})})]})]}),p.length>0&&a.jsxs("div",{"aria-label":j,className:n.chips,children:[p.map(s=>a.jsx(H.Chip,{accessibleLabel:O(s),label:s.label,onDelete:()=>m(s.value,!1)},s.value)),a.jsx(h.Button,{onClick:()=>l==null?void 0:l([]),variant:"tertiary",children:v})]}),u&&a.jsx(E.Dialog,{"aria-labelledby":o,className:n["filter-dialog"],controls:a.jsxs(A.Controls,{children:[a.jsx(h.Button,{onClick:()=>{l==null||l([]),_(!1)},children:v}),a.jsx(h.Button,{onClick:()=>_(!1),variant:"primary",children:R})]}),header:a.jsx(J.Header,{children:a.jsx("h2",{id:o,children:M})}),open:!0,setOpen:_,children:a.jsx("div",{className:n["filter-groups"],"data-columns":f,children:t.map((s,i)=>a.jsxs("section",{"aria-labelledby":s.label?`${o}-${i}`:void 0,className:n["filter-group"],"data-column-span":s.columnSpan??1,role:s.control==="radio"?"radiogroup":"group",children:[s.label&&a.jsx("h3",{id:`${o}-${i}`,children:s.label}),s.options.map(e=>y(e,s)),s.collapsible&&a.jsx(P.Collapsible,{summary:s.collapsible.label,children:a.jsx("div",{className:n["collapsible-options"],children:s.collapsible.options.map(e=>y(e,s))})})]},s.label??i))})})]})};exports.Search=Y;
|
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
1
|
+
import { jsxs as n, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useId as T, useState as q, useMemo as A } from "react";
|
|
3
3
|
import { Button as p } from "../button/index.js";
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { Chip as
|
|
6
|
-
import { Collapsible as
|
|
7
|
-
import { C as
|
|
8
|
-
import { Dialog as
|
|
9
|
-
import { Header as
|
|
10
|
-
import { I as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"filter-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
import { Checkbox as C } from "../checkbox/index.js";
|
|
5
|
+
import { Chip as E } from "../chip/index.js";
|
|
6
|
+
import { Collapsible as J } from "../collapsible/index.js";
|
|
7
|
+
import { C as K } from "../../index-acMNM3VJ.js";
|
|
8
|
+
import { Dialog as P } from "../dialog/index.js";
|
|
9
|
+
import { Header as Q } from "../header/index.js";
|
|
10
|
+
import { I as U } from "../../index-6TyCExT0.js";
|
|
11
|
+
import { Loading as V } from "../loading/index.js";
|
|
12
|
+
import '../../assets/index9.css';const W = "_search_1r1ik_3", X = "_controls_1r1ik_15", Y = "_actions_1r1ik_36", Z = "_chips_1r1ik_56", L = "_radio_1r1ik_122", o = {
|
|
13
|
+
search: W,
|
|
14
|
+
controls: X,
|
|
15
|
+
actions: Y,
|
|
16
|
+
"loading-status": "_loading-status_1r1ik_46",
|
|
17
|
+
chips: Z,
|
|
18
|
+
"filter-dialog": "_filter-dialog_1r1ik_63",
|
|
19
|
+
"filter-groups": "_filter-groups_1r1ik_68",
|
|
20
|
+
"filter-group": "_filter-group_1r1ik_68",
|
|
21
|
+
"filter-option": "_filter-option_1r1ik_104",
|
|
22
|
+
"option-copy": "_option-copy_1r1ik_110",
|
|
23
|
+
radio: L,
|
|
24
|
+
"collapsible-options": "_collapsible-options_1r1ik_145"
|
|
25
|
+
}, ca = ({
|
|
26
|
+
filterButtonLabel: k = "Filters",
|
|
27
|
+
filterDialogColumns: D = 1,
|
|
28
|
+
filterDialogTitle: O = "Filters",
|
|
29
|
+
filterGroups: r = [],
|
|
30
|
+
isLoading: m,
|
|
31
|
+
loadingLabel: u = "Loading results",
|
|
32
|
+
onChange: x,
|
|
28
33
|
onSelectedFiltersChange: e,
|
|
29
|
-
removeFilterLabel:
|
|
30
|
-
resetLabel:
|
|
31
|
-
searchLabel:
|
|
32
|
-
searchPlaceholder:
|
|
33
|
-
selectedFilters:
|
|
34
|
-
showResultsLabel:
|
|
35
|
-
value:
|
|
34
|
+
removeFilterLabel: I = (c) => `Remove ${c.label} filter`,
|
|
35
|
+
resetLabel: f = "Reset",
|
|
36
|
+
searchLabel: j = "Search",
|
|
37
|
+
searchPlaceholder: R = "Search",
|
|
38
|
+
selectedFilters: d = [],
|
|
39
|
+
showResultsLabel: z = "Show results",
|
|
40
|
+
value: B = ""
|
|
36
41
|
}) => {
|
|
37
|
-
const
|
|
38
|
-
var
|
|
39
|
-
return [...a.options, ...((
|
|
40
|
-
}).map((a) => [a.value, a])), [
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
}),
|
|
44
|
-
var
|
|
42
|
+
const c = T(), [y, h] = q(!1), H = A(() => new Map(r.flatMap((a) => {
|
|
43
|
+
var l;
|
|
44
|
+
return [...a.options, ...((l = a.collapsible) == null ? void 0 : l.options) ?? []];
|
|
45
|
+
}).map((a) => [a.value, a])), [r]), _ = d.flatMap((a) => {
|
|
46
|
+
const l = H.get(a);
|
|
47
|
+
return l ? [l] : [];
|
|
48
|
+
}), b = (a, l, i) => {
|
|
49
|
+
var w;
|
|
45
50
|
if (!e) return;
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
e(
|
|
51
|
+
const v = /* @__PURE__ */ new Set([...(i == null ? void 0 : i.options.map((t) => t.value)) ?? [], ...((w = i == null ? void 0 : i.collapsible) == null ? void 0 : w.options.map((t) => t.value)) ?? []]), M = d.filter((t) => !v.has(t));
|
|
52
|
+
if (l && (i == null ? void 0 : i.defaultValue) === a) {
|
|
53
|
+
e(M);
|
|
49
54
|
return;
|
|
50
55
|
}
|
|
51
|
-
e(
|
|
52
|
-
},
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
},
|
|
56
|
-
/* @__PURE__ */ s("input", { checked:
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
e(l ? (i == null ? void 0 : i.control) === "radio" || (i == null ? void 0 : i.selectionMode) === "single" ? [...M, a] : [.../* @__PURE__ */ new Set([...d, a])] : d.filter((t) => t !== a));
|
|
57
|
+
}, N = (a, l) => {
|
|
58
|
+
var i;
|
|
59
|
+
return d.includes(a) || l.defaultValue === a && ![...l.options, ...((i = l.collapsible) == null ? void 0 : i.options) ?? []].some((v) => d.includes(v.value));
|
|
60
|
+
}, $ = (a, l) => /* @__PURE__ */ s("div", { className: o["filter-option"], "data-component": "renderfilter", children: l.control === "radio" ? /* @__PURE__ */ n("label", { className: o.radio, children: [
|
|
61
|
+
/* @__PURE__ */ s("input", { checked: N(a.value, l), name: `${c}-filter-${l.label ?? "group"}`, onChange: (i) => b(a.value, i.target.checked, l), type: "radio" }),
|
|
62
|
+
/* @__PURE__ */ n("span", { className: o["option-copy"], children: [
|
|
58
63
|
a.label,
|
|
59
64
|
a.description && /* @__PURE__ */ s("sub", { children: a.description })
|
|
60
65
|
] })
|
|
61
|
-
] }) : /* @__PURE__ */ s(
|
|
66
|
+
] }) : /* @__PURE__ */ s(C, { checked: N(a.value, l), label: /* @__PURE__ */ n("span", { className: o["option-copy"], children: [
|
|
62
67
|
a.label,
|
|
63
68
|
a.description && /* @__PURE__ */ s("sub", { children: a.description })
|
|
64
|
-
] }), onChange: (
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ s(
|
|
68
|
-
|
|
69
|
+
] }), onChange: (i) => b(a.value, i.target.checked, l) }) }, a.value);
|
|
70
|
+
return /* @__PURE__ */ n("div", { className: o.search, "data-component": "search", children: [
|
|
71
|
+
/* @__PURE__ */ n("div", { className: o.controls, "data-with-filters": r.length > 0 || void 0, children: [
|
|
72
|
+
/* @__PURE__ */ s(U, { "aria-label": j, icon: "MagnifyingGlass", onChange: (a) => x(a.target.value), placeholder: R, type: "search", value: B }),
|
|
73
|
+
(r.length > 0 || m !== void 0) && /* @__PURE__ */ n("div", { className: o.actions, children: [
|
|
74
|
+
r.length > 0 && /* @__PURE__ */ s(p, { "aria-expanded": y, "aria-haspopup": "dialog", badge: _.length, icon: "Funnel", onClick: () => h(!0), variant: "tertiary", children: k }),
|
|
75
|
+
m !== void 0 && /* @__PURE__ */ s("div", { "aria-hidden": !m, "aria-label": u, className: o["loading-status"], role: "status", children: m && /* @__PURE__ */ s(V, { size: "small" }) })
|
|
76
|
+
] })
|
|
69
77
|
] }),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */ s(p, { onClick: () => e == null ? void 0 : e([]), variant: "tertiary", children:
|
|
78
|
+
_.length > 0 && /* @__PURE__ */ n("div", { "aria-label": k, className: o.chips, children: [
|
|
79
|
+
_.map((a) => /* @__PURE__ */ s(E, { accessibleLabel: I(a), label: a.label, onDelete: () => b(a.value, !1) }, a.value)),
|
|
80
|
+
/* @__PURE__ */ s(p, { onClick: () => e == null ? void 0 : e([]), variant: "tertiary", children: f })
|
|
73
81
|
] }),
|
|
74
|
-
|
|
82
|
+
y && /* @__PURE__ */ s(P, { "aria-labelledby": c, className: o["filter-dialog"], controls: /* @__PURE__ */ n(K, { children: [
|
|
75
83
|
/* @__PURE__ */ s(p, { onClick: () => {
|
|
76
|
-
e == null || e([]),
|
|
77
|
-
}, children:
|
|
78
|
-
/* @__PURE__ */ s(p, { onClick: () =>
|
|
79
|
-
] }), header: /* @__PURE__ */ s(
|
|
80
|
-
a.label && /* @__PURE__ */ s("h3", { id: `${
|
|
81
|
-
a.options.map((
|
|
82
|
-
a.collapsible && /* @__PURE__ */ s(
|
|
83
|
-
] }, a.label ??
|
|
84
|
+
e == null || e([]), h(!1);
|
|
85
|
+
}, children: f }),
|
|
86
|
+
/* @__PURE__ */ s(p, { onClick: () => h(!1), variant: "primary", children: z })
|
|
87
|
+
] }), header: /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s("h2", { id: c, children: O }) }), open: !0, setOpen: h, children: /* @__PURE__ */ s("div", { className: o["filter-groups"], "data-columns": D, children: r.map((a, l) => /* @__PURE__ */ n("section", { "aria-labelledby": a.label ? `${c}-${l}` : void 0, className: o["filter-group"], "data-column-span": a.columnSpan ?? 1, role: a.control === "radio" ? "radiogroup" : "group", children: [
|
|
88
|
+
a.label && /* @__PURE__ */ s("h3", { id: `${c}-${l}`, children: a.label }),
|
|
89
|
+
a.options.map((i) => $(i, a)),
|
|
90
|
+
a.collapsible && /* @__PURE__ */ s(J, { summary: a.collapsible.label, children: /* @__PURE__ */ s("div", { className: o["collapsible-options"], children: a.collapsible.options.map((i) => $(i, a)) }) })
|
|
91
|
+
] }, a.label ?? l)) }) })
|
|
84
92
|
] });
|
|
85
93
|
};
|
|
86
94
|
export {
|
|
87
|
-
|
|
95
|
+
ca as Search
|
|
88
96
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -290,7 +290,7 @@ export declare const Divider: ({ className, ...props }: DividerProps) => JSX.Ele
|
|
|
290
290
|
|
|
291
291
|
export declare type DividerProps = React.ComponentPropsWithoutRef<'hr'>;
|
|
292
292
|
|
|
293
|
-
export declare const Dropdown: ({ children: selectElement, className, combobox, description, errorMessage, invalid, searchable: searchableProp, createOption, emptyLabel, errorLabel, onRetry, retryLabel, label, filterOptions, hasNextPage, loading, loadMoreLabel, onLoadMore, onOpenChange, onSearchChange, searchValue, renderOption, searchPlaceholder, selectedItems, variant, ...props }: DropdownProps) => JSX.Element;
|
|
293
|
+
export declare const Dropdown: ({ children: selectElement, className, combobox, description, errorMessage, invalid, searchable: searchableProp, createOption, emptyLabel, errorLabel, onRetry, retryLabel, label, filterOptions, hasNextPage, loading, loadingLabel, loadMoreLabel, onLoadMore, onOpenChange, onSearchChange, searchValue, renderOption, searchPlaceholder, selectedItems, variant, ...props }: DropdownProps) => JSX.Element;
|
|
294
294
|
|
|
295
295
|
export declare type DropdownCreateOption = {
|
|
296
296
|
isValid: (value: string) => boolean;
|
|
@@ -315,7 +315,6 @@ declare type DropdownProps = Omit<default_2.ComponentPropsWithoutRef<'div'>, 'ch
|
|
|
315
315
|
description?: string;
|
|
316
316
|
errorMessage?: default_2.ReactNode;
|
|
317
317
|
invalid?: boolean;
|
|
318
|
-
/** Defaults to true when there are more than eight visible options. */
|
|
319
318
|
searchable?: boolean;
|
|
320
319
|
createOption?: DropdownCreateOption;
|
|
321
320
|
emptyLabel?: string;
|
|
@@ -327,6 +326,7 @@ declare type DropdownProps = Omit<default_2.ComponentPropsWithoutRef<'div'>, 'ch
|
|
|
327
326
|
filterOptions?: boolean;
|
|
328
327
|
hasNextPage?: boolean;
|
|
329
328
|
loading?: boolean;
|
|
329
|
+
loadingLabel?: string;
|
|
330
330
|
loadMoreLabel?: string;
|
|
331
331
|
onLoadMore?: () => void;
|
|
332
332
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -1357,7 +1357,7 @@ export declare type RadioProps = Omit<React.ComponentPropsWithRef<'input'>, 'typ
|
|
|
1357
1357
|
label?: string;
|
|
1358
1358
|
};
|
|
1359
1359
|
|
|
1360
|
-
export declare const Search: ({ filterButtonLabel, filterDialogColumns, filterDialogTitle, filterGroups, onChange, onSelectedFiltersChange, removeFilterLabel, resetLabel, searchLabel, searchPlaceholder, selectedFilters, showResultsLabel, value, }: SearchProps) => JSX.Element;
|
|
1360
|
+
export declare const Search: ({ filterButtonLabel, filterDialogColumns, filterDialogTitle, filterGroups, isLoading, loadingLabel, onChange, onSelectedFiltersChange, removeFilterLabel, resetLabel, searchLabel, searchPlaceholder, selectedFilters, showResultsLabel, value, }: SearchProps) => JSX.Element;
|
|
1361
1361
|
|
|
1362
1362
|
export declare type SearchFilter = {
|
|
1363
1363
|
description?: string;
|
|
@@ -1383,6 +1383,8 @@ export declare type SearchProps = {
|
|
|
1383
1383
|
filterDialogColumns?: 1 | 2;
|
|
1384
1384
|
filterDialogTitle?: string;
|
|
1385
1385
|
filterGroups?: readonly SearchFilterGroup[];
|
|
1386
|
+
isLoading?: boolean;
|
|
1387
|
+
loadingLabel?: string;
|
|
1386
1388
|
onChange: (value: string) => void;
|
|
1387
1389
|
onSelectedFiltersChange?: (selectedFilters: string[]) => void;
|
|
1388
1390
|
removeFilterLabel?: (filter: SearchFilter) => string;
|
package/dist/tokens.json
CHANGED