@ogcio/design-system-react 1.29.0 → 1.30.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 (51) hide show
  1. package/README.md +11 -33
  2. package/dist/alert/variants.d.ts +78 -2
  3. package/dist/atoms/DsButton.d.ts +194 -0
  4. package/dist/atoms/DsButton.js +329 -0
  5. package/dist/atoms/icons/Close.d.ts +3 -0
  6. package/dist/atoms/icons/Close.js +22 -0
  7. package/dist/atoms/icons/KeyboardArrowDown.d.ts +3 -0
  8. package/dist/atoms/icons/KeyboardArrowDown.js +22 -0
  9. package/dist/atoms/icons/KeyboardArrowUp.d.ts +3 -0
  10. package/dist/atoms/icons/KeyboardArrowUp.js +22 -0
  11. package/dist/atoms/icons/Visibility.d.ts +3 -0
  12. package/dist/atoms/icons/Visibility.js +22 -0
  13. package/dist/atoms/icons/VisibilityOff.d.ts +3 -0
  14. package/dist/atoms/icons/VisibilityOff.js +22 -0
  15. package/dist/atoms/icons/index.d.ts +6 -0
  16. package/dist/atoms/icons/index.js +12 -0
  17. package/dist/atoms/icons/types.d.ts +10 -0
  18. package/dist/atoms/icons/types.js +1 -0
  19. package/dist/atoms/index.d.ts +2 -0
  20. package/dist/atoms/index.js +14 -0
  21. package/dist/autocomplete/autocomplete.js +131 -115
  22. package/dist/combo-box/dropdown-item.js +39 -40
  23. package/dist/data-table/data-table-footer.js +57 -51
  24. package/dist/data-table/data-table-header.d.ts +7 -7
  25. package/dist/data-table/data-table-header.js +97 -110
  26. package/dist/data-table/data-table-selected-rows.d.ts +1 -0
  27. package/dist/data-table/data-table-selected-rows.js +15 -19
  28. package/dist/forms/form-field/form-field.d.ts +2 -2
  29. package/dist/forms/form-field/form-field.js +40 -30
  30. package/dist/forms/form-field/types.d.ts +10 -3
  31. package/dist/header/components/header-slot.js +33 -32
  32. package/dist/header/variants.d.ts +220 -20
  33. package/dist/heading/heading.d.ts +70 -2
  34. package/dist/hooks/use-breakpoint.js +15 -12
  35. package/dist/icon/icon.d.ts +10 -0
  36. package/dist/icon/icon.js +64 -52
  37. package/dist/icon/icons.d.ts +1 -1
  38. package/dist/input-password/input-password.js +13 -12
  39. package/dist/input-text/input-text.js +18 -16
  40. package/dist/label/label.d.ts +43 -0
  41. package/dist/label/label.js +7 -6
  42. package/dist/modal/modal.js +8 -7
  43. package/dist/spinner/spinner.d.ts +30 -2
  44. package/dist/styles.css +12 -2
  45. package/dist/table/table.d.ts +22 -2
  46. package/dist/tabs/tab-item.d.ts +2 -2
  47. package/dist/text-input/text-input.d.ts +1 -1
  48. package/dist/textarea/textarea.js +27 -28
  49. package/dist/toast/ds-toast.d.ts +78 -2
  50. package/fonts.css +10 -0
  51. package/package.json +12 -7
@@ -7,7 +7,17 @@ declare const tableVariants: import('tailwind-variants').TVReturnType<{
7
7
  auto: string;
8
8
  fixed: string;
9
9
  };
