@canonical/react-ds-app 0.27.1-experimental.0 → 0.28.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 (169) hide show
  1. package/dist/esm/lib/ApplicationLayout/ApplicationLayout.js +15 -0
  2. package/dist/esm/lib/ApplicationLayout/ApplicationLayout.js.map +1 -0
  3. package/dist/esm/lib/ApplicationLayout/index.js +3 -0
  4. package/dist/esm/lib/ApplicationLayout/index.js.map +1 -0
  5. package/dist/esm/lib/ApplicationLayout/styles.css +29 -0
  6. package/dist/esm/lib/ApplicationLayout/types.js +3 -0
  7. package/dist/esm/lib/ApplicationLayout/types.js.map +1 -0
  8. package/dist/esm/lib/ContentLayout/ContentLayout.js +19 -0
  9. package/dist/esm/lib/ContentLayout/ContentLayout.js.map +1 -0
  10. package/dist/esm/lib/ContentLayout/index.js +3 -0
  11. package/dist/esm/lib/ContentLayout/index.js.map +1 -0
  12. package/dist/esm/lib/ContentLayout/styles.css +13 -0
  13. package/dist/esm/lib/ContentLayout/types.js +3 -0
  14. package/dist/esm/lib/ContentLayout/types.js.map +1 -0
  15. package/dist/esm/lib/SideNavigation/SideNavigation.js +46 -0
  16. package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -0
  17. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +17 -0
  18. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -0
  19. package/dist/esm/lib/SideNavigation/common/CollapseToggle/index.js +3 -0
  20. package/dist/esm/lib/SideNavigation/common/CollapseToggle/index.js.map +1 -0
  21. package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +5 -0
  22. package/dist/esm/lib/SideNavigation/common/CollapseToggle/types.js +2 -0
  23. package/dist/esm/lib/SideNavigation/common/CollapseToggle/types.js.map +1 -0
  24. package/dist/esm/lib/SideNavigation/common/Content/Content.js +16 -0
  25. package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -0
  26. package/dist/esm/lib/SideNavigation/common/Content/index.js +3 -0
  27. package/dist/esm/lib/SideNavigation/common/Content/index.js.map +1 -0
  28. package/dist/esm/lib/SideNavigation/common/Content/styles.css +33 -0
  29. package/dist/esm/lib/SideNavigation/common/Content/types.js +2 -0
  30. package/dist/esm/lib/SideNavigation/common/Content/types.js.map +1 -0
  31. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +16 -0
  32. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -0
  33. package/dist/esm/lib/SideNavigation/common/Footer/index.js +3 -0
  34. package/dist/esm/lib/SideNavigation/common/Footer/index.js.map +1 -0
  35. package/dist/esm/lib/SideNavigation/common/Footer/styles.css +6 -0
  36. package/dist/esm/lib/SideNavigation/common/Footer/types.js +2 -0
  37. package/dist/esm/lib/SideNavigation/common/Footer/types.js.map +1 -0
  38. package/dist/esm/lib/SideNavigation/common/Header/Header.js +16 -0
  39. package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -0
  40. package/dist/esm/lib/SideNavigation/common/Header/index.js +3 -0
  41. package/dist/esm/lib/SideNavigation/common/Header/index.js.map +1 -0
  42. package/dist/esm/lib/SideNavigation/common/Header/styles.css +37 -0
  43. package/dist/esm/lib/SideNavigation/common/Header/types.js +2 -0
  44. package/dist/esm/lib/SideNavigation/common/Header/types.js.map +1 -0
  45. package/dist/esm/lib/SideNavigation/common/Item/Item.js +29 -0
  46. package/dist/esm/lib/SideNavigation/common/Item/Item.js.map +1 -0
  47. package/dist/esm/lib/SideNavigation/common/Item/index.js +2 -0
  48. package/dist/esm/lib/SideNavigation/common/Item/index.js.map +1 -0
  49. package/dist/esm/lib/SideNavigation/common/Item/styles.css +54 -0
  50. package/dist/esm/lib/SideNavigation/common/Item/types.js +2 -0
  51. package/dist/esm/lib/SideNavigation/common/Item/types.js.map +1 -0
  52. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js +39 -0
  53. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js.map +1 -0
  54. package/dist/esm/lib/SideNavigation/common/NavTree/index.js +2 -0
  55. package/dist/esm/lib/SideNavigation/common/NavTree/index.js.map +1 -0
  56. package/dist/esm/lib/SideNavigation/common/NavTree/styles.css +31 -0
  57. package/dist/esm/lib/SideNavigation/common/NavTree/types.js +2 -0
  58. package/dist/esm/lib/SideNavigation/common/NavTree/types.js.map +1 -0
  59. package/dist/esm/lib/SideNavigation/common/index.js +7 -0
  60. package/dist/esm/lib/SideNavigation/common/index.js.map +1 -0
  61. package/dist/esm/lib/SideNavigation/index.js +3 -0
  62. package/dist/esm/lib/SideNavigation/index.js.map +1 -0
  63. package/dist/esm/lib/SideNavigation/styles.css +25 -0
  64. package/dist/esm/lib/SideNavigation/types.js +2 -0
  65. package/dist/esm/lib/SideNavigation/types.js.map +1 -0
  66. package/dist/esm/lib/ViewLayout/ViewLayout.js +15 -0
  67. package/dist/esm/lib/ViewLayout/ViewLayout.js.map +1 -0
  68. package/dist/esm/lib/ViewLayout/index.js +3 -0
  69. package/dist/esm/lib/ViewLayout/index.js.map +1 -0
  70. package/dist/esm/lib/ViewLayout/styles.css +27 -0
  71. package/dist/esm/lib/ViewLayout/types.js +3 -0
  72. package/dist/esm/lib/ViewLayout/types.js.map +1 -0
  73. package/dist/esm/lib/index.js +4 -1
  74. package/dist/esm/lib/index.js.map +1 -1
  75. package/dist/types/lib/ApplicationLayout/ApplicationLayout.d.ts +13 -0
  76. package/dist/types/lib/ApplicationLayout/ApplicationLayout.d.ts.map +1 -0
  77. package/dist/types/lib/ApplicationLayout/index.d.ts +3 -0
  78. package/dist/types/lib/ApplicationLayout/index.d.ts.map +1 -0
  79. package/dist/types/lib/ApplicationLayout/types.d.ts +12 -0
  80. package/dist/types/lib/ApplicationLayout/types.d.ts.map +1 -0
  81. package/dist/types/lib/ContentLayout/ContentLayout.d.ts +15 -0
  82. package/dist/types/lib/ContentLayout/ContentLayout.d.ts.map +1 -0
  83. package/dist/types/lib/ContentLayout/index.d.ts +3 -0
  84. package/dist/types/lib/ContentLayout/index.d.ts.map +1 -0
  85. package/dist/types/lib/ContentLayout/types.d.ts +17 -0
  86. package/dist/types/lib/ContentLayout/types.d.ts.map +1 -0
  87. package/dist/types/lib/SideNavigation/SideNavigation.d.ts +18 -0
  88. package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -0
  89. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +14 -0
  90. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -0
  91. package/dist/types/lib/SideNavigation/common/CollapseToggle/index.d.ts +3 -0
  92. package/dist/types/lib/SideNavigation/common/CollapseToggle/index.d.ts.map +1 -0
  93. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +9 -0
  94. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -0
  95. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts +13 -0
  96. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts.map +1 -0
  97. package/dist/types/lib/SideNavigation/common/Content/index.d.ts +3 -0
  98. package/dist/types/lib/SideNavigation/common/Content/index.d.ts.map +1 -0
  99. package/dist/types/lib/SideNavigation/common/Content/types.d.ts +14 -0
  100. package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -0
  101. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts +13 -0
  102. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -0
  103. package/dist/types/lib/SideNavigation/common/Footer/index.d.ts +3 -0
  104. package/dist/types/lib/SideNavigation/common/Footer/index.d.ts.map +1 -0
  105. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts +14 -0
  106. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts.map +1 -0
  107. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +13 -0
  108. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -0
  109. package/dist/types/lib/SideNavigation/common/Header/index.d.ts +3 -0
  110. package/dist/types/lib/SideNavigation/common/Header/index.d.ts.map +1 -0
  111. package/dist/types/lib/SideNavigation/common/Header/types.d.ts +14 -0
  112. package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -0
  113. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts +21 -0
  114. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts.map +1 -0
  115. package/dist/types/lib/SideNavigation/common/Item/index.d.ts +3 -0
  116. package/dist/types/lib/SideNavigation/common/Item/index.d.ts.map +1 -0
  117. package/dist/types/lib/SideNavigation/common/Item/types.d.ts +17 -0
  118. package/dist/types/lib/SideNavigation/common/Item/types.d.ts.map +1 -0
  119. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts +20 -0
  120. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts.map +1 -0
  121. package/dist/types/lib/SideNavigation/common/NavTree/index.d.ts +3 -0
  122. package/dist/types/lib/SideNavigation/common/NavTree/index.d.ts.map +1 -0
  123. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts +11 -0
  124. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts.map +1 -0
  125. package/dist/types/lib/SideNavigation/common/index.d.ts +6 -0
  126. package/dist/types/lib/SideNavigation/common/index.d.ts.map +1 -0
  127. package/dist/types/lib/SideNavigation/index.d.ts +3 -0
  128. package/dist/types/lib/SideNavigation/index.d.ts.map +1 -0
  129. package/dist/types/lib/SideNavigation/types.d.ts +60 -0
  130. package/dist/types/lib/SideNavigation/types.d.ts.map +1 -0
  131. package/dist/types/lib/ViewLayout/ViewLayout.d.ts +13 -0
  132. package/dist/types/lib/ViewLayout/ViewLayout.d.ts.map +1 -0
  133. package/dist/types/lib/ViewLayout/index.d.ts +3 -0
  134. package/dist/types/lib/ViewLayout/index.d.ts.map +1 -0
  135. package/dist/types/lib/ViewLayout/types.d.ts +12 -0
  136. package/dist/types/lib/ViewLayout/types.d.ts.map +1 -0
  137. package/dist/types/lib/index.d.ts +4 -1
  138. package/dist/types/lib/index.d.ts.map +1 -1
  139. package/package.json +15 -15
  140. package/dist/esm/lib/Button/Button.js +0 -10
  141. package/dist/esm/lib/Button/Button.js.map +0 -1
  142. package/dist/esm/lib/Button/index.js +0 -2
  143. package/dist/esm/lib/Button/index.js.map +0 -1
  144. package/dist/esm/lib/Button/styles.css +0 -63
  145. package/dist/esm/lib/Button/types.js +0 -12
  146. package/dist/esm/lib/Button/types.js.map +0 -1
  147. package/dist/esm/ui/Button/Button.js +0 -10
  148. package/dist/esm/ui/Button/Button.js.map +0 -1
  149. package/dist/esm/ui/Button/index.js +0 -2
  150. package/dist/esm/ui/Button/index.js.map +0 -1
  151. package/dist/esm/ui/Button/styles.css +0 -63
  152. package/dist/esm/ui/Button/types.js +0 -12
  153. package/dist/esm/ui/Button/types.js.map +0 -1
  154. package/dist/esm/ui/index.js +0 -2
  155. package/dist/esm/ui/index.js.map +0 -1
  156. package/dist/types/lib/Button/Button.d.ts +0 -6
  157. package/dist/types/lib/Button/Button.d.ts.map +0 -1
  158. package/dist/types/lib/Button/index.d.ts +0 -3
  159. package/dist/types/lib/Button/index.d.ts.map +0 -1
  160. package/dist/types/lib/Button/types.d.ts +0 -18
  161. package/dist/types/lib/Button/types.d.ts.map +0 -1
  162. package/dist/types/ui/Button/Button.d.ts +0 -6
  163. package/dist/types/ui/Button/Button.d.ts.map +0 -1
  164. package/dist/types/ui/Button/index.d.ts +0 -3
  165. package/dist/types/ui/Button/index.d.ts.map +0 -1
  166. package/dist/types/ui/Button/types.d.ts +0 -18
  167. package/dist/types/ui/Button/types.d.ts.map +0 -1
  168. package/dist/types/ui/index.d.ts +0 -2
  169. package/dist/types/ui/index.d.ts.map +0 -1
