@glyphjs/components 0.8.0 → 0.9.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.
package/dist/index.cjs CHANGED
@@ -5609,7 +5609,7 @@ function renderRatingGroup(items, keyPrefix) {
5609
5609
  marginTop: "var(--glyph-spacing-xs, 0.25rem)",
5610
5610
  fontStyle: "italic"
5611
5611
  },
5612
- children: item.description
5612
+ children: /* @__PURE__ */ jsxRuntime.jsx(runtime.RichText, { content: item.description })
5613
5613
  }
5614
5614
  )
5615
5615
  ] })
@@ -7480,6 +7480,129 @@ var annotateDefinition = {
7480
7480
  schema: schemas.annotateSchema,
7481
7481
  render: Annotate
7482
7482
  };
7483
+ function Columns({
7484
+ data,
7485
+ block,
7486
+ layout,
7487
+ container
7488
+ }) {
7489
+ const childBlocks = block.children ?? [];
7490
+ const ratio = data.ratio ?? childBlocks.map(() => 1);
7491
+ const cols = ratio.map((r) => `${String(r)}fr`).join(" ");
7492
+ const gap = data.gap ?? "1rem";
7493
+ return /* @__PURE__ */ jsxRuntime.jsx(
7494
+ "div",
7495
+ {
7496
+ style: {
7497
+ display: "grid",
7498
+ gridTemplateColumns: cols,
7499
+ gap
7500
+ },
7501
+ children: childBlocks.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx(
7502
+ runtime.BlockRenderer,
7503
+ {
7504
+ block: child,
7505
+ layout,
7506
+ index: i,
7507
+ container
7508
+ },
7509
+ child.id
7510
+ ))
7511
+ }
7512
+ );
7513
+ }
7514
+
7515
+ // src/columns/index.ts
7516
+ var columnsDefinition = {
7517
+ type: "ui:columns",
7518
+ schema: schemas.columnsSchema,
7519
+ render: Columns
7520
+ };
7521
+ function Rows({
7522
+ data,
7523
+ block,
7524
+ layout,
7525
+ container
7526
+ }) {
7527
+ const childBlocks = block.children ?? [];
7528
+ const ratio = data.ratio ?? childBlocks.map(() => 1);
7529
+ const rows = ratio.map((r) => `${String(r)}fr`).join(" ");
7530
+ const gap = data.gap ?? "1rem";
7531
+ return /* @__PURE__ */ jsxRuntime.jsx(
7532
+ "div",
7533
+ {
7534
+ style: {
7535
+ display: "grid",
7536
+ gridTemplateRows: rows,
7537
+ gap,
7538
+ height: "100%"
7539
+ },
7540
+ children: childBlocks.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx(
7541
+ runtime.BlockRenderer,
7542
+ {
7543
+ block: child,
7544
+ layout,
7545
+ index: i,
7546
+ container
7547
+ },
7548
+ child.id
7549
+ ))
7550
+ }
7551
+ );
7552
+ }
7553
+
7554
+ // src/rows/index.ts
7555
+ var rowsDefinition = {
7556
+ type: "ui:rows",
7557
+ schema: schemas.rowsSchema,
7558
+ render: Rows
7559
+ };
7560
+ var PANEL_STYLES = {
7561
+ card: {
7562
+ backgroundColor: "var(--glyph-surface, #ffffff)",
7563
+ borderRadius: "var(--glyph-radius-lg, 0.5rem)",
7564
+ boxShadow: "var(--glyph-shadow-sm, 0 1px 3px rgba(0,0,0,0.1))",
7565
+ border: "1px solid var(--glyph-border, rgba(0,0,0,0.08))"
7566
+ },
7567
+ bordered: {
7568
+ border: "1px solid var(--glyph-border, rgba(0,0,0,0.2))",
7569
+ borderRadius: "var(--glyph-radius-md, 0.25rem)"
7570
+ },
7571
+ elevated: {
7572
+ backgroundColor: "var(--glyph-surface, #ffffff)",
7573
+ borderRadius: "var(--glyph-radius-lg, 0.5rem)",
7574
+ boxShadow: "var(--glyph-shadow-md, 0 4px 12px rgba(0,0,0,0.15))"
7575
+ },
7576
+ ghost: {}
7577
+ };
7578
+ function Panel({
7579
+ data,
7580
+ block,
7581
+ layout,
7582
+ container
7583
+ }) {
7584
+ const childBlock = block.children?.[0];
7585
+ const panelStyle = data.style ?? "card";
7586
+ const padding = data.padding ?? "1rem";
7587
+ return /* @__PURE__ */ jsxRuntime.jsx(
7588
+ "div",
7589
+ {
7590
+ style: {
7591
+ ...PANEL_STYLES[panelStyle],
7592
+ padding,
7593
+ overflow: "hidden"
7594
+ },
7595
+ children: childBlock && /* @__PURE__ */ jsxRuntime.jsx(runtime.BlockRenderer, { block: childBlock, layout, index: 0, container })
7596
+ }
7597
+ );
7598
+ }
7599
+
7600
+ // src/panel/index.ts
7601
+ var panelDefinition = {
7602
+ type: "ui:panel",
7603
+ schema: schemas.panelSchema,
7604
+ render: Panel
7605
+ };
7483
7606
 
