@kosdev-code/kos-ddk-styles 3.0.7 → 3.1.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.
package/index.cjs CHANGED
@@ -91,6 +91,50 @@ const fontStyles = react.css`
91
91
  font-weight: 600;
92
92
  }
93
93
  `;
94
+ const layoutStyles = react.css`
95
+ body[data-orientation="landscape"] {
96
+ /* --- page width (the single knob Container/View consume) --- */
97
+ --ddk-component-shell-max-width: 1920px;
98
+ --ddk-component-page-max-width: 1820px;
99
+ /* kept for any consumer still reading the large-container token directly */
100
+ --ddk-component-container-max-width-large: 1820px;
101
+
102
+ /* --- dashboard structure: holder rows stack full-width, cards reflow --- */
103
+ --ddk-component-dashboard-card-flex-direction: var(--ddk-component-dashboard-card-flex-direction-horizontal);
104
+ --ddk-component-dashboard-card-flex-wrap: wrap;
105
+ --ddk-component-dashboard-overflow: visible;
106
+
107
+ /* grid: macros & assembly share the last row */
108
+ --ddk-component-dashboard-grid-template-areas: var(--ddk-component-dashboard-grid-template-areas-horizontal);
109
+ --ddk-component-dashboard-grid-template-columns: var(--ddk-component-dashboard-grid-template-columns-horizontal);
110
+ --ddk-component-dashboard-grid-template-rows: var(--ddk-component-dashboard-grid-template-rows-horizontal);
111
+ --ddk-component-dashboard-grid-template-areas-3col: var(--ddk-component-dashboard-grid-template-areas-3col-horizontal);
112
+ --ddk-component-dashboard-grid-template-columns-3col: var(--ddk-component-dashboard-grid-template-columns-3col-horizontal);
113
+ --ddk-component-dashboard-grid-template-rows-3col: var(--ddk-component-dashboard-grid-template-rows-3col-horizontal);
114
+
115
+ /* spacing */
116
+ --ddk-component-dashboard-row-gap: var(--ddk-component-dashboard-row-gap-horizontal);
117
+ --ddk-component-dashboard-column-gap: var(--ddk-component-dashboard-column-gap-horizontal);
118
+
119
+ /* --- card value defaults for landscape (themes/overlay may refine) --- */
120
+ --ddk-component-dashboard-card-height: var(--ddk-component-dashboard-card-height-horizontal);
121
+ --ddk-component-dashboard-card-small-height: var(--ddk-component-dashboard-card-small-height-horizontal);
122
+ --ddk-component-dashboard-card-large-width: var(--ddk-component-dashboard-card-large-width-horizontal);
123
+ --ddk-component-dashboard-card-small-width: var(--ddk-component-dashboard-card-small-width-horizontal);
124
+ --ddk-component-dashboard-card-min-width: var(--ddk-component-dashboard-card-min-width-horizontal);
125
+ --ddk-component-dashboard-card-max-height: var(--ddk-component-dashboard-card-max-height-horizontal);
126
+ --ddk-component-macro-card-height: var(--ddk-component-macro-card-height-horizontal);
127
+
128
+ /* modal */
129
+ --ddk-component-modal-max-width: 1000px;
130
+ --ddk-component-modal-max-height: 750px;
131
+ }
132
+
133
+ /* small cards (macros & assembly) take the shorter macro height */
134
+ body[data-orientation="landscape"] [data-card-size="small"] {
135
+ --ddk-component-dashboard-card-height: var(--ddk-component-macro-card-height-horizontal);
136
+ }
137
+ `;
94
138
  const rootStyles = react.css`
95
139
  ::-webkit-scrollbar {
96
140
  background-color: transparent;
@@ -890,6 +934,11 @@ const baseComponentStyles = react.css`
890
934
  --ddk-component-container-max-width-medium: 640px;
891
935
  --ddk-component-container-max-width-small: 408px;
892
936
 
937
+ // page width — single knob consumed by Container/View (decoupled from
938
+ // container-max-width-large so the orientation skeleton/overlay can widen
939
+ // pages without disturbing other consumers). Landscape widens it in layout.ts.
940
+ --ddk-component-page-max-width: var(--ddk-component-container-max-width-large);
941
+
893
942
  // frame-container
