@bolttech/atoms-checkbox 0.2.2 → 0.3.1

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/index.cjs CHANGED
@@ -1098,13 +1098,15 @@ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign },
1098
1098
  const CheckboxContainer = /*#__PURE__*/styled__default["default"].section.withConfig({
1099
1099
  displayName: "atoms-checkboxstyles__CheckboxContainer",
1100
1100
  componentId: "sc-1gq944z-0"
1101
- })(["display:flex;flex-direction:row;"]);
1101
+ })(["display:flex;flex-direction:row;gap:", ";"], ({
1102
+ theme
1103
+ }) => theme.components.checkbox.gap);
1102
1104
  const Input = /*#__PURE__*/styled__default["default"].input.attrs({
1103
1105
  type: 'checkbox'
1104
1106
  }).withConfig({
1105
1107
  displayName: "atoms-checkboxstyles__Input",
1106
1108
  componentId: "sc-1gq944z-1"
1107
- })(["appearance:none;margin:0;cursor:pointer;width:18px;height:18px;border:1px solid ", ";transform:translateY(-0.075em);display:grid;place-content:center;&:checked{background-color:", ";&::before{content:'';width:12px;height:12px;transform:scale(0);clip-path:polygon(11% 38%,0 53%,49% 90%,100% 24%,87% 11%,47% 65%);box-shadow:inset 12px 12px ", ";}&:not(:disabled){&:hover{background-color:", ";}}}&:focus{box-shadow:0 0 0 1px ", ",0 0 0 2px ", ";border:none;}&:not(:disabled){&:focus{box-shadow:0 0 0 1px ", ",0 0 0 2px ", ";border:none;}&:not(:checked){&:hover::before{content:'';width:12px;height:12px;transform:scale(1);box-shadow:inset 12px 12px ", ";}}}&:checked::before{transform:scale(1);}:disabled{border:1px solid ", ";cursor:not-allowed;&:checked{background-color:", ";&::before{box-shadow:inset 12px 12px ", ";}}}"], ({
1109
+ })(["appearance:none;margin:0;flex-shrink:0;cursor:pointer;width:14px;height:14px;outline:1px solid ", ";outline-offset:-1px;transform:translateY(0.15em);display:grid;place-content:center;&:checked{background-color:", ";&::before{content:'';width:8px;height:8px;transform:scale(0);clip-path:polygon(11% 38%,0 53%,49% 90%,100% 24%,87% 11%,47% 65%);box-shadow:inset 12px 12px ", ";}&:not(:disabled){&:hover{background-color:", ";}}}&:focus{box-shadow:0 0 0 1px ", ",0 0 0 2px ", ";outline:none;}&:not(:disabled){&:focus{box-shadow:0 0 0 1px ", ",0 0 0 2px ", ";outline:none;}&:not(:checked){&:hover::before{content:'';width:8px;height:8px;transform:scale(1);box-shadow:inset 8px 8px ", ";}}}&:checked::before{transform:scale(1);}:disabled{outline:1px solid ", ";cursor:not-allowed;&:checked{background-color:", ";&::before{box-shadow:inset 12px 12px ", ";}}}"], ({
1108
1110
  theme,
1109
1111
  error
1110
1112
  }) => error ? theme.components.checkbox.square.color.error : theme.components.checkbox.square.color.default, ({
@@ -1133,7 +1135,7 @@ const Input = /*#__PURE__*/styled__default["default"].input.attrs({
1133
1135
  const Label = /*#__PURE__*/styled__default["default"].label.withConfig({
1134
1136
  displayName: "atoms-checkboxstyles__Label",
1135
1137
  componentId: "sc-1gq944z-2"
1136
- })(["color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";padding-left:", ";"], ({
1138
+ })(["color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";"], ({
1137
1139
  theme,
1138
1140
  disabled
1139
1141
  }) => disabled ? theme.components.checkbox.text.color.textLabel.disable : theme.components.checkbox.text.color.textLabel.default, ({
@@ -1144,9 +1146,7 @@ const Label = /*#__PURE__*/styled__default["default"].label.withConfig({
1144
1146
  theme
1145
1147
  }) => theme.components.checkbox.fieldLabel.fontSize, ({
1146
1148
  theme
1147
- }) => theme.components.checkbox.fieldLabel.letterSpacing, ({
1148
- theme
1149
- }) => theme.components.checkbox.gap);
1149
+ }) => theme.components.checkbox.fieldLabel.letterSpacing);
1150
1150
  const CheckboxContainerError = /*#__PURE__*/styled__default["default"].section.withConfig({
1151
1151
  displayName: "atoms-checkboxstyles__CheckboxContainerError",
1152
1152
  componentId: "sc-1gq944z-3"
@@ -1173,7 +1173,9 @@ function Checkbox({
1173
1173
  errorMessage,
1174
1174
  ref = null,
1175
1175
  checked,
1176
- onChange
1176
+ onChange,
1177
+ onBlur,
1178
+ onFocus
1177
1179
  }) {
1178
1180
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1179
1181
  children: [jsxRuntime.jsxs(CheckboxContainer, {
@@ -1185,7 +1187,9 @@ function Checkbox({
1185
1187
  ref: ref,
1186
1188
  type: "checkbox",
1187
1189
  "data-testid": `${id}-test`,
1188
- onChange: onChange
1190
+ onChange: onChange,
1191
+ onBlur: onBlur,
1192
+ onFocus: onFocus
1189
1193
  }), jsxRuntime.jsx(Label, Object.assign({
1190
1194
  htmlFor: id,
1191
1195
  disabled: disabled
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bolttech/atoms-checkbox",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "main": "./index.cjs",
5
5
  "type": "commonjs",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {
8
- "@edirect/frontend-foundations": "0.0.51",
8
+ "@edirect/frontend-foundations": "0.0.55",
9
9
  "react": "18.2.0",
10
10
  "styled-components": "5.3.6"
11
11
  },
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CheckboxProps } from './atoms-checkbox.type';
3
- export declare function Checkbox({ id, label, disabled, errorMessage, ref, checked, onChange, }: CheckboxProps): JSX.Element;
3
+ export declare function Checkbox({ id, label, disabled, errorMessage, ref, checked, onChange, onBlur, onFocus, }: CheckboxProps): JSX.Element;
@@ -7,4 +7,6 @@ export interface CheckboxProps {
7
7
  checked?: boolean;
8
8
  ref?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
9
9
  onChange?: ChangeEventHandler<HTMLInputElement>;
10
+ onBlur?: ChangeEventHandler<HTMLInputElement>;
11
+ onFocus?: ChangeEventHandler<HTMLInputElement>;
10
12
  }