@sunggang/ui-lib 0.3.65 → 0.4.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 (94) hide show
  1. package/BaseCkeditor.cjs.js +66855 -0
  2. package/BaseCkeditor.esm.js +15 -18
  3. package/BigCalender.cjs.d.ts +1 -0
  4. package/BigCalender.cjs.default.js +1 -0
  5. package/BigCalender.cjs.js +20404 -0
  6. package/BigCalender.cjs.mjs +2 -0
  7. package/BigCalender.esm.d.ts +1 -0
  8. package/BigCalender.esm.js +20393 -0
  9. package/CkEditor.cjs.d.ts +1 -0
  10. package/CkEditor.cjs.default.js +1 -0
  11. package/CkEditor.cjs.js +31 -0
  12. package/CkEditor.cjs.mjs +2 -0
  13. package/CkEditor.esm.d.ts +1 -0
  14. package/CkEditor.esm.js +23 -0
  15. package/DataTable.cjs.d.ts +1 -0
  16. package/DataTable.cjs.default.js +1 -0
  17. package/DataTable.cjs.js +968 -0
  18. package/DataTable.cjs.mjs +2 -0
  19. package/DataTable.esm.d.ts +1 -0
  20. package/DataTable.esm.js +943 -0
  21. package/DropImage.cjs.d.ts +1 -0
  22. package/DropImage.cjs.default.js +1 -0
  23. package/DropImage.cjs.js +16845 -0
  24. package/DropImage.cjs.mjs +2 -0
  25. package/DropImage.esm.d.ts +1 -0
  26. package/DropImage.esm.js +16834 -0
  27. package/Form.cjs.d.ts +1 -0
  28. package/Form.cjs.default.js +1 -0
  29. package/Form.cjs.js +402 -0
  30. package/Form.cjs.mjs +2 -0
  31. package/Form.esm.d.ts +1 -0
  32. package/Form.esm.js +390 -0
  33. package/FormProvider.cjs.d.ts +1 -0
  34. package/FormProvider.cjs.default.js +1 -0
  35. package/FormProvider.cjs.js +81 -0
  36. package/FormProvider.cjs.mjs +2 -0
  37. package/FormProvider.esm.d.ts +1 -0
  38. package/FormProvider.esm.js +71 -0
  39. package/LiffProvider.cjs.d.ts +1 -0
  40. package/LiffProvider.cjs.default.js +1 -0
  41. package/LiffProvider.cjs.js +1120 -0
  42. package/LiffProvider.cjs.mjs +2 -0
  43. package/LiffProvider.esm.d.ts +1 -0
  44. package/LiffProvider.esm.js +1114 -0
  45. package/Modal.cjs.js +168 -0
  46. package/Modal.esm.js +164 -0
  47. package/Tabs.cjs.d.ts +1 -0
  48. package/Tabs.cjs.default.js +1 -0
  49. package/Tabs.cjs.js +62 -0
  50. package/Tabs.cjs.mjs +2 -0
  51. package/Tabs.esm.d.ts +1 -0
  52. package/Tabs.esm.js +58 -0
  53. package/_commonjsHelpers.cjs.js +30 -0
  54. package/_commonjsHelpers.esm.js +25 -0
  55. package/_tslib.cjs.js +232 -0
  56. package/_tslib.esm.js +224 -0
  57. package/baseSwitch.cjs.js +25830 -0
  58. package/baseSwitch.esm.js +25785 -0
  59. package/index.cjs.css +4832 -0
  60. package/index.cjs.d.ts +1 -0
  61. package/index.cjs.default.js +1 -0
  62. package/index.cjs.js +1962 -0
  63. package/index.cjs.mjs +2 -0
  64. package/index.cjs2.js +1064 -0
  65. package/index.cjs3.js +6424 -0
  66. package/index.esm.cjs.js +3406 -0
  67. package/index.esm.css +3624 -3632
  68. package/index.esm.esm.js +3375 -0
  69. package/index.esm.js +1902 -22
  70. package/index.esm2.js +131 -81165
  71. package/index.esm3.js +2 -25
  72. package/inheritsLoose.cjs.js +9 -0
  73. package/inheritsLoose.esm.js +7 -0
  74. package/input.cjs.js +244 -0
  75. package/input.esm.js +220 -0
  76. package/memoize-one.esm.cjs.js +204 -0
  77. package/memoize-one.esm.esm.js +189 -0
  78. package/package.json +57 -5
  79. package/setPrototypeOf.cjs.js +91 -0
  80. package/setPrototypeOf.esm.js +83 -0
  81. package/src/BigCalender.d.ts +2 -0
  82. package/src/CkEditor.d.ts +1 -0
  83. package/src/DataTable.d.ts +2 -0
  84. package/src/DropImage.d.ts +2 -0
  85. package/src/Form.d.ts +3 -0
  86. package/src/FormProvider.d.ts +1 -0
  87. package/src/LiffProvider.d.ts +1 -0
  88. package/src/Tabs.d.ts +1 -0
  89. package/src/index.d.ts +8 -21
  90. package/src/lib/Form/types.d.ts +1 -0
  91. package/styled-components.esm.cjs.js +1621 -0
  92. package/styled-components.esm.esm.js +1615 -0
  93. package/utils.cjs.js +13 -0
  94. package/utils.esm.js +11 -0