7484
7607
  // src/index.ts
7485
7608
  var allComponentDefinitions = [
@@ -7511,7 +7634,10 @@ var allComponentDefinitions = [
7511
7634
  matrixDefinition,
7512
7635
  formDefinition,
7513
7636
  kanbanDefinition,
7514
- annotateDefinition
7637
+ annotateDefinition,
7638
+ columnsDefinition,
7639
+ rowsDefinition,
7640
+ panelDefinition
7515
7641
  ];
7516
7642
 
7517
7643
  exports.Accordion = Accordion;
@@ -7521,6 +7647,7 @@ exports.Callout = Callout;
7521
7647
  exports.Card = Card;
7522
7648
  exports.Chart = Chart;
7523
7649
  exports.CodeDiff = CodeDiff;
7650
+ exports.Columns = Columns;
7524
7651
  exports.Comparison = Comparison;
7525
7652
  exports.Equation = Equation;
7526
7653
  exports.FileTree = FileTree;
@@ -7532,11 +7659,13 @@ exports.Kanban = Kanban;
7532
7659
  exports.Kpi = Kpi;
7533
7660
  exports.Matrix = Matrix;
7534
7661
  exports.MindMap = MindMap;
7662
+ exports.Panel = Panel;
7535
7663
  exports.Poll = Poll;
7536
7664
  exports.Quiz = Quiz;
7537
7665
  exports.Ranker = Ranker;
7538
7666
  exports.Rating = Rating;
7539
7667
  exports.Relation = Relation;
7668
+ exports.Rows = Rows;
7540
7669
  exports.Sequence = Sequence;
7541
7670
  exports.Slider = Slider;
7542
7671
  exports.Steps = Steps;
@@ -7551,6 +7680,7 @@ exports.calloutDefinition = calloutDefinition;
7551
7680
  exports.cardDefinition = cardDefinition;
7552
7681
  exports.chartDefinition = chartDefinition;
7553
7682
  exports.codeDiffDefinition = codeDiffDefinition;
7683
+ exports.columnsDefinition = columnsDefinition;
7554
7684
  exports.comparisonDefinition = comparisonDefinition;
7555
7685
  exports.computeArchitectureLayout = computeArchitectureLayout;
7556
7686
  exports.computeDagreLayout = computeDagreLayout;
@@ -7566,11 +7696,13 @@ exports.kanbanDefinition = kanbanDefinition;
7566
7696
  exports.kpiDefinition = kpiDefinition;
7567
7697
  exports.matrixDefinition = matrixDefinition;
7568
7698
  exports.mindMapDefinition = mindMapDefinition;
7699
+ exports.panelDefinition = panelDefinition;
7569
7700
  exports.pollDefinition = pollDefinition;
7570
7701
  exports.quizDefinition = quizDefinition;
7571
7702
  exports.rankerDefinition = rankerDefinition;
7572
7703
  exports.ratingDefinition = ratingDefinition;
7573
7704
  exports.relationDefinition = relationDefinition;
7705
+ exports.rowsDefinition = rowsDefinition;
7574
7706
  exports.sequenceDefinition = sequenceDefinition;
7575
7707
  exports.sliderDefinition = sliderDefinition;
7576
7708
  exports.stepsDefinition = stepsDefinition;