@noya-app/noya-designsystem 0.1.19 → 0.1.21

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.
@@ -5,13 +5,13 @@
5
5
  CLI Target: esnext
6
6
  CJS Build start
7
7
  ESM Build start
8
- CJS dist/index.js 226.60 KB
9
- CJS dist/index.js.map 457.17 KB
10
- CJS ⚡️ Build success in 94ms
11
- ESM dist/index.mjs 208.81 KB
12
- ESM dist/index.mjs.map 457.29 KB
13
- ESM ⚡️ Build success in 94ms
8
+ ESM dist/index.mjs 209.89 KB
9
+ ESM dist/index.mjs.map 459.25 KB
10
+ ESM ⚡️ Build success in 295ms
11
+ CJS dist/index.js 227.68 KB
12
+ CJS dist/index.js.map 459.13 KB
13
+ CJS ⚡️ Build success in 296ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 9611ms
16
- DTS dist/index.d.ts 60.18 KB
17
- DTS dist/index.d.mts 60.18 KB
15
+ DTS ⚡️ Build success in 12004ms
16
+ DTS dist/index.d.ts 60.59 KB
17
+ DTS dist/index.d.mts 60.59 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @noya-app/noya-designsystem
2
2
 
3
+ ## 0.1.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 57bf0c9: Improve pixel ratio, toolbar, details
8
+ - dd8569c: Fix input styling
9
+
10
+ ## 0.1.20
11
+
12
+ ### Patch Changes
13
+
14
+ - 7306000: Improve embedded apis
15
+ - 5f3843e: Improve workspace sizing
16
+
3
17
  ## 0.1.19
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1075,9 +1075,22 @@ interface Props$1 {
1075
1075
  hasRightSidebar?: boolean;
1076
1076
  hasLeftSidebar?: boolean;
1077
1077
  onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
1078
- leftSidebarInitialSize?: number;
1079
- rightSidebarInitialSize?: number;
1080
1078
  leftSidebarCanResize?: boolean;
1079
+ id?: string;
1080
+ className?: string;
1081
+ style?: React__default.CSSProperties;
1082
+ /**
1083
+ * Accepts a number (px) or % string (e.g. "50%").
1084
+ * Use % to avoid flicker server-rendering.
1085
+ */
1086
+ leftSidebarInitialSize?: number | string;
1087
+ leftSidebarMinSize?: number | string;
1088
+ /**
1089
+ * Accepts a number (px) or % string (e.g. "50%").
1090
+ * Use % to avoid flicker server-rendering.
1091
+ */
1092
+ rightSidebarInitialSize?: number | string;
1093
+ rightSidebarMinSize?: number | string;
1081
1094
  }
