@brightlocal/ui-components 0.4.1 → 1.0.0
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 +2 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +2 -2
- package/dist/alert.js +64 -64
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +38 -38
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +2 -2
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +23 -23
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +34 -34
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +2 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +58 -57
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +19 -40
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +1 -1
- package/dist/chart.cjs +2 -2
- package/dist/chart.d.ts +3 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +21 -21
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +6 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +157 -149
- package/dist/command.cjs +1 -1
- package/dist/command.js +35 -35
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +7 -7
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +22 -22
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +40 -45
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +133 -92
- package/dist/header.d.ts.map +1 -1
- package/dist/header.js +1 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +394 -381
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +18 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +1 -1
- package/dist/input-group.js +10 -10
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -20
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +93 -134
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +16 -16
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +1 -8
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +23 -11
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +12 -12
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +15 -15
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +3 -19
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +93 -121
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +46 -50
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +19 -19
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +7 -8
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +1 -21
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +31 -100
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +10 -12
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +9 -9
- package/dist/typography.cjs +1 -0
- package/dist/typography.d.ts +176 -0
- package/dist/typography.d.ts.map +1 -0
- package/dist/typography.js +331 -0
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +10 -10
- package/src/blocks/sidebar.tsx +13 -13
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert.tsx +10 -10
- package/src/components/breadcrumb.tsx +3 -3
- package/src/components/button.tsx +7 -7
- package/src/components/calendar.tsx +4 -22
- package/src/components/centred-layout.tsx +1 -1
- package/src/components/chart.tsx +5 -5
- package/src/components/checkbox.tsx +3 -3
- package/src/components/combobox.tsx +26 -10
- package/src/components/command.tsx +5 -5
- package/src/components/context-menu.tsx +2 -2
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +3 -3
- package/src/components/dropdown-menu.tsx +6 -11
- package/src/components/field.tsx +70 -22
- package/src/components/header.tsx +1 -4
- package/src/components/input-chip.tsx +1 -4
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +12 -92
- package/src/components/input-password.tsx +2 -10
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/link.tsx +1 -5
- package/src/components/logo.tsx +11 -5
- package/src/components/menubar.tsx +2 -2
- package/src/components/pagination.tsx +4 -8
- package/src/components/radio-group.tsx +66 -130
- package/src/components/select.tsx +8 -12
- package/src/components/sheet.tsx +5 -5
- package/src/components/sonner.tsx +4 -5
- package/src/components/switch.tsx +29 -140
- package/src/components/tabs.tsx +0 -2
- package/src/components/toggle.tsx +1 -1
- package/src/components/typography.tsx +678 -0
- package/src/index.ts +1 -0
- package/dist/link.figma.d.ts +0 -2
- package/dist/link.figma.d.ts.map +0 -1
- package/dist/switch.figma.d.ts +0 -2
- package/dist/switch.figma.d.ts.map +0 -1
- package/dist/toggle.figma.d.ts +0 -2
- package/dist/toggle.figma.d.ts.map +0 -1
- package/src/components/link.figma.tsx +0 -71
- package/src/components/switch.figma.tsx +0 -111
- package/src/components/toggle.figma.tsx +0 -75
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { figma } from "@figma/code-connect";
|
|
2
|
-
import { Link } from "@brightlocal/ui-components/link";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Figma Code Connect mapping for Link component
|
|
6
|
-
*
|
|
7
|
-
* File: Design System - UI Components
|
|
8
|
-
* Last Updated: 2025-10-29
|
|
9
|
-
*
|
|
10
|
-
* The Link component has a single "default" variant with multiple states:
|
|
11
|
-
* - Default state (normal interactive)
|
|
12
|
-
* - Hover state (mouse over)
|
|
13
|
-
* - Active state (while clicking)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// Link Component - Default State
|
|
17
|
-
figma.connect(
|
|
18
|
-
Link,
|
|
19
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---UI-Components?node-id=23024-2865&m=dev",
|
|
20
|
-
{
|
|
21
|
-
imports: ["import { Link } from '@brightlocal/ui-components/link'"],
|
|
22
|
-
variant: { State: "Default" },
|
|
23
|
-
props: {
|
|
24
|
-
text: figma.string("Link Text"),
|
|
25
|
-
href: figma.string("URL"),
|
|
26
|
-
},
|
|
27
|
-
example: ({ text, href }) => (
|
|
28
|
-
<Link dataHook="link" href={href || "#"}>
|
|
29
|
-
{text || "Link"}
|
|
30
|
-
</Link>
|
|
31
|
-
),
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
// Link Component - Hover State
|
|
36
|
-
figma.connect(
|
|
37
|
-
Link,
|
|
38
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---UI-Components?node-id=23024-2865&m=dev",
|
|
39
|
-
{
|
|
40
|
-
imports: ["import { Link } from '@brightlocal/ui-components/link'"],
|
|
41
|
-
variant: { State: "Hover" },
|
|
42
|
-
props: {
|
|
43
|
-
text: figma.string("Link Text"),
|
|
44
|
-
href: figma.string("URL"),
|
|
45
|
-
},
|
|
46
|
-
example: ({ text, href }) => (
|
|
47
|
-
<Link dataHook="link" href={href || "#"}>
|
|
48
|
-
{text || "Link"}
|
|
49
|
-
</Link>
|
|
50
|
-
),
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// Link Component - Active State
|
|
55
|
-
figma.connect(
|
|
56
|
-
Link,
|
|
57
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---UI-Components?node-id=23024-2865&m=dev",
|
|
58
|
-
{
|
|
59
|
-
imports: ["import { Link } from '@brightlocal/ui-components/link'"],
|
|
60
|
-
variant: { State: "Active" },
|
|
61
|
-
props: {
|
|
62
|
-
text: figma.string("Link Text"),
|
|
63
|
-
href: figma.string("URL"),
|
|
64
|
-
},
|
|
65
|
-
example: ({ text, href }) => (
|
|
66
|
-
<Link dataHook="link" href={href || "#"}>
|
|
67
|
-
{text || "Link"}
|
|
68
|
-
</Link>
|
|
69
|
-
),
|
|
70
|
-
}
|
|
71
|
-
);
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { figma } from "@figma/code-connect";
|
|
3
|
-
import { Switch } from "@brightlocal/ui-components/switch";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Figma Code Connect mapping for Switch component
|
|
7
|
-
*
|
|
8
|
-
* File: Design System - Components
|
|
9
|
-
* Component URL: https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---Components?node-id=60-438
|
|
10
|
-
* Last Updated: 2025-11-05
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// Default variant - label on right side
|
|
14
|
-
figma.connect(
|
|
15
|
-
Switch,
|
|
16
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---Components?node-id=428-1425",
|
|
17
|
-
{
|
|
18
|
-
imports: [
|
|
19
|
-
"import { Switch, SwitchVariant, SwitchSide } from '@brightlocal/ui-components/switch'",
|
|
20
|
-
],
|
|
21
|
-
variant: { Type: "Default", Side: "Right" },
|
|
22
|
-
props: {
|
|
23
|
-
checked: figma.boolean("Active"),
|
|
24
|
-
},
|
|
25
|
-
example: ({ checked }) => (
|
|
26
|
-
<Switch
|
|
27
|
-
checked={checked}
|
|
28
|
-
dataHook="switch-default"
|
|
29
|
-
id="switch"
|
|
30
|
-
label="Switch Text"
|
|
31
|
-
side="right"
|
|
32
|
-
variant="default"
|
|
33
|
-
/>
|
|
34
|
-
),
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// Default variant - label on left side
|
|
39
|
-
figma.connect(
|
|
40
|
-
Switch,
|
|
41
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---Components?node-id=17118-18360",
|
|
42
|
-
{
|
|
43
|
-
imports: [
|
|
44
|
-
"import { Switch, SwitchVariant, SwitchSide } from '@brightlocal/ui-components/switch'",
|
|
45
|
-
],
|
|
46
|
-
variant: { Type: "Default", Side: "Left" },
|
|
47
|
-
props: {
|
|
48
|
-
checked: figma.boolean("Active"),
|
|
49
|
-
},
|
|
50
|
-
example: ({ checked }) => (
|
|
51
|
-
<Switch
|
|
52
|
-
checked={checked}
|
|
53
|
-
dataHook="switch-default-left"
|
|
54
|
-
id="switch-left"
|
|
55
|
-
label="Switch Text"
|
|
56
|
-
side="left"
|
|
57
|
-
variant="default"
|
|
58
|
-
/>
|
|
59
|
-
),
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
// Box variant - label on left side
|
|
64
|
-
figma.connect(
|
|
65
|
-
Switch,
|
|
66
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---Components?node-id=17119-18448",
|
|
67
|
-
{
|
|
68
|
-
imports: [
|
|
69
|
-
"import { Switch, SwitchVariant } from '@brightlocal/ui-components/switch'",
|
|
70
|
-
],
|
|
71
|
-
variant: { Type: "Box", Side: "Left" },
|
|
72
|
-
props: {
|
|
73
|
-
checked: figma.boolean("Active"),
|
|
74
|
-
},
|
|
75
|
-
example: ({ checked }) => (
|
|
76
|
-
<Switch
|
|
77
|
-
checked={checked}
|
|
78
|
-
dataHook="switch-box"
|
|
79
|
-
description="This is a switch description."
|
|
80
|
-
id="switch-box"
|
|
81
|
-
label="Switch Text"
|
|
82
|
-
variant="box"
|
|
83
|
-
/>
|
|
84
|
-
),
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
// Box variant - label on right side
|
|
89
|
-
figma.connect(
|
|
90
|
-
Switch,
|
|
91
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---Components?node-id=17119-18455",
|
|
92
|
-
{
|
|
93
|
-
imports: [
|
|
94
|
-
"import { Switch, SwitchVariant } from '@brightlocal/ui-components/switch'",
|
|
95
|
-
],
|
|
96
|
-
variant: { Type: "Box", Side: "Right" },
|
|
97
|
-
props: {
|
|
98
|
-
checked: figma.boolean("Active"),
|
|
99
|
-
},
|
|
100
|
-
example: ({ checked }) => (
|
|
101
|
-
<Switch
|
|
102
|
-
checked={checked}
|
|
103
|
-
dataHook="switch-box-right"
|
|
104
|
-
description="This is a switch description."
|
|
105
|
-
id="switch-box-right"
|
|
106
|
-
label="Switch Text"
|
|
107
|
-
variant="box"
|
|
108
|
-
/>
|
|
109
|
-
),
|
|
110
|
-
}
|
|
111
|
-
);
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { figma } from "@figma/code-connect";
|
|
3
|
-
import { Toggle } from "@brightlocal/ui-components/toggle";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Figma Code Connect mapping for Toggle component
|
|
7
|
-
*
|
|
8
|
-
* File: Design System - UI Components
|
|
9
|
-
* Component URL: https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---UI-Components?node-id=17429-129988
|
|
10
|
-
* Last Updated: 2025-11-04
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
figma.connect(
|
|
14
|
-
Toggle,
|
|
15
|
-
"https://www.figma.com/design/p3krmC8DBUgqpbq6cLzaal/Design-System---UI-Components?node-id=17429-129988&m=dev",
|
|
16
|
-
{
|
|
17
|
-
imports: ["import { Toggle } from '@brightlocal/ui-components/toggle'"],
|
|
18
|
-
props: {
|
|
19
|
-
// Map Figma variant property to code string
|
|
20
|
-
variant: figma.enum("Variant", {
|
|
21
|
-
Default: "default",
|
|
22
|
-
Outline: "outline",
|
|
23
|
-
}),
|
|
24
|
-
// Map Figma size property to code string
|
|
25
|
-
size: figma.enum("Size", {
|
|
26
|
-
sm: "sm",
|
|
27
|
-
default: "default",
|
|
28
|
-
lg: "lg",
|
|
29
|
-
}),
|
|
30
|
-
// Map Figma properties
|
|
31
|
-
disabled: figma.boolean("Disabled"),
|
|
32
|
-
pressed: figma.boolean("Pressed"),
|
|
33
|
-
showText: figma.boolean("Show Text"),
|
|
34
|
-
showIcon: figma.boolean("Show Icon"),
|
|
35
|
-
text: figma.string("Text"),
|
|
36
|
-
// Tracking and testing attributes
|
|
37
|
-
dataHook: figma.string("Data Hook"),
|
|
38
|
-
trackingEl: figma.string("Tracking El"),
|
|
39
|
-
trackingLabel: figma.string("Tracking Label"),
|
|
40
|
-
ariaLabel: figma.string("ARIA Label"),
|
|
41
|
-
},
|
|
42
|
-
example: (props: {
|
|
43
|
-
variant?: "default" | "outline";
|
|
44
|
-
size?: "default" | "sm" | "lg";
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
pressed?: boolean;
|
|
47
|
-
showText?: boolean;
|
|
48
|
-
showIcon?: boolean;
|
|
49
|
-
text?: string;
|
|
50
|
-
dataHook?: string;
|
|
51
|
-
trackingEl?: string;
|
|
52
|
-
trackingLabel?: string;
|
|
53
|
-
ariaLabel?: string;
|
|
54
|
-
}) => {
|
|
55
|
-
// Render icon if showIcon is true (using Bold as placeholder)
|
|
56
|
-
const icon = props.showIcon ? <span>B</span> : null;
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<Toggle
|
|
60
|
-
ariaLabel={props.ariaLabel}
|
|
61
|
-
dataHook={props.dataHook || "toggle"}
|
|
62
|
-
disabled={props.disabled}
|
|
63
|
-
pressed={props.pressed}
|
|
64
|
-
size={props.size || "default"}
|
|
65
|
-
trackingEl={props.trackingEl}
|
|
66
|
-
trackingLabel={props.trackingLabel}
|
|
67
|
-
variant={props.variant || "default"}
|
|
68
|
-
>
|
|
69
|
-
{icon}
|
|
70
|
-
{props.showText && (props.text || "Toggle")}
|
|
71
|
-
</Toggle>
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
);
|