@x-plat/design-system 0.7.2 → 0.8.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.
Files changed (52) hide show
  1. package/dist/components/AutoResizeTextArea/index.css +2 -0
  2. package/dist/components/Button/index.css +2 -1
  3. package/dist/components/Button/index.d.cts +6 -0
  4. package/dist/components/Button/index.d.ts +6 -0
  5. package/dist/components/Chart/index.cjs +8 -1
  6. package/dist/components/Chart/index.js +8 -1
  7. package/dist/components/ChatInput/index.css +4 -0
  8. package/dist/components/DatePicker/index.cjs +388 -400
  9. package/dist/components/DatePicker/index.css +7 -1
  10. package/dist/components/DatePicker/index.js +375 -387
  11. package/dist/components/Dropdown/index.cjs +21 -26
  12. package/dist/components/Dropdown/index.js +20 -25
  13. package/dist/components/Input/index.css +2 -0
  14. package/dist/components/Link/index.cjs +64 -0
  15. package/dist/components/Link/index.css +25 -0
  16. package/dist/components/Link/index.d.cts +27 -0
  17. package/dist/components/Link/index.d.ts +27 -0
  18. package/dist/components/Link/index.js +37 -0
  19. package/dist/components/LinkButton/index.cjs +64 -0
  20. package/dist/components/LinkButton/index.css +106 -0
  21. package/dist/components/LinkButton/index.d.cts +28 -0
  22. package/dist/components/LinkButton/index.d.ts +28 -0
  23. package/dist/components/LinkButton/index.js +37 -0
  24. package/dist/components/Modal/index.cjs +18 -28
  25. package/dist/components/Modal/index.css +3 -0
  26. package/dist/components/Modal/index.js +17 -27
  27. package/dist/components/PopOver/index.cjs +18 -23
  28. package/dist/components/PopOver/index.js +17 -22
  29. package/dist/components/Select/index.cjs +337 -342
  30. package/dist/components/Select/index.js +336 -341
  31. package/dist/components/TextArea/index.css +2 -0
  32. package/dist/components/Tooltip/index.cjs +92 -52
  33. package/dist/components/Tooltip/index.d.cts +10 -2
  34. package/dist/components/Tooltip/index.d.ts +10 -2
  35. package/dist/components/Tooltip/index.js +91 -51
  36. package/dist/components/index.cjs +578 -488
  37. package/dist/components/index.css +39 -1
  38. package/dist/components/index.d.cts +2 -0
  39. package/dist/components/index.d.ts +2 -0
  40. package/dist/components/index.js +527 -439
  41. package/dist/index.cjs +602 -512
  42. package/dist/index.css +39 -1
  43. package/dist/index.d.cts +2 -0
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.js +549 -461
  46. package/guidelines/AGENT_PROMPT.md +2 -2
  47. package/guidelines/Guidelines.md +2 -1
  48. package/guidelines/components/button.md +54 -0
  49. package/guidelines/components/card.md +15 -19
  50. package/guidelines/components/link.md +35 -0
  51. package/guidelines/components/overlay.md +30 -1
  52. package/package.json +1 -1
@@ -21,6 +21,8 @@
21
21
  .lib-xplat-auto-resize-textarea-wrapper .lib-xplat-auto-resize-textarea:focus-within {
22
22
  border-color: var(--semantic-interaction-focus-ring);
23
23
  box-shadow: 0 0 0 2px var(--semantic-interaction-overlay-10);
24
+ outline: 2px solid transparent;
25
+ outline-offset: 2px;
24
26
  }
25
27
  .lib-xplat-auto-resize-textarea-wrapper .lib-xplat-auto-resize-textarea:has(> textarea:not(:placeholder-shown)):not(:focus-within) {
26
28
  border-color: var(--semantic-border-tertiary);
@@ -39,7 +39,8 @@
39
39
  font-weight: var(--semantic-typo-label-1-m-weight);
40
40
  letter-spacing: var(--semantic-typo-label-1-m-ls);
41
41
  }
