@nearform/quantum 0.0.1 → 0.0.3
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/dist/index.d.ts +13 -1
- package/dist/index.js +142 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/.commitlintrc +0 -5
- package/.editorconfig +0 -6
- package/.eslintrc +0 -11
- package/.github/ISSUE_TEMPLATE/component-issue-template.md +0 -13
- package/.github/ISSUE_TEMPLATE/tailwind-config-customisation-issue.md +0 -11
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/check-linked-issues.yml +0 -20
- package/.github/workflows/ci.yml +0 -31
- package/.github/workflows/deploy-github-pages.yml +0 -44
- package/.github/workflows/notify-release.yml +0 -19
- package/.github/workflows/release.yml +0 -29
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -4
- package/.nvmrc +0 -1
- package/.prettierrc +0 -6
- package/.storybook/main.ts +0 -34
- package/.storybook/manager.ts +0 -6
- package/.storybook/preview.ts +0 -21
- package/.storybook/theme.ts +0 -6
- package/.svg-to-tsrc +0 -18
- package/index.js +0 -0
- package/postcss.config.js +0 -3
- package/src/assets/build/check.icon.tsx +0 -16
- package/src/assets/build/minus.icon.tsx +0 -14
- package/src/assets/build/radioselected.icon.tsx +0 -7
- package/src/assets/index.ts +0 -3
- package/src/assets/svg-icons/check.svg +0 -5
- package/src/assets/svg-icons/minus.svg +0 -5
- package/src/assets/svg-icons/radio-selected.svg +0 -5
- package/src/colors.ts +0 -164
- package/src/components/Button/index.tsx +0 -72
- package/src/components/Checkbox/index.tsx +0 -32
- package/src/components/Label/index.tsx +0 -26
- package/src/components/Radio/RadioGroup.tsx +0 -20
- package/src/components/Radio/RadioGroupItem.tsx +0 -26
- package/src/components/Radio/index.tsx +0 -2
- package/src/global.css +0 -4
- package/src/index.ts +0 -2
- package/src/lib/utils.ts +0 -6
- package/stories/Button/Button.stories.tsx +0 -74
- package/stories/Checkbox/CheckBox.example.tsx +0 -16
- package/stories/Checkbox/Checkbox.stories.ts +0 -42
- package/stories/Colors.mdx +0 -49
- package/stories/Label/Label.example.tsx +0 -20
- package/stories/Label/Label.stories.ts +0 -27
- package/stories/Radio/Radio.example.tsx +0 -39
- package/stories/Radio/Radio.stories.ts +0 -32
- package/stories/global.css +0 -6
- package/stories/tailwind.config.js +0 -5
- package/tailwind.config.js +0 -47
- package/tsconfig.json +0 -14
- package/tsup.config.ts +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
export { LabelProps } from '@radix-ui/react-label';
|
|
7
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
8
|
|
|
5
9
|
declare const colors: {
|
|
6
10
|
grey: {
|
|
@@ -134,4 +138,12 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Var
|
|
|
134
138
|
}
|
|
135
139
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
142
|
+
|
|
143
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
144
|
+
|
|
145
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
146
|
+
|
|
147
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
148
|
+
|
|
149
|
+
export { Button, ButtonProps, Checkbox, Label, RadioGroupItem as Radio, RadioGroup, buttonVariants, colors };
|
package/dist/index.js
CHANGED
|
@@ -1302,7 +1302,7 @@ var require_react_development = __commonJS({
|
|
|
1302
1302
|
}
|
|
1303
1303
|
return lazyType;
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1305
|
+
function forwardRef6(render) {
|
|
1306
1306
|
{
|
|
1307
1307
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1308
1308
|
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
@@ -2199,7 +2199,7 @@ var require_react_development = __commonJS({
|
|
|
2199
2199
|
exports.createElement = createElement$1;
|
|
2200
2200
|
exports.createFactory = createFactory;
|
|
2201
2201
|
exports.createRef = createRef;
|
|
2202
|
-
exports.forwardRef =
|
|
2202
|
+
exports.forwardRef = forwardRef6;
|
|
2203
2203
|
exports.isValidElement = isValidElement;
|
|
2204
2204
|
exports.lazy = lazy;
|
|
2205
2205
|
exports.memo = memo;
|
|
@@ -2276,7 +2276,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
2276
2276
|
if (process.env.NODE_ENV !== "production") {
|
|
2277
2277
|
(function() {
|
|
2278
2278
|
"use strict";
|
|
2279
|
-
var
|
|
2279
|
+
var React6 = require_react();
|
|
2280
2280
|
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
2281
2281
|
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
2282
2282
|
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
@@ -2302,7 +2302,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
2302
2302
|
}
|
|
2303
2303
|
return null;
|
|
2304
2304
|
}
|
|
2305
|
-
var ReactSharedInternals =
|
|
2305
|
+
var ReactSharedInternals = React6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2306
2306
|
function error(format) {
|
|
2307
2307
|
{
|
|
2308
2308
|
{
|
|
@@ -3137,11 +3137,11 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
3137
3137
|
return jsxWithValidation(type, props, key, false);
|
|
3138
3138
|
}
|
|
3139
3139
|
}
|
|
3140
|
-
var
|
|
3141
|
-
var
|
|
3140
|
+
var jsx9 = jsxWithValidationDynamic;
|
|
3141
|
+
var jsxs2 = jsxWithValidationStatic;
|
|
3142
3142
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
3143
|
-
exports.jsx =
|
|
3144
|
-
exports.jsxs =
|
|
3143
|
+
exports.jsx = jsx9;
|
|
3144
|
+
exports.jsxs = jsxs2;
|
|
3145
3145
|
})();
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
@@ -3163,6 +3163,10 @@ var require_jsx_runtime = __commonJS({
|
|
|
3163
3163
|
var src_exports = {};
|
|
3164
3164
|
__export(src_exports, {
|
|
3165
3165
|
Button: () => Button,
|
|
3166
|
+
Checkbox: () => Checkbox,
|
|
3167
|
+
Label: () => Label,
|
|
3168
|
+
Radio: () => RadioGroupItem,
|
|
3169
|
+
RadioGroup: () => RadioGroup,
|
|
3166
3170
|
buttonVariants: () => buttonVariants,
|
|
3167
3171
|
colors: () => colors
|
|
3168
3172
|
});
|
|
@@ -3482,9 +3486,139 @@ var Button = React.forwardRef(
|
|
|
3482
3486
|
}
|
|
3483
3487
|
);
|
|
3484
3488
|
Button.displayName = "Button";
|
|
3489
|
+
|
|
3490
|
+
// src/components/Checkbox/index.tsx
|
|
3491
|
+
var React2 = __toESM(require_react());
|
|
3492
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
3493
|
+
|
|
3494
|
+
// src/assets/build/check.icon.tsx
|
|
3495
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
|
3496
|
+
var Check = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3497
|
+
"svg",
|
|
3498
|
+
__spreadProps(__spreadValues({
|
|
3499
|
+
viewBox: "0 0 24 24",
|
|
3500
|
+
fill: "none",
|
|
3501
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3502
|
+
}, props), {
|
|
3503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("g", { id: "check", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3504
|
+
"path",
|
|
3505
|
+
{
|
|
3506
|
+
id: "Vector",
|
|
3507
|
+
d: "M9.72648 17.5L9.72217 17.5C9.60611 17.5005 9.4852 17.4519 9.38785 17.3489L4.66647 12.3507C4.66633 12.3506 4.6662 12.3504 4.66607 12.3503C4.6169 12.2978 4.57557 12.233 4.54633 12.1585L4.08221 12.3408L4.54633 12.1585C4.517 12.0838 4.50096 12.0022 4.50004 11.9186C4.49817 11.748 4.55898 11.5911 4.65755 11.481C4.75482 11.3723 4.87789 11.3197 4.99627 11.3182C5.11455 11.3166 5.23805 11.3658 5.33701 11.4712L5.33813 11.4724L9.36492 15.7335L9.72855 16.1183L10.0919 15.7333L18.6614 6.65376L18.662 6.65306C18.7612 6.54761 18.8849 6.4984 19.0033 6.50004C19.1219 6.50168 19.2451 6.55443 19.3425 6.66337C19.4412 6.77376 19.5019 6.93091 19.5 7.10171C19.498 7.27229 19.4337 7.42694 19.3334 7.53385C19.3333 7.53398 19.3332 7.5341 19.3331 7.53423L10.0608 17.3489C9.96345 17.4519 9.84254 17.5005 9.72648 17.5Z"
|
|
3508
|
+
}
|
|
3509
|
+
) })
|
|
3510
|
+
})
|
|
3511
|
+
);
|
|
3512
|
+
|
|
3513
|
+
// src/assets/build/minus.icon.tsx
|
|
3514
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime());
|
|
3515
|
+
var Minus = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", __spreadProps(__spreadValues({ viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("g", { id: "minus", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3516
|
+
"path",
|
|
3517
|
+
{
|
|
3518
|
+
id: "Vector",
|
|
3519
|
+
d: "M19 12L5 12",
|
|
3520
|
+
strokeWidth: "inherit",
|
|
3521
|
+
strokeLinecap: "round",
|
|
3522
|
+
strokeLinejoin: "round"
|
|
3523
|
+
}
|
|
3524
|
+
) }) }));
|
|
3525
|
+
|
|
3526
|
+
// src/assets/build/radioselected.icon.tsx
|
|
3527
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime());
|
|
3528
|
+
var RadioSelected = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg" }, props), { viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("g", { id: "State=Selected", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { id: "Ellipse 1", cx: 10, cy: 10, r: 4 }) }) }));
|
|
3529
|
+
|
|
3530
|
+
// src/components/Checkbox/index.tsx
|
|
3531
|
+
var import_jsx_runtime5 = __toESM(require_jsx_runtime());
|
|
3532
|
+
var Checkbox = React2.forwardRef((_a, ref) => {
|
|
3533
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3535
|
+
CheckboxPrimitive.Root,
|
|
3536
|
+
__spreadProps(__spreadValues({
|
|
3537
|
+
ref,
|
|
3538
|
+
className: cn(
|
|
3539
|
+
"peer h-5 w-5 p-0.5 shrink-0 gap-0 rounded border border-border-default data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-foreground-inverse data-[state=indeterminate]:border-blue-600 data-[state=indeterminate]:bg-blue-600 data-[state=indeterminate]:text-foreground-inverse",
|
|
3540
|
+
className
|
|
3541
|
+
)
|
|
3542
|
+
}, props), {
|
|
3543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
3544
|
+
CheckboxPrimitive.Indicator,
|
|
3545
|
+
{
|
|
3546
|
+
className: cn("flex items-center justify-center text-inherit"),
|
|
3547
|
+
children: [
|
|
3548
|
+
(props.checked === true || props.checked === void 0) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Check, { className: "text-inherit stroke-current stroke-1 fill-current" }),
|
|
3549
|
+
props.checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Minus, { className: "text-inherit stroke-current stroke-3 fill-current" })
|
|
3550
|
+
]
|
|
3551
|
+
}
|
|
3552
|
+
)
|
|
3553
|
+
})
|
|
3554
|
+
);
|
|
3555
|
+
});
|
|
3556
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
3557
|
+
|
|
3558
|
+
// src/components/Label/index.tsx
|
|
3559
|
+
var React3 = __toESM(require_react());
|
|
3560
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
3561
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
3562
|
+
var import_jsx_runtime6 = __toESM(require_jsx_runtime());
|
|
3563
|
+
var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
3564
|
+
"text-sm font-medium leading-normal peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-foreground-inverse"
|
|
3565
|
+
);
|
|
3566
|
+
var Label = React3.forwardRef((_a, ref) => {
|
|
3567
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3569
|
+
LabelPrimitive.Root,
|
|
3570
|
+
__spreadValues({
|
|
3571
|
+
ref,
|
|
3572
|
+
className: cn(labelVariants(), className)
|
|
3573
|
+
}, props)
|
|
3574
|
+
);
|
|
3575
|
+
});
|
|
3576
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
3577
|
+
|
|
3578
|
+
// src/components/Radio/RadioGroup.tsx
|
|
3579
|
+
var React4 = __toESM(require_react());
|
|
3580
|
+
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
|
|
3581
|
+
var import_jsx_runtime7 = __toESM(require_jsx_runtime());
|
|
3582
|
+
var RadioGroup = React4.forwardRef((_a, ref) => {
|
|
3583
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3585
|
+
RadioGroupPrimitive.Root,
|
|
3586
|
+
__spreadProps(__spreadValues({
|
|
3587
|
+
className: cn("grid gap-2", className)
|
|
3588
|
+
}, props), {
|
|
3589
|
+
ref
|
|
3590
|
+
})
|
|
3591
|
+
);
|
|
3592
|
+
});
|
|
3593
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
3594
|
+
|
|
3595
|
+
// src/components/Radio/RadioGroupItem.tsx
|
|
3596
|
+
var React5 = __toESM(require_react());
|
|
3597
|
+
var RadioGroupPrimitive2 = __toESM(require("@radix-ui/react-radio-group"));
|
|
3598
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime());
|
|
3599
|
+
var RadioGroupItem = React5.forwardRef((_a, ref) => {
|
|
3600
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
3601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3602
|
+
RadioGroupPrimitive2.Item,
|
|
3603
|
+
__spreadProps(__spreadValues({
|
|
3604
|
+
ref,
|
|
3605
|
+
className: cn(
|
|
3606
|
+
"h-5 w-5 rounded-full border-[0.67px] border-border-default bg-grey-50 disabled:opacity-50 data-[state=checked]:border-primary-600 data-[state=checked]:bg-primary-600 text-foreground-inverse",
|
|
3607
|
+
className
|
|
3608
|
+
)
|
|
3609
|
+
}, props), {
|
|
3610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadioGroupPrimitive2.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadioSelected, { className: "text-inherit stroke-current stroke-1 fill-current" }) })
|
|
3611
|
+
})
|
|
3612
|
+
);
|
|
3613
|
+
});
|
|
3614
|
+
RadioGroupItem.displayName = RadioGroupPrimitive2.Item.displayName;
|
|
3485
3615
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3486
3616
|
0 && (module.exports = {
|
|
3487
3617
|
Button,
|
|
3618
|
+
Checkbox,
|
|
3619
|
+
Label,
|
|
3620
|
+
Radio,
|
|
3621
|
+
RadioGroup,
|
|
3488
3622
|
buttonVariants,
|
|
3489
3623
|
colors
|
|
3490
3624
|
});
|