@ogcio/design-system-react 1.23.0 → 1.25.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.
@@ -0,0 +1 @@
1
+ export * from './browser-support.js';
@@ -0,0 +1,4 @@
1
+ import { BrowserSupport as p } from "./browser-support.js";
2
+ export {
3
+ p as BrowserSupport
4
+ };
@@ -0,0 +1,16 @@
1
+ function a(r) {
2
+ var f, n, t = "";
3
+ if (typeof r == "string" || typeof r == "number") t += r;
4
+ else if (typeof r == "object") if (Array.isArray(r)) {
5
+ var o = r.length;
6
+ for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
7
+ } else for (n in r) r[n] && (t && (t += " "), t += n);
8
+ return t;
9
+ }
10
+ function i() {
11
+ for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
12
+ return t;
13
+ }
14
+ export {
15
+ i as c
16
+ };
package/dist/cn.js CHANGED
@@ -1,19 +1,7 @@
1
- function i(r) {
2
- var f, n, t = "";
3
- if (typeof r == "string" || typeof r == "number") t += r;
4
- else if (typeof r == "object") if (Array.isArray(r)) {
5
- var o = r.length;
6
- for (f = 0; f < o; f++) r[f] && (n = i(r[f])) && (t && (t += " "), t += n);
7
- } else for (n in r) r[n] && (t && (t += " "), t += n);
8
- return t;
9
- }
10
- function u() {
11
- for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = i(r)) && (t && (t += " "), t += f);
12
- return t;
13
- }
14
- function a(...r) {
15
- return u(r);
1
+ import { c } from "./clsx-OuTLNxxd.js";
2
+ function o(...r) {
3
+ return c(r);
16
4
  }
17
5
  export {
18
- a as cn
6
+ o as cn
19
7
  };
@@ -0,0 +1,43 @@
1
+ export declare const DS_HOST = "https://ds.services.gov.ie";
2
+ export declare const BROWSER_POLICY: {
3
+ readonly desktop: {
4
+ readonly chrome: ">=109";
5
+ readonly firefox: ">=128";
6
+ readonly safari: ">=18";
7
+ readonly edge: ">=136";
8
+ readonly chromium: ">=109";
9
+ readonly opera: ">=109";
10
+ readonly vivaldi: ">=109";
11
+ readonly yandex: ">=109";
12
+ readonly uc: ">=109";
13
+ readonly qq: ">=109";
14
+ };
15
+ readonly mobile: {
16
+ readonly chrome: ">=138";
17
+ readonly firefox: ">=140";
18
+ readonly safari: ">=18";
19
+ readonly 'mobile safari': ">=18";
20
+ readonly samsung_internet: ">=27";
21
+ readonly edge: ">=138";
22
+ readonly chromium: ">=138";
23
+ readonly opera: ">=138";
24
+ readonly vivaldi: ">=138";
25
+ readonly yandex: ">=138";
26
+ readonly uc: ">=138";
27
+ readonly qq: ">=138";
28
+ };
29
+ readonly tablet: {
30
+ readonly chrome: ">=138";
31
+ readonly firefox: ">=140";
32
+ readonly safari: ">=18";
33
+ readonly 'mobile safari': ">=18";
34
+ readonly samsung_internet: ">=27";
35
+ readonly edge: ">=138";
36
+ readonly chromium: ">=138";
37
+ readonly opera: ">=138";
38
+ readonly vivaldi: ">=138";
39
+ readonly yandex: ">=138";
40
+ readonly uc: ">=138";
41
+ readonly qq: ">=138";
42
+ };
43
+ };
@@ -0,0 +1,46 @@
1
+ const e = "https://ds.services.gov.ie", i = {
2
+ desktop: {
3
+ chrome: ">=109",
4
+ firefox: ">=128",
5
+ safari: ">=18",
6
+ edge: ">=136",
7
+ chromium: ">=109",
8
+ opera: ">=109",
9
+ vivaldi: ">=109",
10
+ yandex: ">=109",
11
+ uc: ">=109",
12
+ qq: ">=109"
13
+ },
14
+ mobile: {
15
+ chrome: ">=138",
16
+ firefox: ">=140",
17
+ safari: ">=18",
18
+ "mobile safari": ">=18",
19
+ samsung_internet: ">=27",
20
+ edge: ">=138",
21
+ chromium: ">=138",
22
+ opera: ">=138",
23
+ vivaldi: ">=138",
24
+ yandex: ">=138",
25
+ uc: ">=138",
26
+ qq: ">=138"
27
+ },
28
+ tablet: {
29
+ chrome: ">=138",
30
+ firefox: ">=140",
31
+ safari: ">=18",
32
+ "mobile safari": ">=18",
33
+ samsung_internet: ">=27",
34
+ edge: ">=138",
35
+ chromium: ">=138",
36
+ opera: ">=138",
37
+ vivaldi: ">=138",
38
+ yandex: ">=138",
39
+ uc: ">=138",
40
+ qq: ">=138"
41
+ }
42
+ };
43
+ export {
44
+ i as BROWSER_POLICY,
45
+ e as DS_HOST
46
+ };
@@ -1,7 +1,8 @@
1
+ import { ComponentPropsWithoutRef, MouseEventHandler } from 'react';
1
2
  import { iconIds } from './icons.js';
2
3
  export type IconId = (typeof iconIds)[number];
3
4
  export type IconSize = 'sm' | 'md' | 'lg' | 'xl';
4
- export type IconProps = React.HTMLAttributes<HTMLSpanElement> & {
5
+ export type IconProps = {
5
6
  icon: IconId;
6
7
  size?: IconSize;
7
8
  filled?: boolean;
@@ -10,6 +11,17 @@ export type IconProps = React.HTMLAttributes<HTMLSpanElement> & {
10
11
  ariaLabel?: string;
11
12
  inline?: boolean;
12
13
  className?: string;
13
- onClick?: React.MouseEventHandler<HTMLSpanElement>;
14
- };
15
- export declare function Icon({ icon, size, filled, disabled, ariaHidden, ariaLabel, inline, className, onClick, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
14
+ onClick?: MouseEventHandler<HTMLSpanElement>;
15
+ } & Omit<ComponentPropsWithoutRef<'span'>, 'children'>;
16
+ export declare const Icon: import('react').ForwardRefExoticComponent<{
17
+ icon: IconId;
18
+ size?: IconSize;
19
+ filled?: boolean;
20
+ disabled?: boolean;
21
+ ariaHidden?: boolean;
22
+ ariaLabel?: string;
23
+ inline?: boolean;
24
+ className?: string;
25
+ onClick?: MouseEventHandler<HTMLSpanElement>;
26
+ } & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & import('react').RefAttributes<HTMLSpanElement>>;
27
+ export default Icon;
package/dist/icon/icon.js CHANGED
@@ -1,173 +1,86 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { cn as i } from "../cn.js";
4
- import b from "./svgs/bluesky.js";
5
- import u from "./svgs/facebook.js";
6
- import y from "./svgs/instagram.js";
7
- import z from "./svgs/linkedin.js";
8
- import N from "./svgs/placeholder.js";
9
- import h from "./svgs/threads.js";
10
- import x from "./svgs/tiktok.js";
11
- import _ from "./svgs/x.js";
12
- import n from "./svgs/youtube.js";
13
- function j({
14
- icon: t,
15
- size: g = "md",
16
- filled: c,
17
- disabled: s,
18
- ariaHidden: l,
19
- ariaLabel: a,
20
- inline: r = !1,
21
- className: k = "",
22
- onClick: m,
23
- ...f
24
- }) {
25
- let o = "24px";
26
- switch (g) {
27
- case "sm": {
28
- o = "16px";
29
- break;
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { forwardRef as u } from "react";
4
+ import { cn as m } from "../cn.js";
5
+ import _ from "./svgs/bluesky.js";
6
+ import x from "./svgs/facebook.js";
7
+ import h from "./svgs/instagram.js";
8
+ import I from "./svgs/linkedin.js";
9
+ import S from "./svgs/placeholder.js";
10
+ import R from "./svgs/threads.js";
11
+ import z from "./svgs/tiktok.js";
12
+ import T from "./svgs/x.js";
13
+ import v from "./svgs/youtube.js";
14
+ const d = {
15
+ sm: "16px",
16
+ md: "24px",
17
+ lg: "32px",
18
+ xl: "48px"
19
+ }, w = {
20
+ social_bluesky: { Component: _, disabledClass: "gi-stroke-gray-700" },
21
+ social_facebook: { Component: x, disabledClass: "gi-stroke-gray-700" },
22
+ social_instagram: {
23
+ Component: h,
24
+ disabledClass: "gi-stroke-gray-700"
25
+ },
26
+ social_linkedin: { Component: I, disabledClass: "gi-stroke-gray-700" },
27
+ social_threads: { Component: R, disabledClass: "gi-stroke-gray-700" },
28
+ social_tiktok: { Component: z, disabledClass: "gi-stroke-gray-700" },
29
+ social_x: { Component: T, disabledClass: "gi-stroke-gray-700" },
30
+ social_youtube: { Component: v, disabledClass: "gi-stroke-gray-700" },
31
+ placeholder: { Component: S, disabledClass: "gi-fill-gray-700" }
32
+ }, M = u(
33
+ ({
34
+ icon: i,
35
+ size: g = "md",
36
+ filled: c,
37
+ disabled: e,
38
+ ariaHidden: k,
39
+ ariaLabel: a,
40
+ inline: o,
41
+ className: r,
42
+ onClick: C,
43
+ ...s
44
+ }, p) => {
45
+ const t = d[g] ?? d.md, l = w[String(i)];
46
+ if (l) {
47
+ const { Component: f, disabledClass: b } = l, y = m(
48
+ { "gi-block": !o, "gi-inline-block": o },
49
+ e && b,
50
+ r
51
+ );
52
+ return /* @__PURE__ */ n(f, { size: t, className: y });
30
53
  }
31
- case "lg": {
32
- o = "32px";
33
- break;
34
- }
35
- case "xl": {
36
- o = "48px";
37
- break;
38
- }
39
- }
40
- if (t === "social_bluesky")
41
- return /* @__PURE__ */ e(
42
- b,
43
- {
44
- size: o,
45
- className: i({
46
- "gi-block": !r,
47
- "gi-inline-block": r,
48
- "gi-stroke-gray-700": s
49
- })
50
- }
51
- );
52
- if (t === "social_facebook")
53
- return /* @__PURE__ */ e(
54
- u,
55
- {
56
- size: o,
57
- className: i({
58
- "gi-block": !r,
59
- "gi-inline-block": r,
60
- "gi-stroke-gray-700": s
61
- })
62
- }
63
- );
64
- if (t === "social_instagram")
65
- return /* @__PURE__ */ e(
66
- y,
67
- {
68
- size: o,
69
- className: i({
70
- "gi-block": !r,
71
- "gi-inline-block": r,
72
- "gi-stroke-gray-700": s
73
- })
74
- }
75
- );
76
- if (t === "social_linkedin")
77
- return /* @__PURE__ */ e(
78
- z,
79
- {
80
- size: o,
81
- className: i({
82
- "gi-block": !r,
83
- "gi-inline-block": r,
84
- "gi-stroke-gray-700": s
85
- })
86
- }
87
- );
88
- if (t === "social_threads")
89
- return /* @__PURE__ */ e(
90
- h,
54
+ return /* @__PURE__ */ n(
55
+ "span",
91
56
  {
92
- size: o,
93
- className: i({
94
- "gi-block": !r,
95
- "gi-inline-block": r,
96
- "gi-stroke-gray-700": s
97
- })
57
+ "aria-hidden": k,
58
+ "aria-label": a,
59
+ "data-testid": "govie-icon",
60
+ ...s,
61
+ ref: p,
62
+ onClick: C,
63
+ role: a ? "img" : "presentation",
64
+ className: m(
65
+ {
66
+ "gi-block": !o,
67
+ "gi-inline-block": o,
68
+ "gi-text-gray-700": e
69
+ },
70
+ "material-symbols-outlined",
71
+ r
72
+ ),
73
+ style: {
74
+ fontSize: t,
75
+ fontVariationSettings: `'FILL' ${c ? 1 : 0}, 'wght' 400, 'GRAD' 0, 'opsz' ${t}`,
76
+ ...s == null ? void 0 : s.style
77
+ },
78
+ children: i
98
79
  }
99
80
  );
100
- if (t === "social_tiktok")
101
- return /* @__PURE__ */ e(
102
- x,
103
- {
104
- size: o,
105
- className: i({
106
- "gi-block": !r,
107
- "gi-inline-block": r,
108
- "gi-stroke-gray-700": s
109
- })
110
- }
111
- );
112
- if (t === "social_x")
113
- return /* @__PURE__ */ e(
114
- _,
115
- {
116
- size: o,
117
- className: i({
118
- "gi-block": !r,
119
- "gi-inline-block": r,
120
- "gi-stroke-gray-700": s
121
- })
122
- }
123
- );
124
- if (t === "social_youtube")
125
- return /* @__PURE__ */ e(
126
- n,
127
- {
128
- size: o,
129
- className: i({
130
- "gi-block": !r,
131
- "gi-inline-block": r,
132
- "gi-stroke-gray-700": s
133
- })
134
- }
135
- );
136
- if (t === "placeholder")
137
- return /* @__PURE__ */ e(
138
- N,
139
- {
140
- size: o,
141
- className: i({
142
- "gi-block": !r,
143
- "gi-inline-block": r,
144
- "gi-fill-gray-700": s
145
- })
146
- }
147
- );
148
- const p = c ? "'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' " + o : "'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' " + o;
149
- return /* @__PURE__ */ e(
150
- "span",
151
- {
152
- "data-testid": "govie-icon",
153
- ...f,
154
- onClick: m,
155
- "aria-hidden": l || void 0,
156
- "aria-label": a,
157
- role: a ? "img" : "presentation",
158
- className: i(
159
- { "gi-block": !r, "gi-text-gray-700": s },
160
- "material-symbols-outlined",
161
- k
162
- ),
163
- style: {
164
- fontSize: o,
165
- fontVariationSettings: p
166
- },
167
- children: t
168
- }
169
- );
170
- }
81
+ }
82
+ );
171
83
  export {
172
- j as Icon
84
+ M as Icon,
85
+ M as default
173
86
  };
package/dist/index.d.ts CHANGED
@@ -80,8 +80,7 @@ export { SectionBreak, type SectionBreakProps, } from './section-break/section-b
80
80
  export { Select, SelectGroupItem, SelectItem, SelectTableCell, } from './select/select.js';
81
81
  export { SelectNext, SelectGroupItemNext, SelectItemNext, } from './select/select-next.js';
82
82
  export type { SelectGroupItemProps, SelectMenuOptionProps, SelectMenuProps, SelectNextGroupProps, SelectNextOptionProps, SelectNextProps, } from './select/types.js';
83
- export { SideNav, SideNavItem } from './side-nav/side-nav.js';
84
- export type { SideNavItemProps, SideNavProps } from './side-nav/types.js';
83
+ export * from './side-nav/index.js';
85
84
  export { Spinner, type SpinnerProps } from './spinner/spinner.js';
86
85
  export { Stack } from './stack/stack.js';
87
86
  export { type StackProps } from './stack/types.js';
@@ -102,10 +101,11 @@ export { TabPanel } from './tabs/tab-panel.js';
102
101
  export { Tabs } from './tabs/tabs.js';
103
102
  export type { TabItemProps, TabsProps, TabPanelProps } from './tabs/types.js';
104
103
  export * from './data-table/index.js';
105
- export { Tag, TagTypeEnum, type TagProps, type TagType } from './tag/tag.js';
104
+ export { Tag, TagTypeEnum, type TagProps, type TagType, type TagSize, } from './tag/tag.js';
106
105
  export { TextInput, type TextInputProps } from './text-input/text-input.js';
107
106
  export { TextArea, type TextAreaProps } from './textarea/textarea.js';
108
107
  export { toaster, ToastProvider } from './toast/toast.js';
109
108
  export type { ToastHorizontalPosition, ToastPosition, ToastProps, ToastVariant, ToastVerticalPosition, } from './toast/types.js';
110
109
  export { Tooltip, type TooltipProps } from './tooltip/tooltip.js';
111
110
  export { useToggleMap } from './hooks/use-toggle-map.js';
111
+ export * from './browser-support/index.js';