10
- }, undefined, "gi-table", TVConfig<V, EV>, {
10
+ }, undefined, "gi-table", import('tailwind-variants/dist/config.js').TVConfig<{
11
+ layout: {
12
+ auto: string;
13
+ fixed: string;
14
+ };
15
+ }, {
16
+ layout: {
17
+ auto: string;
18
+ fixed: string;
19
+ };
20
+ }>, {
11
21
  layout: {
12
22
  auto: string;
13
23
  fixed: string;
@@ -17,7 +27,17 @@ declare const tableVariants: import('tailwind-variants').TVReturnType<{
17
27
  auto: string;
18
28
  fixed: string;
19
29
  };
20
- }, undefined, "gi-table", TVConfig<V, EV>, unknown, unknown, undefined>>;
30
+ }, undefined, "gi-table", import('tailwind-variants/dist/config.js').TVConfig<{
31
+ layout: {
32
+ auto: string;
33
+ fixed: string;
34
+ };
35
+ }, {
36
+ layout: {
37
+ auto: string;
38
+ fixed: string;
39
+ };
40
+ }>, unknown, unknown, undefined>>;
21
41
  export type TableProps = VariantProps<typeof tableVariants> & {
22
42
  dataTestid?: string;
23
43
  rowSize?: 'sm' | 'md' | 'lg';
@@ -4,9 +4,9 @@ export declare const TabItem: FC<TabItemProps>;
4
4
  export declare const InternalTabItem: import('react').ForwardRefExoticComponent<TabItemProps & {
5
5
  onTabKeyDown?: (event: import('./types.js').TabKeyboardEvent) => void;
6
6
  index: number;
7
- appearance?: "default" | "dark";
7
+ appearance?: "dark" | "default";
8
8
  size?: "md" | "sm";
9
9
  stretch?: boolean;
10
10
  labelAlignment?: "center" | "end" | "start";
11
11
  className?: string;
12
- } & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
12
+ } & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -12,7 +12,7 @@ export declare const TextInput: import('react').ForwardRefExoticComponent<import
12
12
  iconEnd?: import('react').ReactNode;
13
13
  iconEndClassName?: string;
14
14
  onIconEndClick?: () => void;
15
- inputActionButton?: import('../input-text/type.js').InputActionButtonProps;
15
+ inputActionButton?: import('../index.js').InputActionButtonProps;
16
16
  iconEndRef?: any;
17
17
  inputActionPosition?: "beforeSuffix" | "afterSuffix";
18
18
  type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import { jsxs as g, Fragment as j, jsx as e } from "react/jsx-runtime";
3
3
  import { forwardRef as z, useRef as A, useState as h, useImperativeHandle as H, useEffect as O } from "react";