1082
1095
  type IWorkspaceLayout = {
1083
1096
  setLeftSidebarExpanded: (expanded: boolean) => void;
package/dist/index.d.ts CHANGED
@@ -1075,9 +1075,22 @@ interface Props$1 {
1075
1075
  hasRightSidebar?: boolean;
1076
1076
  hasLeftSidebar?: boolean;
1077
1077
  onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
1078
- leftSidebarInitialSize?: number;
1079
- rightSidebarInitialSize?: number;
1080
1078
  leftSidebarCanResize?: boolean;
1079
+ id?: string;
1080
+ className?: string;
1081
+ style?: React__default.CSSProperties;
1082
+ /**
1083
+ * Accepts a number (px) or % string (e.g. "50%").
1084
+ * Use % to avoid flicker server-rendering.
1085
+ */
1086
+ leftSidebarInitialSize?: number | string;
1087
+ leftSidebarMinSize?: number | string;
1088
+ /**
1089
+ * Accepts a number (px) or % string (e.g. "50%").
1090
+ * Use % to avoid flicker server-rendering.
1091
+ */
1092
+ rightSidebarInitialSize?: number | string;
1093
+ rightSidebarMinSize?: number | string;
1081
1094
  }
1082
1095
  type IWorkspaceLayout = {
1083
1096
  setLeftSidebarExpanded: (expanded: boolean) => void;
package/dist/index.js CHANGED
@@ -788,7 +788,8 @@ var textStyles = {
788
788
  fontFamily: fonts.normal,
789
789
  fontSize: `${typeScale[6]}rem`,
790
790
  fontWeight: 400,
791
- lineHeight: "1.4"
791
+ lineHeight: "19px"
792
+ // lineHeight: "1.4",
792
793
  },
793
794
  button: {
794
795
  fontFamily: fonts.normal,
@@ -2043,7 +2044,11 @@ var InputElement = (0, import_styled_components13.default)(TextInput_default)(({
2043
2044
  // },
2044
2045
  };
2045
2046
  });
2046
- var InputFieldInput = (0, import_react32.forwardRef)(function InputFieldInput2(props, forwardedRef) {
2047
+ var InputFieldInput = (0, import_react32.forwardRef)(function InputFieldInput2({
2048
+ textAlign,
2049
+ variant,
2050
+ ...rest
2051
+ }, forwardedRef) {
2047
2052
  const {
2048
2053
  labelPosition,
2049
2054
  labelSize,
@@ -2071,8 +2076,10 @@ var InputFieldInput = (0, import_react32.forwardRef)(function InputFieldInput2(p
2071
2076
  $hasLabel: hasLabel,
2072
2077
  $hasDropdown: hasDropdown,
2073
2078
  $size: size2,
2079
+ $variant: variant,
2080
+ $textAlign: textAlign,
2074
2081
  onFocusChange: handleFocusChange,
2075
- ...props
2082
+ ...rest
2076
2083
  }
2077
2084
  );
2078
2085
  });
@@ -2597,15 +2604,15 @@ var ChipElement = import_styled_components16.default.span(({ theme, $colorScheme
2597
2604
  userSelect: "none",
2598
2605
  display: "inline-flex",
2599
2606
  alignItems: "center",
2600
- lineHeight: "1.4",
2607
+ // lineHeight: "1.4",
2608
+ lineHeight: "15px",
2601
2609
  whiteSpace: "pre",
2602
2610
  ...$size === "medium" ? {
2603
2611
  fontSize: "11px",
2604
2612
  padding: "4px 8px"
2605
2613
  } : {
2606
2614
  fontSize: "9px",
2607
- padding: "0px 4px",
2608
- lineHeight: "15px"
2615
+ padding: "0px 4px"
2609
2616
  },
2610
2617
  ...$monospace && {
2611
2618
  fontFamily: theme.fonts.monospace
@@ -6305,11 +6312,21 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
6305
6312
  onChangeLayoutState,
6306
6313
  leftSidebarInitialSize = 280,
6307
6314
  rightSidebarInitialSize = 400,
6308
- leftSidebarCanResize = false
6315
+ leftSidebarMinSize,
6316
+ rightSidebarMinSize,
6317
+ leftSidebarCanResize = false,
6318
+ id,
6319
+ className,
6320
+ style: style3
6309
6321
  }, forwardedRef) {
6310
6322
  const windowSize = useWindowSize();
6311
- const leftSidebarPercentage = leftSidebarInitialSize / windowSize.width * 100;
6312
- const rightSidebarPercentage = rightSidebarInitialSize / windowSize.width * 100;
6323
+ function getPercentage(size2) {
6324
+ return typeof size2 === "string" ? parseFloat(size2) : size2 / windowSize.width * 100;
6325
+ }
6326
+ const leftSidebarPercentage = getPercentage(leftSidebarInitialSize);
6327
+ const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
6328
+ const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
6329
+ const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
6313
6330
  const panelGroupRef = (0, import_react63.useRef)(null);
6314
6331
  const leftSidebarRef = (0, import_react63.useRef)(null);
6315
6332
  const rightSidebarRef = (0, import_react63.useRef)(null);
@@ -6371,82 +6388,97 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
6371
6388
  }
6372
6389
  }
6373
6390
  });
6374
- return /* @__PURE__ */ import_react63.default.createElement(Stack.H, { flex: "1" }, /* @__PURE__ */ import_react63.default.createElement(
6375
- import_react_resizable_panels.PanelGroup,
6391
+ const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
6392
+ return /* @__PURE__ */ import_react63.default.createElement(
6393
+ "div",
6376
6394
  {
6377
- ref: panelGroupRef,
6378
- id: EDITOR_PANEL_GROUP_ID,
6379
- direction: "horizontal",
6380
- autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
6381
- style: { flex: "1" }
6382
- },
6383
- hasLeftSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
6384
- import_react_resizable_panels.Panel,
6385
- {
6386
- id: LEFT_SIDEBAR_ID,
6387
- order: 1,
6388
- ref: leftSidebarRef,
6389
- defaultSize: leftSidebarPercentage,
6390
- minSize: leftSidebarPercentage,
6391
- ...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
6392
- collapsible: true,
6393
- style: {
6394
- display: "flex",
6395
- flexDirection: "row"
6396
- }
6397
- },
6398
- leftPanelContent
6399
- ), /* @__PURE__ */ import_react63.default.createElement(
6400
- import_react_resizable_panels.PanelResizeHandle,
6401
- {
6402
- style: {
6403
- cursor: "col-resize",
6404
- width: "1px",
6405
- height: "100%",
6406
- backgroundColor: theme.colors.divider
6407
- }
6395
+ id,
6396
+ className,
6397
+ style: {
6398
+ backgroundColor: theme.colors.canvas.background,
6399
+ display: "flex",
6400
+ flexDirection: "row",
6401
+ ...style3
6408
6402
  }
6409
- )),
6403
+ },
6410
6404
  /* @__PURE__ */ import_react63.default.createElement(
6411
- import_react_resizable_panels.Panel,
6405
+ import_react_resizable_panels.PanelGroup,
6412
6406
  {
6413
- id: CONTENT_AREA_ID,
6414
- order: 2,
6415
- minSize: 10,
6416
- style: {
6417
- display: "flex",
6418
- flexDirection: "row"
6419
- }
6407
+ ref: panelGroupRef,
6408
+ id: EDITOR_PANEL_GROUP_ID,
6409
+ direction: "horizontal",
6410
+ autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
6411
+ style: { flex: "1" }
6420
6412
  },
6421
- centerPanelContent
6422
- ),
6423
- hasRightSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
6424
- import_react_resizable_panels.PanelResizeHandle,
6425
- {
6426
- style: {
6427
- cursor: "col-resize",
6428
- width: "1px",
6429
- height: "100%",
6430
- backgroundColor: theme.colors.divider
6413
+ hasLeftSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
6414
+ import_react_resizable_panels.Panel,
6415
+ {
6416
+ id: LEFT_SIDEBAR_ID,
6417
+ order: 1,
6418
+ ref: leftSidebarRef,
6419
+ defaultSize: leftSidebarPercentage,
6420
+ minSize: leftSidebarMinPercentage ?? leftSidebarPercentage,
6421
+ ...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
6422
+ collapsible: true,
6423
+ style: {
6424
+ display: "flex",
6425
+ flexDirection: "row"
6426
+ }
6427
+ },
6428
+ leftPanelContent
6429
+ ), /* @__PURE__ */ import_react63.default.createElement(
6430
+ import_react_resizable_panels.PanelResizeHandle,
6431
+ {
6432
+ style: {
6433
+ cursor: "col-resize",
6434
+ width: "1px",
6435
+ height: "100%",
6436
+ backgroundColor: theme.colors.divider
6437
+ }
6431
6438
  }
6432
- }
6433
- ), /* @__PURE__ */ import_react63.default.createElement(
6434
- import_react_resizable_panels.Panel,
6435
- {
6436
- id: RIGHT_SIDEBAR_ID,
6437
- order: 3,
6438
- ref: rightSidebarRef,
6439
- minSize: rightSidebarPercentage,
6440
- defaultSize: rightSidebarPercentage,
6441
- collapsible: true,
6442
- style: {
6443
- display: "flex",
6444
- flexDirection: "row"
6439
+ )),
6440
+ /* @__PURE__ */ import_react63.default.createElement(
6441
+ import_react_resizable_panels.Panel,
6442
+ {
6443
+ id: CONTENT_AREA_ID,
6444
+ order: 2,
6445
+ defaultSize: centerPanelPercentage,
6446
+ minSize: 10,
6447
+ style: {
6448
+ display: "flex",
6449
+ flexDirection: "row"
6450
+ }
6451
+ },
6452
+ centerPanelContent
6453
+ ),
6454
+ hasRightSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
6455
+ import_react_resizable_panels.PanelResizeHandle,
6456
+ {
6457
+ style: {
6458
+ cursor: "col-resize",
6459
+ width: "1px",
6460
+ height: "100%",
6461
+ backgroundColor: theme.colors.divider
6462
+ }
6445
6463
  }
6446
- },
6447
- rightPanelContent
6448
- ))
6449
- ));
6464
+ ), /* @__PURE__ */ import_react63.default.createElement(
6465
+ import_react_resizable_panels.Panel,
6466
+ {
6467
+ id: RIGHT_SIDEBAR_ID,
6468
+ order: 3,
6469
+ ref: rightSidebarRef,
6470
+ minSize: rightSidebarMinPercentage ?? rightSidebarPercentage,
6471
+ defaultSize: rightSidebarPercentage,
6472
+ collapsible: true,
6473
+ style: {
6474
+ display: "flex",
6475
+ flexDirection: "row"
6476
+ }
6477
+ },
6478
+ rightPanelContent
6479
+ ))
6480
+ )
6481
+ );
6450
6482
  });
6451
6483
 
6452
6484
  // src/hooks/usePlatform.ts