@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.
- package/CHANGELOG.md +70 -0
- package/dist/_shared/tokens.js +9 -0
- package/dist/_types/messages/BrandMessages.d.ts +13 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/AppLauncher/AppLauncher.d.ts +43 -8
- package/dist/_types/molecules/CommandPalette/CommandPalette.d.ts +43 -8
- package/dist/_types/molecules/Consent/Consent.d.ts +93 -20
- package/dist/_types/molecules/NotificationButton/NotificationButton.d.ts +17 -4
- package/dist/_types/molecules/NotificationPanel/NotificationPanel.d.ts +54 -8
- package/dist/_types/sections/FloatingDock/FloatingDock.d.ts +33 -3
- package/dist/app-launcher.js +67 -61
- package/dist/brand.css +137 -6
- package/dist/command-palette.js +38 -36
- package/dist/consent.js +75 -73
- package/dist/floating-dock.js +42 -41
- package/dist/multi-select.css +1 -1
- package/dist/multi-select.js +1 -2
- package/dist/notification-button.js +18 -17
- package/dist/notification-panel.js +81 -80
- package/dist/select.css +1 -1
- package/dist/select.js +1 -2
- package/dist/tokens.css +137 -6
- package/package.json +1 -1
- package/src/tokens/components/control.css +4 -1
- package/src/tokens/components/multi-select.css +3 -0
- package/src/tokens/components/select.css +3 -0
- package/src/tokens/molecules/filter-bar.css +2 -2
- package/src/tokens/scss/components/_control.scss +4 -1
- package/src/tokens/scss/components/_multi-select.scss +3 -0
- package/src/tokens/scss/components/_select.scss +3 -0
- package/src/tokens/scss/molecules/_filter-bar.scss +2 -2
- package/src/tokens/surface-public.css +124 -2
- package/src/tokens/tokens.json +9 -0
|
@@ -1,139 +1,140 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './notification-panel.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
|
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
|
|
19
|
+
function _() {
|
|
19
20
|
let e = document.documentElement;
|
|
20
|
-
return
|
|
21
|
+
return g(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
function v({ children: e, ...t }) {
|
|
24
|
+
return /* @__PURE__ */ m("a", {
|
|
24
25
|
...t,
|
|
25
26
|
children: e
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
var
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
let e =
|
|
36
|
-
return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(
|
|
37
|
-
}, []),
|
|
38
|
-
e ||
|
|
39
|
-
},
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
trigger: /* @__PURE__ */
|
|
42
|
-
count:
|
|
43
|
-
max:
|
|
44
|
-
label:
|
|
45
|
-
countLabel:
|
|
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:
|
|
48
|
+
label: Q,
|
|
48
49
|
align: "end",
|
|
49
|
-
sideOffset:
|
|
50
|
-
open:
|
|
51
|
-
defaultOpen:
|
|
52
|
-
onOpenChange:
|
|
53
|
-
initialFocus:
|
|
54
|
-
className: ["notification-panel",
|
|
55
|
-
children: /* @__PURE__ */
|
|
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:
|
|
58
|
+
ref: H,
|
|
58
59
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(i, {
|
|
60
61
|
level: 2,
|
|
61
62
|
size: 3,
|
|
62
|
-
id:
|
|
63
|
-
children:
|
|
63
|
+
id: Z,
|
|
64
|
+
children: Q
|
|
64
65
|
}) }),
|
|
65
|
-
|
|
66
|
+
g.length === 0 ? /* @__PURE__ */ m("div", {
|
|
66
67
|
className: "notification-panel__empty",
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ m(a, {
|
|
68
69
|
size: "small",
|
|
69
|
-
children:
|
|
70
|
+
children: B("empty", M)
|
|
70
71
|
})
|
|
71
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
72
73
|
className: "notification-panel__list",
|
|
73
|
-
"aria-labelledby":
|
|
74
|
-
children:
|
|
75
|
-
let i =
|
|
76
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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: () =>
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
onClick: () => q(e),
|
|
84
|
+
children: [/* @__PURE__ */ m("span", {
|
|
84
85
|
className: "notification-panel__indicator",
|
|
85
|
-
children: i && /* @__PURE__ */
|
|
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__ */
|
|
90
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ m(n, { children: B("unread", j) })] })
|
|
91
|
+
}), /* @__PURE__ */ h("span", {
|
|
91
92
|
className: "notification-panel__item-text",
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ m(s, {
|
|
94
95
|
id: a,
|
|
95
96
|
tone: i ? "default" : "muted",
|
|
96
97
|
className: "notification-panel__item-title",
|
|
97
|
-
children:
|
|
98
|
+
children: e.title
|
|
98
99
|
}),
|
|
99
|
-
|
|
100
|
+
e.body && /* @__PURE__ */ m(s, {
|
|
100
101
|
tone: "muted",
|
|
101
102
|
className: "notification-panel__item-body",
|
|
102
|
-
children:
|
|
103
|
+
children: e.body
|
|
103
104
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ m(s, {
|
|
105
106
|
tone: "muted",
|
|
106
107
|
className: "notification-panel__item-time",
|
|
107
|
-
children:
|
|
108
|
+
children: e.time
|
|
108
109
|
})
|
|
109
110
|
]
|
|
110
111
|
})]
|
|
111
112
|
})
|
|
112
|
-
},
|
|
113
|
+
}, e.id);
|
|
113
114
|
})
|
|
114
115
|
}),
|
|
115
|
-
|
|
116
|
+
w && K && /* @__PURE__ */ m("div", {
|
|
116
117
|
className: "notification-panel__mark-all",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ m(r, {
|
|
118
119
|
variant: "outline",
|
|
119
120
|
size: "sm",
|
|
120
121
|
block: !0,
|
|
121
|
-
onClick:
|
|
122
|
-
children:
|
|
122
|
+
onClick: J,
|
|
123
|
+
children: B("markAllRead", F)
|
|
123
124
|
})
|
|
124
125
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ m("div", {
|
|
126
127
|
className: "notification-panel__footer",
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ h("div", {
|
|
128
129
|
className: "notification-panel__footer-links",
|
|
129
|
-
children: [
|
|
130
|
-
href: w,
|
|
131
|
-
className: y,
|
|
132
|
-
children: M
|
|
133
|
-
}), E({
|
|
130
|
+
children: [D({
|
|
134
131
|
href: T,
|
|
135
|
-
className:
|
|
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 {
|
|
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) {
|