@@ -0,0 +1,60 @@
1
+ import type { IconName } from "@canonical/ds-assets";
2
+ import type { Item } from "@canonical/ds-types";
3
+ import type { ComponentType, HTMLAttributes, ReactNode } from "react";
4
+ /**
5
+ * Props passed to a custom link component (router integration).
6
+ * Mirrors the contract used by Breadcrumbs so the same router `Link` works for
7
+ * both. Defaults to the intrinsic `"a"` element when not provided.
8
+ */
9
+ export interface LinkComponentProps {
10
+ href?: string;
11
+ className?: string;
12
+ children?: ReactNode;
13
+ "aria-current"?: HTMLAttributes<HTMLElement>["aria-current"];
14
+ }
15
+ /**
16
+ * The SideNavigation item — the WD405 `Item` enhanced with the presentational
17
+ * extras this component understands:
18
+ *
19
+ * - `icon` — a leading icon (start slot), by ds-assets icon name.
20
+ * - `slot` — trailing content for **leaf** items (end slot): a badge, count,
21
+ * etc. Ignored when the item has subitems — those show a disclosure caret
22
+ * automatically (`end = hasSubitems ? caret : slot`).
23
+ *
24
+ * No discriminated union to author: the caret-vs-slot choice is structural,
25
+ * derived from whether the item has `items`.
26
+ */
27
+ export interface NavItem extends Omit<Item, "items"> {
28
+ /** Leading icon (start slot), by ds-assets icon name. */
29
+ icon?: IconName;
30
+ /** Trailing content for leaf items (end slot). Ignored if the item has subitems. */
31
+ slot?: ReactNode;
32
+ /** Subitems. Presence drives the disclosure caret (vs the leaf `slot`). */
33
+ items?: NavItem[];
34
+ }
35
+ export interface SideNavigationProps extends HTMLAttributes<HTMLDivElement> {
36
+ /** Brand content (logo/wordmark) rendered in the header. */
37
+ brand?: ReactNode;
38
+ /** Optional application name/wordmark shown beside the brand in the header. */
39
+ applicationName?: ReactNode;
40
+ /** Main navigation, as a root NavItem. Its direct children are rendered. */
41
+ root?: NavItem;
42
+ /** Footer navigation, as a root NavItem. Pinned to the bottom. */
43
+ footerRoot?: NavItem;
44
+ /**
45
+ * Component used to render navigable items (those with a `url`). Receives
46
+ * `LinkComponentProps`. Defaults to `"a"`. Pass a router `Link` (e.g.
47
+ * `@canonical/router-react`) to integrate with client-side navigation.
48
+ */
49
+ LinkComponent?: ComponentType<LinkComponentProps> | "a";
50
+ /**
51
+ * Live current location, used to resolve which item is active. The matching
52
+ * item is marked `aria-current` and its ancestor groups expanded. Keep it in
53
+ * sync with the consumer's router (e.g. `useRoute().pathname`) so the active
54
+ * state updates on navigation.
55
+ */
56
+ currentUrl?: string;
57
+ /** Initial expanded (rail) state when uncontrolled. Defaults to `true`. */
58
+ defaultExpanded?: boolean;
59
+ }
60
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;CAC9D;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,OAAQ,SAAQ,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;IAClD,yDAAyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
@@ -0,0 +1,13 @@
1
+ import type React from "react";
2
+ import type { ViewLayoutProps } from "./types.js";
3
+ import "./styles.css";
4
+ /**
5
+ * ViewLayout — a single view within the application shell.
6
+ *
7
+ * Divides its space between the view content (default slot, `1fr`) and an
8
+ * optional contextual aside (named slot, `min-content`), per the ontology
9
+ * instance `apps.layout.view_layout`.
10
+ */
11
+ declare const ViewLayout: ({ className, children, aside, ...props }: ViewLayoutProps) => React.ReactElement;
12
+ export default ViewLayout;
13
+ //# sourceMappingURL=ViewLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/ViewLayout/ViewLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,UAAU,GAAI,0CAKjB,eAAe,KAAG,KAAK,CAAC,YAU1B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type * from "./types.js";
2
+ export { default as ViewLayout } from "./ViewLayout.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/ViewLayout/index.ts"],"names":[],"mappings":"AAEA,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface ViewLayoutProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** View content (default slot). Typically a ContentLayout. */
4
+ children?: ReactNode;
5
+ /**
6
+ * Contextual aside (named slot), rendered in the trailing `min-content`
7
+ * column — a detail panel, filters, help. Slot-agnostic: pass any
8
+ * ReactNode; the slot owns its inline size.
9
+ */
10
+ aside?: ReactNode;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ViewLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
@@ -1,2 +1,5 @@
1
- export * from "./Button/index.js";
1
+ export * from "./ApplicationLayout/index.js";
2
+ export * from "./ContentLayout/index.js";
3
+ export * from "./SideNavigation/index.js";
4
+ export * from "./ViewLayout/index.js";
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-app",
3
- "version": "0.27.1-experimental.0",
3
+ "version": "0.28.0",
4
4
  "type": "module",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -42,13 +42,13 @@
