@wrdagency/blockout 1.0.29 → 1.0.31

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 (46) hide show
  1. package/dist/assets/index2.css +1 -1
  2. package/dist/assets/index9.css +1 -1
  3. package/dist/assets/static.css +1 -1
  4. package/dist/assets/style16.css +1 -1
  5. package/dist/assets/style20.css +1 -1
  6. package/dist/assets/style25.css +1 -1
  7. package/dist/components/controls/select-control/control.js +23 -23
  8. package/dist/components/controls/select-control/props.d.ts +2 -2
  9. package/dist/components/controls/select-control/select.js +85 -71
  10. package/dist/components/controls/tag-control/ariakit-experimental.js +1067 -1081
  11. package/dist/components/data-view/api.d.ts +2 -2
  12. package/dist/components/data-view/api.js +14 -17
  13. package/dist/components/data-view/data/normalize.d.ts +0 -2
  14. package/dist/components/data-view/data/normalize.js +24 -36
  15. package/dist/components/data-view/layouts/grid/group.js +3 -2
  16. package/dist/components/data-view/layouts/kanban/group.js +3 -2
  17. package/dist/components/data-view/layouts/list/group.js +3 -2
  18. package/dist/components/data-view/layouts/table/empty.js +3 -2
  19. package/dist/components/data-view/layouts/table/group.js +3 -2
  20. package/dist/components/data-view/layouts/table/root.js +3 -2
  21. package/dist/components/data-view/layouts/tile/group.js +3 -2
  22. package/dist/components/data-view/parts/controls/index.js +3 -2
  23. package/dist/components/data-view/parts/controls/search.js +3 -2
  24. package/dist/components/data-view/parts/footer/actions.js +43 -62
  25. package/dist/components/data-view/parts/footer/index.js +3 -2
  26. package/dist/components/data-view/parts/footer/selection.js +3 -2
  27. package/dist/components/data-view/parts/view-control/index.js +18 -17
  28. package/dist/components/data-view/root.js +3 -2
  29. package/dist/components/data-view/slots/item/actions.js +20 -34
  30. package/dist/components/data-view/types/actions.d.ts +4 -14
  31. package/dist/components/menu/context.d.ts +7 -0
  32. package/dist/components/menu/context.js +10 -0
  33. package/dist/components/menu/index.d.ts +5 -4
  34. package/dist/components/menu/index.js +19 -17
  35. package/dist/components/menu/item.d.ts +1 -1
  36. package/dist/components/menu/items/action.d.ts +1 -1
  37. package/dist/components/menu/items/action.js +10 -7
  38. package/dist/components/menu/items/submenu.d.ts +1 -1
  39. package/dist/components/menu/items/toggle.d.ts +1 -1
  40. package/dist/components/menu/items/toggle.js +20 -19
  41. package/dist/components/menu/types.d.ts +9 -9
  42. package/dist/primitives/popover/root.d.ts +2 -3
  43. package/dist/{select-popover-Dheunyb0.js → select-popover-CGgkyRb4.js} +227 -210
  44. package/dist/types/options.d.ts +15 -0
  45. package/dist/types/options.js +44 -12
  46. package/package.json +1 -1
@@ -5,10 +5,25 @@ export type Option<T extends string = string> = {
5
5
  icon?: ReactNode;
6
6
  disabled?: boolean;
7
7
  description?: string;
8
+ aliases?: string[];
8
9
  };
9
10
  export type PartialOption<T extends string = string> = Partial<Option<T>> & {
10
11
  value: T;
11
12
  };
12
13
  export type Optionable<T extends string = string> = Option<T> | PartialOption<T> | T;
14
+ export type OptionGroup<T extends string = string> = {
15
+ type: "group";
16
+ label: string;
17
+ items: Option<T>[];
18
+ };
19
+ export type OptionableGroup<T extends string = string> = {
20
+ type: "group";
21
+ label: string;
22
+ items: Optionable<T>[];
23
+ };
24
+ export declare function isOptionGroup<T extends string = string>(value: Optionable<T> | OptionableGroup<T>): value is OptionGroup<T> | OptionableGroup<T>;
13
25
  export declare function normalizeOption<T extends string = string>(opt: Optionable<T>): Option<T>;
26
+ export declare function normalizeOptionGroup<T extends string = string>(group: OptionableGroup<T>): OptionGroup<T>;
27
+ export declare function normalizeOptions<T extends string = string>(opts: (OptionableGroup<T> | Optionable<T>)[]): OptionGroup<T>[];
28
+ export declare function findOption<T extends string = string>(options: (OptionableGroup<T> | Optionable<T>)[], value: T | undefined): Option<T> | undefined;
14
29
  export declare function uniqueOptions<T extends string = string>(value: Optionable<T>, index: number, array: Optionable<T>[]): boolean;
@@ -1,18 +1,50 @@
1
- function n(e) {
2
- return typeof e == "string" ? {
3
- value: e,
4
- label: e
1
+ function s(n) {
2
+ return typeof n == "object" && n.hasOwnProperty("type") && n.type === "group";
3
+ }
4
+ function i(n) {
5
+ return typeof n == "string" ? {
6
+ value: n,
7
+ label: n
5
8
  } : {
6
- label: e.label || e.value,
7
- ...e
9
+ label: n.label || n.value,
10
+ ...n
11
+ };
12
+ }
13
+ function f(n) {
14
+ return {
15
+ ...n,
16
+ items: n.items.map(i)
8
17
  };
9
18
  }
10
- function r(e, l, u) {
11
- return u.findIndex(
12
- (i) => n(i).value === n(e).value
13
- ) === l;
19
+ function p(n) {
20
+ const o = [], e = {
21
+ type: "group",
22
+ label: "",
23
+ items: []
24
+ };
25
+ for (const t of n)
26
+ s(t) ? o.push(f(t)) : e.items.push(i(t));
27
+ return e.items.length > 0 && o.push(e), o;
28
+ }
29
+ function l(n, o) {
30
+ const e = p(n);
31
+ console.log(e, o);
32
+ for (const t of e) {
33
+ const r = t.items.find((u) => u.value === o);
34
+ if (r)
35
+ return r;
36
+ }
37
+ }
38
+ function c(n, o, e) {
39
+ return e.findIndex(
40
+ (t) => i(t).value === i(n).value
41
+ ) === o;
14
42
  }
15
43
  export {
16
- n as normalizeOption,
17
- r as uniqueOptions
44
+ l as findOption,
45
+ s as isOptionGroup,
46
+ i as normalizeOption,
47
+ f as normalizeOptionGroup,
48
+ p as normalizeOptions,
49
+ c as uniqueOptions
18
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrdagency/blockout",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "A React component library created by WRD.agency",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",