@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.
Files changed (156) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.js +2 -2
  4. package/dist/alert.cjs +1 -1
  5. package/dist/alert.d.ts +2 -2
  6. package/dist/alert.js +64 -64
  7. package/dist/blocks/data-table.cjs +1 -1
  8. package/dist/blocks/data-table.js +38 -38
  9. package/dist/blocks/sidebar.cjs +1 -1
  10. package/dist/blocks/sidebar.d.ts +2 -2
  11. package/dist/blocks/sidebar.d.ts.map +1 -1
  12. package/dist/blocks/sidebar.js +23 -23
  13. package/dist/breadcrumb.cjs +1 -1
  14. package/dist/breadcrumb.js +34 -34
  15. package/dist/button.cjs +1 -1
  16. package/dist/button.d.ts +2 -2
  17. package/dist/button.d.ts.map +1 -1
  18. package/dist/button.js +58 -57
  19. package/dist/calendar.cjs +1 -1
  20. package/dist/calendar.d.ts.map +1 -1
  21. package/dist/calendar.js +19 -40
  22. package/dist/centred-layout.cjs +1 -1
  23. package/dist/centred-layout.js +1 -1
  24. package/dist/chart.cjs +2 -2
  25. package/dist/chart.d.ts +3 -1
  26. package/dist/chart.d.ts.map +1 -1
  27. package/dist/chart.js +21 -21
  28. package/dist/checkbox.cjs +1 -1
  29. package/dist/checkbox.js +3 -3
  30. package/dist/combobox.cjs +1 -1
  31. package/dist/combobox.d.ts +6 -2
  32. package/dist/combobox.d.ts.map +1 -1
  33. package/dist/combobox.js +157 -149
  34. package/dist/command.cjs +1 -1
  35. package/dist/command.js +35 -35
  36. package/dist/context-menu.cjs +1 -1
  37. package/dist/context-menu.js +2 -2
  38. package/dist/date-picker.cjs +1 -1
  39. package/dist/date-picker.js +7 -7
  40. package/dist/dialog.cjs +1 -1
  41. package/dist/dialog.js +22 -22
  42. package/dist/dropdown-menu.cjs +1 -1
  43. package/dist/dropdown-menu.d.ts.map +1 -1
  44. package/dist/dropdown-menu.js +40 -45
  45. package/dist/field.cjs +1 -1
  46. package/dist/field.d.ts +8 -1
  47. package/dist/field.d.ts.map +1 -1
  48. package/dist/field.js +133 -92
  49. package/dist/header.d.ts.map +1 -1
  50. package/dist/header.js +1 -4
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +394 -381
  55. package/dist/input-chip.d.ts.map +1 -1
  56. package/dist/input-chip.js +18 -25
  57. package/dist/input-group.cjs +1 -1
  58. package/dist/input-group.d.ts +1 -1
  59. package/dist/input-group.js +10 -10
  60. package/dist/input-otp.cjs +1 -1
  61. package/dist/input-otp.d.ts +3 -20
  62. package/dist/input-otp.d.ts.map +1 -1
  63. package/dist/input-otp.js +93 -134
  64. package/dist/input-password.cjs +1 -1
  65. package/dist/input-password.d.ts.map +1 -1
  66. package/dist/input-password.js +16 -16
  67. package/dist/input.cjs +1 -1
  68. package/dist/input.js +9 -9
  69. package/dist/label.cjs +1 -1
  70. package/dist/label.js +1 -1
  71. package/dist/link.cjs +1 -1
  72. package/dist/link.d.ts.map +1 -1
  73. package/dist/link.js +1 -8
  74. package/dist/logo.cjs +1 -1
  75. package/dist/logo.d.ts.map +1 -1
  76. package/dist/logo.js +23 -11
  77. package/dist/menubar.cjs +1 -1
  78. package/dist/menubar.js +12 -12
  79. package/dist/pagination.cjs +1 -1
  80. package/dist/pagination.d.ts.map +1 -1
  81. package/dist/pagination.js +15 -15
  82. package/dist/radio-group.cjs +1 -1
  83. package/dist/radio-group.d.ts +3 -19
  84. package/dist/radio-group.d.ts.map +1 -1
  85. package/dist/radio-group.js +93 -121
  86. package/dist/resizable.d.ts +1 -1
  87. package/dist/select.cjs +1 -1
  88. package/dist/select.d.ts +1 -1
  89. package/dist/select.d.ts.map +1 -1
  90. package/dist/select.js +46 -50
  91. package/dist/sheet.cjs +1 -1
  92. package/dist/sheet.d.ts.map +1 -1
  93. package/dist/sheet.js +19 -19
  94. package/dist/sonner.cjs +1 -1
  95. package/dist/sonner.d.ts.map +1 -1
  96. package/dist/sonner.js +7 -8
  97. package/dist/switch.cjs +1 -1
  98. package/dist/switch.d.ts +1 -21
  99. package/dist/switch.d.ts.map +1 -1
  100. package/dist/switch.js +31 -100
  101. package/dist/tabs.cjs +1 -1
  102. package/dist/tabs.d.ts.map +1 -1
  103. package/dist/tabs.js +10 -12
  104. package/dist/toggle.cjs +1 -1
  105. package/dist/toggle.js +9 -9
  106. package/dist/typography.cjs +1 -0
  107. package/dist/typography.d.ts +176 -0
  108. package/dist/typography.d.ts.map +1 -0
  109. package/dist/typography.js +331 -0
  110. package/package.json +2 -2
  111. package/src/blocks/data-table.tsx +10 -10
  112. package/src/blocks/sidebar.tsx +13 -13
  113. package/src/components/accordion.tsx +2 -2
  114. package/src/components/alert.tsx +10 -10
  115. package/src/components/breadcrumb.tsx +3 -3
  116. package/src/components/button.tsx +7 -7
  117. package/src/components/calendar.tsx +4 -22
  118. package/src/components/centred-layout.tsx +1 -1
  119. package/src/components/chart.tsx +5 -5
  120. package/src/components/checkbox.tsx +3 -3
  121. package/src/components/combobox.tsx +26 -10
  122. package/src/components/command.tsx +5 -5
  123. package/src/components/context-menu.tsx +2 -2
  124. package/src/components/date-picker.tsx +1 -1
  125. package/src/components/dialog.tsx +3 -3
  126. package/src/components/dropdown-menu.tsx +6 -11
  127. package/src/components/field.tsx +70 -22
  128. package/src/components/header.tsx +1 -4
  129. package/src/components/input-chip.tsx +1 -4
  130. package/src/components/input-group.tsx +1 -1
  131. package/src/components/input-otp.tsx +12 -92
  132. package/src/components/input-password.tsx +2 -10
  133. package/src/components/input.tsx +1 -1
  134. package/src/components/label.tsx +1 -1
  135. package/src/components/link.tsx +1 -5
  136. package/src/components/logo.tsx +11 -5
  137. package/src/components/menubar.tsx +2 -2
  138. package/src/components/pagination.tsx +4 -8
  139. package/src/components/radio-group.tsx +66 -130
  140. package/src/components/select.tsx +8 -12
  141. package/src/components/sheet.tsx +5 -5
  142. package/src/components/sonner.tsx +4 -5
  143. package/src/components/switch.tsx +29 -140
  144. package/src/components/tabs.tsx +0 -2
  145. package/src/components/toggle.tsx +1 -1
  146. package/src/components/typography.tsx +678 -0
  147. package/src/index.ts +1 -0
  148. package/dist/link.figma.d.ts +0 -2
  149. package/dist/link.figma.d.ts.map +0 -1
  150. package/dist/switch.figma.d.ts +0 -2
  151. package/dist/switch.figma.d.ts.map +0 -1
  152. package/dist/toggle.figma.d.ts +0 -2
  153. package/dist/toggle.figma.d.ts.map +0 -1
  154. package/src/components/link.figma.tsx +0 -71
  155. package/src/components/switch.figma.tsx +0 -111
  156. 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
- );