@buildcanada/components 0.3.3 → 0.3.5

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 (145) hide show
  1. package/dist/content/Card/Card.d.ts +62 -0
  2. package/dist/content/Card/Card.d.ts.map +1 -0
  3. package/dist/content/Card/Card.js +45 -0
  4. package/dist/content/Card/Card.scss +281 -0
  5. package/dist/content/Card/index.d.ts +3 -0
  6. package/dist/content/Card/index.d.ts.map +1 -0
  7. package/dist/content/Card/index.js +2 -0
  8. package/dist/content/Hero/Hero.d.ts +28 -0
  9. package/dist/content/Hero/Hero.d.ts.map +1 -0
  10. package/dist/content/Hero/Hero.js +16 -0
  11. package/dist/content/Hero/Hero.scss +150 -0
  12. package/dist/content/Hero/index.d.ts +3 -0
  13. package/dist/content/Hero/index.d.ts.map +1 -0
  14. package/dist/content/Hero/index.js +2 -0
  15. package/dist/content/StatBlock/StatBlock.d.ts +15 -0
  16. package/dist/content/StatBlock/StatBlock.d.ts.map +1 -0
  17. package/dist/content/StatBlock/StatBlock.js +10 -0
  18. package/dist/content/StatBlock/StatBlock.scss +83 -0
  19. package/dist/content/StatBlock/index.d.ts +3 -0
  20. package/dist/content/StatBlock/index.d.ts.map +1 -0
  21. package/dist/content/StatBlock/index.js +2 -0
  22. package/dist/feedback/Dialog/Dialog.d.ts +18 -0
  23. package/dist/feedback/Dialog/Dialog.d.ts.map +1 -0
  24. package/dist/feedback/Dialog/Dialog.js +33 -0
  25. package/dist/feedback/Dialog/Dialog.scss +158 -0
  26. package/dist/feedback/Dialog/index.d.ts +2 -0
  27. package/dist/feedback/Dialog/index.d.ts.map +1 -0
  28. package/dist/feedback/Dialog/index.js +1 -0
  29. package/dist/feedback/PopupForm/PopupForm.d.ts +24 -0
  30. package/dist/feedback/PopupForm/PopupForm.d.ts.map +1 -0
  31. package/dist/feedback/PopupForm/PopupForm.js +13 -0
  32. package/dist/feedback/PopupForm/PopupForm.scss +34 -0
  33. package/dist/feedback/PopupForm/index.d.ts +2 -0
  34. package/dist/feedback/PopupForm/index.d.ts.map +1 -0
  35. package/dist/feedback/PopupForm/index.js +1 -0
  36. package/dist/index.d.ts +21 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +25 -0
  39. package/dist/layout/Container/Container.d.ts +11 -0
  40. package/dist/layout/Container/Container.d.ts.map +1 -0
  41. package/dist/layout/Container/Container.js +7 -0
  42. package/dist/layout/Container/Container.scss +40 -0
  43. package/dist/layout/Container/index.d.ts +3 -0
  44. package/dist/layout/Container/index.d.ts.map +1 -0
  45. package/dist/layout/Container/index.js +2 -0
  46. package/dist/layout/Divider/Divider.d.ts +12 -0
  47. package/dist/layout/Divider/Divider.d.ts.map +1 -0
  48. package/dist/layout/Divider/Divider.js +7 -0
  49. package/dist/layout/Divider/Divider.scss +117 -0
  50. package/dist/layout/Divider/index.d.ts +3 -0
  51. package/dist/layout/Divider/index.d.ts.map +1 -0
  52. package/dist/layout/Divider/index.js +2 -0
  53. package/dist/layout/Grid/Grid.d.ts +24 -0
  54. package/dist/layout/Grid/Grid.d.ts.map +1 -0
  55. package/dist/layout/Grid/Grid.js +11 -0
  56. package/dist/layout/Grid/Grid.scss +81 -0
  57. package/dist/layout/Grid/index.d.ts +3 -0
  58. package/dist/layout/Grid/index.d.ts.map +1 -0
  59. package/dist/layout/Grid/index.js +2 -0
  60. package/dist/layout/Section/Section.d.ts +13 -0
  61. package/dist/layout/Section/Section.d.ts.map +1 -0
  62. package/dist/layout/Section/Section.js +7 -0
  63. package/dist/layout/Section/Section.scss +74 -0
  64. package/dist/layout/Section/index.d.ts +3 -0
  65. package/dist/layout/Section/index.d.ts.map +1 -0
  66. package/dist/layout/Section/index.js +2 -0
  67. package/dist/layout/Stack/Stack.d.ts +18 -0
  68. package/dist/layout/Stack/Stack.d.ts.map +1 -0
  69. package/dist/layout/Stack/Stack.js +7 -0
  70. package/dist/layout/Stack/Stack.scss +61 -0
  71. package/dist/layout/Stack/index.d.ts +3 -0
  72. package/dist/layout/Stack/index.d.ts.map +1 -0
  73. package/dist/layout/Stack/index.js +2 -0
  74. package/dist/navigation/Footer/Footer.d.ts +31 -0
  75. package/dist/navigation/Footer/Footer.d.ts.map +1 -0
  76. package/dist/navigation/Footer/Footer.js +21 -0
  77. package/dist/navigation/Footer/Footer.scss +233 -0
  78. package/dist/navigation/Footer/index.d.ts +3 -0
  79. package/dist/navigation/Footer/index.d.ts.map +1 -0
  80. package/dist/navigation/Footer/index.js +2 -0
  81. package/dist/navigation/Header/Header.d.ts +23 -0
  82. package/dist/navigation/Header/Header.d.ts.map +1 -0
  83. package/dist/navigation/Header/Header.js +16 -0
  84. package/dist/navigation/Header/Header.scss +325 -0
  85. package/dist/navigation/Header/index.d.ts +3 -0
  86. package/dist/navigation/Header/index.d.ts.map +1 -0
  87. package/dist/navigation/Header/index.js +2 -0
  88. package/dist/primitives/Button/Button.d.ts +31 -0
  89. package/dist/primitives/Button/Button.d.ts.map +1 -0
  90. package/dist/primitives/Button/Button.js +36 -0
  91. package/dist/primitives/Button/Button.scss +218 -0
  92. package/dist/primitives/Button/index.d.ts +3 -0
  93. package/dist/primitives/Button/index.d.ts.map +1 -0
  94. package/dist/primitives/Button/index.js +2 -0
  95. package/dist/primitives/Checkbox/Checkbox.d.ts +13 -0
  96. package/dist/primitives/Checkbox/Checkbox.d.ts.map +1 -0
  97. package/dist/primitives/Checkbox/Checkbox.js +10 -0
  98. package/dist/primitives/Checkbox/Checkbox.scss +114 -0
  99. package/dist/primitives/Checkbox/index.d.ts +3 -0
  100. package/dist/primitives/Checkbox/index.d.ts.map +1 -0
  101. package/dist/primitives/Checkbox/index.js +2 -0
  102. package/dist/primitives/TextField/TextField.d.ts +22 -0
  103. package/dist/primitives/TextField/TextField.d.ts.map +1 -0
  104. package/dist/primitives/TextField/TextField.js +14 -0
  105. package/dist/primitives/TextField/TextField.scss +93 -0
  106. package/dist/primitives/TextField/index.d.ts +3 -0
  107. package/dist/primitives/TextField/index.d.ts.map +1 -0
  108. package/dist/primitives/TextField/index.js +2 -0
  109. package/dist/styles/fonts.scss +27 -0
  110. package/dist/styles/main.scss +36 -0
  111. package/dist/styles/tokens.scss +301 -0
  112. package/dist/styles/typography.scss +232 -0
  113. package/package.json +12 -11
  114. package/src/content/Card/Card.stories.tsx +389 -0
  115. package/src/content/Card/index.ts +2 -2
  116. package/src/content/Hero/Hero.stories.tsx +299 -0
  117. package/src/content/Hero/index.ts +2 -2
  118. package/src/content/StatBlock/StatBlock.stories.tsx +331 -0
  119. package/src/content/StatBlock/index.ts +2 -2
  120. package/src/feedback/Dialog/Dialog.stories.tsx +286 -0
  121. package/src/feedback/Dialog/index.ts +1 -1
  122. package/src/feedback/PopupForm/PopupForm.stories.tsx +341 -0
  123. package/src/feedback/PopupForm/PopupForm.tsx +2 -2
  124. package/src/feedback/PopupForm/index.ts +1 -1
  125. package/src/index.ts +15 -15
  126. package/src/layout/Container/Container.stories.tsx +153 -0
  127. package/src/layout/Container/index.ts +2 -2
  128. package/src/layout/Divider/Divider.stories.tsx +204 -0
  129. package/src/layout/Divider/index.ts +2 -2
  130. package/src/layout/Grid/Grid.stories.tsx +263 -0
  131. package/src/layout/Grid/index.ts +2 -2
  132. package/src/layout/Section/Section.stories.tsx +173 -0
  133. package/src/layout/Section/index.ts +2 -2
  134. package/src/layout/Stack/Stack.stories.tsx +342 -0
  135. package/src/layout/Stack/index.ts +2 -2
  136. package/src/navigation/Footer/Footer.stories.tsx +351 -0
  137. package/src/navigation/Footer/index.ts +2 -2
  138. package/src/navigation/Header/Header.stories.tsx +346 -0
  139. package/src/navigation/Header/index.ts +2 -2
  140. package/src/primitives/Button/Button.stories.tsx +300 -0
  141. package/src/primitives/Button/index.ts +2 -2
  142. package/src/primitives/Checkbox/Checkbox.stories.tsx +204 -0
  143. package/src/primitives/Checkbox/index.ts +2 -2
  144. package/src/primitives/TextField/TextField.stories.tsx +265 -0
  145. package/src/primitives/TextField/index.ts +2 -2
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import cx from "classnames";
3
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4
+ import { faArrowRight } from "@fortawesome/free-solid-svg-icons";
5
+ export function Button({ variant = "solid-auburn", size = "md", className, style, href, onClick, text, children, ariaLabel, type = "button", icon = faArrowRight, iconPosition = "right", fullWidth = false, dataTrackNote, disabled, }) {
6
+ const classes = cx("bc-btn", `bc-btn--${variant}`, `bc-btn--${size}`, className, {
7
+ "bc-btn--icon-only": icon && !text && !children,
8
+ "bc-btn--full-width": fullWidth,
9
+ });
10
+ const content = (_jsxs(_Fragment, { children: [iconPosition === "left" && icon && (_jsx(FontAwesomeIcon, { className: cx("bc-btn__icon", { "bc-btn__icon--left": text || children }), icon: icon })), text && _jsx("span", { className: "bc-btn__text", children: text }), children, iconPosition !== "left" && icon && (_jsx(FontAwesomeIcon, { className: cx("bc-btn__icon", { "bc-btn__icon--right": text || children }), icon: icon }))] }));
11
+ if (href) {
12
+ const aProps = {
13
+ href: disabled ? undefined : href,
14
+ className: classes,
15
+ style,
16
+ "data-track-note": dataTrackNote,
17
+ onClick: disabled
18
+ ? (e) => e.preventDefault()
19
+ : undefined,
20
+ "aria-label": ariaLabel,
21
+ "aria-disabled": disabled,
22
+ };
23
+ return _jsx("a", { ...aProps, children: content });
24
+ }
25
+ const buttonProps = {
26
+ type,
27
+ className: classes,
28
+ style,
29
+ onClick,
30
+ "aria-label": ariaLabel,
31
+ "data-track-note": dataTrackNote,
32
+ disabled,
33
+ };
34
+ return _jsx("button", { ...buttonProps, children: content });
35
+ }
36
+ export default Button;
@@ -0,0 +1,218 @@
1
+ @use "../../styles/tokens" as *;
2
+ @use "../../styles/typography" as *;
3
+
4
+ /*******************************************************************************
5
+ * Button Component
6
+ *
7
+ * Design notes:
8
+ * - Square corners (border-radius: 0) per brand motif "Huge Square Buttons"
9
+ * - Uppercase text with letter-spacing
10
+ * - Three sizes: sm (36px), md (44px), lg (56px)
11
+ ******************************************************************************/
12
+
13
+ .bc-btn {
14
+ @include button-text-md;
15
+ display: inline-flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ gap: $space-1;
19
+ border: 2px solid transparent;
20
+ border-radius: $radius-none;
21
+ cursor: pointer;
22
+ text-decoration: none;
23
+ transition: all $transition-fast;
24
+ white-space: nowrap;
25
+
26
+ &:focus-visible {
27
+ outline: 2px solid $auburn;
28
+ outline-offset: 2px;
29
+ }
30
+
31
+ /***************************************************************************
32
+ * Size Variants
33
+ ***************************************************************************/
34
+
35
+ &--sm {
36
+ @include button-text-sm;
37
+ padding: $space-1 $space-2;
38
+ min-height: 36px;
39
+ }
40
+
41
+ &--md {
42
+ @include button-text-md;
43
+ padding: calc($space-1 + 4px) $space-3;
44
+ min-height: 44px;
45
+ }
46
+
47
+ &--lg {
48
+ @include button-text-lg;
49
+ padding: $space-2 $space-4;
50
+ min-height: 56px;
51
+ }
52
+
53
+ /***************************************************************************
54
+ * Solid Variants
55
+ ***************************************************************************/
56
+
57
+ &--solid-auburn {
58
+ background-color: $auburn;
59
+ border-color: $auburn;
60
+ color: $white;
61
+
62
+ &:hover:not(:disabled) {
63
+ background-color: $auburn-600;
64
+ border-color: $auburn-600;
65
+ }
66
+
67
+ &:active:not(:disabled) {
68
+ background-color: $auburn-700;
69
+ border-color: $auburn-700;
70
+ }
71
+ }
72
+
73
+ &--solid-charcoal {
74
+ background-color: $charcoal;
75
+ border-color: $charcoal;
76
+ color: $white;
77
+
78
+ &:hover:not(:disabled) {
79
+ background-color: $gray-700;
80
+ border-color: $gray-700;
81
+ }
82
+
83
+ &:active:not(:disabled) {
84
+ background-color: $gray-600;
85
+ border-color: $gray-600;
86
+ }
87
+ }
88
+
89
+ &--solid-linen {
90
+ background-color: $linen;
91
+ border-color: $linen;
92
+ color: $charcoal;
93
+
94
+ &:hover:not(:disabled) {
95
+ background-color: darken($linen, 5%);
96
+ border-color: darken($linen, 5%);
97
+ }
98
+
99
+ &:active:not(:disabled) {
100
+ background-color: darken($linen, 8%);
101
+ border-color: darken($linen, 8%);
102
+ }
103
+ }
104
+
105
+ /***************************************************************************
106
+ * Outline Variants
107
+ ***************************************************************************/
108
+
109
+ &--outline-auburn {
110
+ background-color: transparent;
111
+ border-color: $auburn;
112
+ color: $auburn;
113
+
114
+ &:hover:not(:disabled) {
115
+ background-color: $auburn;
116
+ color: $white;
117
+ }
118
+
119
+ &:active:not(:disabled) {
120
+ background-color: $auburn-600;
121
+ border-color: $auburn-600;
122
+ color: $white;
123
+ }
124
+ }
125
+
126
+ &--outline-charcoal {
127
+ background-color: transparent;
128
+ border-color: $charcoal;
129
+ color: $charcoal;
130
+
131
+ &:hover:not(:disabled) {
132
+ background-color: $charcoal;
133
+ color: $white;
134
+ }
135
+
136
+ &:active:not(:disabled) {
137
+ background-color: $gray-700;
138
+ border-color: $gray-700;
139
+ color: $white;
140
+ }
141
+ }
142
+
143
+ &--outline-white {
144
+ background-color: transparent;
145
+ border-color: $white;
146
+ color: $white;
147
+
148
+ &:hover:not(:disabled) {
149
+ background-color: $white;
150
+ color: $charcoal;
151
+ }
152
+
153
+ &:active:not(:disabled) {
154
+ background-color: $gray-100;
155
+ border-color: $gray-100;
156
+ color: $charcoal;
157
+ }
158
+ }
159
+
160
+ /***************************************************************************
161
+ * State Modifiers
162
+ ***************************************************************************/
163
+
164
+ &:disabled {
165
+ opacity: 0.5;
166
+ cursor: not-allowed;
167
+ }
168
+
169
+ &--icon-only {
170
+ padding: $space-1;
171
+
172
+ &.bc-btn--sm {
173
+ padding: calc($space-1 - 2px);
174
+ min-width: 36px;
175
+ }
176
+
177
+ &.bc-btn--md {
178
+ padding: calc($space-1 + 2px);
179
+ min-width: 44px;
180
+ }
181
+
182
+ &.bc-btn--lg {
183
+ padding: $space-2;
184
+ min-width: 56px;
185
+ }
186
+ }
187
+
188
+ &--full-width {
189
+ width: 100%;
190
+ }
191
+
192
+ /***************************************************************************
193
+ * Icon Styles
194
+ ***************************************************************************/
195
+
196
+ &__icon {
197
+ font-size: 0.875em;
198
+ transition: transform $transition-fast;
199
+
200
+ &--left {
201
+ margin-right: $space-1;
202
+ }
203
+
204
+ &--right {
205
+ margin-left: $space-1;
206
+ }
207
+ }
208
+
209
+ // Animated arrow on hover (buildcanada.com style)
210
+ &:hover:not(:disabled) &__icon--right {
211
+ transform: translateX(4px);
212
+ }
213
+
214
+ &__text {
215
+ // Ensure text is vertically centered
216
+ line-height: 1;
217
+ }
218
+ }
@@ -0,0 +1,3 @@
1
+ export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from "./Button.js";
2
+ export { default } from "./Button.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { Button } from "./Button.js";
2
+ export { default } from "./Button.js";
@@ -0,0 +1,13 @@
1
+ export interface CheckboxProps {
2
+ label: string;
3
+ checked?: boolean;
4
+ defaultChecked?: boolean;
5
+ name?: string;
6
+ id?: string;
7
+ className?: string;
8
+ disabled?: boolean;
9
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
10
+ }
11
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
12
+ export default Checkbox;
13
+ //# sourceMappingURL=Checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/primitives/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;CAC9D;AAED,eAAO,MAAM,QAAQ,4GA0DpB,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import cx from "classnames";
3
+ import { forwardRef, useId } from "react";
4
+ export const Checkbox = forwardRef(function Checkbox({ label, checked, defaultChecked, name, id: providedId, className, disabled = false, onChange, }, ref) {
5
+ const generatedId = useId();
6
+ const id = providedId || generatedId;
7
+ const classes = cx("bc-checkbox", { "bc-checkbox--disabled": disabled }, className);
8
+ return (_jsxs("div", { className: classes, children: [_jsx("input", { ref: ref, type: "checkbox", id: id, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, className: "bc-checkbox__input", onChange: onChange }), _jsxs("label", { htmlFor: id, className: "bc-checkbox__label", children: [_jsx("span", { className: "bc-checkbox__box", children: _jsx("svg", { className: "bc-checkbox__check", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.5 4L5.5 10L2.5 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }) }) }), _jsx("span", { className: "bc-checkbox__text", children: label })] })] }));
9
+ });
10
+ export default Checkbox;
@@ -0,0 +1,114 @@
1
+ @use "../../styles/tokens" as *;
2
+ @use "../../styles/typography" as *;
3
+
4
+ /*******************************************************************************
5
+ * Checkbox Component
6
+ ******************************************************************************/
7
+
8
+ .bc-checkbox {
9
+ display: inline-flex;
10
+
11
+ /***************************************************************************
12
+ * Hidden native input
13
+ ***************************************************************************/
14
+
15
+ &__input {
16
+ position: absolute;
17
+ width: 1px;
18
+ height: 1px;
19
+ padding: 0;
20
+ margin: -1px;
21
+ overflow: hidden;
22
+ clip: rect(0, 0, 0, 0);
23
+ white-space: nowrap;
24
+ border: 0;
25
+ }
26
+
27
+ /***************************************************************************
28
+ * Label wrapper
29
+ ***************************************************************************/
30
+
31
+ &__label {
32
+ display: inline-flex;
33
+ align-items: center;
34
+ gap: $space-1;
35
+ cursor: pointer;
36
+ user-select: none;
37
+ }
38
+
39
+ /***************************************************************************
40
+ * Custom checkbox box
41
+ ***************************************************************************/
42
+
43
+ &__box {
44
+ display: inline-flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ width: 20px;
48
+ height: 20px;
49
+ border: 2px solid $border-default;
50
+ border-radius: $radius-none;
51
+ background-color: $white;
52
+ transition: all $transition-fast;
53
+ flex-shrink: 0;
54
+ }
55
+
56
+ &__check {
57
+ width: 14px;
58
+ height: 14px;
59
+ color: $white;
60
+ opacity: 0;
61
+ transform: scale(0.8);
62
+ transition: all $transition-fast;
63
+ }
64
+
65
+ &__text {
66
+ @include body-2;
67
+ color: $text-primary;
68
+ }
69
+
70
+ /***************************************************************************
71
+ * States
72
+ ***************************************************************************/
73
+
74
+ // Hover
75
+ &__label:hover &__box {
76
+ border-color: $gray-400;
77
+ }
78
+
79
+ // Focus
80
+ &__input:focus-visible + &__label &__box {
81
+ outline: 2px solid $auburn;
82
+ outline-offset: 2px;
83
+ }
84
+
85
+ // Checked
86
+ &__input:checked + &__label &__box {
87
+ background-color: $auburn;
88
+ border-color: $auburn;
89
+ }
90
+
91
+ &__input:checked + &__label &__check {
92
+ opacity: 1;
93
+ transform: scale(1);
94
+ }
95
+
96
+ // Disabled
97
+ &--disabled &__label {
98
+ cursor: not-allowed;
99
+ }
100
+
101
+ &--disabled &__box {
102
+ background-color: $gray-100;
103
+ border-color: $gray-300;
104
+ }
105
+
106
+ &--disabled &__text {
107
+ color: $text-muted;
108
+ }
109
+
110
+ &--disabled &__input:checked + &__label &__box {
111
+ background-color: $gray-400;
112
+ border-color: $gray-400;
113
+ }
114
+ }
@@ -0,0 +1,3 @@
1
+ export { Checkbox, type CheckboxProps } from "./Checkbox.js";
2
+ export { default } from "./Checkbox.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from "./Checkbox.js";
2
+ export { default } from "./Checkbox.js";
@@ -0,0 +1,22 @@
1
+ export type TextFieldType = "text" | "email" | "password" | "number" | "tel" | "url";
2
+ export interface TextFieldProps {
3
+ label?: string;
4
+ placeholder?: string;
5
+ value?: string;
6
+ defaultValue?: string;
7
+ type?: TextFieldType;
8
+ name?: string;
9
+ id?: string;
10
+ className?: string;
11
+ error?: string;
12
+ hint?: string;
13
+ disabled?: boolean;
14
+ required?: boolean;
15
+ autoComplete?: string;
16
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
17
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
18
+ onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
19
+ }
20
+ export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
21
+ export default TextField;
22
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/primitives/TextField/TextField.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAA;AAEpF,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAC3D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACxD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;CAC5D;AAED,eAAO,MAAM,SAAS,6GA8ErB,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import cx from "classnames";
3
+ import { forwardRef, useId } from "react";
4
+ export const TextField = forwardRef(function TextField({ label, placeholder, value, defaultValue, type = "text", name, id: providedId, className, error, hint, disabled = false, required = false, autoComplete, onChange, onBlur, onFocus, }, ref) {
5
+ const generatedId = useId();
6
+ const id = providedId || generatedId;
7
+ const errorId = `${id}-error`;
8
+ const hintId = `${id}-hint`;
9
+ const hasError = Boolean(error);
10
+ const classes = cx("bc-textfield", { "bc-textfield--error": hasError }, { "bc-textfield--disabled": disabled }, className);
11
+ return (_jsxs("div", { className: classes, children: [label && (_jsxs("label", { htmlFor: id, className: "bc-textfield__label", children: [label, required && _jsx("span", { className: "bc-textfield__required", children: "*" })] })), _jsx("input", { ref: ref, type: type, id: id, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, required: required, autoComplete: autoComplete, className: "bc-textfield__input", "aria-invalid": hasError, "aria-describedby": [error && errorId, hint && hintId].filter(Boolean).join(" ") ||
12
+ undefined, onChange: onChange, onBlur: onBlur, onFocus: onFocus }), hint && !error && (_jsx("p", { id: hintId, className: "bc-textfield__hint", children: hint })), error && (_jsx("p", { id: errorId, className: "bc-textfield__error", role: "alert", children: error }))] }));
13
+ });
14
+ export default TextField;
@@ -0,0 +1,93 @@
1
+ @use "../../styles/tokens" as *;
2
+ @use "../../styles/typography" as *;
3
+
4
+ /*******************************************************************************
5
+ * TextField Component
6
+ ******************************************************************************/
7
+
8
+ .bc-textfield {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: calc($space-1 / 2);
12
+
13
+ /***************************************************************************
14
+ * Label
15
+ ***************************************************************************/
16
+
17
+ &__label {
18
+ @include label;
19
+ color: $text-primary;
20
+ }
21
+
22
+ &__required {
23
+ color: $auburn;
24
+ margin-left: 2px;
25
+ }
26
+
27
+ /***************************************************************************
28
+ * Input
29
+ ***************************************************************************/
30
+
31
+ &__input {
32
+ @include body-2;
33
+ width: 100%;
34
+ padding: calc($space-1 + 4px) $space-2;
35
+ border: 2px solid $border-default;
36
+ border-radius: $radius-none;
37
+ background-color: $white;
38
+ color: $text-primary;
39
+ transition: border-color $transition-fast, box-shadow $transition-fast;
40
+
41
+ &::placeholder {
42
+ color: $text-muted;
43
+ }
44
+
45
+ &:hover:not(:disabled) {
46
+ border-color: $gray-400;
47
+ }
48
+
49
+ &:focus {
50
+ outline: none;
51
+ border-color: $auburn;
52
+ box-shadow: 0 0 0 3px rgba($auburn, 0.1);
53
+ }
54
+
55
+ &:disabled {
56
+ background-color: $gray-100;
57
+ color: $text-muted;
58
+ cursor: not-allowed;
59
+ }
60
+ }
61
+
62
+ /***************************************************************************
63
+ * Hint & Error
64
+ ***************************************************************************/
65
+
66
+ &__hint {
67
+ @include body-3;
68
+ color: $text-secondary;
69
+ margin: 0;
70
+ }
71
+
72
+ &__error {
73
+ @include body-3;
74
+ color: $auburn;
75
+ margin: 0;
76
+ }
77
+
78
+ /***************************************************************************
79
+ * States
80
+ ***************************************************************************/
81
+
82
+ &--error &__input {
83
+ border-color: $auburn;
84
+
85
+ &:focus {
86
+ box-shadow: 0 0 0 3px rgba($auburn, 0.15);
87
+ }
88
+ }
89
+
90
+ &--disabled &__label {
91
+ color: $text-muted;
92
+ }
93
+ }
@@ -0,0 +1,3 @@
1
+ export { TextField, type TextFieldProps, type TextFieldType } from "./TextField.js";
2
+ export { default } from "./TextField.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { TextField } from "./TextField.js";
2
+ export { default } from "./TextField.js";
@@ -0,0 +1,27 @@
1
+ /*******************************************************************************
2
+ * Build Canada Font Definitions
3
+ ******************************************************************************/
4
+
5
+ @font-face {
6
+ font-family: 'Soehne Kraftig';
7
+ src: url('/assets/fonts/soehne-kraftig.woff2') format('woff2');
8
+ font-weight: 500;
9
+ font-style: normal;
10
+ font-display: swap;
11
+ }
12
+
13
+ @font-face {
14
+ font-family: 'Financier Text';
15
+ src: url('/assets/fonts/financier-text-regular.woff2') format('woff2');
16
+ font-weight: 400;
17
+ font-style: normal;
18
+ font-display: swap;
19
+ }
20
+
21
+ @font-face {
22
+ font-family: 'Founders Grotesk Mono';
23
+ src: url('/assets/fonts/founders-grotesk-mono-regular.woff2') format('woff2');
24
+ font-weight: 400;
25
+ font-style: normal;
26
+ font-display: swap;
27
+ }
@@ -0,0 +1,36 @@
1
+ /*******************************************************************************
2
+ * Build Canada Components - Main Stylesheet
3
+ *
4
+ * All @use statements must come first before any other rules
5
+ ******************************************************************************/
6
+
7
+ @use "fonts";
8
+ @use "tokens";
9
+ @use "typography";
10
+
11
+ // Component stylesheets (using @use to include their CSS output)
12
+ @use "../primitives/Button/Button.scss";
13
+ @use "../primitives/TextField/TextField.scss";
14
+ @use "../primitives/Checkbox/Checkbox.scss";
15
+ @use "../layout/Container/Container.scss";
16
+ @use "../layout/Section/Section.scss";
17
+ @use "../layout/Grid/Grid.scss";
18
+ @use "../layout/Stack/Stack.scss";
19
+ @use "../layout/Divider/Divider.scss";
20
+ @use "../content/Card/Card.scss";
21
+ @use "../content/Hero/Hero.scss";
22
+ @use "../content/StatBlock/StatBlock.scss";
23
+ @use "../navigation/Header/Header.scss";
24
+ @use "../navigation/Footer/Footer.scss";
25
+ @use "../feedback/Dialog/Dialog.scss";
26
+ @use "../feedback/PopupForm/PopupForm.scss";
27
+
28
+ /*******************************************************************************
29
+ * Base Styles
30
+ ******************************************************************************/
31
+
32
+ *,
33
+ *::before,
34
+ *::after {
35
+ box-sizing: border-box;
36
+ }