@crisp-ui-kit/crisp 0.10.0 → 0.10.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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./middletruncate"), exports);
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MiddleTruncate = MiddleTruncate;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_middle_truncate_1 = require("@seed-design/react-middle-truncate");
7
+ /**
8
+ * Truncates in the MIDDLE rather than the end, so the part that identifies a
9
+ * string survives: `annual-report-fi…-v7-final.pdf` keeps its extension, and a
10
+ * record title keeps its suffix. An end-truncating `text-overflow: ellipsis`
11
+ * throws exactly that away.
12
+ *
13
+ * Measurement is seed-design's — it re-measures on resize with a
14
+ * `ResizeObserver` and only touches the DOM inside an effect, so it renders the
15
+ * full string on the server and narrows it on hydration.
16
+ *
17
+ * It owns no pixels, in crisp or in seed: there is no recipe here because
18
+ * seed-design ships no stylesheet for it either. It inherits the type around it
19
+ * by design, which is what makes it usable inside a table cell.
20
+ */
21
+ function MiddleTruncate({ children, title, ...props }) {
22
+ return ((0, jsx_runtime_1.jsx)(react_middle_truncate_1.MiddleTruncate, { ...props, title: title ?? children, children: children }));
23
+ }
package/dist/cjs/index.js CHANGED
@@ -45,6 +45,7 @@ __exportStar(require("./components/input"), exports);
45
45
  __exportStar(require("./components/kbd"), exports);
46
46
  __exportStar(require("./components/linechart"), exports);
47
47
  __exportStar(require("./components/menu"), exports);
48
+ __exportStar(require("./components/middletruncate"), exports);
48
49
  __exportStar(require("./components/multiselect"), exports);
49
50
  __exportStar(require("./components/popover"), exports);
50
51
  __exportStar(require("./components/progress"), exports);
@@ -0,0 +1 @@
1
+ export * from "./middletruncate.js";
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { MiddleTruncate as SeedMiddleTruncate, } from "@seed-design/react-middle-truncate";
4
+ /**
5
+ * Truncates in the MIDDLE rather than the end, so the part that identifies a
6
+ * string survives: `annual-report-fi…-v7-final.pdf` keeps its extension, and a
7
+ * record title keeps its suffix. An end-truncating `text-overflow: ellipsis`
8
+ * throws exactly that away.
9
+ *
10
+ * Measurement is seed-design's — it re-measures on resize with a
11
+ * `ResizeObserver` and only touches the DOM inside an effect, so it renders the
12
+ * full string on the server and narrows it on hydration.
13
+ *
14
+ * It owns no pixels, in crisp or in seed: there is no recipe here because
15
+ * seed-design ships no stylesheet for it either. It inherits the type around it
16
+ * by design, which is what makes it usable inside a table cell.
17
+ */
18
+ export function MiddleTruncate({ children, title, ...props }) {
19
+ return (_jsx(SeedMiddleTruncate, { ...props, title: title ?? children, children: children }));
20
+ }
package/dist/esm/index.js CHANGED
@@ -29,6 +29,7 @@ export * from "./components/input/index.js";
29
29
  export * from "./components/kbd/index.js";
30
30
  export * from "./components/linechart/index.js";
31
31
  export * from "./components/menu/index.js";
32
+ export * from "./components/middletruncate/index.js";
32
33
  export * from "./components/multiselect/index.js";
33
34
  export * from "./components/popover/index.js";
34
35
  export * from "./components/progress/index.js";
@@ -0,0 +1 @@
1
+ export * from "./middletruncate";
@@ -0,0 +1,20 @@
1
+ import { type MiddleTruncateProps as SeedProps } from "@seed-design/react-middle-truncate";
2
+ export type MiddleTruncateProps = Omit<SeedProps, "asChild"> & {
3
+ /** The full string. Kept whole in the DOM's accessible name via `title`. */
4
+ children: string;
5
+ };
6
+ /**
7
+ * Truncates in the MIDDLE rather than the end, so the part that identifies a
8
+ * string survives: `annual-report-fi…-v7-final.pdf` keeps its extension, and a
9
+ * record title keeps its suffix. An end-truncating `text-overflow: ellipsis`
10
+ * throws exactly that away.
11
+ *
12
+ * Measurement is seed-design's — it re-measures on resize with a
13
+ * `ResizeObserver` and only touches the DOM inside an effect, so it renders the
14
+ * full string on the server and narrows it on hydration.
15
+ *
16
+ * It owns no pixels, in crisp or in seed: there is no recipe here because
17
+ * seed-design ships no stylesheet for it either. It inherits the type around it
18
+ * by design, which is what makes it usable inside a table cell.
19
+ */
20
+ export declare function MiddleTruncate({ children, title, ...props }: MiddleTruncateProps): import("react").JSX.Element;
@@ -25,6 +25,7 @@ export * from "./components/input";
25
25
  export * from "./components/kbd";
26
26
  export * from "./components/linechart";
27
27
  export * from "./components/menu";
28
+ export * from "./components/middletruncate";
28
29
  export * from "./components/multiselect";
29
30
  export * from "./components/popover";
30
31
  export * from "./components/progress";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crisp-ui-kit/crisp",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "A lean React design system, measured pixel-for-pixel from Attio.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -167,6 +167,11 @@
167
167
  "import": "./dist/esm/components/menu/index.js",
168
168
  "require": "./dist/cjs/components/menu/index.js"
169
169
  },
170
+ "./middletruncate": {
171
+ "types": "./dist/types/components/middletruncate/index.d.ts",
172
+ "import": "./dist/esm/components/middletruncate/index.js",
173
+ "require": "./dist/cjs/components/middletruncate/index.js"
174
+ },
170
175
  "./multiselect": {
171
176
  "types": "./dist/types/components/multiselect/index.d.ts",
172
177
  "import": "./dist/esm/components/multiselect/index.js",
@@ -423,6 +428,7 @@
423
428
  "@seed-design/dom-utils": "^2.1.0",
424
429
  "@seed-design/react-date-picker": "1.2.0",
425
430
  "@seed-design/react-file-upload": "1.0.1",
431
+ "@seed-design/react-middle-truncate": "1.0.1",
426
432
  "@seed-design/react-slider": "2.0.1",
427
433
  "@seed-design/react-time-picker": "1.0.0",
428
434
  "@zag-js/combobox": "^1.43.3",