894
943
  --ddk-component-frame-body-padding: var(--ddk-semantic-control-padding-small);
895
944
  --ddk-component-frame-container-background-color: var(--ddk-generic-color-grey-5);
@@ -1514,6 +1563,10 @@ const baseComponentStyles = react.css`
1514
1563
  // dashboard layout mode flag (set to 'horizontal' to activate horizontal layout)
1515
1564
  --ddk-component-dashboard-layout-mode: vertical;
1516
1565
 
1566
+ // dashboard - structural defaults (orientation skeleton refines these in layout.ts)
1567
+ --ddk-component-dashboard-card-flex-wrap: nowrap;
1568
+ --ddk-component-dashboard-overflow: visible;
1569
+
1517
1570
  // dashboard-card
1518
1571
  --ddk-component-dashboard-card-background-color-unassigned: var(--ddk-generic-color-grey-10);
1519
1572
  --ddk-component-dashboard-card-background-color-removed: var(--ddk-generic-color-grey-10);
@@ -1527,17 +1580,21 @@ const baseComponentStyles = react.css`
1527
1580
  --ddk-component-dashboard-card-small-width: 216px; // validated
1528
1581
  --ddk-component-dashboard-card-max-height: 92px; // validated
1529
1582
 
1530
- // dashboard-card - horizontal layout overrides (cards flow horizontally in rows)
1583
+ // dashboard-card - horizontal layout overrides (cards reflow into a wrapping grid)
1584
+ // Heights sized for actual content (title + small fuel gauge + footer/troubles);
1585
+ // the old 284px was tuned for a single horizontal-scroll row. ~1.5x the 115px
1586
+ // portrait height gives the wider landscape card visual balance without empty
1587
+ // space. Tune per device via theme :root or the device theme-overlay.css.
1531
1588
  --ddk-component-dashboard-card-flex-direction-horizontal: row;
1532
- --ddk-component-dashboard-card-height-horizontal: 284px;
1533
- --ddk-component-dashboard-card-small-height-horizontal: 284px;
1589
+ --ddk-component-dashboard-card-height-horizontal: 176px;
1590
+ --ddk-component-dashboard-card-small-height-horizontal: 176px;
1534
1591
  --ddk-component-dashboard-card-large-width-horizontal: 217px;
1535
1592
  --ddk-component-dashboard-card-small-width-horizontal: 217px;
1536
1593
  --ddk-component-dashboard-card-min-width-horizontal: 217px;
1537
1594
  --ddk-component-dashboard-card-max-height-horizontal: none;
1538
1595
 
1539
1596
  // macro-card - horizontal layout overrides (different height than holder cards)
1540
- --ddk-component-macro-card-height-horizontal: 200px;
1597
+ --ddk-component-macro-card-height-horizontal: 148px;
1541
1598
 
1542
1599
  // dashboard - horizontal layout overrides (macros and assembly on same row)
1543
1600
  --ddk-component-dashboard-grid-template-areas-horizontal: "holder1 holder1" "holder2 holder2" "macros assembly";
