@prolibu-suite/cobalt-core 0.11.2 → 0.11.3
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/custom-elements.json +71 -31
- package/dist/cjs/co-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/co-toggle-button.cjs.entry.js +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-efd3e0de.entry.js → p-9b114836.entry.js} +1 -1
- package/dist/cobalt/p-e5f0d560.entry.js +1 -0
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-area/co-color-area.js +2 -2
- package/dist/collection/components/co-color-slider/co-color-slider.js +1 -1
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +1 -1
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-document-editor/co-document-editor.js +5 -5
- package/dist/collection/components/co-option-list/co-option-list.css +30 -4
- package/dist/collection/components/co-popover/co-popover.js +1 -1
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-ref-field/co-ref-field.js +4 -4
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +43 -13
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-tree-item/co-tree-item.js +2 -2
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/{p-Cnfd6Zze.js → p-BqFBZ1PT.js} +1 -1
- package/dist/esm/co-chip_2.entry.js +1 -1
- package/dist/esm/co-toggle-button.entry.js +1 -1
- package/package.json +3 -3
- package/dist/cobalt/p-9ee5bef3.entry.js +0 -1
|
@@ -310,7 +310,7 @@ export class CoColorArea {
|
|
|
310
310
|
"references": {
|
|
311
311
|
"ColorAreaDetail": {
|
|
312
312
|
"location": "local",
|
|
313
|
-
"path": "/Users/agox/
|
|
313
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-area/co-color-area.tsx",
|
|
314
314
|
"id": "src/components/co-color-area/co-color-area.tsx::ColorAreaDetail"
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -331,7 +331,7 @@ export class CoColorArea {
|
|
|
331
331
|
"references": {
|
|
332
332
|
"ColorAreaDetail": {
|
|
333
333
|
"location": "local",
|
|
334
|
-
"path": "/Users/agox/
|
|
334
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-area/co-color-area.tsx",
|
|
335
335
|
"id": "src/components/co-color-area/co-color-area.tsx::ColorAreaDetail"
|
|
336
336
|
}
|
|
337
337
|
}
|
|
@@ -215,7 +215,7 @@ export class CoColorSlider {
|
|
|
215
215
|
"references": {
|
|
216
216
|
"ColorSliderChannel": {
|
|
217
217
|
"location": "local",
|
|
218
|
-
"path": "/Users/agox/
|
|
218
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-slider/co-color-slider.tsx",
|
|
219
219
|
"id": "src/components/co-color-slider/co-color-slider.tsx::ColorSliderChannel"
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -545,7 +545,7 @@ export class CoCombobox {
|
|
|
545
545
|
"references": {
|
|
546
546
|
"ComboboxOption": {
|
|
547
547
|
"location": "local",
|
|
548
|
-
"path": "/Users/agox/
|
|
548
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-combobox/co-combobox.tsx",
|
|
549
549
|
"id": "src/components/co-combobox/co-combobox.tsx::ComboboxOption"
|
|
550
550
|
}
|
|
551
551
|
}
|
|
@@ -257,7 +257,7 @@ export class CoCommandSearch {
|
|
|
257
257
|
"references": {
|
|
258
258
|
"CommandItem": {
|
|
259
259
|
"location": "local",
|
|
260
|
-
"path": "/Users/agox/
|
|
260
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-command-search/co-command-search.tsx",
|
|
261
261
|
"id": "src/components/co-command-search/co-command-search.tsx::CommandItem"
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -509,7 +509,7 @@ export class CoDataTable {
|
|
|
509
509
|
"references": {
|
|
510
510
|
"CoDataTableColumn": {
|
|
511
511
|
"location": "local",
|
|
512
|
-
"path": "/Users/agox/
|
|
512
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-data-table/co-data-table.tsx",
|
|
513
513
|
"id": "src/components/co-data-table/co-data-table.tsx::CoDataTableColumn"
|
|
514
514
|
}
|
|
515
515
|
}
|
|
@@ -1055,7 +1055,7 @@ export class CoDateRangePicker {
|
|
|
1055
1055
|
"references": {
|
|
1056
1056
|
"DateRangeValue": {
|
|
1057
1057
|
"location": "local",
|
|
1058
|
-
"path": "/Users/agox/
|
|
1058
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
|
|
1059
1059
|
"id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
@@ -1076,7 +1076,7 @@ export class CoDateRangePicker {
|
|
|
1076
1076
|
"references": {
|
|
1077
1077
|
"DateRangeValue": {
|
|
1078
1078
|
"location": "local",
|
|
1079
|
-
"path": "/Users/agox/
|
|
1079
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
|
|
1080
1080
|
"id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
@@ -936,7 +936,7 @@ export class CoDocumentEditor {
|
|
|
936
936
|
"references": {
|
|
937
937
|
"DocumentPageSize": {
|
|
938
938
|
"location": "local",
|
|
939
|
-
"path": "/Users/agox/
|
|
939
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
|
|
940
940
|
"id": "src/components/co-document-editor/co-document-editor.tsx::DocumentPageSize"
|
|
941
941
|
}
|
|
942
942
|
}
|
|
@@ -962,7 +962,7 @@ export class CoDocumentEditor {
|
|
|
962
962
|
"references": {
|
|
963
963
|
"DocumentMargins": {
|
|
964
964
|
"location": "local",
|
|
965
|
-
"path": "/Users/agox/
|
|
965
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
|
|
966
966
|
"id": "src/components/co-document-editor/co-document-editor.tsx::DocumentMargins"
|
|
967
967
|
}
|
|
968
968
|
}
|
|
@@ -1027,7 +1027,7 @@ export class CoDocumentEditor {
|
|
|
1027
1027
|
"references": {
|
|
1028
1028
|
"DocumentFeatures": {
|
|
1029
1029
|
"location": "local",
|
|
1030
|
-
"path": "/Users/agox/
|
|
1030
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
|
|
1031
1031
|
"id": "src/components/co-document-editor/co-document-editor.tsx::DocumentFeatures"
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
@@ -1220,7 +1220,7 @@ export class CoDocumentEditor {
|
|
|
1220
1220
|
"references": {
|
|
1221
1221
|
"DocumentHeaderDetail": {
|
|
1222
1222
|
"location": "local",
|
|
1223
|
-
"path": "/Users/agox/
|
|
1223
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
|
|
1224
1224
|
"id": "src/components/co-document-editor/co-document-editor.tsx::DocumentHeaderDetail"
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
@@ -1256,7 +1256,7 @@ export class CoDocumentEditor {
|
|
|
1256
1256
|
"references": {
|
|
1257
1257
|
"DocumentActionDetail": {
|
|
1258
1258
|
"location": "local",
|
|
1259
|
-
"path": "/Users/agox/
|
|
1259
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
|
|
1260
1260
|
"id": "src/components/co-document-editor/co-document-editor.tsx::DocumentActionDetail"
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
@@ -676,6 +676,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
676
676
|
* @prop --co-option-list-item-gap: Separación entre los elementos de una fila (ícono, textos, acciones).
|
|
677
677
|
* @prop --co-option-list-item-min-height: Alto mínimo de fila (default 32px); no cambia el paso fijo de la lista virtual.
|
|
678
678
|
* @prop --co-option-list-item-padding-y: Padding vertical de la fila.
|
|
679
|
+
* @prop --co-option-list-item-padding-start: Padding izquierdo de la fila (default 4px).
|
|
679
680
|
* @prop --co-option-list-item-radius: Radio de la fila.
|
|
680
681
|
* @prop --co-option-list-item-bg: Fondo de la fila en reposo.
|
|
681
682
|
* @prop --co-option-list-item-ring: Sombra/anillo de la fila en reposo.
|
|
@@ -688,6 +689,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
688
689
|
* @prop --co-option-list-icon-tile-radius: Radio del recuadro del ícono.
|
|
689
690
|
* @prop --co-option-list-icon-tile-mix: Porcentaje del tinte del ícono en el fondo del recuadro (default 12%).
|
|
690
691
|
* @prop --co-option-list-icon-tile-ring-mix: Porcentaje del tinte en el borde del recuadro (default 0%, sin borde).
|
|
692
|
+
* @prop --co-option-list-icon-tile-glyph-size: Lado del glifo dentro del recuadro del ícono (default 14px).
|
|
691
693
|
* @prop --co-option-list-search-height: Alto del buscador (default 32px).
|
|
692
694
|
* @prop --co-option-list-search-margin: Margen del buscador.
|
|
693
695
|
* @prop --co-option-list-search-padding: Padding del buscador.
|
|
@@ -697,7 +699,10 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
697
699
|
* @prop --co-option-list-search-border-focus: Color del borde del buscador con foco.
|
|
698
700
|
* @prop --co-option-list-search-bg-focus: Fondo del buscador con foco.
|
|
699
701
|
* @prop --co-option-list-search-caret: Color del cursor de texto del buscador.
|
|
702
|
+
* @prop --co-option-list-search-font-size: Tamaño del texto del buscador (default 14px).
|
|
703
|
+
* @prop --co-option-list-search-font-weight: Peso del texto del buscador (default 500).
|
|
700
704
|
* @prop --co-option-list-group-padding-top: Padding superior del encabezado de grupo.
|
|
705
|
+
* @prop --co-option-list-group-first-padding-top: Padding superior del PRIMER encabezado de grupo (default = el de todos).
|
|
701
706
|
* @prop --co-option-list-group-padding-bottom: Padding inferior del encabezado de grupo.
|
|
702
707
|
* @prop --co-option-list-group-font-family: Familia tipográfica del encabezado de grupo (default mono).
|
|
703
708
|
* @prop --co-option-list-group-font-size: Tamaño del encabezado de grupo.
|
|
@@ -742,7 +747,10 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
742
747
|
* `-search-margin` (12px 12px 0), `-search-padding` (0 8px 0 4px),
|
|
743
748
|
* `-search-border` (1px solid border-subtle), `-search-border-focus`
|
|
744
749
|
* (border-focus), `-search-bg` (transparent), `-search-bg-focus` (= bg),
|
|
745
|
-
* `-search-radius` (radius-xs) y `-search-caret` (auto).
|
|
750
|
+
* `-search-radius` (radius-xs) y `-search-caret` (auto). Tipografía del
|
|
751
|
+
* texto/placeholder: `-search-font-size` (14px) y `-search-font-weight` (500)
|
|
752
|
+
* — paletas con filas de 13 donde el buscador a 14/500 se leía más grande que
|
|
753
|
+
* la lista. Defaults = Figma. */
|
|
746
754
|
.co-option-list__search {
|
|
747
755
|
display: flex;
|
|
748
756
|
align-items: center;
|
|
@@ -779,8 +787,8 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
779
787
|
background: transparent;
|
|
780
788
|
padding: 0;
|
|
781
789
|
font-family: var(--co-font-family-primary, 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
|
|
782
|
-
font-size: var(--co-font-size-14, 14px);
|
|
783
|
-
font-weight: 500;
|
|
790
|
+
font-size: var(--co-option-list-search-font-size, var(--co-font-size-14, 14px));
|
|
791
|
+
font-weight: var(--co-option-list-search-font-weight, 500);
|
|
784
792
|
letter-spacing: var(--co-font-letter-spacing-body, -0.03em);
|
|
785
793
|
line-height: 1;
|
|
786
794
|
color: var(--co-semantic-text-default, #1f1c1b);
|
|
@@ -837,7 +845,9 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
837
845
|
min-width: 0;
|
|
838
846
|
min-height: var(--co-option-list-item-min-height, 32px);
|
|
839
847
|
box-sizing: border-box;
|
|
840
|
-
|
|
848
|
+
/* Overridable: `--co-option-list-item-padding-start` (default 4px) — paletas con tile grande que lo centran en la
|
|
849
|
+
fila con el mismo aire a la izquierda que arriba/abajo (fila 40 + tile 24: 8 por lado = 6 + el margen 2 del tile). */
|
|
850
|
+
padding: var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-spacing-sm2, 8px) var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-option-list-item-padding-start, var(--co-spacing-xs, 4px));
|
|
841
851
|
/* Overridables (paletas con filas-tarjeta, Attio): `--co-option-list-item-radius` (default 8px) y
|
|
842
852
|
`--co-option-list-item-font-size` (default 14px). */
|
|
843
853
|
border-radius: var(--co-option-list-item-radius, var(--co-border-radius-xs, 8px));
|
|
@@ -905,6 +915,15 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
905
915
|
color: var(--co-option-list-icon-tint);
|
|
906
916
|
}
|
|
907
917
|
|
|
918
|
+
/* Glifo del tile: `--co-option-list-icon-tile-glyph-size` (default 14px, el `size` que el .tsx le pasa al co-icon) —
|
|
919
|
+
paletas con tile de 24 que llevan el glifo de 16 del bloque del lienzo. El `!important` es necesario porque co-icon
|
|
920
|
+
fija su ancho/alto INLINE en el estilo de su Host (mismo caso que `--co-select-caret-size` en co-select.css); sin
|
|
921
|
+
setear la variable el glifo mide lo mismo que siempre. */
|
|
922
|
+
.co-option-list__icon-tile co-icon {
|
|
923
|
+
width: var(--co-option-list-icon-tile-glyph-size, 14px) !important;
|
|
924
|
+
height: var(--co-option-list-icon-tile-glyph-size, 14px) !important;
|
|
925
|
+
}
|
|
926
|
+
|
|
908
927
|
.co-option-list__dot {
|
|
909
928
|
flex-shrink: 0;
|
|
910
929
|
width: 10px;
|
|
@@ -1075,6 +1094,13 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
1075
1094
|
color: var(--co-option-list-group-color, var(--co-semantic-text-default, #1f1c1b));
|
|
1076
1095
|
}
|
|
1077
1096
|
|
|
1097
|
+
/* Primer rótulo de la lista: `--co-option-list-group-first-padding-top` (default = el de todos los rótulos) — paletas
|
|
1098
|
+
con aire grande ENTRE secciones que no quieren ese mismo aire bajo su cabecera (filtro/buscador): arriba del primero
|
|
1099
|
+
ya está el padding de la lista. */
|
|
1100
|
+
.co-option-list__group:first-child {
|
|
1101
|
+
padding-top: var(--co-option-list-group-first-padding-top, var(--co-option-list-group-padding-top, var(--co-spacing-sm2, 8px)));
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1078
1104
|
/* ── Clear row ───────────────────────────────────────────── */
|
|
1079
1105
|
.co-option-list__clear-row {
|
|
1080
1106
|
display: flex;
|
|
@@ -446,7 +446,7 @@ export class CoPopover {
|
|
|
446
446
|
"references": {
|
|
447
447
|
"PopoverPlacement": {
|
|
448
448
|
"location": "local",
|
|
449
|
-
"path": "/Users/agox/
|
|
449
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-popover/co-popover.tsx",
|
|
450
450
|
"id": "src/components/co-popover/co-popover.tsx::PopoverPlacement"
|
|
451
451
|
}
|
|
452
452
|
}
|
|
@@ -224,7 +224,7 @@ export class CoRadioGroup {
|
|
|
224
224
|
"references": {
|
|
225
225
|
"RadioOption": {
|
|
226
226
|
"location": "local",
|
|
227
|
-
"path": "/Users/agox/
|
|
227
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-radio-group/co-radio-group.tsx",
|
|
228
228
|
"id": "src/components/co-radio-group/co-radio-group.tsx::RadioOption"
|
|
229
229
|
}
|
|
230
230
|
}
|
|
@@ -1349,7 +1349,7 @@ export class CoRefField {
|
|
|
1349
1349
|
"references": {
|
|
1350
1350
|
"RefFieldOption": {
|
|
1351
1351
|
"location": "local",
|
|
1352
|
-
"path": "/Users/agox/
|
|
1352
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
|
|
1353
1353
|
"id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
@@ -1490,7 +1490,7 @@ export class CoRefField {
|
|
|
1490
1490
|
"references": {
|
|
1491
1491
|
"RefFieldOption": {
|
|
1492
1492
|
"location": "local",
|
|
1493
|
-
"path": "/Users/agox/
|
|
1493
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
|
|
1494
1494
|
"id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
@@ -1511,7 +1511,7 @@ export class CoRefField {
|
|
|
1511
1511
|
"references": {
|
|
1512
1512
|
"RefFieldOption": {
|
|
1513
1513
|
"location": "local",
|
|
1514
|
-
"path": "/Users/agox/
|
|
1514
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
|
|
1515
1515
|
"id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
@@ -1550,7 +1550,7 @@ export class CoRefField {
|
|
|
1550
1550
|
},
|
|
1551
1551
|
"RefFieldOption": {
|
|
1552
1552
|
"location": "local",
|
|
1553
|
-
"path": "/Users/agox/
|
|
1553
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
|
|
1554
1554
|
"id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
|
|
1555
1555
|
}
|
|
1556
1556
|
},
|
|
@@ -160,7 +160,7 @@ export class CoSegmentedBar {
|
|
|
160
160
|
"references": {
|
|
161
161
|
"CoSegment": {
|
|
162
162
|
"location": "local",
|
|
163
|
-
"path": "/Users/agox/
|
|
163
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-segmented-bar/co-segmented-bar.tsx",
|
|
164
164
|
"id": "src/components/co-segmented-bar/co-segmented-bar.tsx::CoSegment"
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -846,7 +846,7 @@ export class CoSelect {
|
|
|
846
846
|
"references": {
|
|
847
847
|
"SelectOption": {
|
|
848
848
|
"location": "local",
|
|
849
|
-
"path": "/Users/agox/
|
|
849
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-select/co-select.tsx",
|
|
850
850
|
"id": "src/components/co-select/co-select.tsx::SelectOption"
|
|
851
851
|
}
|
|
852
852
|
}
|
|
@@ -718,7 +718,7 @@ export class CoSidebarNav {
|
|
|
718
718
|
"references": {
|
|
719
719
|
"NavigateDetail": {
|
|
720
720
|
"location": "local",
|
|
721
|
-
"path": "/Users/agox/
|
|
721
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-sidebar-nav/co-sidebar-nav.tsx",
|
|
722
722
|
"id": "src/components/co-sidebar-nav/co-sidebar-nav.tsx::NavigateDetail"
|
|
723
723
|
}
|
|
724
724
|
}
|
|
@@ -189,7 +189,7 @@ export class CoToast {
|
|
|
189
189
|
"references": {
|
|
190
190
|
"CoToastActionsLayout": {
|
|
191
191
|
"location": "local",
|
|
192
|
-
"path": "/Users/agox/
|
|
192
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-toast/co-toast.tsx",
|
|
193
193
|
"id": "src/components/co-toast/co-toast.tsx::CoToastActionsLayout"
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -215,7 +215,7 @@ export class CoToast {
|
|
|
215
215
|
"references": {
|
|
216
216
|
"CoToastVariant": {
|
|
217
217
|
"location": "local",
|
|
218
|
-
"path": "/Users/agox/
|
|
218
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-toast/co-toast.tsx",
|
|
219
219
|
"id": "src/components/co-toast/co-toast.tsx::CoToastVariant"
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -3,7 +3,23 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @prop --co-toggle-button-width: Ancho del botón (default auto); útil para pastillas de ancho fijo.
|
|
5
5
|
* @prop --co-toggle-button-radius: Radio del botón (default según la talla); se sobrescribe sobre el elemento.
|
|
6
|
+
* @prop --co-toggle-button-color: Tinta de la pastilla no seleccionada (default: la de cada variante).
|
|
7
|
+
* @prop --co-toggle-button-color-selected: Tinta de la pastilla seleccionada (default: la de cada variante).
|
|
8
|
+
* @prop --co-toggle-button-color-hover: Tinta de la no seleccionada bajo el puntero; solo `track` (default: la de siempre).
|
|
6
9
|
*/
|
|
10
|
+
/* Knobs de TINTA (custom props heredables, sin ::part — mismo mecanismo que
|
|
11
|
+
--co-toggle-pill-* / --co-toggle-track-*): el consumidor las fija en el grupo
|
|
12
|
+
o en un ancestro y llegan a cada pastilla a través del shadow.
|
|
13
|
+
--co-toggle-button-color tinta de la pastilla NO seleccionada
|
|
14
|
+
--co-toggle-button-color-selected tinta de la seleccionada
|
|
15
|
+
--co-toggle-button-color-hover tinta de la no seleccionada bajo el puntero
|
|
16
|
+
(solo `track`, la única variante cuyo
|
|
17
|
+
hover ya cambiaba la tinta)
|
|
18
|
+
Cada regla lleva como fallback EXACTAMENTE el valor que tenía antes, así que
|
|
19
|
+
sin knobs nada cambia. Caso de uso: un `track` xs cuyos segmentos inactivos
|
|
20
|
+
deben leerse apagados (gris secundario) frente al activo (tinta plena) —
|
|
21
|
+
hoy el xs pinta los cuatro con la misma tinta y solo la pill delata el
|
|
22
|
+
estado. Lo fija `co-toggle-button.css.test.ts`. */
|
|
7
23
|
|
|
8
24
|
:host {
|
|
9
25
|
display: inline-flex;
|
|
@@ -33,7 +49,7 @@
|
|
|
33
49
|
background: color-mix(in srgb, var(--co-semantic-surface-secondary) 35%, transparent);
|
|
34
50
|
-webkit-backdrop-filter: var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));
|
|
35
51
|
backdrop-filter: var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));
|
|
36
|
-
color: var(--co-semantic-text-default);
|
|
52
|
+
color: var(--co-toggle-button-color, var(--co-semantic-text-default));
|
|
37
53
|
font-family: var(--co-font-family-primary);
|
|
38
54
|
font-weight: 500;
|
|
39
55
|
cursor: pointer;
|
|
@@ -43,11 +59,13 @@
|
|
|
43
59
|
line-height: 1;
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
/* Sizes
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.co-toggle-button--
|
|
50
|
-
.co-toggle-button--
|
|
62
|
+
/* Sizes. Tipografía overridable: `--co-toggle-button-font-size` (heredable, sin ::part) — un segmentado cuyo alto
|
|
63
|
+
fija `--co-toggle-pill-height` y necesita un paso de texto entre dos tamaños (p. ej. pill xs de 24 con rótulo 13).
|
|
64
|
+
Sin la variable cada tamaño conserva su fuente de siempre. */
|
|
65
|
+
.co-toggle-button--l { height: 48px; padding: 0 var(--co-spacing-lg); font-size: var(--co-toggle-button-font-size, var(--co-font-size-16)); }
|
|
66
|
+
.co-toggle-button--m { height: 40px; padding: 0 var(--co-spacing-md); font-size: var(--co-toggle-button-font-size, var(--co-font-size-14)); }
|
|
67
|
+
.co-toggle-button--s { height: 32px; padding: 0 var(--co-spacing-sm2); font-size: var(--co-toggle-button-font-size, var(--co-font-size-14)); }
|
|
68
|
+
.co-toggle-button--xs { height: 24px; padding: 0 var(--co-spacing-sm); font-size: var(--co-toggle-button-font-size, var(--co-font-size-12)); }
|
|
51
69
|
|
|
52
70
|
/* Icon-only */
|
|
53
71
|
.co-toggle-button--icon-only.co-toggle-button--l { width: 48px; padding: 0; }
|
|
@@ -65,7 +83,7 @@
|
|
|
65
83
|
reads as gray, which loses the strong active affordance. */
|
|
66
84
|
.co-toggle-button--selected {
|
|
67
85
|
background: var(--co-color-base-negro, #1f1c1b);
|
|
68
|
-
color: var(--co-color-base-blanco, #fff);
|
|
86
|
+
color: var(--co-toggle-button-color-selected, var(--co-color-base-blanco, #fff));
|
|
69
87
|
border-color: var(--co-color-base-negro, #1f1c1b);
|
|
70
88
|
}
|
|
71
89
|
|
|
@@ -136,7 +154,7 @@
|
|
|
136
154
|
border-radius: var(--co-toggle-pill-radius, 8px);
|
|
137
155
|
border-color: transparent;
|
|
138
156
|
background: transparent;
|
|
139
|
-
color: var(--co-semantic-text-secondary);
|
|
157
|
+
color: var(--co-toggle-button-color, var(--co-semantic-text-secondary));
|
|
140
158
|
box-shadow: none;
|
|
141
159
|
padding: 0 12px;
|
|
142
160
|
-webkit-backdrop-filter: none;
|
|
@@ -150,20 +168,24 @@
|
|
|
150
168
|
|
|
151
169
|
:host([variant='track']) .co-toggle-button:hover:not(:disabled) {
|
|
152
170
|
background: var(--co-semantic-surface-hover);
|
|
153
|
-
color: var(--co-semantic-text-default);
|
|
171
|
+
color: var(--co-toggle-button-color-hover, var(--co-semantic-text-default));
|
|
154
172
|
}
|
|
155
173
|
|
|
156
174
|
/* Pill seleccionada: superficie de página + hairline (la sombra sola no la
|
|
157
175
|
separaba del track). */
|
|
158
176
|
:host([variant='track']) .co-toggle-button--selected {
|
|
159
177
|
background: var(--co-semantic-surface-page);
|
|
160
|
-
color: var(--co-semantic-text-default);
|
|
178
|
+
color: var(--co-toggle-button-color-selected, var(--co-semantic-text-default));
|
|
161
179
|
border-color: var(--co-toggle-pill-border, var(--co-semantic-border-default));
|
|
162
180
|
box-shadow: var(--co-toggle-pill-shadow, var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)));
|
|
163
181
|
}
|
|
164
182
|
|
|
183
|
+
/* La tinta se repite acá porque la regla de hover de arriba (0,5,0) le gana a
|
|
184
|
+
la de la seleccionada (0,3,0): sin esta línea, el knob de hover pintaría la
|
|
185
|
+
pastilla ACTIVA al pasarle el puntero. Default = el de siempre. */
|
|
165
186
|
:host([variant='track']) .co-toggle-button--selected:hover:not(:disabled) {
|
|
166
187
|
background: var(--co-semantic-surface-page);
|
|
188
|
+
color: var(--co-toggle-button-color-selected, var(--co-semantic-text-default));
|
|
167
189
|
border-color: var(--co-toggle-pill-border, var(--co-semantic-border-default));
|
|
168
190
|
}
|
|
169
191
|
|
|
@@ -184,7 +206,15 @@
|
|
|
184
206
|
}
|
|
185
207
|
|
|
186
208
|
:host([variant='track'][size='xs']) .co-toggle-button:not(.co-toggle-button--selected) {
|
|
187
|
-
color: var(--co-semantic-text-default);
|
|
209
|
+
color: var(--co-toggle-button-color, var(--co-semantic-text-default));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* La regla de arriba (0,5,0) empata con el hover de `track` y va después: sin
|
|
213
|
+
esta, el xs nunca cambiaba de tinta bajo el puntero — invisible mientras
|
|
214
|
+
ambas decían text-default, pero con el knob de reposo en gris el hover se
|
|
215
|
+
quedaba gris. Default = text-default, el de siempre. */
|
|
216
|
+
:host([variant='track'][size='xs']) .co-toggle-button:not(.co-toggle-button--selected):hover:not(:disabled) {
|
|
217
|
+
color: var(--co-toggle-button-color-hover, var(--co-semantic-text-default));
|
|
188
218
|
}
|
|
189
219
|
|
|
190
220
|
:host([variant='track'][size='xs']) .co-toggle-button.co-toggle-button--icon-only {
|
|
@@ -204,7 +234,7 @@
|
|
|
204
234
|
border-radius: var(--co-border-radius-xxs);
|
|
205
235
|
border-color: transparent;
|
|
206
236
|
background: var(--co-semantic-surface-control, #f6f6f6);
|
|
207
|
-
color: var(--co-semantic-text-default);
|
|
237
|
+
color: var(--co-toggle-button-color, var(--co-semantic-text-default));
|
|
208
238
|
font-size: var(--co-font-size-12);
|
|
209
239
|
font-weight: var(--co-font-weight-regular);
|
|
210
240
|
/* El diseño pide el contenido a 8px del borde de la pastilla. El borde de
|
|
@@ -224,7 +254,7 @@
|
|
|
224
254
|
|
|
225
255
|
:host([variant='soft']) .co-toggle-button--selected {
|
|
226
256
|
background: var(--co-color-celeste-100);
|
|
227
|
-
color: var(--co-color-primary-azul);
|
|
257
|
+
color: var(--co-toggle-button-color-selected, var(--co-color-primary-azul));
|
|
228
258
|
border-color: transparent;
|
|
229
259
|
}
|
|
230
260
|
|
|
@@ -214,7 +214,7 @@ export class CoTransferList {
|
|
|
214
214
|
"references": {
|
|
215
215
|
"TransferOption": {
|
|
216
216
|
"location": "local",
|
|
217
|
-
"path": "/Users/agox/
|
|
217
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-transfer-list/co-transfer-list.tsx",
|
|
218
218
|
"id": "src/components/co-transfer-list/co-transfer-list.tsx::TransferOption"
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -243,7 +243,7 @@ export class CoTreeItem {
|
|
|
243
243
|
"references": {
|
|
244
244
|
"TreeItemSelection": {
|
|
245
245
|
"location": "local",
|
|
246
|
-
"path": "/Users/agox/
|
|
246
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-tree-item/co-tree-item.tsx",
|
|
247
247
|
"id": "src/components/co-tree-item/co-tree-item.tsx::TreeItemSelection"
|
|
248
248
|
}
|
|
249
249
|
}
|
|
@@ -269,7 +269,7 @@ export class CoTreeItem {
|
|
|
269
269
|
"references": {
|
|
270
270
|
"TreeItemSize": {
|
|
271
271
|
"location": "local",
|
|
272
|
-
"path": "/Users/agox/
|
|
272
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-tree-item/co-tree-item.tsx",
|
|
273
273
|
"id": "src/components/co-tree-item/co-tree-item.tsx::TreeItemSize"
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as o,c,h as a}from"./index.js";import{R as i}from"./p-CWneqh4n.js";import{d as s}from"./p-VcrjNCew.js";import{d as r}from"./p-C_6szR7t.js";import{d as l}from"./p-KK2vAKs-.js";import{d as n}from"./p-8XzG8pzY.js";import{d as p}from"./p-BH184F0X.js";import{d as h}from"./p-Cnfd6Zze.js";import{d}from"./p-9VoFSbIH.js";const u=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSearch=c(this,"coSearch",7),this.coChange=c(this,"coChange",7),this.coClear=c(this,"coClear",7),this.required=!1,this.placeholder="Search…",this.disabled=!1,this.clearable=!0,this.layout="vertical",this.size="md",this.status="default",this.options="[]",this.value="",this.multiple=!1,this.loading=!1,this.minChars=1,this.searchDebounce=300,this.emptyMessage="No results",this.isOpen=!1,this.query="",this.focused=!1,this.handleInput=e=>{const t=e.target.value;this.query=t,this.debounceTimer&&clearTimeout(this.debounceTimer),t.length>=this.minChars?(this.debounceTimer=setTimeout((()=>this.coSearch.emit(t)),this.searchDebounce),this.isOpen=!0):this.isOpen=!1},this.handleFocus=()=>{this.focused=!0,this.query.length>=this.minChars&&this.parsedOptions.length>0&&(this.isOpen=!0)},this.handleClear=e=>{var t;e.stopPropagation(),this.query="",this.value=this.multiple?"[]":"",this.isOpen=!1,this.coClear.emit(),this.coChange.emit({value:this.multiple?[]:"",item:null}),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleChipRemove=e=>{const t=this.selectedValues.filter((t=>t!==e));this.value=JSON.stringify(t),this.coChange.emit({value:t,item:{_id:e,label:e}})},this.handleListChange=e=>{if(null==e.value)return this.value=this.multiple?"[]":"",this.query="",this.isOpen=!1,void this.coChange.emit({value:null,item:null});this.multiple?(this.value=JSON.stringify(e.value),this.coChange.emit({value:e.value,item:e.item})):(this.value=e.value,this.query=e.item.label,this.isOpen=!1,this.coChange.emit({value:e.value,item:e.item}))},this.handleInputKeyDown=async e=>{"Escape"!==e.key?this.isOpen&&this.optionListEl&&("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key||(e.preventDefault(),await this.optionListEl.handleKey(e))):this.isOpen=!1}}get parsedOptions(){let e=this.options;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return[]}return Array.isArray(e)?e.map((e=>"string"==typeof e?{label:e,value:e}:e)):[]}get selectedValues(){if(this.multiple){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(e){return this.value?[this.value]:[]}return this.value}return"string"==typeof this.value&&this.value?[this.value]:[]}get hasValue(){return this.selectedValues.length>0}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}componentWillLoad(){this.syncQueryFromValue()}onOptionsChange(){this.query.length>=this.minChars&&(this.isOpen=!0),this.focused||this.syncQueryFromValue()}onValueChange(){this.syncQueryFromValue()}syncQueryFromValue(){if(!this.multiple&&"string"==typeof this.value&&this.value){const e=this.parsedOptions.find((e=>e.value===this.value));this.query=e?e.label:this.value}else this.multiple||this.value||(this.query="")}handleDocumentClick(e){this.el.contains(e.target)||(this.isOpen=!1,this.focused=!1)}render(){const e=this.parsedOptions,t=this.selectedValues;return a("div",{key:"02fe5e70777f1a39038af676c76032ae1fbecbc8",class:{"co-autocomplete":!0,"co-autocomplete--disabled":this.disabled,"co-autocomplete--focused":this.focused,["co-autocomplete--"+this.size]:!0,["co-autocomplete--"+this.status]:"default"!==this.status}},(this.label||this.secondaryLabel)&&a("div",{key:"a9237e72752d5d3921d70cb2d63a160625db7e62",class:"co-autocomplete__labels"},this.label&&a("label",{key:"f1284520b961bf6598e4b9c8a3d943b8b1aa847f",class:"co-autocomplete__label"},this.label,a(i,{key:"6c40530c3e2dca2b3adef8a8ce00c256b7070b48",required:this.required})),this.secondaryLabel&&a("span",{key:"37a0de4ba199f1bc6503543e18261623642c00cf",class:"co-autocomplete__secondary-label"},this.secondaryLabel)),a("div",{key:"30ff3eacbf9634085b212135356c3edbef6e8df9",class:"co-autocomplete__field"},this.iconLeft&&a("co-icon",{key:"3b8c564aae36e7db59c39fcc31fda7d98f55fae8",name:this.iconLeft,size:16,class:"co-autocomplete__icon"}),this.multiple&&t.length>0&&a("div",{key:"df7f0b08d2b456a048368f80c828ee83502b0a20",class:"co-autocomplete__chips"},t.map((e=>{const t=this.parsedOptions.find((t=>t.value===e));return a("co-chip",{label:t?t.label:e,size:"small",removable:!0,onCoRemove:()=>this.handleChipRemove(e)})}))),a("input",{key:"e2d9cfa48001c20aa9e8a4ef5800135172b2aff9",ref:e=>this.inputEl=e,class:"co-autocomplete__input",type:"text",value:this.query,placeholder:this.placeholder,disabled:this.disabled,onInput:this.handleInput,onFocus:this.handleFocus,onKeyDown:this.handleInputKeyDown}),this.loading&&a("div",{key:"e58449cb033553a123f3c2b1daa9b9c62a571273",class:"co-autocomplete__spinner"}),this.clearable&&(this.hasValue||this.query)&&!this.disabled&&a("button",{key:"ea8021e0807cd0eece9933f84772f5f497d2a63c",class:"co-autocomplete__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},a("co-icon",{key:"67a2f961d0ece0178811aa04fd9e5a082976ef6a",name:"x-circle",size:16,weight:"fill"}))),this.isOpen&&a("div",{key:"562cc6f307edd60c361c60974d0423550d8f681a",class:"co-autocomplete__dropdown"},a("co-option-list",{key:"3dec3da0d38adb8986b57960c74b697ffbc211dd",ref:e=>this.optionListEl=e,items:JSON.stringify(e.map((e=>({_id:e.value,label:e.label,icon:e.icon,disabled:e.disabled})))),value:this.multiple?JSON.stringify(this.selectedValues):this.selectedValues[0]||"",multiple:this.multiple,selectedAffordance:"check",virtual:!0,loading:this.loading,emptyMessage:this.emptyMessage,onCoChange:e=>this.handleListChange(e.detail)})),this.helperText&&a("div",{key:"5c21f62defe09b0160aeec8eaeaa881408dbe964",class:"co-autocomplete__helper co-autocomplete__helper--"+this.status},this.statusIcon&&a("co-icon",{key:"166ccdb5f1e308bb0212c473881bb36a33a8d2e4",name:this.statusIcon,size:14,weight:"fill",class:"co-autocomplete__helper-icon"}),a("span",{key:"bf4b038b665c269484b3bf841b19c92d5b0ceb27",class:"co-autocomplete__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-autocomplete{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-autocomplete__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-autocomplete__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-autocomplete__secondary-label{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-autocomplete--disabled .co-autocomplete__label,.co-autocomplete--disabled .co-autocomplete__secondary-label{color:var(--co-semantic-text-disabled)}.co-autocomplete__field{display:flex;align-items:center;flex-wrap:wrap;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete--s .co-autocomplete__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-autocomplete--sm .co-autocomplete__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-autocomplete--lg .co-autocomplete__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-autocomplete--focused .co-autocomplete__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-autocomplete--disabled .co-autocomplete__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-autocomplete--error .co-autocomplete__field{border-color:var(--co-semantic-status-error)}.co-autocomplete--success .co-autocomplete__field{border-color:var(--co-semantic-status-success)}.co-autocomplete--warning .co-autocomplete__field{border-color:var(--co-color-status-review)}.co-autocomplete--info .co-autocomplete__field{border-color:var(--co-semantic-status-info)}.co-autocomplete__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-autocomplete__chips{display:flex;flex-wrap:wrap;gap:var(--co-spacing-xs)}.co-autocomplete__input{flex:1;min-width:80px;border:none;background:transparent;color:var(--co-semantic-text-default);font-family:inherit;font-size:inherit;font-weight:400;line-height:1;padding:0;outline:none}.co-autocomplete__input::placeholder{color:var(--co-semantic-text-muted)}.co-autocomplete--disabled .co-autocomplete__input{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-autocomplete__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete__clear:hover{color:var(--co-semantic-text-default)}.co-autocomplete__spinner{width:16px;height:16px;border:2px solid var(--co-semantic-border-subtle);border-top-color:var(--co-semantic-text-default);border-radius:var(--co-border-radius-full);animation:co-spin 0.6s linear infinite;flex-shrink:0}@keyframes co-spin{to{transform:rotate(360deg)}}.co-autocomplete__dropdown{position:absolute;top:100%;left:0;right:0;z-index:100;margin-top:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-sm, 12px);box-shadow:0 4px 16px rgba(31, 28, 27, 0.08);overflow:hidden;}.co-autocomplete__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-autocomplete__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-autocomplete__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-autocomplete__helper--error .co-autocomplete__helper-icon,.co-autocomplete__helper--error .co-autocomplete__helper-text{color:var(--co-semantic-status-error)}.co-autocomplete__helper--success .co-autocomplete__helper-icon,.co-autocomplete__helper--success .co-autocomplete__helper-text{color:var(--co-semantic-status-success)}.co-autocomplete__helper--warning .co-autocomplete__helper-icon,.co-autocomplete__helper--warning .co-autocomplete__helper-text{color:var(--co-color-status-review)}.co-autocomplete__helper--info .co-autocomplete__helper-icon,.co-autocomplete__helper--info .co-autocomplete__helper-text{color:var(--co-semantic-status-info)}:host([layout='horizontal']) .co-autocomplete{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-autocomplete__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-autocomplete__label{white-space:normal}:host([layout='horizontal']) .co-autocomplete>:not(.co-autocomplete__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}"}},[1,"co-autocomplete",{label:[1],required:[4],secondaryLabel:[1,"secondary-label"],placeholder:[1],disabled:[4],iconLeft:[1,"icon-left"],clearable:[4],helperText:[1,"helper-text"],layout:[513],size:[513],status:[1],options:[1],value:[1025],multiple:[4],loading:[4],minChars:[2,"min-chars"],searchDebounce:[2,"search-debounce"],emptyMessage:[1,"empty-message"],isOpen:[32],query:[32],focused:[32]},[[4,"click","handleDocumentClick"]],{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}]);function m(){"undefined"!=typeof customElements&&["co-autocomplete","co-avatar","co-chip","co-icon","co-kbd","co-loader","co-option-list","co-tooltip"].forEach((t=>{switch(t){case"co-autocomplete":customElements.get(e(t))||customElements.define(e(t),u);break;case"co-avatar":customElements.get(e(t))||s();break;case"co-chip":customElements.get(e(t))||r();break;case"co-icon":customElements.get(e(t))||l();break;case"co-kbd":customElements.get(e(t))||n();break;case"co-loader":customElements.get(e(t))||p();break;case"co-option-list":customElements.get(e(t))||h();break;case"co-tooltip":customElements.get(e(t))||d()}}))}m();const f=u,b=m;export{f as CoAutocomplete,b as defineCustomElement}
|
|
1
|
+
import{t as e,p as t,H as o,c,h as a}from"./index.js";import{R as i}from"./p-CWneqh4n.js";import{d as s}from"./p-VcrjNCew.js";import{d as r}from"./p-C_6szR7t.js";import{d as l}from"./p-KK2vAKs-.js";import{d as n}from"./p-8XzG8pzY.js";import{d as p}from"./p-BH184F0X.js";import{d as h}from"./p-BqFBZ1PT.js";import{d}from"./p-9VoFSbIH.js";const u=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSearch=c(this,"coSearch",7),this.coChange=c(this,"coChange",7),this.coClear=c(this,"coClear",7),this.required=!1,this.placeholder="Search…",this.disabled=!1,this.clearable=!0,this.layout="vertical",this.size="md",this.status="default",this.options="[]",this.value="",this.multiple=!1,this.loading=!1,this.minChars=1,this.searchDebounce=300,this.emptyMessage="No results",this.isOpen=!1,this.query="",this.focused=!1,this.handleInput=e=>{const t=e.target.value;this.query=t,this.debounceTimer&&clearTimeout(this.debounceTimer),t.length>=this.minChars?(this.debounceTimer=setTimeout((()=>this.coSearch.emit(t)),this.searchDebounce),this.isOpen=!0):this.isOpen=!1},this.handleFocus=()=>{this.focused=!0,this.query.length>=this.minChars&&this.parsedOptions.length>0&&(this.isOpen=!0)},this.handleClear=e=>{var t;e.stopPropagation(),this.query="",this.value=this.multiple?"[]":"",this.isOpen=!1,this.coClear.emit(),this.coChange.emit({value:this.multiple?[]:"",item:null}),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleChipRemove=e=>{const t=this.selectedValues.filter((t=>t!==e));this.value=JSON.stringify(t),this.coChange.emit({value:t,item:{_id:e,label:e}})},this.handleListChange=e=>{if(null==e.value)return this.value=this.multiple?"[]":"",this.query="",this.isOpen=!1,void this.coChange.emit({value:null,item:null});this.multiple?(this.value=JSON.stringify(e.value),this.coChange.emit({value:e.value,item:e.item})):(this.value=e.value,this.query=e.item.label,this.isOpen=!1,this.coChange.emit({value:e.value,item:e.item}))},this.handleInputKeyDown=async e=>{"Escape"!==e.key?this.isOpen&&this.optionListEl&&("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key||(e.preventDefault(),await this.optionListEl.handleKey(e))):this.isOpen=!1}}get parsedOptions(){let e=this.options;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return[]}return Array.isArray(e)?e.map((e=>"string"==typeof e?{label:e,value:e}:e)):[]}get selectedValues(){if(this.multiple){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(e){return this.value?[this.value]:[]}return this.value}return"string"==typeof this.value&&this.value?[this.value]:[]}get hasValue(){return this.selectedValues.length>0}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}componentWillLoad(){this.syncQueryFromValue()}onOptionsChange(){this.query.length>=this.minChars&&(this.isOpen=!0),this.focused||this.syncQueryFromValue()}onValueChange(){this.syncQueryFromValue()}syncQueryFromValue(){if(!this.multiple&&"string"==typeof this.value&&this.value){const e=this.parsedOptions.find((e=>e.value===this.value));this.query=e?e.label:this.value}else this.multiple||this.value||(this.query="")}handleDocumentClick(e){this.el.contains(e.target)||(this.isOpen=!1,this.focused=!1)}render(){const e=this.parsedOptions,t=this.selectedValues;return a("div",{key:"02fe5e70777f1a39038af676c76032ae1fbecbc8",class:{"co-autocomplete":!0,"co-autocomplete--disabled":this.disabled,"co-autocomplete--focused":this.focused,["co-autocomplete--"+this.size]:!0,["co-autocomplete--"+this.status]:"default"!==this.status}},(this.label||this.secondaryLabel)&&a("div",{key:"a9237e72752d5d3921d70cb2d63a160625db7e62",class:"co-autocomplete__labels"},this.label&&a("label",{key:"f1284520b961bf6598e4b9c8a3d943b8b1aa847f",class:"co-autocomplete__label"},this.label,a(i,{key:"6c40530c3e2dca2b3adef8a8ce00c256b7070b48",required:this.required})),this.secondaryLabel&&a("span",{key:"37a0de4ba199f1bc6503543e18261623642c00cf",class:"co-autocomplete__secondary-label"},this.secondaryLabel)),a("div",{key:"30ff3eacbf9634085b212135356c3edbef6e8df9",class:"co-autocomplete__field"},this.iconLeft&&a("co-icon",{key:"3b8c564aae36e7db59c39fcc31fda7d98f55fae8",name:this.iconLeft,size:16,class:"co-autocomplete__icon"}),this.multiple&&t.length>0&&a("div",{key:"df7f0b08d2b456a048368f80c828ee83502b0a20",class:"co-autocomplete__chips"},t.map((e=>{const t=this.parsedOptions.find((t=>t.value===e));return a("co-chip",{label:t?t.label:e,size:"small",removable:!0,onCoRemove:()=>this.handleChipRemove(e)})}))),a("input",{key:"e2d9cfa48001c20aa9e8a4ef5800135172b2aff9",ref:e=>this.inputEl=e,class:"co-autocomplete__input",type:"text",value:this.query,placeholder:this.placeholder,disabled:this.disabled,onInput:this.handleInput,onFocus:this.handleFocus,onKeyDown:this.handleInputKeyDown}),this.loading&&a("div",{key:"e58449cb033553a123f3c2b1daa9b9c62a571273",class:"co-autocomplete__spinner"}),this.clearable&&(this.hasValue||this.query)&&!this.disabled&&a("button",{key:"ea8021e0807cd0eece9933f84772f5f497d2a63c",class:"co-autocomplete__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},a("co-icon",{key:"67a2f961d0ece0178811aa04fd9e5a082976ef6a",name:"x-circle",size:16,weight:"fill"}))),this.isOpen&&a("div",{key:"562cc6f307edd60c361c60974d0423550d8f681a",class:"co-autocomplete__dropdown"},a("co-option-list",{key:"3dec3da0d38adb8986b57960c74b697ffbc211dd",ref:e=>this.optionListEl=e,items:JSON.stringify(e.map((e=>({_id:e.value,label:e.label,icon:e.icon,disabled:e.disabled})))),value:this.multiple?JSON.stringify(this.selectedValues):this.selectedValues[0]||"",multiple:this.multiple,selectedAffordance:"check",virtual:!0,loading:this.loading,emptyMessage:this.emptyMessage,onCoChange:e=>this.handleListChange(e.detail)})),this.helperText&&a("div",{key:"5c21f62defe09b0160aeec8eaeaa881408dbe964",class:"co-autocomplete__helper co-autocomplete__helper--"+this.status},this.statusIcon&&a("co-icon",{key:"166ccdb5f1e308bb0212c473881bb36a33a8d2e4",name:this.statusIcon,size:14,weight:"fill",class:"co-autocomplete__helper-icon"}),a("span",{key:"bf4b038b665c269484b3bf841b19c92d5b0ceb27",class:"co-autocomplete__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-autocomplete{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-autocomplete__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-autocomplete__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-autocomplete__secondary-label{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-autocomplete--disabled .co-autocomplete__label,.co-autocomplete--disabled .co-autocomplete__secondary-label{color:var(--co-semantic-text-disabled)}.co-autocomplete__field{display:flex;align-items:center;flex-wrap:wrap;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete--s .co-autocomplete__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-autocomplete--sm .co-autocomplete__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-autocomplete--lg .co-autocomplete__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-autocomplete--focused .co-autocomplete__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-autocomplete--disabled .co-autocomplete__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-autocomplete--error .co-autocomplete__field{border-color:var(--co-semantic-status-error)}.co-autocomplete--success .co-autocomplete__field{border-color:var(--co-semantic-status-success)}.co-autocomplete--warning .co-autocomplete__field{border-color:var(--co-color-status-review)}.co-autocomplete--info .co-autocomplete__field{border-color:var(--co-semantic-status-info)}.co-autocomplete__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-autocomplete__chips{display:flex;flex-wrap:wrap;gap:var(--co-spacing-xs)}.co-autocomplete__input{flex:1;min-width:80px;border:none;background:transparent;color:var(--co-semantic-text-default);font-family:inherit;font-size:inherit;font-weight:400;line-height:1;padding:0;outline:none}.co-autocomplete__input::placeholder{color:var(--co-semantic-text-muted)}.co-autocomplete--disabled .co-autocomplete__input{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-autocomplete__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete__clear:hover{color:var(--co-semantic-text-default)}.co-autocomplete__spinner{width:16px;height:16px;border:2px solid var(--co-semantic-border-subtle);border-top-color:var(--co-semantic-text-default);border-radius:var(--co-border-radius-full);animation:co-spin 0.6s linear infinite;flex-shrink:0}@keyframes co-spin{to{transform:rotate(360deg)}}.co-autocomplete__dropdown{position:absolute;top:100%;left:0;right:0;z-index:100;margin-top:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-sm, 12px);box-shadow:0 4px 16px rgba(31, 28, 27, 0.08);overflow:hidden;}.co-autocomplete__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-autocomplete__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-autocomplete__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-autocomplete__helper--error .co-autocomplete__helper-icon,.co-autocomplete__helper--error .co-autocomplete__helper-text{color:var(--co-semantic-status-error)}.co-autocomplete__helper--success .co-autocomplete__helper-icon,.co-autocomplete__helper--success .co-autocomplete__helper-text{color:var(--co-semantic-status-success)}.co-autocomplete__helper--warning .co-autocomplete__helper-icon,.co-autocomplete__helper--warning .co-autocomplete__helper-text{color:var(--co-color-status-review)}.co-autocomplete__helper--info .co-autocomplete__helper-icon,.co-autocomplete__helper--info .co-autocomplete__helper-text{color:var(--co-semantic-status-info)}:host([layout='horizontal']) .co-autocomplete{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-autocomplete__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-autocomplete__label{white-space:normal}:host([layout='horizontal']) .co-autocomplete>:not(.co-autocomplete__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}"}},[1,"co-autocomplete",{label:[1],required:[4],secondaryLabel:[1,"secondary-label"],placeholder:[1],disabled:[4],iconLeft:[1,"icon-left"],clearable:[4],helperText:[1,"helper-text"],layout:[513],size:[513],status:[1],options:[1],value:[1025],multiple:[4],loading:[4],minChars:[2,"min-chars"],searchDebounce:[2,"search-debounce"],emptyMessage:[1,"empty-message"],isOpen:[32],query:[32],focused:[32]},[[4,"click","handleDocumentClick"]],{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}]);function m(){"undefined"!=typeof customElements&&["co-autocomplete","co-avatar","co-chip","co-icon","co-kbd","co-loader","co-option-list","co-tooltip"].forEach((t=>{switch(t){case"co-autocomplete":customElements.get(e(t))||customElements.define(e(t),u);break;case"co-avatar":customElements.get(e(t))||s();break;case"co-chip":customElements.get(e(t))||r();break;case"co-icon":customElements.get(e(t))||l();break;case"co-kbd":customElements.get(e(t))||n();break;case"co-loader":customElements.get(e(t))||p();break;case"co-option-list":customElements.get(e(t))||h();break;case"co-tooltip":customElements.get(e(t))||d()}}))}m();const f=u,b=m;export{f as CoAutocomplete,b as defineCustomElement}
|