@5ive-souls/controls 0.0.2 → 0.0.4

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 (38) hide show
  1. package/dist/5ive-souls-controls-0.0.4.tgz +0 -0
  2. package/dist/Utilities-C0PUcYTL.js +157 -0
  3. package/dist/chunk-3-CMb_cR4A.js +11 -0
  4. package/dist/components/ClassNames.js +1 -1
  5. package/dist/components/EventCalender/Context/EventCalenderContext.js +5 -0
  6. package/dist/components/EventCalender/Context/EventCalenderProvider.js +34 -0
  7. package/dist/components/EventCalender/Context/EventProviderProps.js +0 -0
  8. package/dist/components/EventCalender/Context/index.js +6 -0
  9. package/dist/components/EventCalender/Day.js +12 -0
  10. package/dist/components/EventCalender/EventCalender.js +8 -0
  11. package/dist/components/EventCalender/EventList.js +12 -0
  12. package/dist/components/EventCalender/Month.js +48 -0
  13. package/dist/components/EventCalender/MonthPicker.js +65 -0
  14. package/dist/components/EventCalender/Utilities.js +8 -0
  15. package/dist/components/EventCalender/Week.js +10 -0
  16. package/dist/components/EventCalender/WeekdayLabel.js +32 -0
  17. package/dist/components/EventCalender/YearPicker.js +21 -0
  18. package/dist/components/EventCalender/index.js +4 -0
  19. package/dist/components/EventCalender/interfaces/CalenderItemProps.js +0 -0
  20. package/dist/components/EventCalender/interfaces/Event.js +0 -0
  21. package/dist/components/EventCalender/interfaces/EventCalenderProps.js +0 -0
  22. package/dist/components/EventCalender/interfaces/EventCalenderStrings.js +0 -0
  23. package/dist/components/EventCalender/interfaces/index.js +0 -0
  24. package/dist/components/FlexBox/FlexBox.js +5 -5
  25. package/dist/components/FlexBox/FlexBoxItem/FlexBoxItem.js +3 -3
  26. package/dist/components/Grid/Grid.js +30 -30
  27. package/dist/components/JumpList/JumpList.js +178 -0
  28. package/dist/components/JumpList/index.js +4 -0
  29. package/dist/components/Section/Section.js +750 -9
  30. package/dist/components/Section/SectionUtils.js +8 -5
  31. package/dist/components/Section/index.js +1 -1
  32. package/dist/components/Wizard/Wizard.js +16 -15
  33. package/dist/components/index.js +21 -19
  34. package/dist/main.d.ts +53 -0
  35. package/dist/main.js +21 -19
  36. package/package.json +1 -1
  37. package/dist/5ive-souls-controls-0.0.2.tgz +0 -0
  38. package/dist/Section-Br38kDAa.js +0 -754
