@studiolxd/brand 45.0.0 → 46.0.0

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/_shared/tokens.js +9 -0
  3. package/dist/_types/messages/BrandMessages.d.ts +13 -1
  4. package/dist/_types/messages/index.d.ts +1 -1
  5. package/dist/_types/molecules/AppLauncher/AppLauncher.d.ts +43 -8
  6. package/dist/_types/molecules/CommandPalette/CommandPalette.d.ts +43 -8
  7. package/dist/_types/molecules/Consent/Consent.d.ts +93 -20
  8. package/dist/_types/molecules/NotificationButton/NotificationButton.d.ts +17 -4
  9. package/dist/_types/molecules/NotificationPanel/NotificationPanel.d.ts +54 -8
  10. package/dist/_types/sections/FloatingDock/FloatingDock.d.ts +33 -3
  11. package/dist/app-launcher.js +67 -61
  12. package/dist/brand.css +137 -6
  13. package/dist/command-palette.js +38 -36
  14. package/dist/consent.js +75 -73
  15. package/dist/floating-dock.js +42 -41
  16. package/dist/multi-select.css +1 -1
  17. package/dist/multi-select.js +1 -2
  18. package/dist/notification-button.js +18 -17
  19. package/dist/notification-panel.js +81 -80
  20. package/dist/select.css +1 -1
  21. package/dist/select.js +1 -2
  22. package/dist/tokens.css +137 -6
  23. package/package.json +1 -1
  24. package/src/tokens/components/control.css +4 -1
  25. package/src/tokens/components/multi-select.css +3 -0
  26. package/src/tokens/components/select.css +3 -0
  27. package/src/tokens/molecules/filter-bar.css +2 -2
  28. package/src/tokens/scss/components/_control.scss +4 -1
  29. package/src/tokens/scss/components/_multi-select.scss +3 -0
  30. package/src/tokens/scss/components/_select.scss +3 -0
  31. package/src/tokens/scss/molecules/_filter-bar.scss +2 -2
  32. package/src/tokens/surface-public.css +124 -2
  33. package/src/tokens/tokens.json +9 -0
@@ -1,139 +1,140 @@
1
1
  'use client';
2
2
  import './notification-panel.css';
3
- import { Icon as e } from "./icon.js";
4
- import { VisuallyHidden as t } from "./visually-hidden.js";
5
- import { Button as n } from "./button.js";
6
- import { Heading as r } from "./heading.js";
7
- import { Paragraph as i } from "./paragraph.js";
8
- import { Popover as a } from "./popover.js";
9
- import { Text as o } from "./text.js";
10
- import { NotificationButton as s } from "./notification-button.js";
11
- import { useCallback as c, useId as l, useRef as u, useState as d } from "react";
12
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { VisuallyHidden as n } from "./visually-hidden.js";
6
+ import { Button as r } from "./button.js";
7
+ import { Heading as i } from "./heading.js";
8
+ import { Paragraph as a } from "./paragraph.js";
9
+ import { Popover as o } from "./popover.js";
10
+ import { Text as s } from "./text.js";
11
+ import { NotificationButton as c } from "./notification-button.js";
12
+ import { useCallback as l, useId as u, useRef as d, useState as f } from "react";
13
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
14
  //#region src/stories/molecules/NotificationPanel/NotificationPanel.tsx
