@leta-io/components 0.4.0 → 0.4.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.
- package/dist/index.d.ts +12 -9
- package/dist/index.js +30 -15
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -4447,7 +4447,7 @@ declare const BulkActionsToolbar: React.ForwardRefExoticComponent<BulkActionsToo
|
|
|
4447
4447
|
|
|
4448
4448
|
/**
|
|
4449
4449
|
* - `search-create` — search + filter buttons (Created / Filter / Sort By) on the
|
|
4450
|
-
* left, primary CTAs (
|
|
4450
|
+
* left, primary CTAs (Create Order / Import-Export) on the right.
|
|
4451
4451
|
* - `search-column` — the same search + filters, with a data count + an
|
|
4452
4452
|
* Auto-refresh switch + Columns control on the right.
|
|
4453
4453
|
* - `filters-column` — a Top Filter Section on the left, data count +
|
|
@@ -4481,10 +4481,10 @@ interface TableDataControlProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
4481
4481
|
searchSection?: React.ReactNode;
|
|
4482
4482
|
/** Left section for `filters-column` — overrides the default Top Filter Section. */
|
|
4483
4483
|
filters?: React.ReactNode;
|
|
4484
|
-
/** Right section for `search-create` — overrides the default
|
|
4484
|
+
/** Right section for `search-create` — overrides the default Create Order + Import/Export. */
|
|
4485
4485
|
ctas?: React.ReactNode;
|
|
4486
4486
|
/**
|
|
4487
|
-
* Show the Primary "
|
|
4487
|
+
* Show the Primary "Create Order" button (labelled "Add Order" before 2026-10-14) in the default `search-create` CTAs.
|
|
4488
4488
|
* Default true; set `false` for the Empty State toolbar, where the primary
|
|
4489
4489
|
* Add Order CTA lives beside the illustration instead (per Figma
|
|
4490
4490
|
* `4368:154614`). Ignored when `ctas` is overridden.
|
|
@@ -4559,7 +4559,7 @@ interface TableContainerProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
4559
4559
|
* **Centred automatically** (see `empty`) — pass the bare Empty State.
|
|
4560
4560
|
*/
|
|
4561
4561
|
noResults?: React.ReactNode;
|
|
4562
|
-
/** Fired by the default Empty State's Add Order
|
|
4562
|
+
/** Fired by the default Empty State's Create Order CTA (labelled "Add Order" before 2026-10-14). */
|
|
4563
4563
|
onAddOrder?: () => void;
|
|
4564
4564
|
/**
|
|
4565
4565
|
* Fill the available height of a flex-column parent (`flex: 1`): the table
|
|
@@ -4816,17 +4816,20 @@ interface AlertDialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
|
|
|
4816
4816
|
/**
|
|
4817
4817
|
* Footer leading slot — content pinned far left, opposite the actions.
|
|
4818
4818
|
*
|
|
4819
|
-
*
|
|
4820
|
-
*
|
|
4821
|
-
*
|
|
4822
|
-
* the Close / Confirm pair. Switches the footer to `tertiary-action`, which is
|
|
4823
|
-
* the variant that has a leading region.
|
|
4819
|
+
* Content pinned far left, opposite the Close / Confirm pair, for something
|
|
4820
|
+
* that isn't itself an action (e.g. an opt-out checkbox). Switches the footer to
|
|
4821
|
+
* `tertiary-action`, which is the variant that has a leading region.
|
|
4824
4822
|
*/
|
|
4825
4823
|
footerLeading?: React.ReactNode;
|
|
4826
4824
|
/** Cancel/dismiss action label. Default "Close". */
|
|
4827
4825
|
cancelLabel?: string;
|
|
4828
4826
|
/** Confirm action label. Default "Confirm". */
|
|
4829
4827
|
confirmLabel?: string;
|
|
4828
|
+
/**
|
|
4829
|
+
* Leading icon on the confirm button, e.g. `Check` for Change Driver
|
|
4830
|
+
* (Figma `1892:370929`: Primary / Leading Icon). Default none.
|
|
4831
|
+
*/
|
|
4832
|
+
confirmIconLeft?: IconName;
|
|
4830
4833
|
/**
|
|
4831
4834
|
* Style the confirm button as destructive (`Button variant="destructive"`,
|
|
4832
4835
|
* red) instead of the default primary. Doc 3 §5: "primary styled to the
|
package/dist/index.js
CHANGED
|
@@ -7526,7 +7526,7 @@ var TableDataControl = /* @__PURE__ */ React59.forwardRef(
|
|
|
7526
7526
|
}, ref) {
|
|
7527
7527
|
const left = variant === "filters-column" ? filters ?? /* @__PURE__ */ jsx59(TopFilterSection, { filters: DEFAULT_FILTERS }) : searchSection ?? /* @__PURE__ */ jsx59(SearchAndFilter, { placeholder: searchPlaceholder, searchValue, onSearchChange, onSearchClear, filterCount, createdLabel, onCreated: onCreatedClick, onFilter: onFilterClick, onSort: onSortClick });
|
|
7528
7528
|
const right = variant === "search-create" ? ctas ?? /* @__PURE__ */ jsxs42("div", { style: GROUP, children: [
|
|
7529
|
-
showAddOrder && /* @__PURE__ */ jsx59(Button, { variant: "primary", size: "medium", iconLeft: "Add", onClick: onAddOrderClick, children: "
|
|
7529
|
+
showAddOrder && /* @__PURE__ */ jsx59(Button, { variant: "primary", size: "medium", iconLeft: "Add", onClick: onAddOrderClick, children: "Create Order" }),
|
|
7530
7530
|
/* @__PURE__ */ jsx59(Button, { variant: "secondary", size: "medium", iconRight: "Chevron-Down", onClick: onImportExportClick, children: "Import/Export" })
|
|
7531
7531
|
] }) : !showColumnControl ? null : columnControl ?? /* @__PURE__ */ jsx59(ColumnControl, { dataCount, showCount: showDataCount, onColumns: onColumnsClick, autoRefresh, onAutoRefreshChange });
|
|
7532
7532
|
return /* @__PURE__ */ jsxs42(
|
|
@@ -7707,7 +7707,7 @@ var TableContainer = /* @__PURE__ */ React61.forwardRef(
|
|
|
7707
7707
|
] });
|
|
7708
7708
|
const centered = (node, minHeight) => /* @__PURE__ */ jsx61("div", { style: { minHeight, ...fillHeight ? { flex: 1 } : null, display: "flex", alignItems: "center", justifyContent: "center" }, children: node });
|
|
7709
7709
|
const body = isEmpty ? centered(
|
|
7710
|
-
empty ?? /* @__PURE__ */ jsx61(EmptyState, { type: "no-orders", size: "desktop", children: /* @__PURE__ */ jsx61(Button, { variant: "primary", size: "medium", iconLeft: "Add", onClick: onAddOrder, children: "
|
|
7710
|
+
empty ?? /* @__PURE__ */ jsx61(EmptyState, { type: "no-orders", size: "desktop", children: /* @__PURE__ */ jsx61(Button, { variant: "primary", size: "medium", iconLeft: "Add", onClick: onAddOrder, children: "Create Order" }) }),
|
|
7711
7711
|
624
|
|
7712
7712
|
) : isNoResults ? centered(
|
|
7713
7713
|
noResults ?? /* @__PURE__ */ jsx61(EmptyState, { type: "no-results", size: "desktop", description: "Try adjusting your filters and date." }),
|
|
@@ -8636,10 +8636,12 @@ var ConfigurationCardRow = /* @__PURE__ */ React67.forwardRef(
|
|
|
8636
8636
|
alignItems: "center",
|
|
8637
8637
|
width: "100%",
|
|
8638
8638
|
boxSizing: "border-box",
|
|
8639
|
-
padding
|
|
8639
|
+
// Real border, padding trimmed by the stroke so the size is unchanged — an
|
|
8640
|
+
// inset box-shadow in a semi-transparent colour renders visibly heavier.
|
|
8641
|
+
padding: "calc(var(--padding-20px) - var(--stroke-xs))",
|
|
8640
8642
|
borderRadius: "var(--rounding-xl)",
|
|
8641
8643
|
backgroundColor: "var(--surface-neutral-bg-default)",
|
|
8642
|
-
|
|
8644
|
+
border: "var(--stroke-xs) solid var(--border-neutral-default)",
|
|
8643
8645
|
...style
|
|
8644
8646
|
},
|
|
8645
8647
|
...rest,
|
|
@@ -8698,10 +8700,11 @@ var ConfigurationCard = /* @__PURE__ */ React67.forwardRef(
|
|
|
8698
8700
|
gap: 0,
|
|
8699
8701
|
width: "100%",
|
|
8700
8702
|
boxSizing: "border-box",
|
|
8701
|
-
|
|
8703
|
+
// Real border (see the card above); padding trimmed by the stroke.
|
|
8704
|
+
padding: "calc(var(--padding-20px) - var(--stroke-xs))",
|
|
8702
8705
|
borderRadius: "var(--rounding-xxl)",
|
|
8703
8706
|
backgroundColor: "var(--surface-neutral-bg-subtle)",
|
|
8704
|
-
|
|
8707
|
+
border: "var(--stroke-xs) solid var(--border-neutral-default)",
|
|
8705
8708
|
// Dimmed as a whole (Toggle included) so the card reads as unavailable
|
|
8706
8709
|
// rather than merely un-toggled. Literal 0.6 — `--opacity-60` resolves
|
|
8707
8710
|
// to the buggy `60px` (same workaround as WizardTab / SelectionControl).
|
|
@@ -9944,10 +9947,12 @@ var DesktopMetricCard = /* @__PURE__ */ React81.forwardRef(
|
|
|
9944
9947
|
justifyContent: "center",
|
|
9945
9948
|
width: "100%",
|
|
9946
9949
|
boxSizing: "border-box",
|
|
9947
|
-
padding
|
|
9950
|
+
// Real border, padding trimmed by the stroke so the size is unchanged — an
|
|
9951
|
+
// inset box-shadow in a semi-transparent colour renders visibly heavier.
|
|
9952
|
+
padding: "calc(var(--padding-20px) - var(--stroke-xs))",
|
|
9948
9953
|
borderRadius: "var(--rounding-xl)",
|
|
9949
9954
|
backgroundColor: "var(--surface-neutral-card-idle)",
|
|
9950
|
-
|
|
9955
|
+
border: "var(--stroke-xs) solid var(--border-neutral-card-idle)",
|
|
9951
9956
|
...style
|
|
9952
9957
|
},
|
|
9953
9958
|
...rest,
|
|
@@ -10049,13 +10054,17 @@ var OptionCard = /* @__PURE__ */ React82.forwardRef(
|
|
|
10049
10054
|
gap: "var(--spacing-16px)",
|
|
10050
10055
|
width: "100%",
|
|
10051
10056
|
boxSizing: "border-box",
|
|
10052
|
-
|
|
10057
|
+
// Real border whose width follows the state (1px, 1.5px when active), with
|
|
10058
|
+
// the padding trimmed by the same width so the card never changes size. An
|
|
10059
|
+
// inset box-shadow in a semi-transparent colour renders visibly heavier.
|
|
10060
|
+
padding: `calc(var(--padding-16px) - ${state === "active" ? "var(--stroke-sm)" : "var(--stroke-xs)"})`,
|
|
10053
10061
|
borderRadius: "var(--rounding-xl)",
|
|
10054
10062
|
backgroundColor: SURFACE3[state],
|
|
10055
|
-
|
|
10063
|
+
border: `${state === "active" ? "var(--stroke-sm)" : "var(--stroke-xs)"} solid ${BORDER3[state]}`,
|
|
10064
|
+
boxShadow: SHADOW[state] || void 0,
|
|
10056
10065
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
10057
10066
|
opacity: disabled ? 0.6 : 1,
|
|
10058
|
-
transition: "background-color 120ms ease, box-shadow 120ms ease",
|
|
10067
|
+
transition: "background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease",
|
|
10059
10068
|
// Forced focus state renders the ring statically; real keyboard focus is
|
|
10060
10069
|
// handled by the `.leta-option-card:has(:focus-visible)` CSS rule.
|
|
10061
10070
|
...state === "focus" ? {
|
|
@@ -12984,8 +12993,10 @@ var ListSection = /* @__PURE__ */ React101.forwardRef(
|
|
|
12984
12993
|
width: "100%",
|
|
12985
12994
|
backgroundColor: "var(--surface-neutral-bg-default)",
|
|
12986
12995
|
borderRadius: "var(--rounding-xl)",
|
|
12987
|
-
|
|
12988
|
-
|
|
12996
|
+
// Real border, padding trimmed by the stroke so the size is unchanged — an
|
|
12997
|
+
// inset box-shadow in a semi-transparent colour renders visibly heavier.
|
|
12998
|
+
border: "var(--stroke-xs) solid var(--border-neutral-default)",
|
|
12999
|
+
padding: "calc(var(--padding-20px) - var(--stroke-xs))",
|
|
12989
13000
|
...style
|
|
12990
13001
|
},
|
|
12991
13002
|
...rest,
|
|
@@ -13075,6 +13086,7 @@ var AlertDialog = /* @__PURE__ */ React103.forwardRef(
|
|
|
13075
13086
|
footerLeading,
|
|
13076
13087
|
cancelLabel = "Close",
|
|
13077
13088
|
confirmLabel = "Confirm",
|
|
13089
|
+
confirmIconLeft,
|
|
13078
13090
|
destructive = false,
|
|
13079
13091
|
onCancel,
|
|
13080
13092
|
onConfirm,
|
|
@@ -13110,7 +13122,7 @@ var AlertDialog = /* @__PURE__ */ React103.forwardRef(
|
|
|
13110
13122
|
leading: footerLeading,
|
|
13111
13123
|
children: [
|
|
13112
13124
|
/* @__PURE__ */ jsx98(Button, { variant: "secondary", size: "medium", onClick: onCancel, children: cancelLabel }),
|
|
13113
|
-
/* @__PURE__ */ jsx98(Button, { variant: destructive ? "destructive" : "primary", size: "medium", onClick: onConfirm, children: confirmLabel })
|
|
13125
|
+
/* @__PURE__ */ jsx98(Button, { variant: destructive ? "destructive" : "primary", size: "medium", iconLeft: confirmIconLeft, onClick: onConfirm, children: confirmLabel })
|
|
13114
13126
|
]
|
|
13115
13127
|
}
|
|
13116
13128
|
),
|
|
@@ -13232,7 +13244,10 @@ function defaultBody(variant, imageSrc, signatureSrc) {
|
|
|
13232
13244
|
// Grey backdrop while the image loads (`--surface-neutral-bg-tertiary`
|
|
13233
13245
|
// is not a real token — it resolved to transparent).
|
|
13234
13246
|
backgroundColor: "var(--surface-neutral-bg-muted)",
|
|
13235
|
-
|
|
13247
|
+
// Real border inside the fixed 480×304 box (border-box), not an inset
|
|
13248
|
+
// shadow — a semi-transparent inset shadow renders visibly heavier.
|
|
13249
|
+
boxSizing: "border-box",
|
|
13250
|
+
border: "var(--stroke-xs) solid var(--border-neutral-default)"
|
|
13236
13251
|
}
|
|
13237
13252
|
}
|
|
13238
13253
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leta-io/components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "LETA React component library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"country-flag-icons": "^1.6.17",
|
|
29
29
|
"leaflet": "^1.9.4",
|
|
30
30
|
"lottie-web": "^5.12.2",
|
|
31
|
-
"@leta-io/icons": "0.4.
|
|
32
|
-
"@leta-io/design-tokens": "0.4.
|
|
31
|
+
"@leta-io/icons": "0.4.1",
|
|
32
|
+
"@leta-io/design-tokens": "0.4.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.0.0 || ^19.0.0",
|