package/Modal.cjs.js ADDED
@@ -0,0 +1,168 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var react = require('@iconify/react');
6
+
7
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
8
+ // require the crypto API and do not support built-in fallback to lower quality random number
9
+ // generators (like Math.random()).
10
+ var getRandomValues;
11
+ var rnds8 = new Uint8Array(16);
12
+ function rng() {
13
+ // lazy load so that environments that need to polyfill have a chance to do so
14
+ if (!getRandomValues) {
15
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
16
+ // find the complete implementation of crypto (msCrypto) on IE11.
17
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
18
+ if (!getRandomValues) {
19
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
20
+ }
21
+ }
22
+ return getRandomValues(rnds8);
23
+ }
24
+
25
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
26
+
27
+ function validate(uuid) {
28
+ return typeof uuid === "string" && REGEX.test(uuid);
29
+ }
30
+
31
+ /**
32
+ * Convert array of 16 byte values to UUID string format of the form:
33
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
34
+ */ var byteToHex = [];
35
+ for(var i = 0; i < 256; ++i){
36
+ byteToHex.push((i + 0x100).toString(16).substr(1));
37
+ }
38
+ function stringify(arr) {
39
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
40
+ // Note: Be careful editing this code! It's been tuned for performance
41
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
42
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
43
+ // of the following:
44
+ // - One or more input array values don't map to a hex octet (leading to
45
+ // "undefined" in the uuid)
46
+ // - Invalid input values for the RFC `version` or `variant` fields
47
+ if (!validate(uuid)) {
48
+ throw TypeError("Stringified UUID is invalid");
49
+ }
50
+ return uuid;
51
+ }
52
+
53
+ function v4(options, buf, offset) {
54
+ options = options || {};
55
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
56
+ rnds[6] = rnds[6] & 0x0f | 0x40;
57
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
58
+ if (buf) {
59
+ offset = offset || 0;
60
+ for(var i = 0; i < 16; ++i){
61
+ buf[offset + i] = rnds[i];
62
+ }
63
+ return buf;
64
+ }
65
+ return stringify(rnds);
66
+ }
67
+
68
+ var ModalContent = function(param) {
69
+ var title = param.title, setModal = param.setModal, children = param.children, onClick = param.onClick, _param_notice = param.notice, notice = _param_notice === void 0 ? false : _param_notice;
70
+ return /*#__PURE__*/ jsxRuntime.jsxs("form", {
71
+ children: [
72
+ title && /*#__PURE__*/ jsxRuntime.jsx("div", {
73
+ className: "text-2xl text-gray-700 font-medium border-solid border-b border-gray-300 mb-4 p-4",
74
+ children: title
75
+ }),
76
+ children && /*#__PURE__*/ jsxRuntime.jsx("div", {
77
+ className: "py-4 px-8",
78
+ children: children
79
+ }),
80
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
81
+ className: "flex items-center text-base p-4 px-8 justify-around",
82
+ children: notice ? /*#__PURE__*/ jsxRuntime.jsx("button", {
83
+ type: "button",
84
+ className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
85
+ onClick: setModal,
86
+ children: "確定"
87
+ }) : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
88
+ children: [
89
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
90
+ type: "button",
91
+ className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
92
+ onClick: setModal,
93
+ children: "取消"
94
+ }),
95
+ onClick && /*#__PURE__*/ jsxRuntime.jsx("button", {
96
+ type: "button",
97
+ className: "w-24 h-10 mx-3 text-white bg-gray-500 rounded",
98
+ onClick: onClick,
99
+ children: "送出"
100
+ })
101
+ ]
102
+ })
103
+ })
104
+ ]
105
+ });
106
+ };
107
+
108
+ var ErrorContent = function(param) {
109
+ var setModal = param.setModal, errmsg = param.errmsg;
110
+ return /*#__PURE__*/ jsxRuntime.jsx(ModalContent, {
111
+ setModal: setModal,
112
+ onClick: setModal,
113
+ notice: true,
114
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
115
+ className: "w-full max-w-xl",
116
+ children: [
117
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
118
+ className: "flex justify-center items-center mb-6",
119
+ children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
120
+ icon: "fluent-mdl2:status-error-full",
121
+ color: "red",
122
+ height: 60
123
+ })
124
+ }),
125
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
126
+ className: "text-center text-lg text-gray-500",
127
+ children: errmsg
128
+ })
129
+ ]
130
+ })
131
+ });
132
+ };
133
+
134
+ var Modal = function(param) {
135
+ var modal = param.modal, _param_unsetModal = param.unsetModal, unsetModal = _param_unsetModal === void 0 ? function() {} : _param_unsetModal;
136
+ var handleKeyUp = function(e) {
137
+ var _document_activeElement;
138
+ if (e.key === "Escape" && ![
139
+ "INPUT",
140
+ "SELECT"
141
+ ].includes((_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.tagName)) {
142
+ unsetModal();
143
+ }
144
+ };
145
+ React.useEffect(function() {
146
+ document.addEventListener("keyup", handleKeyUp);
147
+ return function() {
148
+ return document.removeEventListener("keyup", handleKeyUp);
149
+ };
150
+ }, [
151
+ unsetModal
152
+ ]);
153
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
154
+ className: "fixed top-0 left-0 h-screen z-[2000] duration-300 transition-opacity bg-[#000000b3] w-full",
155
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
156
+ className: "w-full h-full flex justify-center items-center p-6",
157
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
158
+ className: "bg-white overflow-y-auto w-full m-auto max-w-[455px] rounded-xl",
159
+ children: modal
160
+ })
161
+ })
162
+ });
163
+ };
164
+ var Modal$1 = Modal;
165
+
166
+ exports.ErrorContent = ErrorContent;
167
+ exports.Modal = Modal$1;
168
+ exports.v4 = v4;
package/Modal.esm.js ADDED
@@ -0,0 +1,164 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useEffect } from 'react';
3
+ import { Icon } from '@iconify/react';
4
+
5
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
6
+ // require the crypto API and do not support built-in fallback to lower quality random number
7
+ // generators (like Math.random()).
8
+ var getRandomValues;
9
+ var rnds8 = new Uint8Array(16);
10
+ function rng() {
11
+ // lazy load so that environments that need to polyfill have a chance to do so
12
+ if (!getRandomValues) {
13
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
14
+ // find the complete implementation of crypto (msCrypto) on IE11.
15
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
16
+ if (!getRandomValues) {
17
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
18
+ }
19
+ }
20
+ return getRandomValues(rnds8);
21
+ }
22
+
23
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
24
+
25
+ function validate(uuid) {
26
+ return typeof uuid === "string" && REGEX.test(uuid);
27
+ }
28
+
29
+ /**
30
+ * Convert array of 16 byte values to UUID string format of the form:
31
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
32
+ */ var byteToHex = [];
33
+ for(var i = 0; i < 256; ++i){
34
+ byteToHex.push((i + 0x100).toString(16).substr(1));
35
+ }
36
+ function stringify(arr) {
37
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
38
+ // Note: Be careful editing this code! It's been tuned for performance
39
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
40
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
41
+ // of the following:
42
+ // - One or more input array values don't map to a hex octet (leading to
43
+ // "undefined" in the uuid)
44
+ // - Invalid input values for the RFC `version` or `variant` fields
45
+ if (!validate(uuid)) {
46
+ throw TypeError("Stringified UUID is invalid");
47
+ }
48
+ return uuid;
49
+ }
50
+
51
+ function v4(options, buf, offset) {
52
+ options = options || {};
53
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
54
+ rnds[6] = rnds[6] & 0x0f | 0x40;
55
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
56
+ if (buf) {
57
+ offset = offset || 0;
58
+ for(var i = 0; i < 16; ++i){
59
+ buf[offset + i] = rnds[i];
60
+ }
61
+ return buf;
62
+ }
63
+ return stringify(rnds);
64
+ }
65
+
66
+ var ModalContent = function(param) {
67
+ var title = param.title, setModal = param.setModal, children = param.children, onClick = param.onClick, _param_notice = param.notice, notice = _param_notice === void 0 ? false : _param_notice;
68
+ return /*#__PURE__*/ jsxs("form", {
69
+ children: [
70
+ title && /*#__PURE__*/ jsx("div", {
71
+ className: "text-2xl text-gray-700 font-medium border-solid border-b border-gray-300 mb-4 p-4",
72
+ children: title
73
+ }),
74
+ children && /*#__PURE__*/ jsx("div", {
75
+ className: "py-4 px-8",
76
+ children: children
77
+ }),
78
+ /*#__PURE__*/ jsx("div", {
79
+ className: "flex items-center text-base p-4 px-8 justify-around",
80
+ children: notice ? /*#__PURE__*/ jsx("button", {
81
+ type: "button",
82
+ className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
83
+ onClick: setModal,
84
+ children: "確定"
85
+ }) : /*#__PURE__*/ jsxs(Fragment, {
86
+ children: [
87
+ /*#__PURE__*/ jsx("button", {
88
+ type: "button",
89
+ className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
90
+ onClick: setModal,
91
+ children: "取消"
92
+ }),
93
+ onClick && /*#__PURE__*/ jsx("button", {
94
+ type: "button",
95
+ className: "w-24 h-10 mx-3 text-white bg-gray-500 rounded",
96
+ onClick: onClick,
97
+ children: "送出"
98
+ })
99
+ ]
100
+ })
101
+ })
102
+ ]
103
+ });
104
+ };
105
+
106
+ var ErrorContent = function(param) {
107
+ var setModal = param.setModal, errmsg = param.errmsg;
108
+ return /*#__PURE__*/ jsx(ModalContent, {
109
+ setModal: setModal,
110
+ onClick: setModal,
111
+ notice: true,
112
+ children: /*#__PURE__*/ jsxs("div", {
113
+ className: "w-full max-w-xl",
114
+ children: [
115
+ /*#__PURE__*/ jsx("div", {
116
+ className: "flex justify-center items-center mb-6",
117
+ children: /*#__PURE__*/ jsx(Icon, {
118
+ icon: "fluent-mdl2:status-error-full",
119
+ color: "red",
120
+ height: 60
121
+ })
122
+ }),
123
+ /*#__PURE__*/ jsx("div", {
124
+ className: "text-center text-lg text-gray-500",
125
+ children: errmsg
126
+ })
127
+ ]
128
+ })
129
+ });
130
+ };
131
+
132
+ var Modal = function(param) {
133
+ var modal = param.modal, _param_unsetModal = param.unsetModal, unsetModal = _param_unsetModal === void 0 ? function() {} : _param_unsetModal;
134
+ var handleKeyUp = function(e) {
135
+ var _document_activeElement;
136
+ if (e.key === "Escape" && ![
137
+ "INPUT",
138
+ "SELECT"
139
+ ].includes((_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.tagName)) {
140
+ unsetModal();
141
+ }
142
+ };
143
+ useEffect(function() {
144
+ document.addEventListener("keyup", handleKeyUp);
145
+ return function() {
146
+ return document.removeEventListener("keyup", handleKeyUp);
147
+ };
148
+ }, [
149
+ unsetModal
150
+ ]);
151
+ return /*#__PURE__*/ jsx("div", {
152
+ className: "fixed top-0 left-0 h-screen z-[2000] duration-300 transition-opacity bg-[#000000b3] w-full",
153
+ children: /*#__PURE__*/ jsx("div", {
154
+ className: "w-full h-full flex justify-center items-center p-6",
155
+ children: /*#__PURE__*/ jsx("div", {
156
+ className: "bg-white overflow-y-auto w-full m-auto max-w-[455px] rounded-xl",
157
+ children: modal
158
+ })
159
+ })
160
+ });
161
+ };
162
+ var Modal$1 = Modal;
163
+
164
+ export { ErrorContent as E, Modal$1 as M, v4 as v };
package/Tabs.cjs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/Tabs";
@@ -0,0 +1 @@
1
+ exports._default = require('./Tabs.cjs.js').default;
package/Tabs.cjs.js ADDED
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ require('react');
7
+ var styledComponents_esm = require('./styled-components.esm.cjs.js');
8
+ require('./_tslib.cjs.js');
9
+
10
+ function _tagged_template_literal(strings, raw) {
11
+ if (!raw) {
12
+ raw = strings.slice(0);
13
+ }
14
+ return Object.freeze(Object.defineProperties(strings, {
15
+ raw: {
16
+ value: Object.freeze(raw)
17
+ }
18
+ }));
19
+ }
20
+ function _templateObject() {
21
+ var data = _tagged_template_literal([
22
+ "\n .uiTabs {\n list-style: none;\n display: flex;\n }\n\n .uiTabs .uiTab {\n padding: 0.25rem 1em;\n cursor: pointer;\n transform: translateY(1px);\n transition: background-color 0.2s ease-in-out;\n text-align: center;\n height: 3rem;\n }\n\n .uiTabs .uiTab.selected {\n border-radius: 6px 6px 0px 0px;\n }\n"
23
+ ]);
24
+ _templateObject = function _templateObject() {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
29
+ var StyleTabs = styledComponents_esm.dt.div(_templateObject());
30
+
31
+ var TabsPanel = function(param) {
32
+ var _param_tabsClassName = param.tabsClassName, tabsClassName = _param_tabsClassName === void 0 ? "" : _param_tabsClassName, _param_tabClassName = param.tabClassName, tabClassName = _param_tabClassName === void 0 ? "" : _param_tabClassName, activeIndex = param.activeIndex, setActiveIndex = param.setActiveIndex, config = param.config, children = param.children;
33
+ return /*#__PURE__*/ jsxRuntime.jsxs(StyleTabs, {
34
+ children: [
35
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
36
+ className: [
37
+ "uiTabs border-b border-solid border-[#ccc]",
38
+ tabsClassName
39
+ ].join(" "),
40
+ children: config.map(function(tab, index) {
41
+ return /*#__PURE__*/ jsxRuntime.jsx("button", {
42
+ type: "button",
43
+ className: [
44
+ "uiTab text-sm lg:text-lg",
45
+ index === activeIndex ? "border border-[#ccc] rounded-t-md ".concat(tabClassName) : ""
46
+ ].join(" "),
47
+ onClick: function() {
48
+ return setActiveIndex(index);
49
+ },
50
+ children: tab.title
51
+ }, tab.id);
52
+ })
53
+ }),
54
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
55
+ className: "px-4 py-2 border-l border-r border-b border-[#ccc]",
56
+ children: children
57
+ })
58
+ ]
59
+ });
60
+ };
61
+
62
+ exports.TabsPanel = TabsPanel;
package/Tabs.cjs.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from './Tabs.cjs.js';
2
+ export { _default as default } from './Tabs.cjs.default.js';
package/Tabs.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/Tabs";
package/Tabs.esm.js ADDED
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import 'react';
3
+ import { d as dt } from './styled-components.esm.esm.js';
4
+ import './_tslib.esm.js';
5
+
6
+ function _tagged_template_literal(strings, raw) {
7
+ if (!raw) {
8
+ raw = strings.slice(0);
9
+ }
10
+ return Object.freeze(Object.defineProperties(strings, {
11
+ raw: {
12
+ value: Object.freeze(raw)
13
+ }
14
+ }));
15
+ }
16
+ function _templateObject() {
17
+ var data = _tagged_template_literal([
18
+ "\n .uiTabs {\n list-style: none;\n display: flex;\n }\n\n .uiTabs .uiTab {\n padding: 0.25rem 1em;\n cursor: pointer;\n transform: translateY(1px);\n transition: background-color 0.2s ease-in-out;\n text-align: center;\n height: 3rem;\n }\n\n .uiTabs .uiTab.selected {\n border-radius: 6px 6px 0px 0px;\n }\n"
19
+ ]);
20
+ _templateObject = function _templateObject() {
21
+ return data;
22
+ };
23
+ return data;
24
+ }
25
+ var StyleTabs = dt.div(_templateObject());
26
+
27
+ var TabsPanel = function(param) {
28
+ var _param_tabsClassName = param.tabsClassName, tabsClassName = _param_tabsClassName === void 0 ? "" : _param_tabsClassName, _param_tabClassName = param.tabClassName, tabClassName = _param_tabClassName === void 0 ? "" : _param_tabClassName, activeIndex = param.activeIndex, setActiveIndex = param.setActiveIndex, config = param.config, children = param.children;
29
+ return /*#__PURE__*/ jsxs(StyleTabs, {
30
+ children: [
31
+ /*#__PURE__*/ jsx("div", {
32
+ className: [
33
+ "uiTabs border-b border-solid border-[#ccc]",
34
+ tabsClassName
35
+ ].join(" "),
36
+ children: config.map(function(tab, index) {
37
+ return /*#__PURE__*/ jsx("button", {
38
+ type: "button",
39
+ className: [
40
+ "uiTab text-sm lg:text-lg",
41
+ index === activeIndex ? "border border-[#ccc] rounded-t-md ".concat(tabClassName) : ""
42
+ ].join(" "),
43
+ onClick: function() {
44
+ return setActiveIndex(index);
45
+ },
46
+ children: tab.title
47
+ }, tab.id);
48
+ })
49
+ }),
50
+ /*#__PURE__*/ jsx("div", {
51
+ className: "px-4 py-2 border-l border-r border-b border-[#ccc]",
52
+ children: children
53
+ })
54
+ ]
55
+ });
56
+ };
57
+
58
+ export { TabsPanel };
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
4
+ function getDefaultExportFromCjs(x) {
5
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6
+ }
7
+ function getAugmentedNamespace(n) {
8
+ if (n.__esModule) return n;
9
+ var a = Object.defineProperty({}, "__esModule", {
10
+ value: true
11
+ });
12
+ Object.keys(n).forEach(function(k) {
13
+ var d = Object.getOwnPropertyDescriptor(n, k);
14
+ Object.defineProperty(a, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function get() {
17
+ return n[k];
18
+ }
19
+ });
20
+ });
21
+ return a;
22
+ }
23
+ function commonjsRequire(path) {
24
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
25
+ }
26
+
27
+ exports.commonjsGlobal = commonjsGlobal;
28
+ exports.commonjsRequire = commonjsRequire;
29
+ exports.getAugmentedNamespace = getAugmentedNamespace;
30
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
@@ -0,0 +1,25 @@
1
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2
+ function getDefaultExportFromCjs(x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
+ }
5
+ function getAugmentedNamespace(n) {
6
+ if (n.__esModule) return n;
7
+ var a = Object.defineProperty({}, "__esModule", {
8
+ value: true
9
+ });
10
+ Object.keys(n).forEach(function(k) {
11
+ var d = Object.getOwnPropertyDescriptor(n, k);
12
+ Object.defineProperty(a, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return n[k];
16
+ }
17
+ });
18
+ });
19
+ return a;
20
+ }
21
+ function commonjsRequire(path) {
22
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
23
+ }
24
+
25
+ export { commonjsRequire as a, getAugmentedNamespace as b, commonjsGlobal as c, getDefaultExportFromCjs as g };