@ogcio/design-system-react 1.32.0 → 1.34.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 (79) hide show
  1. package/dist/accordion/accordion-item.js +62 -57
  2. package/dist/alert/alert.js +37 -39
  3. package/dist/alert/variants.d.ts +49 -52
  4. package/dist/alert/variants.js +17 -18
  5. package/dist/atoms/Button.d.ts +2 -2
  6. package/dist/atoms/Button.js +3 -2
  7. package/dist/atoms/heading/styles.js +1 -1
  8. package/dist/atoms/storybook/Heading.meta.d.ts +1 -1
  9. package/dist/atoms/storybook/Heading.meta.js +4 -4
  10. package/dist/atoms/storybook/Icons.meta.d.ts +1 -1
  11. package/dist/atoms/storybook/Icons.meta.js +7 -7
  12. package/dist/atoms/storybook/InsetText.meta.d.ts +1 -1
  13. package/dist/atoms/storybook/InsetText.meta.js +1 -1
  14. package/dist/atoms/storybook/Logos.meta.d.ts +1 -1
  15. package/dist/atoms/storybook/Logos.meta.js +1 -1
  16. package/dist/autocomplete/autocomplete.js +1 -1
  17. package/dist/autocomplete/use-autocomplete-controller.js +2 -2
  18. package/dist/browser-support/browser-support.js +202 -30
  19. package/dist/button/button.d.ts +2 -9
  20. package/dist/button/button.js +65 -32
  21. package/dist/button/helpers.d.ts +2 -1
  22. package/dist/button/types.d.ts +25 -8
  23. package/dist/button-group/button-group.js +43 -45
  24. package/dist/button-group/types.d.ts +5 -5
  25. package/dist/card/card-legacy.js +1 -1
  26. package/dist/card/types.d.ts +1 -1
  27. package/dist/chip/chip.js +1 -1
  28. package/dist/combo-box/dropdown-item.js +1 -1
  29. package/dist/cookie-banner/cookie-banner.d.ts +1 -1
  30. package/dist/data-table/data-table-footer.js +2 -2
  31. package/dist/data-table/data-table-header.js +2 -2
  32. package/dist/data-table/data-table-selected-rows.js +1 -1
  33. package/dist/data-table/editable-table-cell.js +1 -1
  34. package/dist/details/details.js +13 -16
  35. package/dist/drawer/drawer.d.ts +1 -1
  36. package/dist/drawer/drawer.js +18 -18
  37. package/dist/error-text/error-text.js +28 -27
  38. package/dist/forms/form-field/form-field.js +24 -25
  39. package/dist/header/components/header-search.js +2 -2
  40. package/dist/header/header-legacy.js +6 -6
  41. package/dist/header/header-next/header-next.js +3 -3
  42. package/dist/header/variants.js +1 -1
  43. package/dist/hint-text/hint-text.js +26 -20
  44. package/dist/i18n/config.js +2 -2
  45. package/dist/i18n/utility.js +1 -1
  46. package/dist/{i18nInstance-AYICsHJu.js → i18nInstance-DiZ0lVPL.js} +2 -2
  47. package/dist/i18next-zBkzxGW1.js +1388 -0
  48. package/dist/icon-button/icon-button.d.ts +3 -5
  49. package/dist/{index-CB-zPpNk.js → index-C7W4ssMN.js} +1 -1
  50. package/dist/index-DqBV2TCd.js +23108 -0
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +1 -1
  53. package/dist/label/label.d.ts +78 -30
  54. package/dist/label/label.js +29 -14
  55. package/dist/{lodash-82PmXrjJ.js → lodash-DTZaBYO8.js} +289 -272
  56. package/dist/modal/modal.content.js +2 -2
  57. package/dist/modal/modal.js +38 -38
  58. package/dist/modal/types.d.ts +5 -4
  59. package/dist/pagination/pagination.js +82 -80
  60. package/dist/progress-stepper/progress-stepper.js +1 -1
  61. package/dist/score-select/type.d.ts +2 -2
  62. package/dist/select/select-native.js +1 -1
  63. package/dist/select/select-next.js +87 -87
  64. package/dist/side-nav/side-nav.js +1 -1
  65. package/dist/spinner/spinner.js +1 -1
  66. package/dist/stack/stack.js +2 -2
  67. package/dist/styles.css +1 -1
  68. package/dist/table/table.js +1 -1
  69. package/dist/tabs/tab-item.js +53 -71
  70. package/dist/tabs/variants.d.ts +269 -0
  71. package/dist/tabs/variants.js +87 -0
  72. package/dist/toast/ds-toast.js +1 -1
  73. package/dist/tooltip/tooltip.js +27 -35
  74. package/dist/tooltip/variants.d.ts +115 -0
  75. package/dist/tooltip/variants.js +59 -0
  76. package/dist/{useTranslation-DiBQuy8S.js → useTranslation-CRbS3UeG.js} +94 -85
  77. package/package.json +14 -7
  78. package/dist/i18next-Bfi2-LyH.js +0 -1370
  79. package/dist/index-Bh2cTIps.js +0 -33899