42
- .lib-xplat-button:disabled {
42
+ .lib-xplat-button:disabled,
43
+ .lib-xplat-button.disabled {
43
44
  cursor: not-allowed;
44
45
  background-color: var(--semantic-surface-neutral-disabled) !important;
45
46
  border-color: var(--semantic-surface-neutral-disabled) !important;
@@ -9,6 +9,12 @@ interface ButtonProps extends Omit<ButtonAttributes, "className"> {
9
9
  type?: ButtonType;
10
10
  size?: ButtonSize;
11
11
  }
12
+ /**
13
+ * 버튼은 `<button>` 으로만 렌더된다. 누르면 **무언가 일어나는** 자리에 쓴다.
14
+ *
15
+ * 이동하는 자리는 버튼이 아니라 링크다. 버튼처럼 보여야 하면 `LinkButton`,
16
+ * 본문 속 텍스트 링크는 `Link` 를 쓴다.
17
+ */
12
18
  declare const Button: {
13
19
  (props: ButtonProps): react_jsx_runtime.JSX.Element;
14
20
  displayName: string;
@@ -9,6 +9,12 @@ interface ButtonProps extends Omit<ButtonAttributes, "className"> {
9
9
  type?: ButtonType;
10
10
  size?: ButtonSize;
11
11
  }
12
+ /**
13
+ * 버튼은 `<button>` 으로만 렌더된다. 누르면 **무언가 일어나는** 자리에 쓴다.
14
+ *
15
+ * 이동하는 자리는 버튼이 아니라 링크다. 버튼처럼 보여야 하면 `LinkButton`,
16
+ * 본문 속 텍스트 링크는 `Link` 를 쓴다.
17
+ */
12
18
  declare const Button: {
13
19
  (props: ButtonProps): react_jsx_runtime.JSX.Element;
14
20
  displayName: string;
@@ -172,9 +172,16 @@ var useChartTooltip = (enabled) => {
172
172
  }, []);
173
173
  return { tooltip, show, hide, move, containerRef };
174
174
  };
175
+ var formatTick = (value, maxVal) => {
176
+ const step = maxVal / 4;
177
+ if (!Number.isFinite(step) || step <= 0) return "0";
178
+ const decimals = step >= 1 ? 0 : Math.min(4, Math.ceil(-Math.log10(step)));
179
+ const fixed = value.toFixed(decimals);
180
+ return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
181
+ };
175
182
  var GridLines = import_react.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
176
183
  const y = PADDING.top + (1 - ratio) * chartH;
177
- const val = Math.round(maxVal * ratio);
184
+ const val = formatTick(maxVal * ratio, maxVal);
178
185
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
179
186
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
180
187
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
@@ -136,9 +136,16 @@ var useChartTooltip = (enabled) => {
136
136
  }, []);
137
137
  return { tooltip, show, hide, move, containerRef };
138
138
  };
139
+ var formatTick = (value, maxVal) => {
140
+ const step = maxVal / 4;
141
+ if (!Number.isFinite(step) || step <= 0) return "0";
142
+ const decimals = step >= 1 ? 0 : Math.min(4, Math.ceil(-Math.log10(step)));
143
+ const fixed = value.toFixed(decimals);
144
+ return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
145
+ };
139
146
  var GridLines = React.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx(Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
140
147
  const y = PADDING.top + (1 - ratio) * chartH;
141
- const val = Math.round(maxVal * ratio);
148
+ const val = formatTick(maxVal * ratio, maxVal);
142
149
  return /* @__PURE__ */ jsxs("g", { children: [
143
150
  /* @__PURE__ */ jsx("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
144
151
  /* @__PURE__ */ jsx("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
@@ -99,6 +99,8 @@
99
99
  .lib-xplat-auto-resize-textarea-wrapper .lib-xplat-auto-resize-textarea:focus-within {
100
100
  border-color: var(--semantic-interaction-focus-ring);
101
101
  box-shadow: 0 0 0 2px var(--semantic-interaction-overlay-10);
102
+ outline: 2px solid transparent;
103
+ outline-offset: 2px;
102
104
  }
103
105
  .lib-xplat-auto-resize-textarea-wrapper .lib-xplat-auto-resize-textarea:has(> textarea:not(:placeholder-shown)):not(:focus-within) {
104
106
  border-color: var(--semantic-border-tertiary);
@@ -144,6 +146,8 @@
144
146
  .lib-xplat-chat-input:focus-within {
145
147
  border-color: var(--semantic-interaction-focus-ring);
146
148
  box-shadow: 0 0 0 2px var(--semantic-interaction-overlay-10);
149
+ outline: 2px solid transparent;
150
+ outline-offset: 2px;
147
151
  }
148
152
  .lib-xplat-chat-input.disabled {
149
153
  background-color: var(--semantic-surface-neutral-secondary);