@@ -0,0 +1,178 @@
1
+ import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
+ import { makeStyles as V, tokens as h, mergeClasses as l, Text as w, Button as F, Input as X } from "@fluentui/react-components";
3
+ import i from "react";
4
+ import { FlexBox as v } from "../FlexBox/FlexBox.js";
5
+ import { FlexBoxItem as N } from "../FlexBox/FlexBoxItem/FlexBoxItem.js";
6
+ import "../FlexBox/FlexBoxItemResizer/FlexBoxItemResizer.js";
7
+ import { Grid as Y, ColumnDefinition as K } from "../Grid/Grid.js";
8
+ import "../Grid/GridCell/GridCell.js";
9
+ import "../Grid/ResizableGridCell/ResizableGridCell.js";
10
+ import "../Grid/GridContext.js";
11
+ import { Section as z } from "../Section/Section.js";
12
+ import { ClassNames as m } from "../ClassNames.js";
13
+ import { c as G } from "../../createFluentIcon-CwLxkjIW.js";
14
+ const Q = /* @__PURE__ */ G("AppsListRegular", "1em", ["M2 3.5C2 2.67 2.67 2 3.5 2h1C5.33 2 6 2.67 6 3.5v1C6 5.33 5.33 6 4.5 6h-1A1.5 1.5 0 0 1 2 4.5v-1ZM3.5 3a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1ZM2 9.5C2 8.67 2.67 8 3.5 8h1C5.33 8 6 8.67 6 9.5v1c0 .83-.67 1.5-1.5 1.5h-1A1.5 1.5 0 0 1 2 10.5v-1ZM3.5 9a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1ZM2 15.5c0-.83.67-1.5 1.5-1.5h1c.83 0 1.5.67 1.5 1.5v1c0 .83-.67 1.5-1.5 1.5h-1A1.5 1.5 0 0 1 2 16.5v-1Zm1.5-.5a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1ZM8 4.5c0-.28.22-.5.5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 6c0-.28.22-.5.5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 6c0-.28.22-.5.5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Z"]), U = /* @__PURE__ */ G("FilterRegular", "1em", ["M7.5 13h5a.5.5 0 0 1 .09 1H7.5a.5.5 0 0 1-.09-1h5.09-5Zm-2-4h9a.5.5 0 0 1 .09 1H5.5a.5.5 0 0 1-.09-1h9.09-9Zm-2-4h13a.5.5 0 0 1 .09 1H3.5a.5.5 0 0 1-.09-1H16.5h-13Z"]), a = 36, ee = V({
15
+ root: {
16
+ position: "relative"
17
+ },
18
+ list: {
19
+ padding: "0px",
20
+ margin: "0px",
21
+ boxSizing: "border-box",
22
+ listStyle: "none"
23
+ },
24
+ listItem: {
25
+ height: a + "px",
26
+ maxHeight: a + "px",
27
+ alignContent: "center",
28
+ ":hover": {
29
+ backgroundColor: h.colorBrandBackgroundHover
30
+ }
31
+ },
32
+ listItemIcon: {
33
+ textAlign: "center",
34
+ alignContent: "center"
35
+ },
36
+ listItemContent: {
37
+ paddingLeft: h.spacingHorizontalS
38
+ },
39
+ selectedListItem: {
40
+ backgroundColor: h.colorBrandBackgroundSelected
41
+ },
42
+ capitalize: {
43
+ textTransform: "capitalize"
44
+ },
45
+ baseSize: {
46
+ minWidth: `${a}px`,
47
+ width: `${a}px`,
48
+ height: `${a}px`,
49
+ minHeight: `${a}px`
50
+ },
51
+ headerButton: {
52
+ width: "100%",
53
+ justifyContent: "left",
54
+ height: `${a}px`
55
+ },
56
+ menuRoot: {
57
+ overflowY: "auto",
58
+ overflowX: "hidden",
59
+ height: "100%",
60
+ width: "100%",
61
+ backgroundColor: h.colorNeutralBackground1,
62
+ position: "absolute",
63
+ inset: "0px"
64
+ },
65
+ hidden: {
66
+ display: "none"
67
+ }
68
+ }), R = ["#", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"], pe = (y) => {
69
+ const { style: B, className: k, items: u, headerProp: c, renderItem: L, renderIcon: M, onSelectionChanged: Z, strings: H } = y, s = ee(), [p, J] = i.useState(), [T, $] = i.useState(-1), [f, A] = i.useState(), [x, O] = i.useState(), E = i.useId(), d = i.useId(), W = i.useCallback(() => {
70
+ const e = window.document.getElementById(E);
71
+ console.log("TESTING: Offset width: " + e.offsetWidth);
72
+ const t = Math.min(~~((e.offsetWidth - 24) / (a + 8)), 4), n = {
73
+ columns: []
74
+ };
75
+ for (let r = 0; r < t; r++)
76
+ n.columns.push(/* @__PURE__ */ o(K, {}, `column-${r}`));
77
+ console.log("TESTING: Columns: " + n.columns.length), A(n);
78
+ }, [d]), _ = i.useCallback((e) => {
79
+ A(void 0);
80
+ const t = window.document.getElementById(d), n = t.querySelector("#header-button-" + e);
81
+ t.scrollTo({ top: n.offsetTop, behavior: "smooth" });
82
+ }, [d]), q = i.useCallback((e, t) => {
83
+ const n = e[c], r = t[c];
84
+ return n.localeCompare(r);
85
+ }, [c]);
86
+ if (i.useEffect(() => {
87
+ if (!u || u.length == 0 || !c)
88
+ return;
89
+ const e = {};
90
+ R.forEach((t) => {
91
+ e[t] = new Array();
92
+ }), u.forEach((t) => {
93
+ const n = t[c];
94
+ if (x && !new RegExp(x, "i").test(n))
95
+ return;
96
+ const r = n.charAt(0).toLowerCase();
97
+ (Object.hasOwn(e, r) ? e[r] : e["#"]).push(t);
98
+ }), J(e);
99
+ }, [c, u, x]), !p)
100
+ return /* @__PURE__ */ o(z, { className: l(m.JumpList, s.root, k), style: B, id: d, children: /* @__PURE__ */ g(v, { fill: !0, justifyContent: "center", alignItems: "center", children: [
101
+ /* @__PURE__ */ o(Q, { fontSize: 48 }),
102
+ /* @__PURE__ */ o(w, { children: H ? H.emptyList : "No items." })
103
+ ] }) });
104
+ const I = [];
105
+ let C = 0;
106
+ Object.keys(p).forEach((e) => {
107
+ const t = p[e];
108
+ t.length != 0 && (I.push(
109
+ /* @__PURE__ */ o("li", { className: m.JumpListHeader, children: /* @__PURE__ */ o(
110
+ F,
111
+ {
112
+ id: "header-button-" + e,
113
+ className: l(s.headerButton, s.capitalize),
114
+ appearance: "subtle",
115
+ onClick: W,
116
+ children: e
117
+ }
118
+ ) }, e)
119
+ ), t.sort(q).forEach((n) => {
120
+ const r = C == T, j = n[c], b = C + 0, D = L ? L(n, r) : /* @__PURE__ */ o(w, { children: j });
121
+ let S = l(m.JumpListItem, s.listItem);
122
+ r && (S = l(S, s.selectedListItem)), I.push(
123
+ /* @__PURE__ */ o(
124
+ "li",
125
+ {
126
+ className: S,
127
+ onClick: () => {
128
+ Z && T != b && (Z(n), $(b));
129
+ },
130
+ children: /* @__PURE__ */ g(v, { horizontal: !0, alignItems: "center", children: [
131
+ M && /* @__PURE__ */ o(N, { className: l(s.baseSize, s.listItemIcon), children: M(n, r) }),
132
+ /* @__PURE__ */ o(N, { grow: 1, className: s.listItemContent, children: D })
133
+ ] })
134
+ },
135
+ b
136
+ )
137
+ ), C++;
138
+ }));
139
+ });
140
+ const P = (e, t) => {
141
+ O(t.value);
142
+ };
143
+ return /* @__PURE__ */ g(v, { className: l(m.JumpList, s.root, k), style: B, id: E, childrenGap: h.spacingVerticalM, children: [
144
+ y.enableFiltering && /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(
145
+ X,
146
+ {
147
+ type: "search",
148
+ contentAfter: /* @__PURE__ */ o(U, {}),
149
+ placeholder: "Filter",
150
+ style: { width: "100%" },
151
+ onChange: P
152
+ }
153
+ ) }),
154
+ /* @__PURE__ */ o(z, { scrollable: !0, flexBoxItemProps: { grow: 1 }, id: d, children: /* @__PURE__ */ o("ul", { className: s.list, children: I }) }),
155
+ /* @__PURE__ */ o(z, { className: l(m.JumpListMenu, s.menuRoot, !f && s.hidden), scrollable: !0, role: "menu", children: /* @__PURE__ */ g(Y, { gap: h.spacingHorizontalS, justifyContent: "center", alignContent: "center", children: [
156
+ f && f.columns,
157
+ R.map((e) => {
158
+ const t = p[e].length == 0;
159
+ return /* @__PURE__ */ o(
160
+ F,
161
+ {
162
+ appearance: "subtle",
163
+ className: s.baseSize,
164
+ disabled: t,
165
+ onClick: () => {
166
+ _(e);
167
+ },
168
+ children: /* @__PURE__ */ o(w, { weight: "bold", size: 400, className: s.capitalize, children: e })
169
+ },
170
+ e
171
+ );
172
+ })
173
+ ] }) })
174
+ ] });
175
+ };
176
+ export {
177
+ pe as JumpList
178
+ };
@@ -0,0 +1,4 @@
1
+ import { JumpList as p } from "./JumpList.js";
2
+ export {
3
+ p as JumpList
4
+ };