bord-design-system 0.0.29 → 0.0.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"BordIncidentClosureList.d.ts","sourceRoot":"","sources":["../../../src/components/BordIncidentClosureList/BordIncidentClosureList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAyB,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACvG,OAAO,gCAAgC,CAAC;AAOxC;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,kHAQ1B,wBAAwB,4CA+F1B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"BordIncidentClosureList.d.ts","sourceRoot":"","sources":["../../../src/components/BordIncidentClosureList/BordIncidentClosureList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAyB,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACvG,OAAO,gCAAgC,CAAC;AAOxC;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,kHAQ1B,wBAAwB,4CAwG1B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -4,6 +4,7 @@ export interface IBordClosableIncident {
4
4
  visibleId: string;
5
5
  createdAtLabel: string;
6
6
  createdBy: string;
7
+ isReadOnly?: boolean;
7
8
  }
8
9
  export interface IBordIncidentClosureList {
9
10
  incidents: IBordClosableIncident[];
@@ -1 +1 @@
1
- {"version":3,"file":"BordIncidentClosureList.types.d.ts","sourceRoot":"","sources":["../../../src/components/BordIncidentClosureList/BordIncidentClosureList.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"BordIncidentClosureList.types.d.ts","sourceRoot":"","sources":["../../../src/components/BordIncidentClosureList/BordIncidentClosureList.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/index.d.ts CHANGED
@@ -2273,6 +2273,7 @@ interface IBordClosableIncident {
2273
2273
  visibleId: string;
2274
2274
  createdAtLabel: string;
2275
2275
  createdBy: string;
2276
+ isReadOnly?: boolean;
2276
2277
  }
2277
2278
  interface IBordIncidentClosureList {
2278
2279
  incidents: IBordClosableIncident[];
package/dist/index.esm.js CHANGED
@@ -43398,7 +43398,7 @@ const BordIncidentDatesForm = ({ value, onChange, slaStartDate, slaEndDate, pick
43398
43398
  return (jsxs("div", { className: rootClassName, children: [slaRange && (jsxs("div", { className: "bordIncidentDatesFormDSslaBanner", children: [jsx("span", { className: "bordIncidentDatesFormDSslaBannerIcon", "aria-hidden": true, children: jsx(BordOneToneIcon, { variant: "info", standardSize: SLA_BANNER_ICON_SIZE, className: "bordIncidentDatesFormDSslaBannerIconSvg" }) }), jsx("span", { className: "bordIncidentDatesFormDSslaBannerLabel", children: slaBannerLabel }), jsx("span", { className: "bordIncidentDatesFormDSslaBannerRange", children: slaRange })] })), dateFields.length > 0 && (jsx("div", { className: "bordIncidentDatesFormDSdates", children: dateFields.map(({ key, label }) => (jsx("div", { className: "bordIncidentDatesFormDSdateField", children: jsx(BordDatePicker, { label: label, isFilled: Boolean(value[key]), defaultValue: value[key], updateCurrentValueCallback: (v) => update(key, v) }) }, key))) })), trackingFields.map(({ key, label, placeholder }) => (jsx("div", { className: "bordIncidentDatesFormDStrackingField", children: jsx(BordTextInput, { label: label, placeholder: placeholder, currentText: value[key] ?? '', isFilled: Boolean(value[key]), setCurrentText: (v) => update(key, v), hideErrorText: true }) }, key)))] }));
43399
43399
  };
43400
43400
 
43401
- var css_248z$e = ".bordIncidentClosureListDS{display:block;width:100%}.bordIncidentClosureListDS .bordIncidentClosureListDSselectAll{display:flex;justify-content:flex-end;margin-bottom:1.2rem}.bordIncidentClosureListDS .bordIncidentClosureListDSsearch{align-items:center;background-color:var(--ds-c-layout-l1);border-color:var(--ds-c-stroke-default);border-radius:.6rem;border-style:solid;border-width:1px;cursor:text;display:flex;gap:.8rem;height:4rem;margin-bottom:1.6rem;padding-left:1.2rem;padding-right:1.2rem;position:relative}.bordIncidentClosureListDS .bordIncidentClosureListDSsearch:focus-within{border-color:var(--ds-c-primary-bg-default)}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchIcon{align-items:center;color:var(--ds-c-content-secondary);display:flex;flex-shrink:0;justify-content:center}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput{background-color:transparent;border-style:none;color:var(--ds-c-content-default);flex:1 1 0%;font-size:1.2rem;line-height:1.5rem;outline:2px solid transparent;outline-offset:2px}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput::-moz-placeholder{color:var(--ds-c-content-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput::placeholder{color:var(--ds-c-content-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSlist{display:flex;flex-direction:column;gap:.8rem;list-style-type:none;margin:0;padding:0}.bordIncidentClosureListDS .bordIncidentClosureListDSitem{--tw-bg-opacity:1;align-items:flex-start;background-color:rgb(250 250 249/var(--tw-bg-opacity));border-color:var(--ds-c-stroke-default);border-radius:.6rem;border-style:solid;border-width:1px;display:flex;gap:1.2rem;padding:1.2rem;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.bordIncidentClosureListDS .bordIncidentClosureListDSitem:hover{background-color:var(--ds-c-primary-bg-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSitem.selected{background-color:var(--ds-c-primary-bg-secondary);border-color:var(--ds-c-primary-bg-default)}.bordIncidentClosureListDS .bordIncidentClosureListDSitemCheckbox{flex-shrink:0;margin-top:.2rem}.bordIncidentClosureListDS .bordCheckBoxButtonSvg svg .largeRect,.bordIncidentClosureListDS .bordCheckBoxButtonSvg svg .smallRect{stroke-width:1.6}.bordIncidentClosureListDS .bordIncidentClosureListDSitemContent{flex:1 1 0%;min-width:0}.bordIncidentClosureListDS .bordIncidentClosureListDSitemDate{color:var(--ds-c-content-secondary);display:block;font-size:1rem;line-height:1.3rem;margin-bottom:.4rem}.bordIncidentClosureListDS .bordIncidentClosureListDSitemMessage{color:var(--ds-c-content-secondary);display:block;font-size:1.2rem;line-height:1.5rem}.bordIncidentClosureListDS .bordIncidentClosureListDSitemMessage strong{font-weight:700}.bordIncidentClosureListDS .bordIncidentClosureListDSemptyState{color:var(--ds-c-content-secondary);display:block;font-size:1.2rem;line-height:1.5rem;padding:2.4rem 1.6rem;text-align:center}";
43401
+ var css_248z$e = ".bordIncidentClosureListDS{display:block;width:100%}.bordIncidentClosureListDS .bordIncidentClosureListDSselectAll{display:flex;justify-content:flex-end;margin-bottom:1.2rem}.bordIncidentClosureListDS .bordIncidentClosureListDSsearch{align-items:center;background-color:var(--ds-c-layout-l1);border-color:var(--ds-c-stroke-default);border-radius:.6rem;border-style:solid;border-width:1px;cursor:text;display:flex;gap:.8rem;height:4rem;margin-bottom:1.6rem;padding-left:1.2rem;padding-right:1.2rem;position:relative}.bordIncidentClosureListDS .bordIncidentClosureListDSsearch:focus-within{border-color:var(--ds-c-primary-bg-default)}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchIcon{align-items:center;color:var(--ds-c-content-secondary);display:flex;flex-shrink:0;justify-content:center}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput{background-color:transparent;border-style:none;color:var(--ds-c-content-default);flex:1 1 0%;font-size:1.2rem;line-height:1.5rem;outline:2px solid transparent;outline-offset:2px}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput::-moz-placeholder{color:var(--ds-c-content-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSsearchInput::placeholder{color:var(--ds-c-content-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSlist{display:flex;flex-direction:column;gap:.8rem;list-style-type:none;margin:0;padding:0}.bordIncidentClosureListDS .bordIncidentClosureListDSitem{--tw-bg-opacity:1;align-items:flex-start;background-color:rgb(250 250 249/var(--tw-bg-opacity));border-color:var(--ds-c-stroke-default);border-radius:.6rem;border-style:solid;border-width:1px;display:flex;gap:1.2rem;padding:1.2rem;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.bordIncidentClosureListDS .bordIncidentClosureListDSitem:hover{background-color:var(--ds-c-primary-bg-secondary)}.bordIncidentClosureListDS .bordIncidentClosureListDSitem.selected{background-color:var(--ds-c-primary-bg-secondary);border-color:var(--ds-c-primary-bg-default)}.bordIncidentClosureListDS .bordIncidentClosureListDSitem.readOnly{cursor:not-allowed;opacity:.6}.bordIncidentClosureListDS .bordIncidentClosureListDSitem.readOnly:hover{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity))}.bordIncidentClosureListDS .bordIncidentClosureListDSitemCheckbox{flex-shrink:0;margin-top:.2rem}.bordIncidentClosureListDS .bordCheckBoxButtonSvg svg .largeRect,.bordIncidentClosureListDS .bordCheckBoxButtonSvg svg .smallRect{stroke-width:1.6}.bordIncidentClosureListDS .bordIncidentClosureListDSitemContent{flex:1 1 0%;min-width:0}.bordIncidentClosureListDS .bordIncidentClosureListDSitemDate{color:var(--ds-c-content-secondary);display:block;font-size:1rem;line-height:1.3rem;margin-bottom:.4rem}.bordIncidentClosureListDS .bordIncidentClosureListDSitemMessage{color:var(--ds-c-content-secondary);display:block;font-size:1.2rem;line-height:1.5rem}.bordIncidentClosureListDS .bordIncidentClosureListDSitemMessage strong{font-weight:700}.bordIncidentClosureListDS .bordIncidentClosureListDSemptyState{color:var(--ds-c-content-secondary);display:block;font-size:1.2rem;line-height:1.5rem;padding:2.4rem 1.6rem;text-align:center}";
43402
43402
  styleInject(css_248z$e);
43403
43403
 
43404
43404
  const DEFAULT_SELECT_ALL_LABEL = 'Seleccionar todos los incidentes abiertos';
@@ -43421,7 +43421,8 @@ const BordIncidentClosureList = ({ incidents, selectedUids, onSelectionChange, s
43421
43421
  r.visibleId.toLowerCase().includes(q) ||
43422
43422
  r.createdBy.toLowerCase().includes(q));
43423
43423
  }, [incidents, searchText]);
43424
- const allFilteredSelected = filteredIncidents.length > 0 && filteredIncidents.every((r) => selectedSet.has(r.uid));
43424
+ const selectableIncidents = useMemo(() => filteredIncidents.filter((r) => !r.isReadOnly), [filteredIncidents]);
43425
+ const allFilteredSelected = selectableIncidents.length > 0 && selectableIncidents.every((r) => selectedSet.has(r.uid));
43425
43426
  const toggleIncident = (uid) => {
43426
43427
  const next = new Set(selectedSet);
43427
43428
  if (next.has(uid))
@@ -43433,16 +43434,17 @@ const BordIncidentClosureList = ({ incidents, selectedUids, onSelectionChange, s
43433
43434
  const toggleSelectAll = () => {
43434
43435
  const next = new Set(selectedSet);
43435
43436
  if (allFilteredSelected) {
43436
- filteredIncidents.forEach((r) => next.delete(r.uid));
43437
+ selectableIncidents.forEach((r) => next.delete(r.uid));
43437
43438
  }
43438
43439
  else {
43439
- filteredIncidents.forEach((r) => next.add(r.uid));
43440
+ selectableIncidents.forEach((r) => next.add(r.uid));
43440
43441
  }
43441
43442
  onSelectionChange(Array.from(next));
43442
43443
  };
43443
- return (jsxs("div", { className: `bordIncidentClosureListDS ${className}`.trim(), children: [jsx("div", { className: "bordIncidentClosureListDSselectAll", children: jsx(BordCheckBox, { label: selectAllLabel, isButtonActive: allFilteredSelected, isButtonDisabled: filteredIncidents.length === 0, handleClickButton: toggleSelectAll }) }), jsxs("div", { className: "bordIncidentClosureListDSsearch", children: [jsx("span", { className: "bordIncidentClosureListDSsearchIcon", "aria-hidden": true, children: jsx(BordOneToneIcon, { variant: "search", standardSize: SEARCH_ICON_SIZE }) }), jsx("input", { type: "text", className: "bordIncidentClosureListDSsearchInput", placeholder: searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), autoComplete: "off" })] }), filteredIncidents.length === 0 ? (jsx("div", { className: "bordIncidentClosureListDSemptyState", children: emptyStateText })) : (jsx("ul", { className: "bordIncidentClosureListDSlist", children: filteredIncidents.map((incident) => {
43444
- const isSelected = selectedSet.has(incident.uid);
43445
- return (jsxs("li", { className: `bordIncidentClosureListDSitem ${isSelected ? 'selected' : ''}`, children: [jsx("div", { className: "bordIncidentClosureListDSitemCheckbox", children: jsx(BordCheckBox, { isButtonActive: isSelected, handleClickButton: () => toggleIncident(incident.uid) }) }), jsxs("div", { className: "bordIncidentClosureListDSitemContent", children: [jsx("span", { className: "bordIncidentClosureListDSitemDate", children: incident.createdAtLabel }), jsxs("span", { className: "bordIncidentClosureListDSitemMessage", children: ["Cerrar incidente:", ' ', jsxs("strong", { children: ["\u201C", incident.name, " (ID: ", incident.visibleId, ")\u201D"] }), ", creado por ", incident.createdBy, "."] })] })] }, incident.uid));
43444
+ return (jsxs("div", { className: `bordIncidentClosureListDS ${className}`.trim(), children: [jsx("div", { className: "bordIncidentClosureListDSselectAll", children: jsx(BordCheckBox, { label: selectAllLabel, isButtonActive: allFilteredSelected, isButtonDisabled: selectableIncidents.length === 0, handleClickButton: toggleSelectAll }) }), jsxs("div", { className: "bordIncidentClosureListDSsearch", children: [jsx("span", { className: "bordIncidentClosureListDSsearchIcon", "aria-hidden": true, children: jsx(BordOneToneIcon, { variant: "search", standardSize: SEARCH_ICON_SIZE }) }), jsx("input", { type: "text", className: "bordIncidentClosureListDSsearchInput", placeholder: searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), autoComplete: "off" })] }), filteredIncidents.length === 0 ? (jsx("div", { className: "bordIncidentClosureListDSemptyState", children: emptyStateText })) : (jsx("ul", { className: "bordIncidentClosureListDSlist", children: filteredIncidents.map((incident) => {
43445
+ const isReadOnly = incident.isReadOnly === true;
43446
+ const isSelected = !isReadOnly && selectedSet.has(incident.uid);
43447
+ return (jsxs("li", { className: `bordIncidentClosureListDSitem ${isSelected ? 'selected' : ''} ${isReadOnly ? 'readOnly' : ''}`.trim(), children: [jsx("div", { className: "bordIncidentClosureListDSitemCheckbox", children: jsx(BordCheckBox, { isButtonActive: isSelected, isButtonDisabled: isReadOnly, handleClickButton: isReadOnly ? undefined : () => toggleIncident(incident.uid) }) }), jsxs("div", { className: "bordIncidentClosureListDSitemContent", children: [jsx("span", { className: "bordIncidentClosureListDSitemDate", children: incident.createdAtLabel }), jsxs("span", { className: "bordIncidentClosureListDSitemMessage", children: [isReadOnly ? null : jsx(Fragment, { children: "Cerrar incidente: " }), jsxs("strong", { children: ["\u201C", incident.name, " (ID: ", incident.visibleId, ")\u201D"] }), ", creado por ", incident.createdBy, "."] })] })] }, incident.uid));
43446
43448
  }) }))] }));
43447
43449
  };
43448
43450