@studiolxd/brand 49.11.0 → 49.12.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 +118 -0
- package/dist/_shared/tokens.js +160 -0
- package/dist/_types/messages/BrandMessages.d.ts +13 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/ClockWidget/ClockWidget.d.ts +116 -0
- package/dist/_types/molecules/ClockWidget/clockDuration.d.ts +23 -0
- package/dist/_types/molecules/Heatmap/Heatmap.d.ts +101 -0
- package/dist/_types/molecules/Heatmap/heatmapScale.d.ts +39 -0
- package/dist/_types/molecules/RecurrenceField/RecurrenceField.d.ts +93 -0
- package/dist/_types/molecules/RecurrenceField/recurrenceRule.d.ts +62 -0
- package/dist/_types/molecules/Timeline/Timeline.d.ts +77 -0
- package/dist/_types/organisms/OrgChart/OrgChart.d.ts +104 -0
- package/dist/_types/organisms/PlanningGrid/PlanningGrid.d.ts +120 -0
- package/dist/_types/organisms/PlanningGrid/planningHours.d.ts +10 -0
- package/dist/brand.css +396 -1
- package/dist/clock-widget.css +1 -0
- package/dist/clock-widget.js +126 -0
- package/dist/heatmap.css +1 -0
- package/dist/heatmap.js +104 -0
- package/dist/org-chart.css +1 -0
- package/dist/org-chart.js +122 -0
- package/dist/planning-grid.css +1 -0
- package/dist/planning-grid.js +167 -0
- package/dist/recurrence-field.css +1 -0
- package/dist/recurrence-field.js +185 -0
- package/dist/timeline.css +1 -0
- package/dist/timeline.js +57 -0
- package/dist/tokens.css +414 -1
- package/package.json +31 -1
- package/src/tokens/index.css +6 -0
- package/src/tokens/molecules/clock-widget.css +36 -0
- package/src/tokens/molecules/clock-widget.ts +7 -0
- package/src/tokens/molecules/heatmap.css +78 -0
- package/src/tokens/molecules/heatmap.ts +7 -0
- package/src/tokens/molecules/org-chart.css +59 -0
- package/src/tokens/molecules/org-chart.ts +7 -0
- package/src/tokens/molecules/planning-grid.css +58 -0
- package/src/tokens/molecules/planning-grid.ts +7 -0
- package/src/tokens/molecules/recurrence-field.css +21 -0
- package/src/tokens/molecules/recurrence-field.ts +7 -0
- package/src/tokens/molecules/timeline.css +36 -0
- package/src/tokens/molecules/timeline.ts +7 -0
- package/src/tokens/scss/_index.legacy.scss +6 -0
- package/src/tokens/scss/_index.scss +6 -0
- package/src/tokens/scss/molecules/_clock-widget.scss +22 -0
- package/src/tokens/scss/molecules/_heatmap.scss +48 -0
- package/src/tokens/scss/molecules/_org-chart.scss +39 -0
- package/src/tokens/scss/molecules/_planning-grid.scss +36 -0
- package/src/tokens/scss/molecules/_recurrence-field.scss +11 -0
- package/src/tokens/scss/molecules/_timeline.scss +22 -0
- package/src/tokens/surface-invert.css +56 -0
- package/src/tokens/surface-light.css +56 -0
- package/src/tokens/surface-public.css +7 -0
- package/src/tokens/tokens.json +160 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import './recurrence-field.css';
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Fieldset as t } from "./fieldset.js";
|
|
5
|
+
import { Toggle as n } from "./toggle.js";
|
|
6
|
+
import { ToggleGroup as r } from "./toggle-group.js";
|
|
7
|
+
import { SelectField as i } from "./select-field.js";
|
|
8
|
+
import { DatePickerField as a } from "./date-picker-field.js";
|
|
9
|
+
import { NumberInputField as o } from "./number-input-field.js";
|
|
10
|
+
import { useId as s, useMemo as c } from "react";
|
|
11
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
12
|
+
//#region src/stories/molecules/RecurrenceField/recurrenceRule.ts
|
|
13
|
+
var f = [
|
|
14
|
+
"MO",
|
|
15
|
+
"TU",
|
|
16
|
+
"WE",
|
|
17
|
+
"TH",
|
|
18
|
+
"FR",
|
|
19
|
+
"SA",
|
|
20
|
+
"SU"
|
|
21
|
+
], p = {
|
|
22
|
+
frequency: "weekly",
|
|
23
|
+
interval: 1,
|
|
24
|
+
weekdays: [],
|
|
25
|
+
end: { type: "never" }
|
|
26
|
+
}, m = [
|
|
27
|
+
"daily",
|
|
28
|
+
"weekly",
|
|
29
|
+
"monthly",
|
|
30
|
+
"yearly"
|
|
31
|
+
], h = Date.UTC(2024, 0, 1);
|
|
32
|
+
function g({ value: g, onValueChange: _, id: v, legend: y, disabled: b, size: x, locale: S = "es-ES", weekStartsOn: C = "monday", minDate: w, maxDate: T, className: E, frequencyLabel: D, weekdaysLabel: O, endLabel: k }) {
|
|
33
|
+
let A = e("recurrenceField"), j = s(), M = v ?? j, N = c(() => {
|
|
34
|
+
let e = new Intl.DateTimeFormat(S, {
|
|
35
|
+
weekday: "short",
|
|
36
|
+
timeZone: "UTC"
|
|
37
|
+
}), t = new Intl.DateTimeFormat(S, {
|
|
38
|
+
weekday: "long",
|
|
39
|
+
timeZone: "UTC"
|
|
40
|
+
}), n = f.map((n, r) => {
|
|
41
|
+
let i = new Date(h + r * 864e5);
|
|
42
|
+
return {
|
|
43
|
+
key: n,
|
|
44
|
+
short: e.format(i),
|
|
45
|
+
long: t.format(i)
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
return C === "sunday" ? [n[6], ...n.slice(0, 6)] : n;
|
|
49
|
+
}, [S, C]), P = (e) => {
|
|
50
|
+
g && _({
|
|
51
|
+
...g,
|
|
52
|
+
...e
|
|
53
|
+
});
|
|
54
|
+
}, F = [{
|
|
55
|
+
value: "",
|
|
56
|
+
label: A("never")
|
|
57
|
+
}, ...m.map((e) => ({
|
|
58
|
+
value: e,
|
|
59
|
+
label: A(e)
|
|
60
|
+
}))], I = [
|
|
61
|
+
{
|
|
62
|
+
value: "never",
|
|
63
|
+
label: A("endNever")
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: "until",
|
|
67
|
+
label: A("endUntil")
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "count",
|
|
71
|
+
label: A("endCount")
|
|
72
|
+
}
|
|
73
|
+
], L = /* @__PURE__ */ d("div", {
|
|
74
|
+
className: ["recurrence-field", E].filter(Boolean).join(" "),
|
|
75
|
+
children: [/* @__PURE__ */ u(i, {
|
|
76
|
+
id: `${M}-frequency`,
|
|
77
|
+
label: A("frequency", D),
|
|
78
|
+
options: F,
|
|
79
|
+
value: g?.frequency ?? "",
|
|
80
|
+
disabled: b,
|
|
81
|
+
size: x,
|
|
82
|
+
onValueChange: (e) => {
|
|
83
|
+
if (!e) return _(null);
|
|
84
|
+
_({
|
|
85
|
+
...g ?? p,
|
|
86
|
+
frequency: e
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}), g ? /* @__PURE__ */ d(l, { children: [
|
|
90
|
+
/* @__PURE__ */ u("div", {
|
|
91
|
+
className: "recurrence-field__row",
|
|
92
|
+
children: /* @__PURE__ */ u(o, {
|
|
93
|
+
id: `${M}-interval`,
|
|
94
|
+
className: "recurrence-field__interval",
|
|
95
|
+
label: A("interval")(g.frequency),
|
|
96
|
+
value: g.interval,
|
|
97
|
+
min: 1,
|
|
98
|
+
max: 99,
|
|
99
|
+
disabled: b,
|
|
100
|
+
size: x,
|
|
101
|
+
onChange: (e) => P({ interval: Number.isFinite(e) ? Math.max(1, e) : 1 })
|
|
102
|
+
})
|
|
103
|
+
}),
|
|
104
|
+
g.frequency === "weekly" ? /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
|
|
105
|
+
className: "recurrence-field__weekdays-label",
|
|
106
|
+
id: `${M}-weekdays-label`,
|
|
107
|
+
children: A("weekdays", O)
|
|
108
|
+
}), /* @__PURE__ */ u(r, {
|
|
109
|
+
className: "recurrence-field__weekdays",
|
|
110
|
+
multiple: !0,
|
|
111
|
+
size: x,
|
|
112
|
+
value: g.weekdays,
|
|
113
|
+
"aria-labelledby": `${M}-weekdays-label`,
|
|
114
|
+
onValueChange: (e) => P({ weekdays: e }),
|
|
115
|
+
children: N.map((e) => /* @__PURE__ */ u(n, {
|
|
116
|
+
value: e.key,
|
|
117
|
+
"aria-label": e.long,
|
|
118
|
+
disabled: b,
|
|
119
|
+
children: e.short
|
|
120
|
+
}, e.key))
|
|
121
|
+
})] }) : null,
|
|
122
|
+
/* @__PURE__ */ d("div", {
|
|
123
|
+
className: "recurrence-field__row",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ u(i, {
|
|
126
|
+
id: `${M}-end`,
|
|
127
|
+
className: "recurrence-field__end",
|
|
128
|
+
label: A("end", k),
|
|
129
|
+
options: I,
|
|
130
|
+
value: g.end.type,
|
|
131
|
+
disabled: b,
|
|
132
|
+
size: x,
|
|
133
|
+
onValueChange: (e) => {
|
|
134
|
+
if (e === "until") return P({ end: {
|
|
135
|
+
type: "until",
|
|
136
|
+
date: null
|
|
137
|
+
} });
|
|
138
|
+
if (e === "count") return P({ end: {
|
|
139
|
+
type: "count",
|
|
140
|
+
count: 10
|
|
141
|
+
} });
|
|
142
|
+
P({ end: { type: "never" } });
|
|
143
|
+
}
|
|
144
|
+
}),
|
|
145
|
+
g.end.type === "until" ? /* @__PURE__ */ u(a, {
|
|
146
|
+
id: `${M}-until`,
|
|
147
|
+
className: "recurrence-field__end",
|
|
148
|
+
label: A("until"),
|
|
149
|
+
value: g.end.date,
|
|
150
|
+
locale: S,
|
|
151
|
+
minDate: w,
|
|
152
|
+
maxDate: T,
|
|
153
|
+
disabled: b,
|
|
154
|
+
size: x,
|
|
155
|
+
onChange: (e) => P({ end: {
|
|
156
|
+
type: "until",
|
|
157
|
+
date: e
|
|
158
|
+
} })
|
|
159
|
+
}) : null,
|
|
160
|
+
g.end.type === "count" ? /* @__PURE__ */ u(o, {
|
|
161
|
+
id: `${M}-count`,
|
|
162
|
+
className: "recurrence-field__end",
|
|
163
|
+
label: A("count"),
|
|
164
|
+
value: g.end.count,
|
|
165
|
+
min: 1,
|
|
166
|
+
max: 999,
|
|
167
|
+
disabled: b,
|
|
168
|
+
size: x,
|
|
169
|
+
onChange: (e) => P({ end: {
|
|
170
|
+
type: "count",
|
|
171
|
+
count: Number.isFinite(e) ? Math.max(1, e) : 1
|
|
172
|
+
} })
|
|
173
|
+
}) : null
|
|
174
|
+
]
|
|
175
|
+
})
|
|
176
|
+
] }) : null]
|
|
177
|
+
});
|
|
178
|
+
return y ? /* @__PURE__ */ u(t, {
|
|
179
|
+
legend: y,
|
|
180
|
+
disabled: b,
|
|
181
|
+
children: L
|
|
182
|
+
}) : L;
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
export { g as RecurrenceField };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.timeline{font-family:var(--timeline-font-family);margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;list-style:none}.timeline__item{column-gap:var(--timeline-column-gap);grid-template-columns:auto 1fr;display:grid}.timeline__item:not(:last-child) .timeline__body{padding-block-end:var(--timeline-gap)}.timeline__marker{align-items:center;gap:var(--timeline-rail-gap);flex-direction:column;display:flex}.timeline__rail{inline-size:var(--timeline-rail-width);min-block-size:var(--timeline-gap);background-color:var(--timeline-rail-color);flex:auto}.timeline__body{gap:var(--timeline-body-gap);flex-direction:column;min-inline-size:0;display:flex}.timeline__title{font-size:var(--timeline-title-font-size);font-weight:var(--timeline-title-font-weight);line-height:var(--timeline-title-line-height);color:var(--timeline-title-color);margin-block:0}.timeline__meta{align-items:baseline;gap:var(--timeline-meta-gap);font-size:var(--timeline-meta-font-size);color:var(--timeline-meta-color);flex-wrap:wrap;margin-block:0;display:flex}.timeline__date+.timeline__author:before{content:"·";color:var(--timeline-meta-separator-color);margin-inline-end:var(--timeline-meta-gap)}.timeline__note{font-size:var(--timeline-note-font-size);line-height:var(--timeline-note-line-height);color:var(--timeline-note-color);margin-block:0}.timeline__actions{margin-block-start:var(--timeline-actions-margin-block-start)}
|
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import './timeline.css';
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
|
+
import { StepMarker as n } from "./step-marker.js";
|
|
6
|
+
import { forwardRef as r } from "react";
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
|
+
//#region src/stories/molecules/Timeline/Timeline.tsx
|
|
9
|
+
var o = r(function({ items: r, label: o, currentLabel: s, markerSize: c = "sm", className: l, ...u }, d) {
|
|
10
|
+
let f = e("timeline");
|
|
11
|
+
return /* @__PURE__ */ i("ol", {
|
|
12
|
+
ref: d,
|
|
13
|
+
className: ["timeline", l].filter(Boolean).join(" "),
|
|
14
|
+
"aria-label": f("label", o),
|
|
15
|
+
...u,
|
|
16
|
+
children: r.map((e, o) => /* @__PURE__ */ a("li", {
|
|
17
|
+
className: "timeline__item",
|
|
18
|
+
children: [/* @__PURE__ */ a("span", {
|
|
19
|
+
className: "timeline__marker",
|
|
20
|
+
children: [/* @__PURE__ */ i(n, {
|
|
21
|
+
state: e.current ? "current" : "neutral",
|
|
22
|
+
tone: e.tone ?? "neutral",
|
|
23
|
+
size: c,
|
|
24
|
+
icon: e.icon ?? "dot"
|
|
25
|
+
}), o < r.length - 1 ? /* @__PURE__ */ i("span", { className: "timeline__rail" }) : null]
|
|
26
|
+
}), /* @__PURE__ */ a("div", {
|
|
27
|
+
className: "timeline__body",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ a("p", {
|
|
30
|
+
className: "timeline__title",
|
|
31
|
+
children: [e.title, e.current ? /* @__PURE__ */ i(t, { children: ` (${f("current", s)})` }) : null]
|
|
32
|
+
}),
|
|
33
|
+
e.date || e.author ? /* @__PURE__ */ a("p", {
|
|
34
|
+
className: "timeline__meta",
|
|
35
|
+
children: [e.date ? /* @__PURE__ */ i("span", {
|
|
36
|
+
className: "timeline__date",
|
|
37
|
+
children: e.date
|
|
38
|
+
}) : null, e.author ? /* @__PURE__ */ i("span", {
|
|
39
|
+
className: "timeline__author",
|
|
40
|
+
children: e.author
|
|
41
|
+
}) : null]
|
|
42
|
+
}) : null,
|
|
43
|
+
e.note ? /* @__PURE__ */ i("p", {
|
|
44
|
+
className: "timeline__note",
|
|
45
|
+
children: e.note
|
|
46
|
+
}) : null,
|
|
47
|
+
e.actions ? /* @__PURE__ */ i("div", {
|
|
48
|
+
className: "timeline__actions",
|
|
49
|
+
children: e.actions
|
|
50
|
+
}) : null
|
|
51
|
+
]
|
|
52
|
+
})]
|
|
53
|
+
}, e.id))
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
export { o as Timeline };
|