14
- function h(e) {
15
+ function g(e) {
15
16
  let t = parseFloat(e);
16
17
  return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
17
18
  }
18
- function g() {
19
+ function _() {
19
20
  let e = document.documentElement;
20
- return h(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
21
+ return g(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
21
22
  }
22
- function _({ children: e, ...t }) {
23
- return /* @__PURE__ */ p("a", {
23
+ function v({ children: e, ...t }) {
24
+ return /* @__PURE__ */ m("a", {
24
25
  ...t,
25
26
  children: e
26
27
  });
27
28
  }
28
- var v = "button, a[href]", y = "notification-panel__footer-link";
29
- function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, allHref: w, preferencesHref: T, renderLink: E = _, label: D, countLabel: O, panelLabel: k = "Notificaciones", unreadLabel: A = "Sin leer", emptyLabel: j = "Estás al día", allLabel: M = "Ver todas las notificaciones", preferencesLabel: N = "Preferencias de notificaciones", markAllReadLabel: P = "Marcar todas como leídas", open: F, defaultOpen: I, onOpenChange: L, className: R }) {
30
- let z = l(), B = u(null), [V, H] = d([]), U = (e) => e.unread && !V.includes(e.id), W = h.some(U), G = (e) => {
31
- U(e) && (H((t) => [...t, e.id]), S(e.id));
32
- }, K = () => {
33
- H(h.map((e) => e.id)), C?.();
34
- }, q = c(() => {
35
- let e = B.current;
36
- return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(v) : null;
37
- }, []), J = (e, t) => {
38
- e || H([]), L?.(e, t);
39
- }, Y = `${z}-title`;
40
- return /* @__PURE__ */ p(a, {
41
- trigger: /* @__PURE__ */ p(s, {
42
- count: b,
43
- max: x,
44
- label: D,
45
- countLabel: O
29
+ var y = "button, a[href]", b = "notification-panel__footer-link";
30
+ function x({ items: g = [], count: x = 0, max: S, onRead: C, onMarkAllRead: w, allHref: T, preferencesHref: E, renderLink: D = v, label: O, countLabel: k, panelLabel: A, unreadLabel: j, emptyLabel: M, allLabel: N, preferencesLabel: P, markAllReadLabel: F, open: I, defaultOpen: L, onOpenChange: R, className: z }) {
31
+ let B = e("notificationPanel"), V = u(), H = d(null), [U, W] = f([]), G = (e) => e.unread && !U.includes(e.id), K = g.some(G), q = (e) => {
32
+ G(e) && (W((t) => [...t, e.id]), C(e.id));
33
+ }, J = () => {
34
+ W(g.map((e) => e.id)), w?.();
35
+ }, Y = l(() => {
36
+ let e = H.current;
37
+ return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(y) : null;
38
+ }, []), X = (e, t) => {
39
+ e || W([]), R?.(e, t);
40
+ }, Z = `${V}-title`, Q = B("panel", A);
41
+ return /* @__PURE__ */ m(o, {
42
+ trigger: /* @__PURE__ */ m(c, {
43
+ count: x,
44
+ max: S,
45
+ label: O,
46
+ countLabel: k
46
47
  }),
47
- label: k,
48
+ label: Q,
48
49
  align: "end",
49
- sideOffset: g,
50
- open: F,
51
- defaultOpen: I,
52
- onOpenChange: J,
53
- initialFocus: q,
54
- className: ["notification-panel", R].filter(Boolean).join(" "),
55
- children: /* @__PURE__ */ m("div", {
50
+ sideOffset: _,
51
+ open: I,
52
+ defaultOpen: L,
53
+ onOpenChange: X,
54
+ initialFocus: Y,
55
+ className: ["notification-panel", z].filter(Boolean).join(" "),
56
+ children: /* @__PURE__ */ h("div", {
56
57
  className: "notification-panel__body",
57
- ref: B,
58
+ ref: H,
58
59
  children: [
59
- /* @__PURE__ */ p(t, { children: /* @__PURE__ */ p(r, {
60
+ /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(i, {
60
61
  level: 2,
61
62
  size: 3,
62
- id: Y,
63
- children: k
63
+ id: Z,
64
+ children: Q
64
65
  }) }),
65
- h.length === 0 ? /* @__PURE__ */ p("div", {
66
+ g.length === 0 ? /* @__PURE__ */ m("div", {
66
67
  className: "notification-panel__empty",
67
- children: /* @__PURE__ */ p(i, {
68
+ children: /* @__PURE__ */ m(a, {
68
69
  size: "small",
69
- children: j
70
+ children: B("empty", M)
70
71
  })
71
- }) : /* @__PURE__ */ p("ul", {
72
+ }) : /* @__PURE__ */ m("ul", {
72
73
  className: "notification-panel__list",
73
- "aria-labelledby": Y,
74
- children: h.map((n, r) => {
75
- let i = U(n), a = `${z}-t-${r}`;
76
- return /* @__PURE__ */ p("li", {
74
+ "aria-labelledby": Z,
75
+ children: g.map((e, r) => {
76
+ let i = G(e), a = `${V}-t-${r}`;
77
+ return /* @__PURE__ */ m("li", {
77
78
  className: "notification-panel__item",
78
- children: /* @__PURE__ */ m("button", {
79
+ children: /* @__PURE__ */ h("button", {
79
80
  type: "button",
80
81
  className: "notification-panel__item-action",
81
82
  "aria-disabled": i ? void 0 : !0,
82
- onClick: () => G(n),
83
- children: [/* @__PURE__ */ p("span", {
83
+ onClick: () => q(e),
84
+ children: [/* @__PURE__ */ m("span", {
84
85
  className: "notification-panel__indicator",
85
- children: i && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(e, {
86
+ children: i && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(t, {
86
87
  name: "dot",
87
88
  size: "sm",
88
89
  className: "notification-panel__dot"
89
- }), /* @__PURE__ */ p(t, { children: A })] })
90
- }), /* @__PURE__ */ m("span", {
90
+ }), /* @__PURE__ */ m(n, { children: B("unread", j) })] })
91
+ }), /* @__PURE__ */ h("span", {
91
92
  className: "notification-panel__item-text",
92
93
  children: [
93
- /* @__PURE__ */ p(o, {
94
+ /* @__PURE__ */ m(s, {
94
95
  id: a,
95
96
  tone: i ? "default" : "muted",
96
97
  className: "notification-panel__item-title",
97
- children: n.title
98
+ children: e.title
98
99
  }),
99
- n.body && /* @__PURE__ */ p(o, {
100
+ e.body && /* @__PURE__ */ m(s, {
100
101
  tone: "muted",
101
102
  className: "notification-panel__item-body",
102
- children: n.body
103
+ children: e.body
103
104
  }),
104
- /* @__PURE__ */ p(o, {
105
+ /* @__PURE__ */ m(s, {
105
106
  tone: "muted",
106
107
  className: "notification-panel__item-time",
107
- children: n.time
108
+ children: e.time
108
109
  })
109
110
  ]
110
111
  })]
111
112
  })
112
- }, n.id);
113
+ }, e.id);
113
114
  })
114
115
  }),
115
- C && W && /* @__PURE__ */ p("div", {
116
+ w && K && /* @__PURE__ */ m("div", {
116
117
  className: "notification-panel__mark-all",
117
- children: /* @__PURE__ */ p(n, {
118
+ children: /* @__PURE__ */ m(r, {
118
119
  variant: "outline",
119
120
  size: "sm",
120
121
  block: !0,
121
- onClick: K,
122
- children: P
122
+ onClick: J,
123
+ children: B("markAllRead", F)
123
124
  })
124
125
  }),
125
- /* @__PURE__ */ p("div", {
126
+ /* @__PURE__ */ m("div", {
126
127
  className: "notification-panel__footer",
127
- children: /* @__PURE__ */ m("div", {
128
+ children: /* @__PURE__ */ h("div", {
128
129
  className: "notification-panel__footer-links",
129
- children: [E({
130
- href: w,
131
- className: y,
132
- children: M
133
- }), E({
130
+ children: [D({
134
131
  href: T,
135
- className: y,
136
- children: N
132
+ className: b,
133
+ children: B("all", N)
134
+ }), D({
135
+ href: E,
136
+ className: b,
137
+ children: B("preferences", P)
137
138
  })]
138
139
  })
139
140
  })
@@ -142,4 +143,4 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
142
143
  });
143
144
  }
144
145
  //#endregion
145
- export { b as NotificationPanel };
146
+ export { x as NotificationPanel };
package/dist/select.css CHANGED
@@ -1 +1 @@
1
- .select{justify-content:space-between;align-items:center;gap:var(--select-icon-gap);block-size:var(--select-height);padding-block:0;padding-inline:var(--select-padding-inline);font-family:var(--select-font-family);font-size:var(--select-font-size);line-height:var(--select-line-height);font-weight:var(--select-font-weight);color:var(--select-color);background-color:var(--select-bg);border-width:var(--select-border-width);border-style:var(--select-border-style);border-color:var(--select-border-color);border-radius:var(--select-border-radius);box-sizing:border-box;cursor:pointer;width:100%;display:inline-flex}.select:focus,.select[data-popup-open]{outline:none}.select:focus-visible{outline:var(--select-focus-ring-width) solid var(--select-focus-ring-color);outline-offset:calc(-1 * (var(--select-focus-ring-width) + var(--select-border-width)))}.select__icon{transition:transform var(--select-icon-transition) var(--motion-easing-default);flex-shrink:0;transform:rotate(90deg)}[data-popup-open] .select__icon{transform:rotate(-90deg)}.select__positioner{z-index:var(--select-content-z-index)}.select__content{background-color:var(--select-content-bg);border-width:var(--select-border-width);border-style:var(--select-border-style);border-color:var(--select-content-border-color);min-width:var(--anchor-width);max-height:var(--select-content-max-height,var(--available-height));overscroll-behavior:contain;overflow-y:auto}.select__content[data-side=bottom]{border-top:none}.select__content[data-side=top]{border-bottom:none}.select__item{width:100%;padding-block:var(--select-item-padding-block);padding-inline:var(--select-padding-inline);font-size:var(--select-font-size);font-family:var(--select-font-family);cursor:pointer;align-items:center;display:flex}.select__item[data-highlighted]{background-color:var(--select-item-highlighted-bg);color:var(--select-item-highlighted-color)}.select__item[data-selected]{font-weight:var(--select-item-selected-font-weight)}.select__content .select__item+.select__item,.select__content[data-side=bottom] .select__item:first-child{border-top:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__content[data-side=top] .select__item:last-child{border-bottom:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select.select--sm{block-size:var(--select-sm-height);font-size:var(--select-sm-font-size);padding-inline:var(--select-sm-padding-inline)}.select__content--sm .select__item{font-size:var(--select-sm-font-size);padding-block:var(--select-sm-item-padding-block)}.select.select--lg{block-size:var(--select-lg-height);font-size:var(--select-lg-font-size);padding-inline:var(--select-lg-padding-inline)}.select__content--lg .select__item{font-size:var(--select-lg-font-size);padding-block:var(--select-lg-item-padding-block)}.select__content .select__group:not(:first-child)>.select__label,.select__content[data-side=bottom] .select__group:first-child>.select__label,.select__content .select__group+.select__item{border-top:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__content[data-side=top] .select__group:last-child>.select__item:last-child{border-bottom:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__label{padding-block:var(--select-item-padding-block);padding-inline:var(--select-padding-inline);font-family:var(--label-font-family);font-size:var(--label-font-size);font-weight:var(--label-font-weight);line-height:var(--label-line-height);color:var(--label-color);letter-spacing:var(--label-letter-spacing)}.select__separator{height:var(--select-separator-height);background-color:var(--select-separator-color);margin-block:var(--select-item-padding-block)}.select[aria-invalid=true]{border-color:var(--select-error-border-color)}
1
+ .select{justify-content:space-between;align-items:center;gap:var(--select-icon-gap);block-size:var(--select-height);padding-block:0;padding-inline:var(--select-padding-inline);font-family:var(--select-font-family);font-size:var(--select-font-size);line-height:var(--select-line-height);font-weight:var(--select-font-weight);color:var(--select-color);background-color:var(--select-bg);border-width:var(--select-border-width);border-style:var(--select-border-style);border-color:var(--select-border-color);border-radius:var(--select-border-radius);box-sizing:border-box;cursor:pointer;width:100%;display:inline-flex}.select:focus,.select[data-popup-open]{outline:none}.select:focus-visible{outline:var(--select-focus-ring-width) solid var(--select-focus-ring-color);outline-offset:calc(-1 * (var(--select-focus-ring-width) + var(--select-border-width)))}.select .select__icon{--icon-size:var(--select-icon-size)}.select__icon{transition:transform var(--select-icon-transition) var(--motion-easing-default);flex-shrink:0;transform:rotate(90deg)}[data-popup-open] .select__icon{transform:rotate(-90deg)}.select__positioner{z-index:var(--select-content-z-index)}.select__content{background-color:var(--select-content-bg);border-width:var(--select-border-width);border-style:var(--select-border-style);border-color:var(--select-content-border-color);min-width:var(--anchor-width);max-height:var(--select-content-max-height,var(--available-height));overscroll-behavior:contain;overflow-y:auto}.select__content[data-side=bottom]{border-top:none}.select__content[data-side=top]{border-bottom:none}.select__item{width:100%;padding-block:var(--select-item-padding-block);padding-inline:var(--select-padding-inline);font-size:var(--select-font-size);font-family:var(--select-font-family);cursor:pointer;align-items:center;display:flex}.select__item[data-highlighted]{background-color:var(--select-item-highlighted-bg);color:var(--select-item-highlighted-color)}.select__item[data-selected]{font-weight:var(--select-item-selected-font-weight)}.select__content .select__item+.select__item,.select__content[data-side=bottom] .select__item:first-child{border-top:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__content[data-side=top] .select__item:last-child{border-bottom:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select.select--sm{block-size:var(--select-sm-height);font-size:var(--select-sm-font-size);padding-inline:var(--select-sm-padding-inline);--select-icon-size:var(--select-sm-icon-size)}.select__content--sm .select__item{font-size:var(--select-sm-font-size);padding-block:var(--select-sm-item-padding-block)}.select.select--lg{block-size:var(--select-lg-height);font-size:var(--select-lg-font-size);padding-inline:var(--select-lg-padding-inline);--select-icon-size:var(--select-lg-icon-size)}.select__content--lg .select__item{font-size:var(--select-lg-font-size);padding-block:var(--select-lg-item-padding-block)}.select__content .select__group:not(:first-child)>.select__label,.select__content[data-side=bottom] .select__group:first-child>.select__label,.select__content .select__group+.select__item{border-top:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__content[data-side=top] .select__group:last-child>.select__item:last-child{border-bottom:var(--select-border-width) var(--select-border-style) var(--select-content-border-color)}.select__label{padding-block:var(--select-item-padding-block);padding-inline:var(--select-padding-inline);font-family:var(--label-font-family);font-size:var(--label-font-size);font-weight:var(--label-font-weight);line-height:var(--label-line-height);color:var(--label-color);letter-spacing:var(--label-letter-spacing)}.select__separator{height:var(--select-separator-height);background-color:var(--select-separator-color);margin-block:var(--select-item-padding-block)}.select[aria-invalid=true]{border-color:var(--select-error-border-color)}
package/dist/select.js CHANGED
@@ -62,8 +62,7 @@ var g = i(function({ placeholder: e, children: t, ...n }, r) {
62
62
  ...i,
63
63
  children: [r, /* @__PURE__ */ l(t, {
64
64
  name: "chevron",
65
- className: "select__icon",
66
- size: e === "sm" ? "xs" : e === "lg" ? "md" : "sm"
65
+ className: "select__icon"
67
66
  })]
68
67
  });
69
68
  }), y = i(function({ size: e = "md", container: t, className: n, children: r, side: i = "bottom", align: a = "start", sideOffset: o = -1, ...s }, c) {