@@ -1654,46 +1711,13 @@ const baseComponentStyles = react.css`
1654
1711
  --ddk-component-setup-sidebar-step-item-padding: 0px;
1655
1712
  }
1656
1713
 
1657
- /* Horizontal dashboard layout mode overrides */
1658
- [data-dashboard-layout="horizontal"] {
1659
- --ddk-component-shell-max-width: 1920px;
1660
- --ddk-component-container-max-width-large: 1820px;
1661
-
1662
- /* Override 2-column layout */
1663
- --ddk-component-dashboard-grid-template-areas: var(--ddk-component-dashboard-grid-template-areas-horizontal);
1664
- --ddk-component-dashboard-grid-template-columns: var(--ddk-component-dashboard-grid-template-columns-horizontal);
1665
- --ddk-component-dashboard-grid-template-rows: var(--ddk-component-dashboard-grid-template-rows-horizontal);
1666
-
1667
- /* Override 3-column layout */
1668
- --ddk-component-dashboard-grid-template-areas-3col: var(--ddk-component-dashboard-grid-template-areas-3col-horizontal);
1669
- --ddk-component-dashboard-grid-template-columns-3col: var(--ddk-component-dashboard-grid-template-columns-3col-horizontal);
1670
- --ddk-component-dashboard-grid-template-rows-3col: var(--ddk-component-dashboard-grid-template-rows-3col-horizontal);
1671
-
1672
- /* Override spacing */
1673
- --ddk-component-dashboard-row-gap: var(--ddk-component-dashboard-row-gap-horizontal);
1674
- --ddk-component-dashboard-column-gap: var(--ddk-component-dashboard-column-gap-horizontal);
1675
-
1676
- /* Override card properties - large cards (holders) */
1677
- --ddk-component-dashboard-card-flex-direction: var(--ddk-component-dashboard-card-flex-direction-horizontal);
1678
- --ddk-component-dashboard-card-height: var(--ddk-component-dashboard-card-height-horizontal);
1679
- --ddk-component-dashboard-card-small-height: var(--ddk-component-dashboard-card-small-height-horizontal);
1680
- --ddk-component-dashboard-card-large-width: var(--ddk-component-dashboard-card-large-width-horizontal);
1681
- --ddk-component-dashboard-card-small-width: var(--ddk-component-dashboard-card-small-width-horizontal);
1682
- --ddk-component-dashboard-card-min-width: var(--ddk-component-dashboard-card-min-width-horizontal);
1683
- --ddk-component-dashboard-card-max-height: var(--ddk-component-dashboard-card-max-height-horizontal);
1684
-
1685
- /* Override macro card height (macros are shorter than holder cards) */
1686
- --ddk-component-macro-card-height: var(--ddk-component-macro-card-height-horizontal);
1687
-
1688
- /* Modal dimensions in horizontal mode */
1689
- --ddk-component-modal-max-width: 1000px;
1690
- --ddk-component-modal-max-height: 750px;
1691
- }
1692
-
1693
- /* Small cards in horizontal mode (macros and assembly cards) */
1694
- [data-dashboard-layout="horizontal"] [data-card-size="small"] {
1695
- --ddk-component-dashboard-card-height: var(--ddk-component-macro-card-height-horizontal);
1696
- }
1714
+ /*
1715
+ * Landscape orientation overrides have moved to the always-on structural
1716
+ * skeleton in ./layout.ts (selector body[data-orientation="landscape"]), so
1717
+ * they win over any theme :root by specificity instead of being clobbered.
1718
+ * The *-horizontal value tokens above remain here as the values that skeleton
1719
+ * reads.
1720
+ */
1697
1721
  `;
