@revisium/schema-toolkit-ui 0.6.10 → 0.6.12

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.
package/dist/index.cjs CHANGED
@@ -39,7 +39,6 @@ let _uiw_codemirror_theme_github = require("@uiw/codemirror-theme-github");
39
39
  let _uiw_react_codemirror = require("@uiw/react-codemirror");
40
40
  _uiw_react_codemirror = __toESM(_uiw_react_codemirror);
41
41
  let _codemirror_lang_json = require("@codemirror/lang-json");
42
- let _chakra_ui_react_breadcrumb = require("@chakra-ui/react/breadcrumb");
43
42
  let react_icons_md = require("react-icons/md");
44
43
  let _chakra_ui_react_menu = require("@chakra-ui/react/menu");
45
44
  let react_icons_lu = require("react-icons/lu");
@@ -2784,29 +2783,40 @@ const EditableSegment = ({ value, onChange, onBlur, tooltip, placeholder, dataTe
2784
2783
 
2785
2784
  //#endregion
2786
2785
  //#region src/components/Breadcrumbs/SegmentContent.tsx
2787
- const SegmentContent = ({ segment, isHighlighted, onClick }) => {
2788
- if (isHighlighted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.CurrentLink, {
2789
- color: CURRENT_COLOR,
2790
- fontWeight: "600",
2791
- "data-testid": segment.dataTestId,
2792
- children: segment.label
2793
- });
2794
- if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Link, {
2795
- as: "button",
2796
- color: SEGMENT_COLOR,
2797
- borderRadius: BREADCRUMB_BORDER_RADIUS,
2798
- px: BREADCRUMB_PADDING,
2799
- py: BREADCRUMB_PADDING,
2800
- focusRing: "none",
2786
+ const StyledButton = (0, _chakra_ui_react.chakra)("button");
2787
+ const SHARED_STYLES = {
2788
+ display: "inline-block",
2789
+ borderRadius: BREADCRUMB_BORDER_RADIUS,
2790
+ px: BREADCRUMB_PADDING,
2791
+ py: BREADCRUMB_PADDING,
2792
+ lineHeight: "inherit",
2793
+ fontSize: "inherit",
2794
+ fontFamily: "inherit"
2795
+ };
2796
+ const SegmentContent = ({ segment, isHighlighted, isLast, onClick }) => {
2797
+ if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
2798
+ type: "button",
2799
+ ...SHARED_STYLES,
2800
+ color: isHighlighted ? CURRENT_COLOR : SEGMENT_COLOR,
2801
+ fontWeight: isHighlighted ? "600" : void 0,
2801
2802
  cursor: "pointer",
2803
+ border: "none",
2804
+ background: "none",
2805
+ outline: "none",
2802
2806
  _hover: { bg: HOVER_BG },
2803
2807
  _focusVisible: { bg: HOVER_BG },
2804
2808
  onClick,
2809
+ "aria-current": isHighlighted ? "page" : void 0,
2805
2810
  "data-testid": segment.dataTestId,
2806
2811
  children: segment.label
2807
2812
  });
2808
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2809
- color: SEGMENT_COLOR,
2813
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Box, {
2814
+ as: "span",
2815
+ ...SHARED_STYLES,
2816
+ color: isHighlighted ? CURRENT_COLOR : SEGMENT_COLOR,
2817
+ fontWeight: isHighlighted ? "600" : void 0,
2818
+ cursor: isHighlighted || isLast ? "text" : "default",
2819
+ "aria-current": isHighlighted ? "page" : void 0,
2810
2820
  "data-testid": segment.dataTestId,
2811
2821
  children: segment.label
2812
2822
  });
@@ -2816,35 +2826,54 @@ const SegmentContent = ({ segment, isHighlighted, onClick }) => {
2816
2826
  //#region src/components/Breadcrumbs/Breadcrumbs.tsx
2817
2827
  const Breadcrumbs = ({ segments, separator = "/", dataTestId, highlightLast = true, onSegmentClick, editable, action }) => {
2818
2828
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react.Flex, {
2829
+ as: "nav",
2830
+ "aria-label": "breadcrumb",
2819
2831
  alignItems: "center",
2820
2832
  gap: BREADCRUMB_PADDING,
2821
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Root, {
2833
+ "data-testid": dataTestId,
2834
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react.Flex, {
2835
+ as: "ol",
2836
+ alignItems: "center",
2837
+ listStyleType: "none",
2838
+ margin: 0,
2839
+ padding: 0,
2822
2840
  fontWeight: "400",
2823
2841
  fontSize: BREADCRUMB_FONT_SIZE,
2824
- "data-testid": dataTestId,
2825
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react_breadcrumb.Breadcrumb.List, {
2826
- fontSize: BREADCRUMB_FONT_SIZE,
2827
- children: [segments.map((segment, index) => {
2828
- const isLast = index === segments.length - 1 && !editable;
2829
- const isHighlighted = isLast && highlightLast;
2830
- const handleClick = onSegmentClick ? () => onSegmentClick(segment, index) : void 0;
2831
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Item, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SegmentContent, {
2842
+ gap: BREADCRUMB_PADDING,
2843
+ children: [segments.map((segment, index) => {
2844
+ const isLast = index === segments.length - 1 && !editable;
2845
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2846
+ as: "li",
2847
+ alignItems: "center",
2848
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SegmentContent, {
2832
2849
  segment,
2833
- isHighlighted,
2834
- onClick: isLast ? void 0 : handleClick
2835
- }) }), (!isLast || editable) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Separator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2850
+ isHighlighted: isLast && highlightLast,
2851
+ isLast,
2852
+ onClick: isLast ? void 0 : onSegmentClick ? () => onSegmentClick(segment, index) : void 0
2853
+ })
2854
+ }), (!isLast || editable) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2855
+ as: "li",
2856
+ "aria-hidden": true,
2857
+ alignItems: "center",
2858
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2836
2859
  color: SEPARATOR_COLOR,
2860
+ px: BREADCRUMB_PADDING,
2861
+ lineHeight: 1,
2837
2862
  children: separator
2838
- }) })] }, `${segment.label}-${index}`);
2839
- }), editable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Item, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditableSegment, {
2863
+ })
2864
+ })] }, `${segment.label}-${index}`);
2865
+ }), editable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2866
+ as: "li",
2867
+ alignItems: "center",
2868
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditableSegment, {
2840
2869
  value: editable.value,
2841
2870
  onChange: editable.onChange,
2842
2871
  onBlur: editable.onBlur,
2843
2872
  tooltip: editable.tooltip,
2844
2873
  placeholder: editable.placeholder,
2845
2874
  dataTestId: editable.dataTestId
2846
- }) })]
2847
- })
2875
+ })
2876
+ })]
2848
2877
  }), action]
2849
2878
  });
2850
2879
  };
@@ -14369,7 +14398,7 @@ const TableEditor = (0, mobx_react_lite.observer)(({ viewModel, useWindowScroll
14369
14398
  px: 3,
14370
14399
  pt: "32px",
14371
14400
  pb: "48px",
14372
- alignItems: "center",
14401
+ alignItems: "flex-start",
14373
14402
  justifyContent: "space-between",
14374
14403
  ...useWindowScroll && {
14375
14404
  position: "sticky",