@thecb/components 12.1.0-beta.0 → 12.1.0-beta.10

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 CHANGED
@@ -140,32 +140,13 @@ Publishing to NPM is automated. When a PR is merged to master, the package will
140
140
  - Run `yarn add @thecb/components`.
141
141
  - To verify it installed successfully, make sure it is in the applicaton's `package.json` file.
142
142
 
143
- ### Local import and development
143
+ ### Testing changes locally
144
144
 
145
- If you are developing locally, you can add or make changes to components in the `@thecb/components` package and see those changes in the application running locally by linking the `@thecb/components` package to your application.
146
- Open the `@thecb/components`, and in the command line
145
+ See **[TESTING.md](./TESTING.md)** for a complete guide to testing your changes. In short, you have three options:
147
146
 
148
- - Run `yarn build`
149
- - Run `yarn link`
150
-
151
- You should see a success message, and directions on how to link this package into an application. In the application you’d like the components, navigate to that application and in the command line
152
-
153
- - Run `yarn link @thecb/components`
154
-
155
- Now the package is linked locally and you can make changes to the `@thecb/components` and you’ll see the changes in the application running `@thecb/components`. To unlink the package, in the application running `@thecb/components` and in the command line
156
-
157
- - Run `yarn unlink @thecb/components`
158
- - Run `yarn install` ` --``force `
159
-
160
- Next go to the `@thecb/components` and in the command line
161
-
162
- - Run `yarn unlink`
163
-
164
- Now the package is unlinked, and you’re using the version on NPM.
165
-
166
- ### Yalc
167
-
168
- If you encounter issues using `yarn link`, a nice alternative is `yalc`. See [https://github.com/wclr/yalc](https://github.com/wclr/yalc) for usage instructions.
147
+ 1. **Storybook** (`yarn storybook`) — fastest, for self-contained component changes
148
+ 2. **Live Sync** (`yarn sync <path-to-project>`) — test inside a real running app without publishing
149
+ 3. **Beta Publish** (`yarn publish-beta`) — publish to npm for CI/CD, QA, or sharing with teammates
169
150
 
170
151
  ### Importing and using components
171
152
 
package/dist/index.cjs.js CHANGED
@@ -22238,43 +22238,45 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
22238
22238
  func();
22239
22239
  }
22240
22240
  };
22241
- var normalizedName = name ? name.replace(/\s+/g, "-") : name;
22242
- var checkboxId = "checkbox-".concat(normalizedName);
22243
- var titleId = title ? "checkboxlabel-".concat(normalizedName) : undefined;
22244
- // aria-label fallback when no visible title or external labelledById is provided
22245
- var ariaLabel = !labelledById && !title ? name : undefined;
22241
+ var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22242
+ var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22243
+ var ariaLabel = ariaLabelledById ? undefined : name;
22246
22244
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22247
22245
  ref: ref,
22248
22246
  padding: "0",
22247
+ tabIndex: "0",
22248
+ role: "checkbox",
22249
+ "aria-checked": checked,
22250
+ "aria-required": isRequired || undefined,
22251
+ "aria-invalid": error,
22252
+ "aria-label": ariaLabel,
22253
+ "aria-labelledby": ariaLabelledById,
22254
+ "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22255
+ onFocus: function onFocus() {
22256
+ return setFocused(true);
22257
+ },
22258
+ onBlur: function onBlur() {
22259
+ return setFocused(false);
22260
+ },
22261
+ onKeyDown: function onKeyDown(e) {
22262
+ return handleClick(e, onChange);
22263
+ },
22249
22264
  hiddenStyles: hidden,
22250
22265
  background: themeValues.backgroundColor,
22251
- extraStyles: "\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22266
+ extraStyles: "\n :focus {\n outline: 0;\n }\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22252
22267
  }, rest), /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22253
- htmlFor: checkboxId,
22254
22268
  "data-qa": dataQa
22255
22269
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22256
22270
  "data-qa": "Checkbox"
22257
22271
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22258
- id: checkboxId,
22272
+ id: "checkbox-".concat(name),
22259
22273
  disabled: disabled,
22260
22274
  name: name,
22261
22275
  checked: checked,
22262
22276
  onChange: onChange,
22263
- tabIndex: "0",
22277
+ tabIndex: "-1",
22264
22278
  required: isRequired,
22265
- "aria-invalid": error,
22266
- "aria-label": ariaLabel,
22267
- "aria-labelledby": labelledById,
22268
- "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22269
- onKeyDown: function onKeyDown(e) {
22270
- return handleClick(e, onChange);
22271
- },
22272
- onFocus: function onFocus() {
22273
- return setFocused(true);
22274
- },
22275
- onBlur: function onBlur() {
22276
- return setFocused(false);
22277
- }
22279
+ "aria-hidden": "true"
22278
22280
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22279
22281
  "aria-hidden": "true",
22280
22282
  error: error,
@@ -27027,7 +27029,7 @@ var NavFooter = function NavFooter(_ref) {
27027
27029
  background: backgroundColor,
27028
27030
  minHeight: footerMinHeight,
27029
27031
  minWidth: "100%",
27030
- extraStyles: isMobile ? "overflow: hidden;" : "height: ".concat(footerMinHeight, "; > * { height: 100%; };")
27032
+ extraStyles: isMobile ? "" : "min-height: ".concat(footerMinHeight, "; > * { min-height: 100%; };")
27031
27033
  }, rest), /*#__PURE__*/React__default.createElement(Center, {
27032
27034
  maxWidth: footerWidth || "76.5rem"
27033
27035
  }, /*#__PURE__*/React__default.createElement(Cover, {
@@ -48247,7 +48249,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48247
48249
  }, html), /*#__PURE__*/React__default.createElement(Cluster, {
48248
48250
  justify: "flex-start",
48249
48251
  align: "center",
48250
- nowrap: true
48252
+ nowrap: true,
48253
+ overflow: true
48251
48254
  }, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48252
48255
  name: id,
48253
48256
  error: hasError,
@@ -48452,7 +48455,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48452
48455
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48453
48456
  name: "bank checkbox",
48454
48457
  dataQa: "Save checking account to wallet",
48455
- title: "Save checking account to wallet (optional).",
48458
+ title: "Save checking account to wallet.",
48456
48459
  checked: walletCheckboxMarked,
48457
48460
  onChange: saveToWallet
48458
48461
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
@@ -48641,7 +48644,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48641
48644
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48642
48645
  name: "credit card checkbox",
48643
48646
  dataQa: "Save credit card to wallet",
48644
- title: "Save credit card to wallet (optional).",
48647
+ title: "Save credit card to wallet.",
48645
48648
  checked: walletCheckboxMarked,
48646
48649
  onChange: saveToWallet
48647
48650
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {