viewkitjs 0.20.0 → 0.22.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 (75) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/MIGRATION.md +2 -1
  3. package/README.md +1 -1
  4. package/fields/dist/conventions.d.ts +15 -3
  5. package/fields/dist/conventions.js +25 -0
  6. package/fields/dist/design/category-colors.d.ts +12 -5
  7. package/fields/dist/design/category-colors.js +7 -7
  8. package/fields/dist/query/buckets.js +42 -35
  9. package/fields/dist/query/date.js +2 -13
  10. package/fields/docs/guides/conventions.md +1 -1
  11. package/fields/docs/guides/options.md +2 -1
  12. package/fields/docs/reference/design-category-colors.md +2 -2
  13. package/fields/docs/reference/design-status-slots.md +1 -1
  14. package/fields/docs/reference/fields.md +1 -1
  15. package/package.json +19 -1
  16. package/views/README.md +2 -1
  17. package/views/dist/atoms/StatusBadge.js +1 -1
  18. package/views/dist/atoms/tones.js +7 -7
  19. package/views/dist/atoms/types.d.ts +3 -2
  20. package/views/dist/contract.d.ts +295 -2
  21. package/views/dist/contract.js +129 -0
  22. package/views/dist/controls/button/button.d.ts +40 -0
  23. package/views/dist/controls/button/button.js +40 -0
  24. package/views/dist/controls/button/looks.d.ts +4 -0
  25. package/views/dist/controls/button/looks.js +20 -0
  26. package/views/dist/controls/button/map-button.d.ts +11 -0
  27. package/views/dist/controls/button/map-button.js +20 -0
  28. package/views/dist/controls/button/own-look.d.ts +59 -0
  29. package/views/dist/controls/button/own-look.js +33 -0
  30. package/views/dist/controls/button.css +530 -0
  31. package/views/dist/controls/controls.d.ts +5 -0
  32. package/views/dist/controls/controls.js +2 -0
  33. package/views/dist/controls/index.d.ts +11 -0
  34. package/views/dist/controls/index.js +6 -0
  35. package/views/dist/controls/smooth.css +101 -0
  36. package/views/dist/controls/spinner/looks.d.ts +4 -0
  37. package/views/dist/controls/spinner/looks.js +32 -0
  38. package/views/dist/controls/spinner/spinner.d.ts +23 -0
  39. package/views/dist/controls/spinner/spinner.js +16 -0
  40. package/views/dist/controls/spinner.css +147 -0
  41. package/views/dist/display/date.js +15 -2
  42. package/views/dist/display/fit-values.d.ts +3 -2
  43. package/views/dist/display/link.d.ts +1 -1
  44. package/views/dist/display/location.js +2 -1
  45. package/views/dist/display/multi-value.js +1 -1
  46. package/views/dist/display/name.js +3 -1
  47. package/views/dist/display/select.js +1 -1
  48. package/views/dist/display/value-list.d.ts +1 -1
  49. package/views/dist/grid/chrome/GridStructure.js +2 -1
  50. package/views/dist/grid/looks.d.ts +45 -0
  51. package/views/dist/grid/looks.js +74 -0
  52. package/views/dist/looks/index.d.ts +9 -0
  53. package/views/dist/looks/index.js +5 -0
  54. package/views/dist/looks/looks.d.ts +47 -0
  55. package/views/dist/looks/looks.js +25 -0
  56. package/views/dist/looks/pieces.d.ts +3 -0
  57. package/views/dist/looks/pieces.js +4 -0
  58. package/views/dist/panels/react/views-row/FoldingViewRow.js +8 -8
  59. package/views/dist/provider/ViewsProvider.d.ts +3 -3
  60. package/views/dist/provider/ViewsProvider.js +1 -1
  61. package/views/dist/provider/context.d.ts +1 -1
  62. package/views/dist/styles.css +1000 -119
  63. package/views/dist/styles.unlayered.css +1017 -119
  64. package/views/docs/contract.md +172 -7
  65. package/views/docs/guides/display.md +11 -7
  66. package/views/docs/guides/looks.md +29 -0
  67. package/views/docs/guides/the-provider.md +2 -2
  68. package/views/docs/index.md +3 -0
  69. package/views/docs/install.md +7 -5
  70. package/views/docs/reference/controls.md +36 -0
  71. package/views/docs/reference/display.md +2 -2
  72. package/views/docs/reference/looks.md +41 -0
  73. package/views/docs/reference/react.md +2 -2
  74. package/views/docs/reference/views.md +5 -2
  75. package/views/skills/views/SKILL.md +2 -2
@@ -0,0 +1,59 @@
1
+ export interface ButtonOwnLook {
2
+ /** Its radius step; none, square. */
3
+ radius?: "none" | "xs" | "sm" | "md" | "lg";
4
+ /** Its corners round, never the smooth corner. */
5
+ corner?: "round";
6
+ /** No edge: none of the Button's 1px border. */
7
+ edge?: "none";
8
+ /** Its words: the place's (size, weight, line), or the place's at xs or sm, or xs at medium. */
9
+ words?: "inherit" | "xs" | "sm" | "xs-medium" | "lg";
10
+ /** Its colour, kept in every state but disabled: faint, the link's, the text's, or the place's. */
11
+ colour?: "faint" | "link" | "text" | "inherit";
12
+ /** Its icons' size, px. */
13
+ icon?: "12" | "14" | "15" | "16" | "20";
14
+ /** Its icons' colour apart from its words: faint, in every state; or subtle, the quiet kind's rest, kept while its words
15
+ * take the text's colour under the pointer, in every state but disabled; or the brand's. */
16
+ iconColour?: "faint" | "subtle" | "brand";
17
+ /** Its room left and right, px: none, the same each side, or 6 at its start and 4 at its end. */
18
+ pad?: "0" | "4" | "6" | "8" | "6-4";
19
+ /** The room between its words and its icons, px. */
20
+ gap?: "3" | "4" | "6" | "8" | "10";
21
+ /** Under the pointer: nothing changes; or its words alone take the text's colour, no ground under them; or a ground of its
22
+ * own: the popup's hover (overlay), or the neutral ground, pressed too. */
23
+ hover?: "none" | "words" | "overlay" | "neutral";
24
+ /** Open (aria-expanded="true"): the ground it has under the pointer; its words and icons in the brand's colour; or the
25
+ * neutral ground. */
26
+ open?: "hovered" | "brand" | "neutral";
27
+ /** Standing pressed (aria-pressed="true"): the popup's hover as its ground, its words the text's. */
28
+ pressed?: "hovered";
29
+ /** Disabled, it keeps its colour and the arrow: plain, never the disabled grey. With a colour named; a quiet Button keeps no
30
+ * ground. */
31
+ disabled?: "plain";
32
+ /** The hand that grabs: a grip's. */
33
+ cursor?: "grab";
34
+ /** Pressed on a card in a popup: the card's pressed step. */
35
+ press?: "card";
36
+ /** Its words at its start, its label growing so an end icon stands at its end. */
37
+ align?: "start";
38
+ /** Its words semibold, over its words' own weight. The frame's Label weight is read from around it, never from it. */
39
+ weight?: "semibold" | "medium";
40
+ /** Its digits one width each (tabular), a month and a year that change in place. */
41
+ digits?: "tabular";
42
+ /** Its last icon turned while what it opens is open or shut (aria-expanded): a quarter clockwise while open (an arrow drawn
43
+ * pointing right), or a quarter back while shut (an arrow drawn pointing down). */
44
+ turn?: "quarter" | "back";
45
+ /** A dot in the brand's colour at its top end corner, saying something is on: set it while it is. */
46
+ dot?: "brand";
47
+ /** Its words cut with … at their end when its place is narrower than they are. */
48
+ cut?: "end";
49
+ /** Room at its end, px, for something laid over it. */
50
+ endRoom?: "30";
51
+ }
52
+ /** Each own option, the attribute it sets (data-button-<attr>) and its values. */
53
+ export declare const buttonOwnOptions: {
54
+ id: keyof ButtonOwnLook;
55
+ attr: string;
56
+ values: string[];
57
+ }[];
58
+ /** The attributes of a Button's own look, on the Button: data-button-own, then each option it names, and only those. */
59
+ export declare function buttonOwnAttrs(look: ButtonOwnLook): Record<string, string>;
@@ -0,0 +1,33 @@
1
+ export const buttonOwnOptions = [
2
+ { id: "radius", attr: "radius", values: ["none", "xs", "sm", "md", "lg"] },
3
+ { id: "corner", attr: "corner", values: ["round"] },
4
+ { id: "edge", attr: "edge", values: ["none"] },
5
+ { id: "words", attr: "words", values: ["inherit", "xs", "sm", "xs-medium", "lg"] },
6
+ { id: "colour", attr: "colour", values: ["faint", "link", "text", "inherit"] },
7
+ { id: "icon", attr: "icon", values: ["12", "14", "15", "16", "20"] },
8
+ { id: "iconColour", attr: "icon-colour", values: ["faint", "subtle", "brand"] },
9
+ { id: "pad", attr: "pad", values: ["0", "4", "6", "8", "6-4"] },
10
+ { id: "gap", attr: "gap", values: ["3", "4", "6", "8", "10"] },
11
+ { id: "hover", attr: "hover", values: ["none", "words", "overlay", "neutral"] },
12
+ { id: "open", attr: "open", values: ["hovered", "brand", "neutral"] },
13
+ { id: "pressed", attr: "pressed", values: ["hovered"] },
14
+ { id: "disabled", attr: "disabled", values: ["plain"] },
15
+ { id: "cursor", attr: "cursor", values: ["grab"] },
16
+ { id: "press", attr: "press", values: ["card"] },
17
+ { id: "align", attr: "align", values: ["start"] },
18
+ { id: "weight", attr: "weight", values: ["semibold", "medium"] },
19
+ { id: "digits", attr: "digits", values: ["tabular"] },
20
+ { id: "turn", attr: "turn", values: ["quarter", "back"] },
21
+ { id: "dot", attr: "dot", values: ["brand"] },
22
+ { id: "cut", attr: "cut", values: ["end"] },
23
+ { id: "endRoom", attr: "end-room", values: ["30"] },
24
+ ];
25
+ export function buttonOwnAttrs(look) {
26
+ const attrs = { "data-button-own": "" };
27
+ for (const o of buttonOwnOptions) {
28
+ const v = look[o.id];
29
+ if (v != null)
30
+ attrs[`data-button-${o.attr}`] = v;
31
+ }
32
+ return attrs;
33
+ }