@@ -1,4 +1,4 @@
1
- import { K as n, n as t } from "../../index-Bh2cTIps.js";
1
+ import { w as n, e as t } from "../../index-DqBV2TCd.js";
2
2
  const s = {
3
3
  tags: ["autodocs"],
4
4
  title: "Foundation/Logos",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as z, jsx as y } from "react/jsx-runtime";
3
3
  import { forwardRef as J, useRef as D, useImperativeHandle as Q, useEffect as W, useCallback as P, createElement as Y, Children as Z, isValidElement as ee } from "react";
4
- import { c as te } from "../index-CB-zPpNk.js";
4
+ import { c as te } from "../index-C7W4ssMN.js";
5
5
  import { cn as oe } from "../cn.js";
6
6
  import { useDomId as ne } from "../hooks/use-dom-id.js";
7
7
  import { translate as G } from "../i18n/utility.js";
@@ -1,5 +1,5 @@
1
- import { l as F } from "../lodash-82PmXrjJ.js";
2
- import { useRef as g, useMemo as G, Children as C, useReducer as X, useEffect as A, isValidElement as h } from "react";
1
+ import { l as F } from "../lodash-DTZaBYO8.js";
2
+ import { useRef as g, useMemo as G, useReducer as X, useEffect as A, Children as C, isValidElement as h } from "react";
3
3
  import { useScrollHighlightedItem as Y } from "../hooks/use-scroll-highlighted-item.js";
4
4
  import { safeCloneElement as j } from "../utils/utilities.js";
5
5
  import { AUTOCOMPLETE_ACTIONS as k } from "./types.js";
@@ -1,18 +1,19 @@
1
1
  "use client";
2
2
  import { jsxs as M, jsx as y } from "react/jsx-runtime";
3
3
  import { c as F } from "../clsx-OuTLNxxd.js";
4
- import { useMemo as S } from "react";
5
- import { Alert as B } from "../alert/alert.js";
6
- import { BROWSER_POLICY as x, DS_HOST as k } from "../constants.js";
4
+ import { useMemo as B } from "react";
5
+ import { Alert as S } from "../alert/alert.js";
6
+ import { BROWSER_POLICY as k, DS_HOST as x } from "../constants.js";
7
7
  import { Link as A } from "../link/link.js";