42
42
  "test:vitest:watch": "vitest"
43
43
  },
44
44
  "dependencies": {
45
- "@canonical/ds-assets": "^0.27.1-experimental.0",
46
- "@canonical/ds-types": "^0.27.1-experimental.0",
47
- "@canonical/react-ds-global": "^0.27.1-experimental.0",
48
- "@canonical/react-hooks": "^0.27.1-experimental.0",
49
- "@canonical/storybook-config": "^0.27.1-experimental.0",
50
- "@canonical/styles": "^0.27.1-experimental.0",
51
- "@canonical/utils": "^0.27.1-experimental.0",
45
+ "@canonical/ds-assets": "^0.28.0",
46
+ "@canonical/ds-types": "^0.28.0",
47
+ "@canonical/react-ds-global": "^0.28.0",
48
+ "@canonical/react-hooks": "^0.28.0",
49
+ "@canonical/storybook-config": "^0.28.0",
50
+ "@canonical/styles": "^0.28.0",
51
+ "@canonical/utils": "^0.28.0",
52
52
  "react": "^19.2.4",
53
53
  "react-dom": "^19.2.4"
54
54
  },
@@ -66,14 +66,14 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@biomejs/biome": "2.4.9",
69
- "@canonical/biome-config": "^0.27.1-experimental.0",
69
+ "@canonical/biome-config": "^0.28.0",
70
70
  "@canonical/design-tokens": "^0.6.0",
