blue-react 11.1.0 → 11.2.1

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,10 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ export type FieldGroupProps = ComponentProps<"details"> & {
3
+ header?: ReactNode;
4
+ isExpanded?: boolean;
5
+ headerClassName?: string;
6
+ id?: string;
7
+ heading?: number;
8
+ pageHeader?: boolean;
9
+ };
10
+ export default function FieldGroup({ className, children, open, header, isExpanded, headerClassName, id, heading, pageHeader, ...rest }: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["className", "children", "open", "header", "isExpanded", "headerClassName", "id", "heading", "pageHeader"];
3
+ 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; }
4
+ 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; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ 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; }
9
+ 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; }
10
+ import clsx from "clsx";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ export default function FieldGroup(_ref) {
13
+ var className = _ref.className,
14
+ children = _ref.children,
15
+ open = _ref.open,
16
+ header = _ref.header,
17
+ _ref$isExpanded = _ref.isExpanded,
18
+ isExpanded = _ref$isExpanded === void 0 ? true : _ref$isExpanded,
19
+ headerClassName = _ref.headerClassName,
20
+ id = _ref.id,
21
+ heading = _ref.heading,
22
+ pageHeader = _ref.pageHeader,
23
+ rest = _objectWithoutProperties(_ref, _excluded);
24
+ return /*#__PURE__*/_jsxs("details", _objectSpread(_objectSpread({
25
+ className: clsx("blue-collapse", className),
26
+ open: isExpanded
27
+ }, rest), {}, {
28
+ children: [/*#__PURE__*/_jsx("summary", {
29
+ role: "heading",
30
+ "aria-level": heading,
31
+ children: /*#__PURE__*/_jsxs("header", {
32
+ className: clsx("blue-collapse-header d-flex align-items-center gap-1", headerClassName, {
33
+ "blue-page-header w-100 mt-0": pageHeader,
34
+ h1: heading === 1,
35
+ h2: heading === 2,
36
+ h3: heading === 3,
37
+ h4: heading === 4,
38
+ h5: heading === 5,
39
+ h6: heading === 6
40
+ }),
41
+ children: [/*#__PURE__*/_jsx("svg", {
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ width: "1em",
44
+ height: "1em",
45
+ fill: "currentColor",
46
+ "aria-hidden": "true",
47
+ className: "blue-collapse-chevron bi bi-chevron-right fs-6 opacity-50",
48
+ viewBox: "0 0 16 16",
49
+ children: /*#__PURE__*/_jsx("path", {
50
+ fillRule: "evenodd",
51
+ d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"
52
+ })
53
+ }), header, id !== undefined && id !== null && id !== "" && /*#__PURE__*/_jsx("small", {
54
+ className: "text-secondary",
55
+ children: id
56
+ })]
57
+ })
58
+ }), children]
59
+ }));
60
+ }
package/index.d.ts CHANGED
@@ -24,6 +24,9 @@ export { ButtonProps } from "./dist/components/Button"
24
24
  export { default as Chevron } from "./dist/components/Chevron"
25
25
  export { ChevronProps } from "./dist/components/Chevron"
26
26
 
27
+ export { default as FieldGroup } from "./dist/components/FieldGroup"
28
+ export { FieldGroupProps } from "./dist/components/FieldGroup"
29
+
27
30
  export { default as HashRouter } from "./dist/components/HashRouter"
28
31
  export { HashRouterProps } from "./dist/components/HashRouter"
29
32
 
package/index.js CHANGED
@@ -3,6 +3,7 @@ export { default as ActionMenu } from "./dist/components/ActionMenu.js"
3
3
  export { default as Actions } from "./dist/components/Actions.js"
4
4
  export { default as Button } from "./dist/components/Button.js"
5
5
  export { default as Chevron } from "./dist/components/Chevron.js"
6
+ export { default as FieldGroup } from "./dist/components/FieldGroup.js"
6
7
  export { default as HashRouter } from "./dist/components/HashRouter.js"
7
8
  export { default as Layout } from "./dist/components/Layout.js"
8
9
  export { default as Header } from "./dist/components/Header.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "11.1.0",
3
+ "version": "11.2.1",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@popperjs/core": "^2.11.5",
38
- "blue-web": "^1.23.0",
38
+ "blue-web": "^1.25.2",
39
39
  "bootstrap": "~5.3.3",
40
40
  "clsx": "^1.1.1"
41
41
  },