8
- import { u as P } from "../useTranslation-DiBQuy8S.js";
9
- const O = {
8
+ import { u as _ } from "../useTranslation-CRbS3UeG.js";
9
+ const P = {
10
10
  AmazonBot: "amazonbot",
11
11
  "Amazon Silk": "amazon_silk",
12
12
  "Android Browser": "android",
13
13
  BaiduSpider: "baiduspider",
14
14
  Bada: "bada",
15
15
  BingCrawler: "bingcrawler",
16
+ Brave: "brave",
16
17
  BlackBerry: "blackberry",
17
18
  "ChatGPT-User": "chatgpt_user",
18
19
  Chrome: "chrome",
@@ -20,6 +21,7 @@ const O = {
20
21
  Chromium: "chromium",
21
22
  Diffbot: "diffbot",
22
23
  DuckDuckBot: "duckduckbot",
24
+ DuckDuckGo: "duckduckgo",
23
25
  Electron: "electron",
24
26
  Epiphany: "epiphany",
25
27
  FacebookExternalHit: "facebookexternalhit",
@@ -33,6 +35,7 @@ const O = {
33
35
  InternetArchiveCrawler: "internetarchivecrawler",
34
36
  "K-Meleon": "k_meleon",
35
37
  LibreWolf: "librewolf",
38
+ Linespider: "linespider",
36
39
  Maxthon: "maxthon",
37
40
  "Meta-ExternalAds": "meta_externalads",
38
41
  "Meta-ExternalAgent": "meta_externalagent",
@@ -58,6 +61,7 @@ const O = {
58
61
  Safari: "safari",
59
62
  Sailfish: "sailfish",
60
63
  "Samsung Internet for Android": "samsung_internet",
64
+ SlackBot: "slackbot",
61
65
  SeaMonkey: "seamonkey",
62
66
  Sleipnir: "sleipnir",
63
67
  "Sogou Browser": "sogou",
@@ -79,12 +83,14 @@ const O = {
79
83
  bada: "Bada",
80
84
  bingcrawler: "BingCrawler",
81
85
  blackberry: "BlackBerry",
86
+ brave: "Brave",
82
87
  chatgpt_user: "ChatGPT-User",
83
88
  chrome: "Chrome",
84
89
  claudebot: "ClaudeBot",
85
90
  chromium: "Chromium",
86
91
  diffbot: "Diffbot",
87
92
  duckduckbot: "DuckDuckBot",
93
+ duckduckgo: "DuckDuckGo",
88
94
  edge: "Microsoft Edge",
89
95
  electron: "Electron",
90
96
  epiphany: "Epiphany",
@@ -99,6 +105,7 @@ const O = {
99
105
  internetarchivecrawler: "InternetArchiveCrawler",
100
106
  k_meleon: "K-Meleon",
101
107
  librewolf: "LibreWolf",
108
+ linespider: "Linespider",
102
109
  maxthon: "Maxthon",
103
110
  meta_externalads: "Meta-ExternalAds",
104
111
  meta_externalagent: "Meta-ExternalAgent",
@@ -124,6 +131,7 @@ const O = {
124
131
  sailfish: "Sailfish",
125
132
  samsung_internet: "Samsung Internet for Android",
126
133
  seamonkey: "SeaMonkey",
134
+ slackbot: "SlackBot",
127
135
  sleipnir: "Sleipnir",
128
136
  sogou: "Sogou Browser",
129
137
  swing: "Swing",
@@ -447,7 +455,7 @@ class s {
447
455
  * @return {string}
448
456
  */
449
457
  static getBrowserAlias(e) {
450
- return O[e];
458
+ return P[e];
451
459
  }
452
460
  /**
453
461
  * Get browser name for a short version/alias
@@ -462,7 +470,7 @@ class s {
462
470
  return w[e] || "";
463
471
  }
464
472
  }
465
- const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
473
+ const o = /version\/(\d+(\.?_?\d+)+)/i, O = [
466
474
  /* GPTBot */
467
475
  {
468
476
  test: [/gptbot/i],
@@ -603,6 +611,16 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
603
611
  return t && (e.version = t), e;
604
612
  }
605
613
  },
614
+ /* Linespider */
615
+ {
616
+ test: [/linespider/i],
617
+ describe(r) {
618
+ const e = {
619
+ name: "Linespider"
620
+ }, t = s.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, r) || s.getFirstMatch(o, r);
621
+ return t && (e.version = t), e;
622
+ }
623
+ },
606
624
  /* AmazonBot */
607
625
  {
608
626
  test: [/amazonbot/i],
@@ -662,6 +680,16 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
662
680
  };
663
681
  }
664
682
  },
683
+ /* SlackBot */
684
+ {
685
+ test: [/slackbot/i, /slack-imgProxy/i],
686
+ describe(r) {
687
+ const e = {
688
+ name: "SlackBot"
689
+ }, t = s.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, r) || s.getFirstMatch(o, r);
690
+ return t && (e.version = t), e;
691
+ }
692
+ },
665
693
  /* YahooSlurp */
666
694
  {
667
695
  test: [/yahoo!?[\s/]*slurp/i],
@@ -1033,6 +1061,41 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
1033
1061
  return t && (e.version = t), e;
1034
1062
  }
1035
1063
  },
1064
+ /* DuckDuckGo Browser */
1065
+ {
1066
+ test(r) {
1067
+ return r.hasBrand("DuckDuckGo") ? !0 : r.test(/\sDdg\/[\d.]+$/i);
1068
+ },
1069
+ describe(r, e) {
1070
+ const t = {
1071
+ name: "DuckDuckGo"
1072
+ };
1073
+ if (e) {
1074
+ const a = e.getBrandVersion("DuckDuckGo");
1075
+ if (a)
1076
+ return t.version = a, t;
1077
+ }
1078
+ const i = s.getFirstMatch(/\sDdg\/([\d.]+)$/i, r);
1079
+ return i && (t.version = i), t;
1080
+ }
1081
+ },
1082
+ /* Brave Browser */
1083
+ {
1084
+ test(r) {
1085
+ return r.hasBrand("Brave");
1086
+ },
1087
+ describe(r, e) {
1088
+ const t = {
1089
+ name: "Brave"
1090
+ };
1091
+ if (e) {
1092
+ const i = e.getBrandVersion("Brave");
1093
+ if (i)
1094
+ return t.version = i, t;
1095
+ }
1096
+ return t;
1097
+ }
1098
+ },
1036
1099
  {
1037
1100
  test: [/chromium/i],
1038
1101
  describe(r) {
@@ -1279,6 +1342,16 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
1279
1342
  };
1280
1343
  }
1281
1344
  },
1345
+ /* LineSpider */
1346
+ {
1347
+ test: [/linespider/i],
1348
+ describe() {
1349
+ return {
1350
+ type: n.bot,
1351
+ vendor: "Line"
1352
+ };
1353
+ }
1354
+ },
1282
1355
  /* AmazonBot */
1283
1356
  {
1284
1357
  test: [/amazonbot/i],
@@ -1469,6 +1542,16 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
1469
1542
  };
1470
1543
  }
1471
1544
  },
