@caratlogic/design-system 0.1.26 → 0.1.28
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/components/molecules/CompanyCard/CompanyCard.d.ts +9 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.d.ts.map +1 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.parts.d.ts +4 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.parts.d.ts.map +1 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.types.d.ts +32 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.types.d.ts.map +1 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.utils.d.ts +4 -0
- package/dist/components/molecules/CompanyCard/CompanyCard.utils.d.ts.map +1 -0
- package/dist/components/molecules/CompanyCard/index.d.ts +3 -0
- package/dist/components/molecules/CompanyCard/index.d.ts.map +1 -0
- package/dist/components/molecules/InvoiceComboBox/InvoiceComboBox.d.ts.map +1 -1
- package/dist/components/molecules/InvoiceComboBox/InvoiceComboBox.utils.d.ts +4 -0
- package/dist/components/molecules/InvoiceComboBox/InvoiceComboBox.utils.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/SegmentedControl.d.ts +7 -5
- package/dist/components/molecules/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/SegmentedControl.types.d.ts +11 -4
- package/dist/components/molecules/SegmentedControl/SegmentedControl.types.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/SegmentedControl.utils.d.ts +9 -0
- package/dist/components/molecules/SegmentedControl/SegmentedControl.utils.d.ts.map +1 -0
- package/dist/components/molecules/SegmentedControl/index.d.ts +1 -1
- package/dist/components/molecules/SegmentedControl/index.d.ts.map +1 -1
- package/dist/index.cjs.js +144 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +144 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CompanyCardProps } from './CompanyCard.types';
|
|
3
|
+
export type { CompanyCardProps, CompanyCardTaxNumber } from './CompanyCard.types';
|
|
4
|
+
/**
|
|
5
|
+
* A business contact at a glance: avatar + name, email / phone / tax number,
|
|
6
|
+
* then the address. Data-only — the app formats each value before passing it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function CompanyCard({ name, subtitle, email, phone, taxNumber, address, viewHref, viewLabel, title, icon, emptyLabel, className, }: CompanyCardProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=CompanyCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyCard.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CompanyCard/CompanyCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAElF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAA0B,EAC1B,KAAiB,EACjB,IAAmD,EACnD,UAA2B,EAC3B,SAAS,GACV,EAAE,gBAAgB,GAAG,YAAY,CAyDjC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CompanyCardFieldProps } from './CompanyCard.types';
|
|
3
|
+
export declare function CompanyCardField({ label, children, emptyLabel, className, }: CompanyCardFieldProps): ReactElement;
|
|
4
|
+
//# sourceMappingURL=CompanyCard.parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyCard.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CompanyCard/CompanyCard.parts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,SAAS,GACV,EAAE,qBAAqB,GAAG,YAAY,CAiBtC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CompanyCardTaxNumber {
|
|
3
|
+
/** e.g. "GSTIN" for Indian contacts, "VAT Number" otherwise. */
|
|
4
|
+
label: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CompanyCardProps {
|
|
8
|
+
/** Display name, e.g. "Riddhesh Shah & Diamonds (JDVY)". */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Secondary line under the name, e.g. "Riddhesh Shah · Udaipur, India". */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
phone?: string;
|
|
14
|
+
taxNumber?: CompanyCardTaxNumber;
|
|
15
|
+
/** One-line formatted address. */
|
|
16
|
+
address?: string;
|
|
17
|
+
/** Opens the contact in a new tab from the header link. */
|
|
18
|
+
viewHref?: string;
|
|
19
|
+
viewLabel?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** Shown for any field without a value. */
|
|
23
|
+
emptyLabel?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CompanyCardFieldProps {
|
|
27
|
+
label: string;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
emptyLabel: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=CompanyCard.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyCard.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CompanyCard/CompanyCard.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyCard.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CompanyCard/CompanyCard.utils.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,IAAI,MAAM,CAG/D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CompanyCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceComboBox.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/InvoiceComboBox/InvoiceComboBox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceComboBox.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/InvoiceComboBox/InvoiceComboBox.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,iBAAwC,EACxC,SAAS,EACT,QAAgB,EAChB,KAAK,EACL,YAAmB,EACnB,aAAa,GACd,EAAE,oBAAoB,2CA6FtB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { Invoice } from '@/types/invoice';
|
|
2
2
|
export declare function formatInvoiceLabel(invoice: Invoice): string;
|
|
3
3
|
export declare function formatCurrency(amount: number, currency?: string): string;
|
|
4
|
+
/** The currency the invoice was issued in; `baseCurrency` is only its ledger currency. */
|
|
5
|
+
export declare function getInvoiceCurrency(invoice: Invoice): string;
|
|
6
|
+
export declare function getInvoiceCompany(invoice: Invoice): string;
|
|
7
|
+
export declare function getInvoiceLocation(invoice: Invoice): string;
|
|
4
8
|
//# sourceMappingURL=InvoiceComboBox.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceComboBox.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/InvoiceComboBox/InvoiceComboBox.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAM3D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAKxE"}
|
|
1
|
+
{"version":3,"file":"InvoiceComboBox.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/InvoiceComboBox/InvoiceComboBox.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAM3D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAKxE;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAG3D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAM3D"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
1
2
|
import type { SegmentedControlProps } from './SegmentedControl.types';
|
|
2
|
-
export type { SegmentedControlOption, SegmentedControlProps, } from './SegmentedControl.types';
|
|
3
|
+
export type { SegmentedControlOption, SegmentedControlOptionLayout, SegmentedControlProps, SegmentedControlVariant, } from './SegmentedControl.types';
|
|
3
4
|
/**
|
|
4
|
-
* Pill-shaped segmented control
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Pill-shaped segmented control. The active segment lifts forward with a card
|
|
6
|
+
* bg, primary border and subtle shadow; inactive segments blend into the muted
|
|
7
|
+
* container background. Giving options a `description` makes the default
|
|
8
|
+
* segments taller, with the icon in a badge.
|
|
7
9
|
*
|
|
8
10
|
* Single source of truth for "two-or-more mutually exclusive views" toggles
|
|
9
11
|
* (e.g. Owned / Memo on the ownership form).
|
|
10
12
|
*/
|
|
11
|
-
export declare function SegmentedControl<V extends string = string>({ value, onChange, options, ariaLabel, className, disabled, variant, }: SegmentedControlProps<V>):
|
|
13
|
+
export declare function SegmentedControl<V extends string = string>({ value, onChange, options, ariaLabel, className, disabled, variant, optionLayout, }: SegmentedControlProps<V>): ReactElement;
|
|
12
14
|
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAUtE,YAAY,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1D,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,QAAQ,EACR,OAAmB,EACnB,YAAwB,GACzB,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,YAAY,CAmCzC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
export type SegmentedControlVariant = 'default' | 'bordered';
|
|
3
|
+
/** Where an option's description sits relative to its label. */
|
|
4
|
+
export type SegmentedControlOptionLayout = 'inline' | 'stacked';
|
|
2
5
|
export interface SegmentedControlOption<V extends string = string> {
|
|
3
6
|
value: V;
|
|
4
7
|
label: ReactNode;
|
|
5
8
|
icon?: ReactNode;
|
|
9
|
+
/** Secondary text, e.g. "Invoice currency" or a rate. Makes the `default` segment taller and puts the icon in a badge. */
|
|
10
|
+
description?: ReactNode;
|
|
6
11
|
disabled?: boolean;
|
|
7
12
|
}
|
|
8
13
|
export interface SegmentedControlProps<V extends string = string> {
|
|
@@ -13,10 +18,12 @@ export interface SegmentedControlProps<V extends string = string> {
|
|
|
13
18
|
className?: string;
|
|
14
19
|
disabled?: boolean;
|
|
15
20
|
/**
|
|
16
|
-
* `default` — active
|
|
17
|
-
* `bordered` —
|
|
18
|
-
*
|
|
21
|
+
* `default` — equal-width segments; the active one lifts forward with a primary border (muted inactive text).
|
|
22
|
+
* `bordered` — segments size to their content and inactive labels stay
|
|
23
|
+
* full-contrast (`text-foreground`). Matches the Figma "Advance Tabs" style.
|
|
19
24
|
*/
|
|
20
|
-
variant?:
|
|
25
|
+
variant?: SegmentedControlVariant;
|
|
26
|
+
/** Description beside the label (`inline`) or under it (`stacked`, default). */
|
|
27
|
+
optionLayout?: SegmentedControlOptionLayout;
|
|
21
28
|
}
|
|
22
29
|
//# sourceMappingURL=SegmentedControl.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC/D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7D,gEAAgE;AAChE,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC/D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0HAA0H;IAC1H,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,gFAAgF;IAChF,YAAY,CAAC,EAAE,4BAA4B,CAAC;CAC7C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SegmentedControlOptionLayout, SegmentedControlVariant } from './SegmentedControl.types';
|
|
2
|
+
/** Options with a description get the taller layout with an icon badge (default variant only). */
|
|
3
|
+
export declare function hasDetails(variant: SegmentedControlVariant, hasDescription: boolean): boolean;
|
|
4
|
+
export declare function getListClassName(variant: SegmentedControlVariant, detailed: boolean): string;
|
|
5
|
+
export declare function getSegmentClassName(variant: SegmentedControlVariant, isActive: boolean, isDisabled: boolean, detailed?: boolean): string;
|
|
6
|
+
export declare function getIconClassName(detailed: boolean, isActive: boolean): string;
|
|
7
|
+
export declare function getContentClassName(layout: SegmentedControlOptionLayout): string;
|
|
8
|
+
export declare function getDescriptionClassName(isActive: boolean): string;
|
|
9
|
+
//# sourceMappingURL=SegmentedControl.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAE7F;AAMD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAS5F;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,EACnB,QAAQ,UAAQ,GACf,MAAM,CAqBR;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAQ7E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,4BAA4B,GAAG,MAAM,CAIhF;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEjE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { SegmentedControl } from './SegmentedControl';
|
|
2
|
-
export type { SegmentedControlOption, SegmentedControlProps, } from './SegmentedControl';
|
|
2
|
+
export type { SegmentedControlOption, SegmentedControlOptionLayout, SegmentedControlProps, SegmentedControlVariant, } from './SegmentedControl';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,sBAAsB,EACtB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -2698,12 +2698,12 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
2698
2698
|
*/
|
|
2699
2699
|
|
|
2700
2700
|
|
|
2701
|
-
const __iconNode$
|
|
2701
|
+
const __iconNode$1p = [
|
|
2702
2702
|
["path", { d: "M15 12H3", key: "6jk70r" }],
|
|
2703
2703
|
["path", { d: "M17 18H3", key: "1amg6g" }],
|
|
2704
2704
|
["path", { d: "M21 6H3", key: "1jwq7v" }]
|
|
2705
2705
|
];
|
|
2706
|
-
const AlignLeft = createLucideIcon("align-left", __iconNode$
|
|
2706
|
+
const AlignLeft = createLucideIcon("align-left", __iconNode$1p);
|
|
2707
2707
|
|
|
2708
2708
|
/**
|
|
2709
2709
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2713,12 +2713,12 @@ const AlignLeft = createLucideIcon("align-left", __iconNode$1o);
|
|
|
2713
2713
|
*/
|
|
2714
2714
|
|
|
2715
2715
|
|
|
2716
|
-
const __iconNode$
|
|
2716
|
+
const __iconNode$1o = [
|
|
2717
2717
|
["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
|
|
2718
2718
|
["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
|
|
2719
2719
|
["path", { d: "M10 12h4", key: "a56b0p" }]
|
|
2720
2720
|
];
|
|
2721
|
-
const Archive = createLucideIcon("archive", __iconNode$
|
|
2721
|
+
const Archive = createLucideIcon("archive", __iconNode$1o);
|
|
2722
2722
|
|
|
2723
2723
|
/**
|
|
2724
2724
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2728,11 +2728,11 @@ const Archive = createLucideIcon("archive", __iconNode$1n);
|
|
|
2728
2728
|
*/
|
|
2729
2729
|
|
|
2730
2730
|
|
|
2731
|
-
const __iconNode$
|
|
2731
|
+
const __iconNode$1n = [
|
|
2732
2732
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
2733
2733
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
2734
2734
|
];
|
|
2735
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
2735
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1n);
|
|
2736
2736
|
|
|
2737
2737
|
/**
|
|
2738
2738
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2742,11 +2742,11 @@ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1m);
|
|
|
2742
2742
|
*/
|
|
2743
2743
|
|
|
2744
2744
|
|
|
2745
|
-
const __iconNode$
|
|
2745
|
+
const __iconNode$1m = [
|
|
2746
2746
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
2747
2747
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
2748
2748
|
];
|
|
2749
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$
|
|
2749
|
+
const ArrowRight = createLucideIcon("arrow-right", __iconNode$1m);
|
|
2750
2750
|
|
|
2751
2751
|
/**
|
|
2752
2752
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2756,11 +2756,11 @@ const ArrowRight = createLucideIcon("arrow-right", __iconNode$1l);
|
|
|
2756
2756
|
*/
|
|
2757
2757
|
|
|
2758
2758
|
|
|
2759
|
-
const __iconNode$
|
|
2759
|
+
const __iconNode$1l = [
|
|
2760
2760
|
["path", { d: "M4.929 4.929 19.07 19.071", key: "196cmz" }],
|
|
2761
2761
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
2762
2762
|
];
|
|
2763
|
-
const Ban = createLucideIcon("ban", __iconNode$
|
|
2763
|
+
const Ban = createLucideIcon("ban", __iconNode$1l);
|
|
2764
2764
|
|
|
2765
2765
|
/**
|
|
2766
2766
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2770,7 +2770,7 @@ const Ban = createLucideIcon("ban", __iconNode$1k);
|
|
|
2770
2770
|
*/
|
|
2771
2771
|
|
|
2772
2772
|
|
|
2773
|
-
const __iconNode$
|
|
2773
|
+
const __iconNode$1k = [
|
|
2774
2774
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
2775
2775
|
[
|
|
2776
2776
|
"path",
|
|
@@ -2781,7 +2781,7 @@ const __iconNode$1j = [
|
|
|
2781
2781
|
],
|
|
2782
2782
|
["circle", { cx: "18", cy: "8", r: "3", key: "1g0gzu" }]
|
|
2783
2783
|
];
|
|
2784
|
-
const BellDot = createLucideIcon("bell-dot", __iconNode$
|
|
2784
|
+
const BellDot = createLucideIcon("bell-dot", __iconNode$1k);
|
|
2785
2785
|
|
|
2786
2786
|
/**
|
|
2787
2787
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2791,7 +2791,7 @@ const BellDot = createLucideIcon("bell-dot", __iconNode$1j);
|
|
|
2791
2791
|
*/
|
|
2792
2792
|
|
|
2793
2793
|
|
|
2794
|
-
const __iconNode$
|
|
2794
|
+
const __iconNode$1j = [
|
|
2795
2795
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
2796
2796
|
["path", { d: "M22 8c0-2.3-.8-4.3-2-6", key: "5bb3ad" }],
|
|
2797
2797
|
[
|
|
@@ -2803,7 +2803,7 @@ const __iconNode$1i = [
|
|
|
2803
2803
|
],
|
|
2804
2804
|
["path", { d: "M4 2C2.8 3.7 2 5.7 2 8", key: "tap9e0" }]
|
|
2805
2805
|
];
|
|
2806
|
-
const BellRing = createLucideIcon("bell-ring", __iconNode$
|
|
2806
|
+
const BellRing = createLucideIcon("bell-ring", __iconNode$1j);
|
|
2807
2807
|
|
|
2808
2808
|
/**
|
|
2809
2809
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2813,7 +2813,7 @@ const BellRing = createLucideIcon("bell-ring", __iconNode$1i);
|
|
|
2813
2813
|
*/
|
|
2814
2814
|
|
|
2815
2815
|
|
|
2816
|
-
const __iconNode$
|
|
2816
|
+
const __iconNode$1i = [
|
|
2817
2817
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
2818
2818
|
[
|
|
2819
2819
|
"path",
|
|
@@ -2823,7 +2823,7 @@ const __iconNode$1h = [
|
|
|
2823
2823
|
}
|
|
2824
2824
|
]
|
|
2825
2825
|
];
|
|
2826
|
-
const Bell = createLucideIcon("bell", __iconNode$
|
|
2826
|
+
const Bell = createLucideIcon("bell", __iconNode$1i);
|
|
2827
2827
|
|
|
2828
2828
|
/**
|
|
2829
2829
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -2833,13 +2833,32 @@ const Bell = createLucideIcon("bell", __iconNode$1h);
|
|
|
2833
2833
|
*/
|
|
2834
2834
|
|
|
2835
2835
|
|
|
2836
|
-
const __iconNode$
|
|
2836
|
+
const __iconNode$1h = [
|
|
2837
2837
|
[
|
|
2838
2838
|
"path",
|
|
2839
2839
|
{ d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
|
|
2840
2840
|
]
|
|
2841
2841
|
];
|
|
2842
|
-
const Bold$1 = createLucideIcon("bold", __iconNode$
|
|
2842
|
+
const Bold$1 = createLucideIcon("bold", __iconNode$1h);
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* @license lucide-react v0.539.0 - ISC
|
|
2846
|
+
*
|
|
2847
|
+
* This source code is licensed under the ISC license.
|
|
2848
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2849
|
+
*/
|
|
2850
|
+
|
|
2851
|
+
|
|
2852
|
+
const __iconNode$1g = [
|
|
2853
|
+
["path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z", key: "1b4qmf" }],
|
|
2854
|
+
["path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2", key: "i71pzd" }],
|
|
2855
|
+
["path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2", key: "10jefs" }],
|
|
2856
|
+
["path", { d: "M10 6h4", key: "1itunk" }],
|
|
2857
|
+
["path", { d: "M10 10h4", key: "tcdvrf" }],
|
|
2858
|
+
["path", { d: "M10 14h4", key: "kelpxr" }],
|
|
2859
|
+
["path", { d: "M10 18h4", key: "1ulq68" }]
|
|
2860
|
+
];
|
|
2861
|
+
const Building2 = createLucideIcon("building-2", __iconNode$1g);
|
|
2843
2862
|
|
|
2844
2863
|
/**
|
|
2845
2864
|
* @license lucide-react v0.539.0 - ISC
|
|
@@ -15396,6 +15415,48 @@ const CollapsibleCard = ({ title, subtitle, icon, headerActions, defaultOpen = t
|
|
|
15396
15415
|
return (jsxRuntime.jsxs("section", { className: cn('overflow-hidden rounded-xl border border-border bg-card shadow-card', className), children: [jsxRuntime.jsxs("header", { className: cn('flex items-center gap-3 bg-muted/30 px-4 py-3', isOpen && 'border-b border-border', headerClassName), children: [icon && jsxRuntime.jsx(SectionIcon, { children: icon }), jsxRuntime.jsxs("div", { className: "flex min-w-0 shrink flex-col gap-0.5", children: [jsxRuntime.jsx("h3", { className: "truncate text-sm font-medium text-foreground", children: title }), subtitle && (jsxRuntime.jsx("div", { className: "truncate text-xs text-muted-foreground", children: subtitle }))] }), headerActions && (jsxRuntime.jsx("div", { className: "ml-auto flex min-w-0 flex-1 items-center justify-end gap-2", children: headerActions })), !headerActions && jsxRuntime.jsx("div", { className: "flex-1" }), !nonCollapsible && (jsxRuntime.jsx("button", { type: "button", onClick: toggle, "aria-expanded": isOpen, "aria-label": isOpen ? 'Collapse section' : 'Expand section', className: "inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30", children: jsxRuntime.jsx(ChevronDown, { className: cn('h-4 w-4 transition-transform duration-200', isOpen && 'rotate-180'), "aria-hidden": "true" }) }))] }), isOpen && jsxRuntime.jsx("div", { className: cn('p-4', bodyClassName), children: children })] }));
|
|
15397
15416
|
};
|
|
15398
15417
|
|
|
15418
|
+
const HEADER_TONE_CLASSES = {
|
|
15419
|
+
neutral: 'bg-[var(--section-header)]',
|
|
15420
|
+
gem: 'bg-primary/5 dark:bg-[#173626]',
|
|
15421
|
+
diamond: 'bg-blue-50 dark:bg-[#0284C7]/20',
|
|
15422
|
+
};
|
|
15423
|
+
const ICON_TONE_CLASSES$1 = {
|
|
15424
|
+
neutral: 'bg-primary/10 text-primary',
|
|
15425
|
+
gem: 'bg-primary/10 text-primary',
|
|
15426
|
+
diamond: 'bg-blue-100 text-blue-500',
|
|
15427
|
+
};
|
|
15428
|
+
/**
|
|
15429
|
+
* Section panel used across the redesigned create/edit forms: a rounded card
|
|
15430
|
+
* with a tinted header band (icon square + title + description) above a
|
|
15431
|
+
* divider, then the form body. The icon-square + title + description header
|
|
15432
|
+
* is the recurring pattern in the new designs.
|
|
15433
|
+
* divider, then the form body.
|
|
15434
|
+
*/
|
|
15435
|
+
const FormSectionCard = ({ icon, title, description, headerAction, children, className, bodyClassName, tone = 'neutral', headerClassName, }) => {
|
|
15436
|
+
return (jsxRuntime.jsxs("section", { className: cn('overflow-hidden rounded-xl border border-border bg-card shadow-card', className), children: [jsxRuntime.jsxs("header", { className: cn('flex items-center justify-between gap-4 border-b border-border px-5 py-4', HEADER_TONE_CLASSES[tone], headerClassName), children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("span", { className: cn('inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md', ICON_TONE_CLASSES$1[tone]), children: icon }), jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [jsxRuntime.jsx("p", { className: "text-base font-medium text-foreground", children: title }), description && (jsxRuntime.jsx("p", { className: "text-[13px] font-normal text-label", children: description }))] })] }), headerAction] }), jsxRuntime.jsx("div", { className: cn('p-5', bodyClassName), children: children })] }));
|
|
15437
|
+
};
|
|
15438
|
+
|
|
15439
|
+
function CompanyCardField({ label, children, emptyLabel, className, }) {
|
|
15440
|
+
return (jsxRuntime.jsxs("div", { className: cn('flex min-w-0 flex-col gap-1', className), children: [jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }), children ? (jsxRuntime.jsx("div", { className: "truncate text-sm font-medium leading-5 text-foreground", children: children })) : (jsxRuntime.jsx("p", { className: "text-sm font-medium italic leading-5 text-muted-foreground", children: emptyLabel }))] }));
|
|
15441
|
+
}
|
|
15442
|
+
|
|
15443
|
+
/** `—` is the placeholder the apps' display helpers return for a missing value. */
|
|
15444
|
+
function hasValue(value) {
|
|
15445
|
+
const trimmed = value?.trim();
|
|
15446
|
+
return !!trimmed && trimmed !== '—';
|
|
15447
|
+
}
|
|
15448
|
+
function getInitial(name) {
|
|
15449
|
+
return (name.trim()[0] ?? '?').toUpperCase();
|
|
15450
|
+
}
|
|
15451
|
+
|
|
15452
|
+
/**
|
|
15453
|
+
* A business contact at a glance: avatar + name, email / phone / tax number,
|
|
15454
|
+
* then the address. Data-only — the app formats each value before passing it.
|
|
15455
|
+
*/
|
|
15456
|
+
function CompanyCard({ name, subtitle, email, phone, taxNumber, address, viewHref, viewLabel = 'View company', title = 'Company', icon = jsxRuntime.jsx(Building2, { className: "size-5", "aria-hidden": true }), emptyLabel = 'Not provided', className, }) {
|
|
15457
|
+
return (jsxRuntime.jsxs(FormSectionCard, { icon: icon, title: title, className: className, headerClassName: "px-4 py-3", bodyClassName: "flex flex-col gap-4 p-4", headerAction: viewHref ? (jsxRuntime.jsx(TextHyperlink, { href: viewHref, showIcon: false, className: "shrink-0 text-sm font-medium", children: viewLabel })) : undefined, children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("span", { "aria-hidden": true, className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground", children: getInitial(name) }), jsxRuntime.jsxs("div", { className: "min-w-0", children: [jsxRuntime.jsx("p", { className: "break-words text-base font-semibold leading-6 text-foreground", children: name }), hasValue(subtitle) ? (jsxRuntime.jsx("p", { className: "break-words text-xs leading-4 text-muted-foreground", children: subtitle })) : null] })] }), jsxRuntime.jsxs("div", { className: cn('grid grid-cols-1 gap-4', taxNumber ? 'sm:grid-cols-3' : 'sm:grid-cols-2'), children: [jsxRuntime.jsx(CompanyCardField, { label: "Email", emptyLabel: emptyLabel, children: hasValue(email) ? (jsxRuntime.jsx("a", { href: `mailto:${email}`, className: "text-primary underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: email })) : null }), jsxRuntime.jsx(CompanyCardField, { label: "Phone", emptyLabel: emptyLabel, children: hasValue(phone) ? phone : null }), taxNumber ? (jsxRuntime.jsx(CompanyCardField, { label: taxNumber.label, emptyLabel: emptyLabel, children: hasValue(taxNumber.value) ? taxNumber.value : null })) : null] }), jsxRuntime.jsx(CompanyCardField, { label: "Address", emptyLabel: emptyLabel, className: "border-t border-border pt-4", children: hasValue(address) ? jsxRuntime.jsx("span", { className: "whitespace-normal break-words", children: address }) : null })] }));
|
|
15458
|
+
}
|
|
15459
|
+
|
|
15399
15460
|
function commonjsRequire(path) {
|
|
15400
15461
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
15401
15462
|
}
|
|
@@ -37633,27 +37694,6 @@ const InAppNotificationCard = ({ notification, onSelect, defaultIcon, className,
|
|
|
37633
37694
|
return (jsxRuntime.jsxs("button", { type: "button", onClick: () => onSelect(notification), className: getInAppNotificationCardClasses(isRead, className), children: [jsxRuntime.jsx("span", { className: getInAppNotificationIconClasses(isRead), children: icon ?? defaultIcon ?? (jsxRuntime.jsx(BellDot, { className: "size-4", "aria-hidden": "true" })) }), jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [jsxRuntime.jsxs("span", { className: "flex items-baseline gap-2", children: [!isRead && (jsxRuntime.jsx("span", { role: "img", "aria-label": inAppNotificationCardA11y.unreadLabel, className: "size-1.5 shrink-0 rounded-full bg-primary" })), jsxRuntime.jsx("span", { className: cn('min-w-0 flex-1 truncate text-sm text-foreground', isRead ? 'font-medium' : 'font-semibold'), children: title }), jsxRuntime.jsx("time", { className: "shrink-0 text-[0.6875rem] text-muted-foreground tabular-nums", children: formatRelativeTime(createdAt) })] }), jsxRuntime.jsx("span", { className: "mt-1 line-clamp-1 text-xs text-secondary-foreground", children: message }), subject && (jsxRuntime.jsx("span", { className: "mt-0.5 block truncate text-[0.6875rem] font-medium text-muted-foreground", children: subject }))] })] }));
|
|
37634
37695
|
};
|
|
37635
37696
|
|
|
37636
|
-
const HEADER_TONE_CLASSES = {
|
|
37637
|
-
neutral: 'bg-[var(--section-header)]',
|
|
37638
|
-
gem: 'bg-primary/5 dark:bg-[#173626]',
|
|
37639
|
-
diamond: 'bg-blue-50 dark:bg-[#0284C7]/20',
|
|
37640
|
-
};
|
|
37641
|
-
const ICON_TONE_CLASSES$1 = {
|
|
37642
|
-
neutral: 'bg-primary/10 text-primary',
|
|
37643
|
-
gem: 'bg-primary/10 text-primary',
|
|
37644
|
-
diamond: 'bg-blue-100 text-blue-500',
|
|
37645
|
-
};
|
|
37646
|
-
/**
|
|
37647
|
-
* Section panel used across the redesigned create/edit forms: a rounded card
|
|
37648
|
-
* with a tinted header band (icon square + title + description) above a
|
|
37649
|
-
* divider, then the form body. The icon-square + title + description header
|
|
37650
|
-
* is the recurring pattern in the new designs.
|
|
37651
|
-
* divider, then the form body.
|
|
37652
|
-
*/
|
|
37653
|
-
const FormSectionCard = ({ icon, title, description, headerAction, children, className, bodyClassName, tone = 'neutral', headerClassName, }) => {
|
|
37654
|
-
return (jsxRuntime.jsxs("section", { className: cn('overflow-hidden rounded-xl border border-border bg-card shadow-card', className), children: [jsxRuntime.jsxs("header", { className: cn('flex items-center justify-between gap-4 border-b border-border px-5 py-4', HEADER_TONE_CLASSES[tone], headerClassName), children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("span", { className: cn('inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md', ICON_TONE_CLASSES$1[tone]), children: icon }), jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [jsxRuntime.jsx("p", { className: "text-base font-medium text-foreground", children: title }), description && (jsxRuntime.jsx("p", { className: "text-[13px] font-normal text-label", children: description }))] })] }), headerAction] }), jsxRuntime.jsx("div", { className: cn('p-5', bodyClassName), children: children })] }));
|
|
37655
|
-
};
|
|
37656
|
-
|
|
37657
37697
|
const TONE_STYLES = {
|
|
37658
37698
|
info: {
|
|
37659
37699
|
container: 'border-border bg-section-header',
|
|
@@ -38003,6 +38043,21 @@ function formatCurrency(amount, currency) {
|
|
|
38003
38043
|
currency: currency || 'USD',
|
|
38004
38044
|
}).format(amount);
|
|
38005
38045
|
}
|
|
38046
|
+
/** The currency the invoice was issued in; `baseCurrency` is only its ledger currency. */
|
|
38047
|
+
function getInvoiceCurrency(invoice) {
|
|
38048
|
+
const target = invoice.target?.currency?.trim().toUpperCase();
|
|
38049
|
+
return target && invoice.target?.rate ? target : invoice.baseCurrency || 'USD';
|
|
38050
|
+
}
|
|
38051
|
+
function getInvoiceCompany(invoice) {
|
|
38052
|
+
return invoice.customer?.companyName || invoice.customer?.contactName || 'N/A';
|
|
38053
|
+
}
|
|
38054
|
+
function getInvoiceLocation(invoice) {
|
|
38055
|
+
const address = invoice.customer?.address ?? invoice.address;
|
|
38056
|
+
return [address?.city, address?.state, address?.country]
|
|
38057
|
+
.map((part) => part?.trim())
|
|
38058
|
+
.filter(Boolean)
|
|
38059
|
+
.join(', ');
|
|
38060
|
+
}
|
|
38006
38061
|
|
|
38007
38062
|
function useInvoiceComboBox(fetchInvoices, statusFilter) {
|
|
38008
38063
|
const fetchPage = React.useCallback(async ({ page, limit, search }) => {
|
|
@@ -38067,7 +38122,8 @@ function InvoiceComboBox({ selectedItem, onSelect, fetchInvoices, searchPlacehol
|
|
|
38067
38122
|
const invoice = item.data;
|
|
38068
38123
|
const invoiceDate = new Date(invoice.invoiceDate).toLocaleDateString();
|
|
38069
38124
|
const dueDate = new Date(invoice.paymentDueDate).toLocaleDateString();
|
|
38070
|
-
|
|
38125
|
+
const location = getInvoiceLocation(invoice);
|
|
38126
|
+
return (jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 mb-1", children: [jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [jsxRuntime.jsx("span", { className: "font-semibold text-sm text-foreground", children: invoice.invoiceNumber }), jsxRuntime.jsx(StatusBadge, { status: invoice.status })] }), jsxRuntime.jsx("span", { className: "shrink-0 text-xs font-semibold text-foreground", children: getInvoiceCurrency(invoice) })] }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 mb-1 text-xs text-muted-foreground", children: [jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: getInvoiceCompany(invoice) }), location ? jsxRuntime.jsx("span", { className: "shrink-0", children: location }) : null] }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 mt-1", children: [jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: ["Date: ", invoiceDate] }), jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2022" }), jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: ["Due: ", dueDate] })] }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 mt-1", children: [jsxRuntime.jsxs("span", { className: "text-xs font-medium text-foreground", children: ["Total:", ' ', formatCurrency(invoice.totalAmount, invoice.baseCurrency)] }), invoice.outstandingAmount > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2022" }), jsxRuntime.jsxs("span", { className: "text-xs text-destructive", children: ["Outstanding:", ' ', formatCurrency(invoice.outstandingAmount, invoice.baseCurrency)] })] }))] })] }));
|
|
38071
38127
|
}, fetchPage: fetchPage, resolveById: resolveById, preSelectedId: preSelectedId ?? null, searchPlaceholder: searchPlaceholder, emptyMessage: "No invoices found.", disabled: disabled, className: className, align: align, debounceMs: 300 }));
|
|
38072
38128
|
}
|
|
38073
38129
|
|
|
@@ -38244,27 +38300,59 @@ const NumberedStepCard = ({ step, title, description, className, }) => {
|
|
|
38244
38300
|
return (jsxRuntime.jsxs("div", { className: cn('flex flex-col gap-3 rounded-xl border border-border bg-card p-4', className), children: [jsxRuntime.jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center rounded-full bg-primary text-xs font-medium text-primary-foreground", children: step }), jsxRuntime.jsxs("div", { className: "space-y-1", children: [jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: title }), jsxRuntime.jsx("p", { className: "text-xs leading-snug text-label", children: description })] })] }));
|
|
38245
38301
|
};
|
|
38246
38302
|
|
|
38303
|
+
/** Options with a description get the taller layout with an icon badge (default variant only). */
|
|
38304
|
+
function hasDetails(variant, hasDescription) {
|
|
38305
|
+
return variant === 'default' && hasDescription;
|
|
38306
|
+
}
|
|
38307
|
+
/** Dark mode: `--primary` is too dim on near-black, so the detailed active state uses the design's lighter green. */
|
|
38308
|
+
const DARK_ACTIVE_GREEN = 'dark:border-[#6FB98A]';
|
|
38309
|
+
const DARK_ACTIVE_GREEN_TEXT = 'dark:text-[#6FB98A]';
|
|
38310
|
+
function getListClassName(variant, detailed) {
|
|
38311
|
+
if (detailed) {
|
|
38312
|
+
// Light: a faint primary tint. Dark: `--muted` is a light overlay that would outshine the active segment.
|
|
38313
|
+
return 'inline-flex w-full items-center gap-1 rounded-xl border border-transparent bg-primary/5 p-1 dark:border-border dark:bg-black/25';
|
|
38314
|
+
}
|
|
38315
|
+
return cn('inline-flex w-full items-center gap-1 bg-muted p-1', variant === 'bordered' ? 'rounded-lg' : 'rounded-md');
|
|
38316
|
+
}
|
|
38317
|
+
function getSegmentClassName(variant, isActive, isDisabled, detailed = false) {
|
|
38318
|
+
return cn('inline-flex cursor-pointer items-center justify-center gap-2 border px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed', 'outline-none focus-visible:ring-2 focus-visible:ring-primary/30', detailed ? 'min-h-11 rounded-lg border-2 py-2 font-semibold' : 'h-7 rounded-md',
|
|
38319
|
+
// Bordered tabs size to their content (Figma "Advance Tabs"); the others stretch to equal width.
|
|
38320
|
+
variant === 'bordered' ? 'shrink-0' : 'flex-1',
|
|
38321
|
+
// Every segment carries a border so the active one's primary border doesn't shift the layout.
|
|
38322
|
+
isActive
|
|
38323
|
+
? cn('border-primary bg-card shadow-xs', detailed ? cn('text-primary dark:bg-muted dark:text-foreground dark:shadow-none', DARK_ACTIVE_GREEN) : 'text-primary')
|
|
38324
|
+
: cn('border-transparent', variant === 'bordered' || detailed ? 'text-secondary-foreground' : 'text-muted-foreground', variant === 'bordered' && 'text-foreground', 'hover:text-foreground'), isDisabled && 'cursor-not-allowed opacity-50');
|
|
38325
|
+
}
|
|
38326
|
+
function getIconClassName(detailed, isActive) {
|
|
38327
|
+
if (!detailed) {
|
|
38328
|
+
return 'inline-flex shrink-0 items-center [&_svg]:h-4 [&_svg]:w-4';
|
|
38329
|
+
}
|
|
38330
|
+
return cn('inline-flex size-7 shrink-0 items-center justify-center rounded-full text-sm font-semibold [&_svg]:size-4', isActive ? cn('bg-primary/10 text-primary dark:bg-primary/25', DARK_ACTIVE_GREEN_TEXT) : 'bg-foreground/5 text-muted-foreground');
|
|
38331
|
+
}
|
|
38332
|
+
function getContentClassName(layout) {
|
|
38333
|
+
return layout === 'inline'
|
|
38334
|
+
? 'flex min-w-0 items-baseline gap-2'
|
|
38335
|
+
: 'flex min-w-0 flex-col items-center gap-0.5';
|
|
38336
|
+
}
|
|
38337
|
+
function getDescriptionClassName(isActive) {
|
|
38338
|
+
return cn('truncate text-xs font-normal', isActive ? cn('text-primary', DARK_ACTIVE_GREEN_TEXT) : 'text-muted-foreground');
|
|
38339
|
+
}
|
|
38340
|
+
|
|
38247
38341
|
/**
|
|
38248
|
-
* Pill-shaped segmented control
|
|
38249
|
-
*
|
|
38250
|
-
*
|
|
38342
|
+
* Pill-shaped segmented control. The active segment lifts forward with a card
|
|
38343
|
+
* bg, primary border and subtle shadow; inactive segments blend into the muted
|
|
38344
|
+
* container background. Giving options a `description` makes the default
|
|
38345
|
+
* segments taller, with the icon in a badge.
|
|
38251
38346
|
*
|
|
38252
38347
|
* Single source of truth for "two-or-more mutually exclusive views" toggles
|
|
38253
38348
|
* (e.g. Owned / Memo on the ownership form).
|
|
38254
38349
|
*/
|
|
38255
|
-
function SegmentedControl({ value, onChange, options, ariaLabel, className, disabled, variant = 'default', }) {
|
|
38256
|
-
const
|
|
38257
|
-
return (jsxRuntime.jsx("div", { role: "tablist", "aria-label": ariaLabel, className: cn(
|
|
38350
|
+
function SegmentedControl({ value, onChange, options, ariaLabel, className, disabled, variant = 'default', optionLayout = 'stacked', }) {
|
|
38351
|
+
const detailed = options.some((opt) => hasDetails(variant, opt.description != null));
|
|
38352
|
+
return (jsxRuntime.jsx("div", { role: "tablist", "aria-label": ariaLabel, className: cn(getListClassName(variant, detailed), className), children: options.map((opt) => {
|
|
38258
38353
|
const isActive = value === opt.value;
|
|
38259
|
-
const isDisabled = disabled || opt.disabled;
|
|
38260
|
-
return (jsxRuntime.jsxs("button", { type: "button", role: "tab", "aria-selected": isActive, disabled: isDisabled, onClick: () => !isDisabled && onChange(opt.value), className:
|
|
38261
|
-
// Bordered tabs size to their content (Figma "Advance Tabs"); the
|
|
38262
|
-
// default variant stretches every segment to equal width.
|
|
38263
|
-
isBordered ? 'shrink-0' : 'flex-1', isActive
|
|
38264
|
-
? cn('bg-card text-primary shadow-xs', isBordered && 'border border-primary')
|
|
38265
|
-
: isBordered
|
|
38266
|
-
? 'text-foreground hover:text-foreground'
|
|
38267
|
-
: 'text-muted-foreground hover:text-foreground', isDisabled && 'cursor-not-allowed opacity-50'), children: [opt.icon && (jsxRuntime.jsx("span", { "aria-hidden": "true", className: "inline-flex shrink-0 items-center [&_svg]:h-4 [&_svg]:w-4", children: opt.icon })), jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: opt.label })] }, opt.value));
|
|
38354
|
+
const isDisabled = !!(disabled || opt.disabled);
|
|
38355
|
+
return (jsxRuntime.jsxs("button", { type: "button", role: "tab", "aria-selected": isActive, disabled: isDisabled, onClick: () => !isDisabled && onChange(opt.value), className: getSegmentClassName(variant, isActive, isDisabled, detailed), children: [opt.icon && (jsxRuntime.jsx("span", { "aria-hidden": "true", className: getIconClassName(detailed, isActive), children: opt.icon })), detailed && opt.description != null ? (jsxRuntime.jsxs("span", { className: getContentClassName(optionLayout), children: [jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: opt.label }), jsxRuntime.jsx("span", { className: getDescriptionClassName(isActive), children: opt.description })] })) : (jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: opt.label }))] }, opt.value));
|
|
38268
38356
|
}) }));
|
|
38269
38357
|
}
|
|
38270
38358
|
|
|
@@ -77709,6 +77797,7 @@ exports.Collapsible = Collapsible;
|
|
|
77709
77797
|
exports.CollapsibleCard = CollapsibleCard;
|
|
77710
77798
|
exports.CollapsibleContent = CollapsibleContent;
|
|
77711
77799
|
exports.CollapsibleTrigger = CollapsibleTrigger;
|
|
77800
|
+
exports.CompanyCard = CompanyCard;
|
|
77712
77801
|
exports.ConfirmDialog = ConfirmDialog;
|
|
77713
77802
|
exports.ContactTypeFilter = ContactTypeFilter;
|
|
77714
77803
|
exports.CopyButton = CopyButton;
|