1698
1722
  const baseGenericStyles = react.css`
1699
1723
  :root {
@@ -2131,6 +2155,7 @@ const getStyles = (temporaryThemeID) => temporaryThemeID === "flex-eu" ? [
2131
2155
  baseGenericStyles,
2132
2156
  baseComponentStyles,
2133
2157
  baseSemanticStyles,
2158
+ layoutStyles,
2134
2159
  flexEUComponentStyles,
2135
2160
  flexEUSemanticStyles
2136
2161
  ] : temporaryThemeID === "compact" ? [
@@ -2139,6 +2164,7 @@ const getStyles = (temporaryThemeID) => temporaryThemeID === "flex-eu" ? [
2139
2164
  baseGenericStyles,
2140
2165
  baseComponentStyles,
2141
2166
  baseSemanticStyles,
2167
+ layoutStyles,
2142
2168
  flexEUComponentStyles,
2143
2169
  flexEUSemanticStyles,
2144
2170
  compactComponentStyles,
@@ -2148,7 +2174,8 @@ const getStyles = (temporaryThemeID) => temporaryThemeID === "flex-eu" ? [
2148
2174
  rootStyles,
2149
2175
  baseGenericStyles,
2150
2176
  baseComponentStyles,
2151
- baseSemanticStyles
2177
+ baseSemanticStyles,
2178
+ layoutStyles
2152
2179
  ];
2153
2180
  const SvgAlertFilled = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M12.0009 7.23564C11.6963 7.23613 11.4496 7.48285 11.4491 7.78735V15.1544C11.4491 15.4591 11.6961 15.7061 12.0009 15.7061C12.3056 15.7061 12.5526 15.4591 12.5526 15.1544V7.78735C12.5521 7.48285 12.3054 7.23613 12.0009 7.23564Z", fill: "currentColor" }), /* @__PURE__ */ React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.07318 20.7783L11.5263 2.67477C11.6239 2.50482 11.8049 2.40002 12.0009 2.40002C12.1969 2.40002 12.3779 2.50482 12.4755 2.67477L22.9268 20.7783C23.0245 20.9478 23.0244 21.1566 22.9265 21.326C22.8287 21.4955 22.6479 21.5999 22.4522 21.6H1.54779C1.35211 21.5999 1.17134 21.4955 1.07348 21.326C0.975613 21.1566 0.975501 20.9478 1.07318 20.7783ZM12.0009 16.4238C11.3001 16.4228 10.7323 15.855 10.7313 15.1544V7.78735C10.7313 7.08629 11.2997 6.51796 12.0009 6.51796C12.702 6.51796 13.2704 7.08629 13.2704 7.78735V15.1544C13.2694 15.855 12.7016 16.4228 12.0009 16.4238ZM12.0009 19.6291C11.9067 19.6289 11.8129 19.6184 11.721 19.5977C11.3898 19.5246 11.1014 19.3227 10.9194 19.0365C10.7374 18.7503 10.6769 18.4035 10.7511 18.0726C10.7943 17.8791 10.9861 17.7572 11.1795 17.8004C11.373 17.8435 11.495 18.0352 11.4518 18.2287C11.3849 18.5305 11.5753 18.8293 11.877 18.8963C12.1788 18.9634 12.4778 18.7732 12.5449 18.4715C12.612 18.1698 12.4219 17.8708 12.1202 17.8035C12.054 17.7883 11.9856 17.7856 11.9184 17.7954C11.7889 17.8197 11.6565 17.7712 11.5735 17.6689C11.4904 17.5666 11.4701 17.427 11.5206 17.3053C11.5711 17.1836 11.6841 17.0994 11.8152 17.0858C12.2862 17.0219 12.7537 17.2248 13.0288 17.6124C13.3039 18.0001 13.341 18.5083 13.1252 18.9318C12.9093 19.3552 12.4762 19.6239 12.0009 19.6291Z", fill: "currentColor" }));
2154
2181
  const SvgCloseSidebar = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("g", { clipPath: "url(#clip0_1054_40209)" }, /* @__PURE__ */ React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 12C0 5.36842 5.36842 0 12 0C18.6316 0 24 5.36842 24 12C24 18.6316 18.6316 24 12 24C5.36842 24 0 18.6316 0 12ZM1.38947 12C1.38947 17.8737 6.12632 22.6105 12 22.6105C17.8737 22.6105 22.6105 17.8737 22.6105 12C22.6105 6.12632 17.8737 1.38947 12 1.38947C6.12632 1.38947 1.38947 6.12632 1.38947 12ZM14.9684 7.38947L10.3579 12L14.9684 16.6105C15.2211 16.8632 15.2211 17.2737 14.9684 17.5263C14.7158 17.8105 14.2737 17.8105 14.0211 17.5579L9.41053 12.9474L8.46316 12L9.41053 11.0526L14.0211 6.44211C14.3053 6.18947 14.7158 6.18947 14.9684 6.44211C15.2211 6.69474 15.2211 7.13684 14.9684 7.38947Z", fill: "currentColor" })), /* @__PURE__ */ React__namespace.createElement("defs", null, /* @__PURE__ */ React__namespace.createElement("clipPath", { id: "clip0_1054_40209" }, /* @__PURE__ */ React__namespace.createElement("rect", { width: 24, height: 24, fill: "white" }))));
@@ -2425,6 +2452,7 @@ exports.getNextSequentialColor = getNextSequentialColor;
2425
2452
  exports.getRgb = getRgb;
2426
2453
  exports.getStyles = getStyles;
2427
2454
  exports.hsvToRgb = hsvToRgb;
2455
+ exports.layoutStyles = layoutStyles;
2428
2456
  exports.padHex = padHex;
2429
2457
  exports.rgbToHex = rgbToHex;
2430
2458
  exports.seedRandom = seedRandom;