@landtrustinc/design-system 1.2.3 → 1.2.4

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/README.md CHANGED
@@ -4,6 +4,41 @@ Design system components for LandTrust applications.
4
4
 
5
5
  [Storybook](https://662e7f123091ccbb08e021fe-lpduyfvtud.chromatic.com)
6
6
 
7
+ ## 📦 Installation
8
+
9
+ ```bash
10
+ npm install @landtrustinc/design-system react-loading-skeleton
11
+ ```
12
+
13
+ ## 🚀 Setup
14
+
15
+ ### Required CSS Imports
16
+
17
+ ⚠️ **Important:** You must import the following CSS files in your app's entry point (e.g., `_app.js` or `_app.tsx` for Next.js):
18
+
19
+ ```tsx
20
+ // pages/_app.tsx (Next.js) or main entry file
21
+ import '@landtrustinc/design-system/dist/variables.css';
22
+ import 'react-loading-skeleton/dist/skeleton.css';
23
+ ```
24
+
25
+ **Why?**
26
+
27
+ - The design system uses `react-loading-skeleton` for loading states in some components
28
+ - Next.js and other frameworks require global CSS to be imported in the app entry point, not from npm packages
29
+ - This prevents build errors and ensures proper styling
30
+
31
+ ### Next.js Configuration
32
+
33
+ If you're using Next.js, make sure these imports are at the top of your `pages/_app.tsx` or `pages/_app.js`:
34
+
35
+ ```tsx
36
+ import 'react-loading-skeleton/dist/skeleton.css';
37
+ import '@landtrustinc/design-system/dist/variables.css';
38
+
39
+ // ... rest of your imports
40
+ ```
41
+
7
42
  ## 📖 Usage
8
43
 
9
44
  ```tsx
@@ -19,7 +54,7 @@ function App() {
19
54
  }
20
55
  ```
21
56
 
22
- ## Styling
57
+ ## 🎨 Styling
23
58
 
24
59
  Following Figma styles try to use tokens from variables.css. Avoid using colors from the theme (these are legacy).
25
60
 
package/dist/index.d.ts CHANGED
@@ -1327,6 +1327,10 @@ type FeatureListItemProps = {
1327
1327
  * Optional subtitle/description text
1328
1328
  */
1329
1329
  subtitle?: React__default.ReactNode;
1330
+ /**
1331
+ * Loading state - shows skeleton when true
1332
+ */
1333
+ isLoading?: boolean;
1330
1334
  /**
1331
1335
  * Additional CSS class names
1332
1336
  */
package/dist/index.js CHANGED
@@ -5371,6 +5371,7 @@ var ChatWidget = ({
5371
5371
  var ChatWidget_default = ChatWidget;
5372
5372
 
5373
5373
  // src/FeatureList/components/FeatureListItem.tsx
5374
+ var import_react_loading_skeleton = __toESM(require("react-loading-skeleton"));
5374
5375
  var import_jsx_runtime214 = require("@emotion/react/jsx-runtime");
5375
5376
  var FeatureListItem = ({
5376
5377
  iconVariant,
@@ -5378,9 +5379,41 @@ var FeatureListItem = ({
5378
5379
  subtitle,
5379
5380
  iconSize = "large",
5380
5381
  iconColor,
5382
+ isLoading = false,
5381
5383
  className,
5382
5384
  ...rest
5383
5385
  }) => {
5386
+ const iconDimensions = IconSizeMap[iconSize];
5387
+ if (isLoading) {
5388
+ return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Box_default, { display: "flex", flexDirection: "column", color: "var(--text-primary)", children: [
5389
+ /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
5390
+ Box_default,
5391
+ {
5392
+ display: "flex",
5393
+ alignItems: "center",
5394
+ gap: "var(--spacing-2)",
5395
+ className,
5396
+ ...rest,
5397
+ children: [
5398
+ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
5399
+ import_react_loading_skeleton.default,
5400
+ {
5401
+ circle: true,
5402
+ width: iconDimensions.width,
5403
+ height: iconDimensions.height,
5404
+ borderRadius: 4
5405
+ }
5406
+ ),
5407
+ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_react_loading_skeleton.default, { width: 120, height: 16, borderRadius: 4 })
5408
+ ]
5409
+ }
5410
+ ),
5411
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-3)", children: [
5412
+ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Box_default, { width: "var(--spacing-6)", children: "\xA0" }),
5413
+ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_react_loading_skeleton.default, { width: 150, height: 14, borderRadius: 4 })
5414
+ ] })
5415
+ ] });
5416
+ }
5384
5417
  return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Box_default, { display: "flex", flexDirection: "column", color: "var(--text-primary)", children: [
5385
5418
  /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
5386
5419
  Box_default,