1545
+ /* SlackBot */
1546
+ {
1547
+ test: [/slackbot/i, /slack-imgProxy/i],
1548
+ describe() {
1549
+ return {
1550
+ type: n.bot,
1551
+ vendor: "Slack"
1552
+ };
1553
+ }
1554
+ },
1472
1555
  /* Yahoo! Slurp */
1473
1556
  {
1474
1557
  test: [/yahoo/i],
@@ -1675,6 +1758,24 @@ const o = /version\/(\d+(\.?_?\d+)+)/i, _ = [
1675
1758
  };
1676
1759
  }
1677
1760
  },
1761
+ /* Smart TV */
1762
+ {
1763
+ test: [/smart-?tv|smarttv/i],
1764
+ describe() {
1765
+ return {
1766
+ type: n.tv
1767
+ };
1768
+ }
1769
+ },
1770
+ /* NetCast (LG Smart TV) */
1771
+ {
1772
+ test: [/netcast/i],
1773
+ describe() {
1774
+ return {
1775
+ type: n.tv
1776
+ };
1777
+ }
1778
+ },
1678
1779
  /* desktop */
1679
1780
  {
1680
1781
  test(r) {
@@ -1809,18 +1910,73 @@ class f {
1809
1910
  * Create instance of Parser
1810
1911
  *
1811
1912
  * @param {String} UA User-Agent string
1812
- * @param {Boolean} [skipParsing=false] parser can skip parsing in purpose of performance
1813
- * improvements if you need to make a more particular parsing
1814
- * like {@link Parser#parseBrowser} or {@link Parser#parsePlatform}
1913
+ * @param {Boolean|ClientHints} [skipParsingOrHints=false] Either a boolean to skip parsing,
1914
+ * or a ClientHints object containing User-Agent Client Hints data
1915
+ * @param {ClientHints} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
1815
1916
  *
1816
1917
  * @throw {Error} in case of empty UA String
1817
1918
  *
1818
1919
  * @constructor
1819
1920
  */
1820
- constructor(e, t = !1) {
1921
+ constructor(e, t = !1, i = null) {
1821
1922
  if (e == null || e === "")
1822
1923
  throw new Error("UserAgent parameter can't be empty");
1823
- this._ua = e, this.parsedResult = {}, t !== !0 && this.parse();
1924
+ this._ua = e;
1925
+ let a = !1;
1926
+ typeof t == "boolean" ? (a = t, this._hints = i) : t != null && typeof t == "object" ? this._hints = t : this._hints = null, this.parsedResult = {}, a !== !0 && this.parse();
1927
+ }
1928
+ /**
1929
+ * Get Client Hints data
1930
+ * @return {ClientHints|null}
1931
+ *
1932
+ * @public
1933
+ * @example
1934
+ * const parser = Bowser.getParser(UA, clientHints);
1935
+ * const hints = parser.getHints();
1936
+ * console.log(hints.platform); // 'Windows'
1937
+ * console.log(hints.mobile); // false
1938
+ */
1939
+ getHints() {
1940
+ return this._hints;
1941
+ }
1942
+ /**
1943
+ * Check if a brand exists in Client Hints brands array
1944
+ * @param {string} brandName The brand name to check for
1945
+ * @return {boolean}
1946
+ *
1947
+ * @public
1948
+ * @example
1949
+ * const parser = Bowser.getParser(UA, clientHints);
1950
+ * if (parser.hasBrand('Google Chrome')) {
1951
+ * console.log('Chrome detected!');
1952
+ * }
1953
+ */
1954
+ hasBrand(e) {
1955
+ if (!this._hints || !Array.isArray(this._hints.brands))
1956
+ return !1;
1957
+ const t = e.toLowerCase();
1958
+ return this._hints.brands.some(
1959
+ (i) => i.brand && i.brand.toLowerCase() === t
1960
+ );
1961
+ }
1962
+ /**
1963
+ * Get brand version from Client Hints
1964
+ * @param {string} brandName The brand name to get version for
1965
+ * @return {string|undefined}
1966
+ *
1967
+ * @public
1968
+ * @example
1969
+ * const parser = Bowser.getParser(UA, clientHints);
1970
+ * const version = parser.getBrandVersion('Google Chrome');
1971
+ * console.log(version); // '131'
1972
+ */
1973
+ getBrandVersion(e) {
1974
+ if (!this._hints || !Array.isArray(this._hints.brands))
1975
+ return;
1976
+ const t = e.toLowerCase(), i = this._hints.brands.find(
1977
+ (a) => a.brand && a.brand.toLowerCase() === t
1978
+ );
1979
+ return i ? i.version : void 0;
1824
1980
  }
1825
1981
  /**
1826
1982
  * Get UserAgent string of current Parser instance
@@ -1845,14 +2001,14 @@ class f {
1845
2001
  */
1846
2002
  parseBrowser() {
1847
2003
  this.parsedResult.browser = {};
1848
- const e = s.find(_, (t) => {
2004
+ const e = s.find(O, (t) => {
1849
2005
  if (typeof t.test == "function")
1850
2006
  return t.test(this);
1851
2007
  if (Array.isArray(t.test))
1852
2008
  return t.test.some((i) => this.test(i));
1853
2009
  throw new Error("Browser's test function is not valid");
1854
2010
  });
1855
- return e && (this.parsedResult.browser = e.describe(this.getUA())), this.parsedResult.browser;
2011
+ return e && (this.parsedResult.browser = e.describe(this.getUA(), this)), this.parsedResult.browser;
1856
2012
  }
1857
2013
  /**
1858
2014
  * Get parsed browser object
@@ -2116,40 +2272,56 @@ class f {
2116
2272
  }
2117
2273
  /*!
2118
2274
  * Bowser - a browser detector
2119
- * https://github.com/lancedikson/bowser
2275
+ * https://github.com/bowser-js/bowser
2120
2276
  * MIT License | (c) Dustin Diaz 2012-2015
2121
2277
  * MIT License | (c) Denis Demchenko 2015-2019
2122
2278
  */
2123
- class R {
2279
+ class L {
2124
2280
  /**
2125
2281
  * Creates a {@link Parser} instance
2126
2282
  *
2127
2283
  * @param {String} UA UserAgent string
2128
- * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it
2129
- * explicitly. Same as `skipParsing` for {@link Parser}.
2284
+ * @param {Boolean|Object} [skipParsingOrHints=false] Either a boolean to skip parsing,
2285
+ * or a ClientHints object (navigator.userAgentData)
2286
+ * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
2130
2287
  * @returns {Parser}
2131
2288
  * @throws {Error} when UA is not a String
2132
2289
  *
2133
2290
  * @example
2134
2291
  * const parser = Bowser.getParser(window.navigator.userAgent);
2135
2292
  * const result = parser.getResult();
2293
+ *
2294
+ * @example
2295
+ * // With User-Agent Client Hints
2296
+ * const parser = Bowser.getParser(
2297
+ * window.navigator.userAgent,
2298
+ * window.navigator.userAgentData
2299
+ * );
2136
2300
  */
2137
- static getParser(e, t = !1) {
2301
+ static getParser(e, t = !1, i = null) {
2138
2302
  if (typeof e != "string")
2139
2303
  throw new Error("UserAgent should be a string");
2140
- return new f(e, t);
2304
+ return new f(e, t, i);
2141
2305
  }
2142
2306
  /**
2143
2307
  * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately
2144
2308
  *
2145
- * @param UA
2309
+ * @param {String} UA UserAgent string
2310
+ * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
2146
2311
  * @return {ParsedResult}
2147
2312
  *
2148
2313
  * @example
2149
2314
  * const result = Bowser.parse(window.navigator.userAgent);
2315
+ *
2316
+ * @example
2317
+ * // With User-Agent Client Hints
2318
+ * const result = Bowser.parse(
2319
+ * window.navigator.userAgent,
2320
+ * window.navigator.userAgentData
2321
+ * );
2150
2322
  */
2151
- static parse(e) {
2152
- return new f(e).getResult();
2323
+ static parse(e, t = null) {
2324
+ return new f(e, t).getResult();
2153
2325
  }
2154
2326
  static get BROWSER_MAP() {
2155
2327
  return w;
@@ -2164,16 +2336,16 @@ class R {
2164
2336
  return n;
2165
2337
  }
2166
2338
  }
2167
- const G = ({
2339
+ const I = ({
2168
2340
  className: r,
2169
2341
  ...e
2170
2342
  }) => {
2171
- const { t } = P();
2172
- return S(
2173
- () => R.getParser(navigator.userAgent).satisfies(x),
2343
+ const { t } = _();
2344
+ return B(
2345
+ () => L.getParser(navigator.userAgent).satisfies(k),
2174
2346
  []
2175
2347
  ) ? null : /* @__PURE__ */ M(
2176
- B,
2348
+ S,
2177
2349
  {
2178
2350
  ...e,
2179
2351
  variant: "warning",
@@ -2187,7 +2359,7 @@ const G = ({
2187
2359
  /* @__PURE__ */ y(
2188
2360
  A,
2189
2361
  {
2190
- href: `${k}/get-started/developers/supported-browsers/`,
2362
+ href: `${x}/get-started/developers/supported-browsers/`,
2191
2363
  target: "_blank",
2192
2364
  rel: "noreferrer",
2193
2365
  children: t("View supported browsers")
@@ -2198,5 +2370,5 @@ const G = ({
2198
2370
  );
2199
2371
  };
2200
2372
  export {
2201
- G as BrowserSupport
2373
+ I as BrowserSupport
2202
2374
  };
@@ -1,9 +1,2 @@
1
- export declare const Button: import('react').ForwardRefExoticComponent<import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
2
- variant?: import('./types.js').ButtonVariant;
3
- appearance?: import('./types.js').ButtonAppearance;
4
- size?: import('./types.js').ButtonSize;
5
- form?: string;
6
- value?: string;
7
- className?: string;
8
- dataTestid?: string;
9
- } & import('react').RefAttributes<HTMLButtonElement>>;
1
+ import { ButtonProps } from './types';
2
+ export declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,43 +1,76 @@
1
- "use client";
2
- import { jsx as l } from "react/jsx-runtime";
3
- import { forwardRef as p } from "react";
4
- import { cn as u } from "../cn.js";
5
- import { getSizeClass as c, isButtonDisabled as b, getVariantAppearanceClass as B } from "./helpers.js";
6
- const r = p(
1
+ import { jsx as $ } from "react/jsx-runtime";
2
+ import { forwardRef as g } from "react";
3
+ import q from "../atoms/Button.js";
4
+ const a = g(
7
5
  ({
8
- variant: e,
9
- appearance: o,
10
- size: a,
11
- disabled: t,
12
- className: n,
13
- children: s,
14
- dataTestid: i,
15
- ...m
16
- }, f) => /* @__PURE__ */ l(
17
- "button",
6
+ id: e,
7
+ variant: r,
8
+ appearance: t,
9
+ size: o,
10
+ children: i,
11
+ disabled: d,
12
+ className: p,
13
+ onClick: s,
14
+ onFocus: l,
15
+ onBlur: n,
16
+ onKeyDown: b,
17
+ onKeyUp: m,
18
+ role: u,
19
+ type: f,
20
+ form: c,
21
+ value: y,
22
+ tabIndex: B,
23
+ dataTestid: x,
24
+ "aria-label": h,
25
+ "aria-labelledby": j,
26
+ "aria-describedby": w,
27
+ "aria-checked": T,
28
+ "aria-pressed": k,
29
+ "aria-expanded": v,
30
+ "aria-controls": I,
31
+ "aria-haspopup": N,
32
+ "aria-busy": O,
33
+ "data-testid": P
34
+ }, R) => /* @__PURE__ */ $(
35
+ q,
18
36
  {
19
- "data-testid": i,
20
- ...m,
21
- ref: f,
22
- "aria-disabled": t,
23
- disabled: t,
24
- className: u(
25
- "gi-btn",
26
- B({ disabled: t, variant: e, appearance: o }),
27
- b({ disabled: t, variant: e, appearance: o }),
28
- c(a),
29
- n
30
- ),
31
- children: s
37
+ ref: R,
38
+ id: e,
39
+ variant: r,
40
+ appearance: t,
41
+ size: o,
42
+ children: i,
43
+ disabled: d,
44
+ className: p,
45
+ onClick: s,
46
+ onFocus: l,
47
+ onBlur: n,
48
+ onKeyDown: b,
49
+ onKeyUp: m,
50
+ ariaLabel: h,
51
+ ariaLabelledBy: j,
52
+ ariaDescribedBy: w,
53
+ ariaChecked: T,
54
+ ariaPressed: k,
55
+ ariaExpanded: v,
56
+ ariaControls: I,
57
+ ariaHasPopup: N,
58
+ ariaBusy: O,
59
+ role: u,
60
+ type: f,
61
+ form: c,
62
+ value: y,
63
+ tabIndex: B,
64
+ dataTestId: P ?? x
32
65
  }
33
66
  )
34
67
  );
35
- r.displayName = "Button";
36
- Object.defineProperty(r, "componentType", {
68
+ a.displayName = "Button";
69
+ Object.defineProperty(a, "componentType", {
37
70
  value: "Button",
38
71
  writable: !1,
39
72
  enumerable: !1
40
73
  });
41
74
  export {
42
- r as Button
75
+ a as Button
43
76
  };
@@ -1,3 +1,4 @@
1
+ import { IconButtonProps } from '../icon-button/icon-button.js';
1
2
  import { ButtonAppearance, ButtonVariant, ButtonSize } from './types.js';
2
3
  export declare const getVariantAppearanceClass: ({ disabled, variant, appearance, }: {
3
4
  disabled?: boolean;
@@ -5,7 +6,7 @@ export declare const getVariantAppearanceClass: ({ disabled, variant, appearance
5
6
  appearance?: ButtonAppearance;
6
7
  }) => string | undefined;
7
8
  export declare const getSizeClass: (size?: ButtonSize) => "gi-btn-small" | "gi-btn-large" | "gi-btn-regular";
8
- export declare const getButtonIconSizeClass: (size?: ButtonSize) => "gi-icon-btn-small" | "gi-icon-btn-large" | "gi-icon-btn-extra-large" | "gi-icon-btn-regular";
9
+ export declare const getButtonIconSizeClass: (size?: IconButtonProps["size"]) => "gi-icon-btn-small" | "gi-icon-btn-large" | "gi-icon-btn-extra-large" | "gi-icon-btn-regular";
9
10
  export declare const isButtonDisabled: ({ disabled, variant, appearance, }: {
10
11
  disabled?: boolean;
11
12
  variant?: ButtonVariant;
@@ -1,13 +1,30 @@
1
+ import { Props as GiButtonProps } from '../atoms/Button.js';
2
+ import * as React from 'react';
1
3
  export declare const ButtonVariants: readonly ["primary", "secondary", "flat"];
2
4
  export type ButtonVariant = (typeof ButtonVariants)[number];
3
5
  export type ButtonAppearance = 'default' | 'dark' | 'light';
4
- export type ButtonSize = 'medium' | 'small' | 'large' | 'extraLarge';
5
- export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
- variant?: ButtonVariant;
7
- appearance?: ButtonAppearance;
8
- size?: ButtonSize;
9
- form?: string;
10
- value?: string;
11
- className?: string;
6
+ export type ButtonSize = 'medium' | 'small' | 'large';
7
+ export type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-checked' | 'aria-pressed' | 'aria-expanded' | 'aria-controls' | 'aria-haspopup' | 'aria-busy'> & GiButtonProps & {
8
+ /** @deprecated Use dataTestId instead */
12
9
  dataTestid?: string;
10
+ /** @deprecated Use dataTestId instead */
11
+ 'data-testid'?: string;
12
+ /** @deprecated Use ariaLabel instead */
13
+ 'aria-label'?: string;
14
+ /** @deprecated Use ariaLabelledBy instead */
15
+ 'aria-labelledby'?: string;
16
+ /** @deprecated Use ariaDescribedBy instead */
17
+ 'aria-describedby'?: string;
18
+ /** @deprecated Use ariaChecked instead */
19
+ 'aria-checked'?: boolean | 'true' | 'false' | 'mixed';
20
+ /** @deprecated Use ariaPressed instead */
21
+ 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed';
22
+ /** @deprecated Use ariaExpanded instead */
23
+ 'aria-expanded'?: boolean | 'true' | 'false';
24
+ /** @deprecated Use ariaControls instead */
25
+ 'aria-controls'?: string;
26
+ /** @deprecated Use ariaHasPopup instead */
27
+ 'aria-haspopup'?: boolean | 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
28
+ /** @deprecated Use ariaBusy instead */
29
+ 'aria-busy'?: boolean | 'true' | 'false';
13
30
  };