opus-toolkit-components 1.3.3 → 1.3.5
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.
|
@@ -702,7 +702,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
702
702
|
Navbar: () => (/* reexport */ Navbar_Navbar),
|
|
703
703
|
Pill: () => (/* reexport */ Pills_Pill),
|
|
704
704
|
RadioButton: () => (/* reexport */ Radios_RadioButton),
|
|
705
|
-
Table: () => (/* reexport */ Table)
|
|
705
|
+
Table: () => (/* reexport */ Table),
|
|
706
|
+
Text: () => (/* reexport */ Text)
|
|
706
707
|
});
|
|
707
708
|
|
|
708
709
|
// EXTERNAL MODULE: external "react"
|
|
@@ -789,10 +790,73 @@ const Pill = _ref => {
|
|
|
789
790
|
}), text);
|
|
790
791
|
};
|
|
791
792
|
/* harmony default export */ const Pills_Pill = (Pill);
|
|
793
|
+
;// ./src/utils/getDataCy.js
|
|
794
|
+
const getDataCy = function () {
|
|
795
|
+
let {
|
|
796
|
+
name,
|
|
797
|
+
value,
|
|
798
|
+
dataCy
|
|
799
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
800
|
+
if (dataCy) return dataCy;
|
|
801
|
+
if (name && value) return "".concat(name, "-").concat(value);
|
|
802
|
+
return name || '';
|
|
803
|
+
};
|
|
804
|
+
;// ./src/components/Text/Text.jsx
|
|
805
|
+
const _excluded = ["variant", "as", "className", "children", "name", "dataCy"];
|
|
806
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
807
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
808
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
const variantMap = {
|
|
812
|
+
h1: 'text-4xl font-bold leading-tight text-[--color-text-strong]',
|
|
813
|
+
h2: 'text-3xl leading-snug text-[--color-text-strong]',
|
|
814
|
+
h3: 'text-2xl font-semibold leading-snug text-[--color-text-strong]',
|
|
815
|
+
h4: 'text-xl font-medium text-[--color-text-strong]',
|
|
816
|
+
h5: 'text-lg font-medium text-[--color-text-strong]',
|
|
817
|
+
h6: 'text-base font-medium text-[--color-text-strong]',
|
|
818
|
+
body: 'text-base text-[--color-text-strong]',
|
|
819
|
+
small: 'text-sm text-[--color-text-strong]',
|
|
820
|
+
caption: 'text-xs text-[--color-text-strong]',
|
|
821
|
+
label: 'text-md text-[--color-text-weak]'
|
|
822
|
+
};
|
|
823
|
+
const elementMap = {
|
|
824
|
+
h1: 'h1',
|
|
825
|
+
h2: 'h2',
|
|
826
|
+
h3: 'h3',
|
|
827
|
+
h4: 'h4',
|
|
828
|
+
h5: 'h5',
|
|
829
|
+
h6: 'h6',
|
|
830
|
+
body: 'p',
|
|
831
|
+
small: 'small',
|
|
832
|
+
caption: 'span',
|
|
833
|
+
label: 'label'
|
|
834
|
+
};
|
|
835
|
+
function Text(_ref) {
|
|
836
|
+
let {
|
|
837
|
+
variant = 'body',
|
|
838
|
+
as,
|
|
839
|
+
className = '',
|
|
840
|
+
children,
|
|
841
|
+
name,
|
|
842
|
+
dataCy
|
|
843
|
+
} = _ref,
|
|
844
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
845
|
+
const Component = as || elementMap[variant] || 'p';
|
|
846
|
+
const variantClass = variantMap[variant] || variantMap.body;
|
|
847
|
+
return /*#__PURE__*/external_react_default().createElement(Component, _extends({
|
|
848
|
+
className: "".concat(variantClass, " ").concat(className),
|
|
849
|
+
"data-cy": getDataCy({
|
|
850
|
+
name,
|
|
851
|
+
dataCy
|
|
852
|
+
})
|
|
853
|
+
}, rest), children);
|
|
854
|
+
}
|
|
792
855
|
;// ./src/components/Accordions/Accordion.jsx
|
|
793
856
|
|
|
794
857
|
|
|
795
858
|
|
|
859
|
+
|
|
796
860
|
const Accordion = _ref => {
|
|
797
861
|
let {
|
|
798
862
|
title,
|
|
@@ -800,6 +864,7 @@ const Accordion = _ref => {
|
|
|
800
864
|
activeIndex,
|
|
801
865
|
index,
|
|
802
866
|
isPreview,
|
|
867
|
+
isLocked,
|
|
803
868
|
onExitPreview = () => {},
|
|
804
869
|
content,
|
|
805
870
|
preview,
|
|
@@ -836,29 +901,31 @@ const Accordion = _ref => {
|
|
|
836
901
|
className: "accordion-item",
|
|
837
902
|
key: index
|
|
838
903
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
839
|
-
className: "\n accordion-header\n flex justify-between items-center
|
|
904
|
+
className: "\n accordion-header\n flex \n justify-between \n items-center \n bg-[--color-accordion-header]\n rounded-t-lg\n rounded-b-lg\n "
|
|
840
905
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
841
|
-
className: "flex items-center gap-2 justify-between
|
|
842
|
-
}, /*#__PURE__*/external_react_default().createElement(
|
|
906
|
+
className: "flex items-center gap-2 justify-between"
|
|
907
|
+
}, /*#__PURE__*/external_react_default().createElement(Text, {
|
|
908
|
+
as: "h2",
|
|
909
|
+
variant: "h2",
|
|
843
910
|
className: "my-2 mx-4 text-h4 text-[--color-text-strong]"
|
|
844
911
|
}, title)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
845
912
|
className: "flex items-center gap-4"
|
|
846
|
-
}, isPill
|
|
913
|
+
}, isPill && /*#__PURE__*/external_react_default().createElement(Pills_Pill, {
|
|
847
914
|
text: pillText,
|
|
848
915
|
status: pillStatus,
|
|
849
916
|
icon: pillIcon
|
|
850
|
-
})
|
|
851
|
-
className: "border-0 border-l-2 border-solid border-[--color-stroke] p-4",
|
|
852
|
-
onClick: toggle
|
|
853
|
-
}, isPreview ? /*#__PURE__*/external_react_default().createElement(esm_PencilSquareIcon, {
|
|
917
|
+
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
918
|
+
className: "border-0 ".concat(!isLocked && 'border-l-2 cursor-pointer', " border-solid border-[--color-stroke] p-4"),
|
|
919
|
+
onClick: !isLocked ? toggle : null // toggle only here
|
|
920
|
+
}, isPreview && !isLocked ? /*#__PURE__*/external_react_default().createElement(esm_PencilSquareIcon, {
|
|
854
921
|
className: "w-5 h-5 text-[--color-text-strong]",
|
|
855
922
|
onClick: e => {
|
|
856
|
-
e.stopPropagation(); // prevent
|
|
857
|
-
onExitPreview(); // trigger exit
|
|
923
|
+
e.stopPropagation(); // prevent toggle from firing on pencil click
|
|
924
|
+
onExitPreview(); // trigger exit preview
|
|
858
925
|
}
|
|
859
|
-
}) : /*#__PURE__*/external_react_default().createElement(esm_ChevronDownIcon, {
|
|
926
|
+
}) : !isLocked ? /*#__PURE__*/external_react_default().createElement(esm_ChevronDownIcon, {
|
|
860
927
|
className: "w-4 h-4 text-[--color-text-strong] transition-transform transform ".concat(isActive ? 'rotate-180' : 'rotate-0')
|
|
861
|
-
}))))), isActive && /*#__PURE__*/external_react_default().createElement("div", {
|
|
928
|
+
}) : null)))), isActive && /*#__PURE__*/external_react_default().createElement("div", {
|
|
862
929
|
className: "accordion-body rounded-b-lg text-[--color-text-weak] bg-[--color-accordion-body] border-0 border-t-2 border-solid border-[--color-stroke] p-3"
|
|
863
930
|
}, content), isPreview && activeIndex !== index && /*#__PURE__*/external_react_default().createElement("div", {
|
|
864
931
|
className: "accordion-body rounded-b-lg bg-[--color-accordion-body] text-[--color-text-weak] border-0 border-t-2 border-solid border-[--color-stroke] p-3"
|
|
@@ -1143,10 +1210,10 @@ var DefaultContext = {
|
|
|
1143
1210
|
};
|
|
1144
1211
|
var IconContext = external_react_.createContext && /*#__PURE__*/external_react_.createContext(DefaultContext);
|
|
1145
1212
|
;// ./node_modules/react-icons/lib/iconBase.mjs
|
|
1146
|
-
var
|
|
1147
|
-
function
|
|
1148
|
-
function
|
|
1149
|
-
function
|
|
1213
|
+
var iconBase_excluded = ["attr", "size", "title"];
|
|
1214
|
+
function iconBase_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = iconBase_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1215
|
+
function iconBase_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
1216
|
+
function iconBase_extends() { iconBase_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return iconBase_extends.apply(this, arguments); }
|
|
1150
1217
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1151
1218
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1152
1219
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -1160,7 +1227,7 @@ function Tree2Element(tree) {
|
|
|
1160
1227
|
}, node.attr), Tree2Element(node.child)));
|
|
1161
1228
|
}
|
|
1162
1229
|
function iconBase_GenIcon(data) {
|
|
1163
|
-
return props => /*#__PURE__*/external_react_.createElement(IconBase,
|
|
1230
|
+
return props => /*#__PURE__*/external_react_.createElement(IconBase, iconBase_extends({
|
|
1164
1231
|
attr: _objectSpread({}, data.attr)
|
|
1165
1232
|
}, props), Tree2Element(data.child));
|
|
1166
1233
|
}
|
|
@@ -1171,12 +1238,12 @@ function IconBase(props) {
|
|
|
1171
1238
|
size,
|
|
1172
1239
|
title
|
|
1173
1240
|
} = props,
|
|
1174
|
-
svgProps =
|
|
1241
|
+
svgProps = iconBase_objectWithoutProperties(props, iconBase_excluded);
|
|
1175
1242
|
var computedSize = size || conf.size || "1em";
|
|
1176
1243
|
var className;
|
|
1177
1244
|
if (conf.className) className = conf.className;
|
|
1178
1245
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
1179
|
-
return /*#__PURE__*/external_react_.createElement("svg",
|
|
1246
|
+
return /*#__PURE__*/external_react_.createElement("svg", iconBase_extends({
|
|
1180
1247
|
stroke: "currentColor",
|
|
1181
1248
|
fill: "currentColor",
|
|
1182
1249
|
strokeWidth: "0"
|
|
@@ -3693,17 +3760,6 @@ function AiTwotoneWarning (props) {
|
|
|
3693
3760
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 1024 1024"},"child":[{"tag":"path","attr":{"fill":"#333","d":"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"},"child":[]},{"tag":"path","attr":{"fill":"#E6E6E6","d":"M172.2 828.1h679.6L512 239.9 172.2 828.1zM560 720a48.01 48.01 0 0 1-96 0 48.01 48.01 0 0 1 96 0zm-16-304v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8z"},"child":[]},{"tag":"path","attr":{"fill":"#333","d":"M464 720a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8z"},"child":[]}]})(props);
|
|
3694
3761
|
};
|
|
3695
3762
|
|
|
3696
|
-
;// ./src/utils/getDataCy.js
|
|
3697
|
-
const getDataCy = function () {
|
|
3698
|
-
let {
|
|
3699
|
-
name,
|
|
3700
|
-
value,
|
|
3701
|
-
dataCy
|
|
3702
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3703
|
-
if (dataCy) return dataCy;
|
|
3704
|
-
if (name && value) return "".concat(name, "-").concat(value);
|
|
3705
|
-
return name || '';
|
|
3706
|
-
};
|
|
3707
3763
|
;// ./src/components/Buttons/Button.js
|
|
3708
3764
|
|
|
3709
3765
|
|
|
@@ -3802,57 +3858,6 @@ function Card(_ref) {
|
|
|
3802
3858
|
className: cardClasses
|
|
3803
3859
|
}, children);
|
|
3804
3860
|
}
|
|
3805
|
-
;// ./src/components/Text/Text.jsx
|
|
3806
|
-
const Text_excluded = ["variant", "as", "className", "children", "name", "dataCy"];
|
|
3807
|
-
function Text_extends() { return Text_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, Text_extends.apply(null, arguments); }
|
|
3808
|
-
function Text_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = Text_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3809
|
-
function Text_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
const variantMap = {
|
|
3813
|
-
h1: 'text-4xl font-bold leading-tight text-[--color-text-strong]',
|
|
3814
|
-
h2: 'text-3xl font-semibold leading-snug text-[--color-text-strong]',
|
|
3815
|
-
h3: 'text-2xl font-semibold leading-snug text-[--color-text-strong]',
|
|
3816
|
-
h4: 'text-xl font-medium text-[--color-text-strong]',
|
|
3817
|
-
h5: 'text-lg font-medium text-[--color-text-strong]',
|
|
3818
|
-
h6: 'text-base font-medium text-[--color-text-strong]',
|
|
3819
|
-
body: 'text-base text-[--color-text-strong]',
|
|
3820
|
-
small: 'text-sm text-[--color-text-strong]',
|
|
3821
|
-
caption: 'text-xs text-[--color-text-strong]',
|
|
3822
|
-
label: 'text-md text-[--color-text-weak]'
|
|
3823
|
-
};
|
|
3824
|
-
const elementMap = {
|
|
3825
|
-
h1: 'h1',
|
|
3826
|
-
h2: 'h2',
|
|
3827
|
-
h3: 'h3',
|
|
3828
|
-
h4: 'h4',
|
|
3829
|
-
h5: 'h5',
|
|
3830
|
-
h6: 'h6',
|
|
3831
|
-
body: 'p',
|
|
3832
|
-
small: 'small',
|
|
3833
|
-
caption: 'span',
|
|
3834
|
-
label: 'label'
|
|
3835
|
-
};
|
|
3836
|
-
function Text(_ref) {
|
|
3837
|
-
let {
|
|
3838
|
-
variant = 'body',
|
|
3839
|
-
as,
|
|
3840
|
-
className = '',
|
|
3841
|
-
children,
|
|
3842
|
-
name,
|
|
3843
|
-
dataCy
|
|
3844
|
-
} = _ref,
|
|
3845
|
-
rest = Text_objectWithoutProperties(_ref, Text_excluded);
|
|
3846
|
-
const Component = as || elementMap[variant] || 'p';
|
|
3847
|
-
const variantClass = variantMap[variant] || variantMap.body;
|
|
3848
|
-
return /*#__PURE__*/external_react_default().createElement(Component, Text_extends({
|
|
3849
|
-
className: "".concat(variantClass, " ").concat(className),
|
|
3850
|
-
"data-cy": getDataCy({
|
|
3851
|
-
name,
|
|
3852
|
-
dataCy
|
|
3853
|
-
})
|
|
3854
|
-
}, rest), children);
|
|
3855
|
-
}
|
|
3856
3861
|
;// ./src/components/Forms/Inputs/Input.jsx
|
|
3857
3862
|
function Input_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3858
3863
|
function Input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Input_ownKeys(Object(t), !0).forEach(function (r) { Input_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Input_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -4291,7 +4296,7 @@ function Table(_ref) {
|
|
|
4291
4296
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4292
4297
|
className: "wrapper w-full ".concat(className)
|
|
4293
4298
|
}, /*#__PURE__*/external_react_default().createElement("table", {
|
|
4294
|
-
className: "
|
|
4299
|
+
className: "\n min-w-full \n table-auto \n text-left \n border-collapse \n table\n "
|
|
4295
4300
|
}, /*#__PURE__*/external_react_default().createElement("thead", {
|
|
4296
4301
|
className: "hidden sm:table-header-group"
|
|
4297
4302
|
}, /*#__PURE__*/external_react_default().createElement("tr", {
|
|
@@ -12888,7 +12893,7 @@ function Dropdown(_ref) {
|
|
|
12888
12893
|
"aria-hidden": "true",
|
|
12889
12894
|
className: "-mr-1 h-5 w-5 text-[--color-text-weak] transition-transform duration-200 ".concat(open ? 'rotate-180' : 'rotate-0')
|
|
12890
12895
|
})), !disabled && /*#__PURE__*/external_react_default().createElement(Pt, {
|
|
12891
|
-
className: " absolute
|
|
12896
|
+
className: "\r absolute \r right-0 \r z-10 \r mt-2 \r w-56 \r origin-top-right \r rounded-md \r bg-[--color-primary-bg] \r shadow-lg \r ring-1 \r ring-[--color-stroke] \r ring-opacity-1 \r focus:outline-none \r max-h-48 \r overflow-y-auto\r "
|
|
12892
12897
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12893
12898
|
className: "py-1"
|
|
12894
12899
|
}, items.map((item, index) => /*#__PURE__*/external_react_default().createElement(Et, {
|
|
@@ -13172,6 +13177,7 @@ const CookieBanner = _ref => {
|
|
|
13172
13177
|
|
|
13173
13178
|
|
|
13174
13179
|
|
|
13180
|
+
|
|
13175
13181
|
/******/ return __webpack_exports__;
|
|
13176
13182
|
/******/ })()
|
|
13177
13183
|
;
|