71
- "@canonical/router-core": "^0.27.1-experimental.0",
72
- "@canonical/router-react": "^0.27.1-experimental.0",
73
- "@canonical/storybook-addon-utils": "^0.27.1-experimental.0",
74
- "@canonical/storybook-helpers": "^0.27.1-experimental.0",
75
- "@canonical/typescript-config-react": "^0.27.1-experimental.0",
76
- "@canonical/webarchitect": "^0.27.1-experimental.0",
71
+ "@canonical/router-core": "^0.28.0",
72
+ "@canonical/router-react": "^0.28.0",
73
+ "@canonical/storybook-addon-utils": "^0.28.0",
74
+ "@canonical/storybook-helpers": "^0.28.0",
75
+ "@canonical/typescript-config-react": "^0.28.0",
76
+ "@canonical/webarchitect": "^0.28.0",
77
77
  "@chromatic-com/storybook": "^5.0.1",
78
78
  "@storybook/addon-docs": "^10.3.1",
79
79
  "@storybook/react-vite": "^10.3.1",
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "./styles.css";
3
- /** Buttons are clickable elements used to perform an action. */
4
- const Button = ({ id, className, children, style, appearance, ...props }) => {
5
- return (_jsx("button", { id: id, className: ["ds", "button", appearance, className]
6
- .filter(Boolean)
7
- .join(" "), style: style, "aria-label": props["aria-label"] || children?.toString(), ...props, children: children }));
8
- };
9
- export default Button;
10
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,OAAO,CACL,iBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC;aAC/C,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,gBAIA,KAAK,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE,QAAQ,EAAE,KACnD,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default as Button } from "./Button.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -1,63 +0,0 @@
1
- /* component styles */
2
-
3
- /* component variables
4
- --button-color-background: background color of the button
5
- --button-color-background-hover: background color of the button on hover
6
- --button-color-background-active: background color of the button on active
7
- --button-color-text: text color of the button
8
- --button-color-border: border color of the button
9
- --button-color-border-hover: border color of the button on hover
10
- --button-color-border-active: border color of the button on active
11
-
12
- --button-margin-left: left margin of the button
13
- --button-margin-bottom: bottom margin of the button
14
- --button-padding-vertical: vertical padding of the button
15
- --button-padding-horizontal: horizontal padding of the button
16
- --button-border-width: border width of the button
17
- --button-font-size: font size of the button
18
- --button-font-weight: font weight of the button
19
- --button-line-height: line height of the button
20
- */
21
- .ds.button {
22
- display: inline-block;
23
- cursor: pointer;
24
-
25
- color: var(--modifier-color-text, var(--button-color-text));
26
- background-color: var(--modifier-color, var(--button-color-background));
27
- border-color: var(--modifier-color-border, var(--button-color-border));
28
- border-style: solid;
29
- border-width: var(--button-border-width);
30
- font-size: var(--button-font-size);
31
- font-weight: var(--button-font-weight);
32
- line-height: var(--button-line-height);
33
- margin-block-end: var(--button-margin-bottom);
34
- margin-inline-end: var(--button-margin-left);
35
- padding-block: var(--button-padding-vertical);
36
- padding-inline: var(--button-padding-horizontal);
37
-
38
- text-align: left;
39
- text-decoration: none;
40
-
41
- /* component states */
42
- &:hover {
43
- background-color: var(
44
- --modifier-color-hover,
45
- var(--button-color-background-hover)
46
- );
47
- border-color: var(
48
- --modifier-color-border-hover,
49
- var(--button-color-border-hover)
50
- );
51
- }
52
-
53
- &:active {
54
- background-color: var(
55
- --modifier-color-active,
56
- var(--button-color-background-active)
57
- );
58
- border-color: var(
59
- --modifier-color-border-active,
60
- var(--button-color-border-active)
61
- );
62
- }
63
- }
@@ -1,12 +0,0 @@
1
- // TODO: this is how appearance could work as enum
2
- //
3
- // export enum ButtonAppearance {
4
- // DEFAULT = "default",
5
- // BASE = "base",
6
- // POSITIVE = "positive",
7
- // NEGATIVE = "negative",
8
- // LINK = "link",
9
- // }
10
- //
11
- export {};
12
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/Button/types.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,iCAAiC;AACjC,yBAAyB;AACzB,mBAAmB;AACnB,2BAA2B;AAC3B,2BAA2B;AAC3B,mBAAmB;AACnB,IAAI;AACJ,EAAE"}
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "./styles.css";
3
- /** Buttons are clickable elements used to perform an action. */
4
- const Button = ({ id, className, children, style, appearance, ...props }) => {
5
- return (_jsx("button", { id: id, className: ["ds", "button", appearance, className]
6
- .filter(Boolean)
7
- .join(" "), style: style, "aria-label": props["aria-label"] || children?.toString(), ...props, children: children }));
8
- };
9
- export default Button;
10
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/ui/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,OAAO,CACL,iBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC;aAC/C,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,gBAIA,KAAK,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE,QAAQ,EAAE,KACnD,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default as Button } from "./Button.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -1,63 +0,0 @@
1
- /* component styles */
2
-
3
- /* component variables
4
- --button-color-background: background color of the button
5
- --button-color-background-hover: background color of the button on hover
6
- --button-color-background-active: background color of the button on active
7
- --button-color-text: text color of the button
8
- --button-color-border: border color of the button
9
- --button-color-border-hover: border color of the button on hover
10
- --button-color-border-active: border color of the button on active
11
-
12
- --button-margin-left: left margin of the button
13
- --button-margin-bottom: bottom margin of the button
14
- --button-padding-vertical: vertical padding of the button
15
- --button-padding-horizontal: horizontal padding of the button
16
- --button-border-width: border width of the button
17
- --button-font-size: font size of the button
18
- --button-font-weight: font weight of the button
19
- --button-line-height: line height of the button
20
- */
21
- .ds.button {
22
- display: inline-block;
23
- cursor: pointer;
24
-
25
- color: var(--modifier-color-text, var(--button-color-text));
26
- background-color: var(--modifier-color, var(--button-color-background));
27
- border-color: var(--modifier-color-border, var(--button-color-border));
28
- border-style: solid;
29
- border-width: var(--button-border-width);
30
- font-size: var(--button-font-size);
31
- font-weight: var(--button-font-weight);
32
- line-height: var(--button-line-height);
33
- margin-block-end: var(--button-margin-bottom);
34
- margin-inline-end: var(--button-margin-left);
35
- padding-block: var(--button-padding-vertical);
36
- padding-inline: var(--button-padding-horizontal);
37
-
38
- text-align: left;
39
- text-decoration: none;
40
-
41
- /* component states */
42
- &:hover {
43
- background-color: var(
44
- --modifier-color-hover,
45
- var(--button-color-background-hover)
46
- );
47
- border-color: var(
48
- --modifier-color-border-hover,
49
- var(--button-color-border-hover)
50
- );
51
- }
52
-
53
- &:active {
54
- background-color: var(
55
- --modifier-color-active,
56
- var(--button-color-background-active)
57
- );
58
- border-color: var(
59
- --modifier-color-border-active,
60
- var(--button-color-border-active)
61
- );
62
- }
63
- }
@@ -1,12 +0,0 @@
1
- // TODO: this is how appearance could work as enum
2
- //
3
- // export enum ButtonAppearance {
4
- // DEFAULT = "default",
5
- // BASE = "base",
6
- // POSITIVE = "positive",
7
- // NEGATIVE = "negative",
8
- // LINK = "link",
9
- // }
10
- //
11
- export {};
12
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Button/types.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,iCAAiC;AACjC,yBAAyB;AACzB,mBAAmB;AACnB,2BAA2B;AAC3B,2BAA2B;AAC3B,mBAAmB;AACnB,IAAI;AACJ,EAAE"}
@@ -1,2 +0,0 @@
1
- export * from "./Button/index.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -1,6 +0,0 @@
1
- import type Props from "./types.js";
2
- import "./styles.css";
3
- /** Buttons are clickable elements used to perform an action. */
4
- declare const Button: ({ id, className, children, style, appearance, ...props }: Props) => React.ReactElement;
5
- export default Button;
6
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,QAAA,MAAM,MAAM,GAAI,0DAOb,KAAK,KAAG,KAAK,CAAC,YAiBhB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default as Button } from "./Button.js";
2
- export type { BaseProps as ButtonBaseProps, default as ButtonProps, } from "./types.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,WAAW,GACvB,MAAM,YAAY,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- export interface BaseProps {
3
- id?: string;
4
- /** Additional CSS classes */
5
- className?: string;
6
- /**
7
- * Button contents.
8
- * This will also be used for the `aria-label`.
9
- * If this contains anything other than a string literal (such as a <p> element), you should specify an
10
- * `aria-label` prop to ensure that the button label is applied properly. Otherwise, the label will be set to [object Object].
11
- * */
12
- children: ReactNode;
13
- /** The visual style of the button */
14
- appearance?: "neutral" | "base" | "positive" | "negative" | "link";
15
- }
16
- type Props = BaseProps & ButtonHTMLAttributes<HTMLButtonElement>;
17
- export default Props;
18
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,SAAS;IAExB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;SAKK;IACL,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;CACpE;AAED,KAAK,KAAK,GAAG,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEjE,eAAe,KAAK,CAAC"}
@@ -1,6 +0,0 @@
1
- import type Props from "./types.js";
2
- import "./styles.css";
3
- /** Buttons are clickable elements used to perform an action. */
4
- declare const Button: ({ id, className, children, style, appearance, ...props }: Props) => React.ReactElement;
5
- export default Button;
6
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,QAAA,MAAM,MAAM,GAAI,0DAOb,KAAK,KAAG,KAAK,CAAC,YAiBhB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default as Button } from "./Button.js";
2
- export type { BaseProps as ButtonBaseProps, default as ButtonProps, } from "./types.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,WAAW,GACvB,MAAM,YAAY,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- export interface BaseProps {
3
- id?: string;
4
- /** Additional CSS classes */
5
- className?: string;
6
- /**
7
- * Button contents.
8
- * This will also be used for the `aria-label`.
9
- * If this contains anything other than a string literal (such as a <p> element), you should specify an
10
- * `aria-label` prop to ensure that the button label is applied properly. Otherwise, the label will be set to [object Object].
11
- * */
12
- children: ReactNode;
13
- /** The visual style of the button */
14
- appearance?: "neutral" | "base" | "positive" | "negative" | "link";
15
- }
16
- type Props = BaseProps & ButtonHTMLAttributes<HTMLButtonElement>;
17
- export default Props;
18
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Button/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,SAAS;IAExB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;SAKK;IACL,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;CACpE;AAED,KAAK,KAAK,GAAG,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEjE,eAAe,KAAK,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./Button/index.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}