4
- import { cn as v } from "../cn.js";
5
- import { HintText as F } from "../hint-text/hint-text.js";
6
- import { translate as L } from "../i18n/utility.js";
7
- import { Icon as S } from "../icon/icon.js";
8
- import { IconButton as Y } from "../icon-button/icon-button.js";
9
- const $ = z(
4
+ import { cn as p } from "../cn.js";
5
+ import { HintText as C } from "../hint-text/hint-text.js";
6
+ import { translate as F } from "../i18n/utility.js";
7
+ import { Icon as L } from "../icon/icon.js";
8
+ import { IconButton as S } from "../icon-button/icon-button.js";
9
+ const Y = z(
10
10
  ({
11
11
  value: r,
12
- rows: p = 4,
12
+ rows: v = 4,
13
13
  cols: x = 100,
14
14
  autoComplete: b = "on",
15
15
  maxChars: t,
@@ -21,72 +21,71 @@ const $ = z(
21
21
  name: s,
22
22
  ...c
23
23
  }, V) => {
24
- const n = A(null), [u, I] = h(
24
+ const i = A(null), [u, I] = h(
25
25
  t
26
26
  );
27
- H(V, () => n.current);
28
- const [T, f] = h(""), i = r !== void 0, m = i ? String(r) : T;
27
+ H(V, () => i.current);
28
+ const [T, f] = h(""), n = r !== void 0, m = n ? String(r) : T;
29
29
  O(() => {
30
30
  t !== void 0 && I(t - m.length);
31
31
  }, [m, t]);
32
32
  const k = (o) => {
33
33
  const y = o.target.value;
34
- i || f(y), a && a(o);
34
+ n || f(y), a && a(o);
35
35
  }, w = () => {
36
- n.current && (i || f(""), a && a({
36
+ i.current && (n || f(""), a && a({
37
37
  target: { name: s, value: "" },
38
38
  currentTarget: { name: s, value: "" },
39
39
  type: "change",
40
40
  bubbles: !0
41
- }), n.current.focus());
41
+ }), i.current.focus());
42
42
  };
43
43
  return /* @__PURE__ */ g(j, { children: [
44
44
  /* @__PURE__ */ e("div", { className: "gi-textarea-container", children: /* @__PURE__ */ g(
45
45
  "div",
46
46
  {
47
- className: v("gi-textarea-inner", {
47
+ className: p("gi-textarea-inner", {
48
48
  "gi-input-half-width": N
49
49
  }),
50
50
  children: [
51
- l && /* @__PURE__ */ e("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ e(S, { icon: l, size: "md", disabled: c.disabled }) }),
51
+ l && /* @__PURE__ */ e("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ e(L, { icon: l, size: "md", disabled: c.disabled }) }),
52
52
  /* @__PURE__ */ e(
53
53
  "textarea",
54
54
  {
55
55
  name: s,
56
- rows: p,
56
+ rows: v,
57
57
  cols: x,
58
58
  autoComplete: b,
59
- className: v(R, "gi-textarea"),
60
- ref: n,
59
+ className: p(R, "gi-textarea"),
60
+ ref: i,
61
61
  "data-icon-start": !!l,
62
62
  "data-clear-enabled": d,
63
63
  maxLength: t,
64
- ...i ? { value: String(r) } : {},
64
+ ...n ? { value: String(r) } : {},
65
65
  onChange: k,
66
66
  ...c
67
67
  }
68
68
  ),
69
69
  d ? /* @__PURE__ */ e("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ e(
70
- Y,
70
+ S,
71
71
  {
72
72
  type: "button",
73
73
  disabled: c.disabled,
74
- icon: {
75
- icon: "close"
76
- },
74
+ icon: { icon: "close" },
77
75
  onClick: w,
78
76
  variant: "flat",
79
77
  size: "small",
80
- appearance: "dark"
78
+ appearance: "dark",
79
+ "aria-label": "Clear input"
81
80
  }
82
81
  ) }) : null
83
82
  ]
84
83
  }
85
84
  ) }),
86
85
  t && /* @__PURE__ */ e("div", { className: "gi-textarea-remaining-chars", children: /* @__PURE__ */ e(
87
- F,
86
+ C,
88
87
  {
89
- text: L("textarea.remainingChars", {
88
+ text: F("textarea.remainingChars", {
90
89
  remainingChars: u,
91
90
  defaultValue: `You have ${u} characters remaining`
92
91
  })
@@ -95,7 +94,7 @@ const $ = z(
95
94
  ] });
96
95
  }
97
96
  );
98
- $.displayName = "TextArea";
97
+ Y.displayName = "TextArea";
99
98
  export {
100
- $ as TextArea
99
+ Y as TextArea
101
100
  };
@@ -25,7 +25,45 @@ declare const toastVariants: import('tailwind-variants').TVReturnType<{
25
25
  heading: string;
26
26
  dismiss: string;
27
27
  innerContainer: string;
28
- }, undefined, TVConfig<V, EV>, {
28
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
29
+ variant: {
30
+ info: {
31
+ base: string;
32
+ baseDismissible: string;
33
+ };
34
+ danger: {
35
+ base: string;
36
+ baseDismissible: string;
37
+ };
38
+ success: {
39
+ base: string;
40
+ baseDismissible: string;
41
+ };
42
+ warning: {
43
+ base: string;
44
+ baseDismissible: string;
45
+ };
46
+ };
47
+ }, {
48
+ variant: {
49
+ info: {
50
+ base: string;
51
+ baseDismissible: string;
52
+ };
53
+ danger: {
54
+ base: string;
55
+ baseDismissible: string;
56
+ };
57
+ success: {
58
+ base: string;
59
+ baseDismissible: string;
60
+ };
61
+ warning: {
62
+ base: string;
63
+ baseDismissible: string;
64
+ };
65
+ };
66
+ }>, {
29
67
  variant: {
30
68
  info: {
31
69
  base: string;
@@ -77,6 +115,44 @@ declare const toastVariants: import('tailwind-variants').TVReturnType<{
77
115
  heading: string;
78
116
  dismiss: string;
79
117
  innerContainer: string;
80
- }, undefined, TVConfig<V, EV>, unknown, unknown, undefined>>;
118
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
119
+ variant: {
120
+ info: {
121
+ base: string;
122
+ baseDismissible: string;
123
+ };
124
+ danger: {
125
+ base: string;
126
+ baseDismissible: string;
127
+ };
128
+ success: {
129
+ base: string;
130
+ baseDismissible: string;
131
+ };
132
+ warning: {
133
+ base: string;
134
+ baseDismissible: string;
135
+ };
136
+ };
137
+ }, {
138
+ variant: {
139
+ info: {
140
+ base: string;
141
+ baseDismissible: string;
142
+ };
143
+ danger: {
144
+ base: string;
145
+ baseDismissible: string;
146
+ };
147
+ success: {
148
+ base: string;
149
+ baseDismissible: string;
150
+ };
151
+ warning: {
152
+ base: string;
153
+ baseDismissible: string;
154
+ };
155
+ };
156
+ }>, unknown, unknown, undefined>>;
81
157
  declare function Toast({ title, description, action, variant, showIcon, dismissible, onClose, slotAction, }: ToastProps): import("react/jsx-runtime").JSX.Element;
82
158
  export { Toast, toastVariants };
package/fonts.css ADDED
@@ -0,0 +1,10 @@
1
+ @import '@fontsource/lato/100.css';
2
+ @import '@fontsource/lato/100-italic.css';
3
+ @import '@fontsource/lato/300.css';
4
+ @import '@fontsource/lato/300-italic.css';
5
+ @import '@fontsource/lato/400.css';
6
+ @import '@fontsource/lato/400-italic.css';
7
+ @import '@fontsource/lato/700.css';
8
+ @import '@fontsource/lato/700-italic.css';
9
+ @import '@fontsource/lato/900.css';
10
+ @import '@fontsource/lato/900-italic.css';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/design-system-react",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "description": "The Government of Ireland Design System React components.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,6 +11,7 @@
11
11
  "exports": {
12
12
  ".": "./dist/index.js",
13
13
  "./styles.css": "./dist/styles.css",
14
+ "./fonts.css": "./fonts.css",
14
15
  "./logos": {
15
16
  "types": "./dist/assets/logos/index.d.ts",
16
17
  "import": "./dist/assets/logos/index.js"
@@ -27,7 +28,8 @@
27
28
  ],
28
29
  "files": [
29
30
  "dist",
30
- "styles"
31
+ "styles",
32
+ "fonts.css"
31
33
  ],
32
34
  "keywords": [],
33
35
  "author": "",
@@ -37,6 +39,7 @@
37
39
  "react-dom": "*"
38
40
  },
39
41
  "dependencies": {
42
+ "@fontsource/lato": "^5.1.1",
40
43
  "@popperjs/core": "^2.11.8",
41
44
  "@radix-ui/react-slot": "^1.1.2",
42
45
  "bowser": "^2.13.1",
@@ -54,16 +57,17 @@
54
57
  "eslint": "^9.23.0",
55
58
  "eslint-plugin-storybook": "^0.12.0",
56
59
  "glob": "^11.0.1",
60
+ "http-server": "^14.1.1",
57
61
  "i18next": "^25.6.2",
58
62
  "postcss": "^8.4.40",
59
63
  "postcss-import": "^16.1.0",
60
64
  "react": "19.0.0",
61
65
  "react-dom": "19.0.0",
62
- "@ogcio/design-system-eslint-config": "1.2.6",
63
- "@ogcio/design-system-prettier-config": "1.1.0",
64
- "@ogcio/design-system-tailwind": "1.21.2",
66
+ "@ogcio/design-system-eslint-config": "1.3.0",
67
+ "@ogcio/design-system-tailwind": "1.21.3",
65
68
  "@ogcio/theme-doete": "1.0.0",
66
- "@ogcio/theme-govie": "1.21.2"
69
+ "@ogcio/theme-govie": "1.21.3",
70
+ "@ogcio/design-system-prettier-config": "1.1.0"
67
71
  },
68
72
  "scripts": {
69
73
  "format": "prettier 'src/**/*.{ts,tsx}' --write",
@@ -73,10 +77,11 @@
73
77
  "test:watch": "vitest",
74
78
  "coverage": "vitest run --coverage",
75
79
  "build": "pnpm build:ts && pnpm build:styles",
76
- "build:styles": "tailwindcss -i ./styles.css -o ./dist/styles.css --minify",
80
+ "build:styles": "tailwindcss -i ./styles.css -o ./dist/styles.css --minify && node scripts/build-styles.js",
77
81
  "build:ts": "vite build",
78
82
  "storybook:dev": "storybook dev -p 6006",
79
83
  "storybook:build": "storybook build --stats-json",
84
+ "storybook:serve": "http-server storybook-static -p 6006 -c-1",
80
85
  "playwright:test": "playwright test",
81
86
  "playwright:update-snapshots": "playwright test --update-snapshots",
82
87
  "typecheck": "tsc -p tsconfig.json --noEmit"