@nearform/quantum 1.8.0 → 1.9.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/README.md +19 -1
- package/dist/animations/index.d.ts +25 -0
- package/dist/animations/index.js +14 -37
- package/dist/animations/index.js.map +1 -1
- package/dist/assets/build/open-source.icon.d.ts +2 -0
- package/dist/assets/build/open-source.icon.js +7 -0
- package/dist/assets/build/open-source.icon.js.map +1 -0
- package/dist/assets/index.d.ts +13 -0
- package/dist/assets/index.js +29 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/colors/accent.d.ts +16 -0
- package/dist/colors/accent.js +21 -0
- package/dist/colors/accent.js.map +1 -0
- package/dist/colors/background.d.ts +36 -0
- package/dist/colors/background.js +41 -0
- package/dist/colors/background.js.map +1 -0
- package/dist/colors/base.d.ts +136 -0
- package/dist/colors/base.js +140 -0
- package/dist/colors/base.js.map +1 -0
- package/dist/colors/border.d.ts +16 -0
- package/dist/colors/border.js +21 -0
- package/dist/colors/border.js.map +1 -0
- package/dist/colors/button.d.ts +106 -0
- package/dist/colors/button.js +115 -0
- package/dist/colors/button.js.map +1 -0
- package/dist/colors/feedback.d.ts +27 -0
- package/dist/colors/feedback.js +32 -0
- package/dist/colors/feedback.js.map +1 -0
- package/dist/colors/foreground.d.ts +35 -0
- package/dist/colors/foreground.js +40 -0
- package/dist/colors/foreground.js.map +1 -0
- package/dist/colors/index.d.ts +351 -0
- package/dist/colors/index.js +13 -416
- package/dist/colors/index.js.map +1 -1
- package/dist/components/Accordion/index.d.ts +13 -0
- package/dist/components/Accordion/index.js +97 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/AppHeader/index.d.ts +21 -0
- package/dist/components/AppHeader/index.js +98 -0
- package/dist/components/AppHeader/index.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +32 -0
- package/dist/components/Avatar/index.js +116 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/BackLink/index.d.ts +9 -0
- package/dist/components/BackLink/index.js +80 -0
- package/dist/components/BackLink/index.js.map +1 -0
- package/dist/components/Badge/index.d.ts +48 -0
- package/dist/components/Badge/index.js +160 -0
- package/dist/components/Badge/index.js.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +13 -0
- package/dist/components/Breadcrumb/index.js +90 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Button/index.d.ts +17 -0
- package/dist/components/Button/index.js +204 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/ButtonGroup/index.d.ts +11 -0
- package/dist/components/ButtonGroup/index.js +102 -0
- package/dist/components/ButtonGroup/index.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +8 -0
- package/dist/components/Calendar/index.js +146 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Card/index.d.ts +28 -0
- package/dist/components/Card/index.js +155 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Chat/index.d.ts +39 -0
- package/dist/components/Chat/index.js +100 -0
- package/dist/components/Chat/index.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +5 -0
- package/dist/components/Checkbox/index.js +128 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +61 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +107 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroupItem.d.ts +19 -0
- package/dist/components/CheckboxGroup/CheckboxGroupItem.js +83 -0
- package/dist/components/CheckboxGroup/CheckboxGroupItem.js.map +1 -0
- package/dist/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/components/CheckboxGroup/index.js +9 -0
- package/dist/components/CheckboxGroup/index.js.map +1 -0
- package/dist/components/Chip/index.d.ts +11 -0
- package/dist/components/Chip/index.js +105 -0
- package/dist/components/Chip/index.js.map +1 -0
- package/dist/components/CodeBlock/index.d.ts +7 -0
- package/dist/components/CodeBlock/index.js +57 -0
- package/dist/components/CodeBlock/index.js.map +1 -0
- package/dist/components/ControlLabel/index.d.ts +13 -0
- package/dist/components/ControlLabel/index.js +83 -0
- package/dist/components/ControlLabel/index.js.map +1 -0
- package/dist/components/DateInput/index.d.ts +26 -0
- package/dist/components/DateInput/index.js +261 -0
- package/dist/components/DateInput/index.js.map +1 -0
- package/dist/components/DocsList/index.d.ts +18 -0
- package/dist/components/DocsList/index.js +125 -0
- package/dist/components/DocsList/index.js.map +1 -0
- package/dist/components/FormGroup/index.d.ts +121 -0
- package/dist/components/FormGroup/index.js +359 -0
- package/dist/components/FormGroup/index.js.map +1 -0
- package/dist/components/HeroButton/index.d.ts +17 -0
- package/dist/components/HeroButton/index.js +139 -0
- package/dist/components/HeroButton/index.js.map +1 -0
- package/dist/components/IconButton/index.d.ts +77 -0
- package/dist/components/IconButton/index.js +235 -0
- package/dist/components/IconButton/index.js.map +1 -0
- package/dist/components/Input/index.d.ts +27 -0
- package/dist/components/Input/index.js +179 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Label/index.d.ts +12 -0
- package/dist/components/Label/index.js +89 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Link/index.d.ts +8 -0
- package/dist/components/Link/index.js +40 -0
- package/dist/components/Link/index.js.map +1 -0
- package/dist/components/Modal/index.d.ts +26 -0
- package/dist/components/Modal/index.js +143 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Navigation/index.d.ts +8 -0
- package/dist/components/Navigation/index.js +65 -0
- package/dist/components/Navigation/index.js.map +1 -0
- package/dist/components/Notice/index.d.ts +17 -0
- package/dist/components/Notice/index.js +134 -0
- package/dist/components/Notice/index.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +15 -0
- package/dist/components/PageHeader/index.js +90 -0
- package/dist/components/PageHeader/index.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +17 -0
- package/dist/components/Pagination/index.js +118 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Password/index.d.ts +18 -0
- package/dist/components/Password/index.js +106 -0
- package/dist/components/Password/index.js.map +1 -0
- package/dist/components/Popover/index.d.ts +28 -0
- package/dist/components/Popover/index.js +97 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Radio/RadioGroup.d.ts +42 -0
- package/dist/components/Radio/RadioGroup.js +82 -0
- package/dist/components/Radio/RadioGroup.js.map +1 -0
- package/dist/components/Radio/RadioGroupItem.d.ts +17 -0
- package/dist/components/Radio/RadioGroupItem.js +117 -0
- package/dist/components/Radio/RadioGroupItem.js.map +1 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +8 -0
- package/dist/components/Radio/index.js.map +1 -0
- package/dist/components/Select/index.d.ts +19 -0
- package/dist/components/Select/index.js +206 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Slider/index.d.ts +18 -0
- package/dist/components/Slider/index.js +122 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/SortAndShow/index.d.ts +15 -0
- package/dist/components/SortAndShow/index.js +68 -0
- package/dist/components/SortAndShow/index.js.map +1 -0
- package/dist/components/SplitButton/index.d.ts +25 -0
- package/dist/components/SplitButton/index.js +224 -0
- package/dist/components/SplitButton/index.js.map +1 -0
- package/dist/components/Stats/index.d.ts +10 -0
- package/dist/components/Stats/index.js +63 -0
- package/dist/components/Stats/index.js.map +1 -0
- package/dist/components/Stepper/index.d.ts +23 -0
- package/dist/components/Stepper/index.js +142 -0
- package/dist/components/Stepper/index.js.map +1 -0
- package/dist/components/StepsIndicator/Step.d.ts +6 -0
- package/dist/components/StepsIndicator/Step.js +24 -0
- package/dist/components/StepsIndicator/Step.js.map +1 -0
- package/dist/components/StepsIndicator/StepsIndicator.d.ts +12 -0
- package/dist/components/StepsIndicator/StepsIndicator.js +67 -0
- package/dist/components/StepsIndicator/StepsIndicator.js.map +1 -0
- package/dist/components/StepsIndicator/index.d.ts +2 -0
- package/dist/components/StepsIndicator/index.js +19 -0
- package/dist/components/StepsIndicator/index.js.map +1 -0
- package/dist/components/Subnav/index.d.ts +14 -0
- package/dist/components/Subnav/index.js +94 -0
- package/dist/components/Subnav/index.js.map +1 -0
- package/dist/components/Switch/index.d.ts +4 -0
- package/dist/components/Switch/index.js +103 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Table/index.d.ts +48 -0
- package/dist/components/Table/index.js +147 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +16 -0
- package/dist/components/Tabs/index.js +168 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Textarea/index.d.ts +13 -0
- package/dist/components/Textarea/index.js +96 -0
- package/dist/components/Textarea/index.js.map +1 -0
- package/dist/components/Toast/index.d.ts +24 -0
- package/dist/components/Toast/index.js +171 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/ToggleList/index.d.ts +20 -0
- package/dist/components/ToggleList/index.js +68 -0
- package/dist/components/ToggleList/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +11 -0
- package/dist/components/Tooltip/index.js +66 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/WebsiteFooter/index.d.ts +23 -0
- package/dist/components/WebsiteFooter/index.js +113 -0
- package/dist/components/WebsiteFooter/index.js.map +1 -0
- package/dist/components/WebsiteHeader/index.d.ts +21 -0
- package/dist/components/WebsiteHeader/index.js +98 -0
- package/dist/components/WebsiteHeader/index.js.map +1 -0
- package/dist/components/choice-group.d.ts +109 -0
- package/dist/components/choice-group.js +200 -0
- package/dist/components/choice-group.js.map +1 -0
- package/dist/components/index.d.ts +49 -0
- package/dist/components/index.js +66 -0
- package/dist/components/index.js.map +1 -0
- package/dist/esm/animations/index.js +17 -0
- package/dist/esm/animations/index.js.map +1 -0
- package/dist/esm/colors/accent.js +18 -0
- package/dist/esm/colors/accent.js.map +1 -0
- package/dist/esm/colors/background.js +38 -0
- package/dist/esm/colors/background.js.map +1 -0
- package/dist/esm/colors/base.js +137 -0
- package/dist/esm/colors/base.js.map +1 -0
- package/dist/esm/colors/border.js +18 -0
- package/dist/esm/colors/border.js.map +1 -0
- package/dist/esm/colors/button.js +112 -0
- package/dist/esm/colors/button.js.map +1 -0
- package/dist/esm/colors/feedback.js +29 -0
- package/dist/esm/colors/feedback.js.map +1 -0
- package/dist/esm/colors/foreground.js +37 -0
- package/dist/esm/colors/foreground.js.map +1 -0
- package/dist/esm/colors/index.js +13 -0
- package/dist/esm/colors/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/tailwind-base.js +31 -0
- package/dist/esm/tailwind-base.js.map +1 -0
- package/dist/esm/tailwind-plugin.js +29 -0
- package/dist/esm/tailwind-plugin.js.map +1 -0
- package/dist/esm/theme.js +55 -0
- package/dist/esm/theme.js.map +1 -0
- package/dist/global.css +552 -485
- package/dist/index.d.ts +3 -1315
- package/dist/index.js +23 -6468
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +16 -0
- package/dist/lib/utils.js +23 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/tailwind-base.js +33 -0
- package/dist/tailwind-base.js.map +1 -0
- package/dist/tailwind-plugin.js +31 -497
- package/dist/tailwind-plugin.js.map +1 -1
- package/dist/theme.js +60 -0
- package/dist/theme.js.map +1 -0
- package/package.json +8 -11
- package/dist/animations/index.mjs +0 -8
- package/dist/animations/index.mjs.map +0 -1
- package/dist/chunk-36NLQKQR.mjs +0 -22
- package/dist/chunk-36NLQKQR.mjs.map +0 -1
- package/dist/chunk-3FFF7Q7C.mjs +0 -55
- package/dist/chunk-3FFF7Q7C.mjs.map +0 -1
- package/dist/chunk-GTI4HTES.mjs +0 -386
- package/dist/chunk-GTI4HTES.mjs.map +0 -1
- package/dist/colors/index.mjs +0 -8
- package/dist/colors/index.mjs.map +0 -1
- package/dist/global.css.map +0 -1
- package/dist/index.d.mts +0 -1315
- package/dist/index.mjs +0 -6043
- package/dist/index.mjs.map +0 -1
- package/dist/tailwind-plugin.mjs +0 -67
- package/dist/tailwind-plugin.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pagination/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,uEAAiE;AACjE,2CAAoC;AACpC,yCAA4D;AAa5D,MAAM,kBAAkB,GAAG,IAAA,8BAAG,EAAC;IAC7B,YAAY;IACZ,oBAAoB;IACpB,sBAAsB;IACtB,OAAO;CACR,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,IAAA,8BAAG,EAAC;IAC3B,UAAU;IACV,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;IACN,YAAY;IACZ,uBAAuB;IACvB,iCAAiC;IACjC,gCAAgC;IAChC,0CAA0C;IAC1C,kBAAkB;IAClB,wBAAwB;IACxB,2BAA2B;IAC3B,2BAA2B;CAC5B,CAAC,CAAA;AAEF,MAAM,sBAAsB,GAAG,IAAA,8BAAG,EAAC;IACjC,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,uBAAuB;IACvB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,0BAA0B;CAC3B,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,IAAA,8BAAG,EAAC;IAC3B,MAAM;IACN,YAAY;IACZ,iBAAiB;IACjB,2BAA2B;IAC3B,wCAAwC;IACxC,kDAAkD;IAClD,iCAAiC;IACjC,2CAA2C;CAC5C,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,CAAC,CAAA;AACtB,MAAM,cAAc,GAAG,YAAY,GAAG,CAAC,GAAG,CAAC,CAAA;AAE3C,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,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
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `size` is the field's height, and is passed through to the same variants
|
|
4
|
+
* `Input` uses so the two line up in a form. As there, it displaces the HTML
|
|
5
|
+
* attribute of that name, which the `flex-grow` input was overruling anyway.
|
|
6
|
+
*/
|
|
7
|
+
interface PasswordProps extends Omit<React.HTMLProps<HTMLInputElement>, 'size'> {
|
|
8
|
+
formClassName?: string;
|
|
9
|
+
variant?: 'primary' | 'error' | 'success';
|
|
10
|
+
size?: 'sm' | 'default' | 'lg';
|
|
11
|
+
toggleMask?: boolean;
|
|
12
|
+
labelText?: string;
|
|
13
|
+
helpText?: string;
|
|
14
|
+
showLabel?: string;
|
|
15
|
+
hideLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Password: React.ForwardRefExoticComponent<Omit<PasswordProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
18
|
+
export { Password, PasswordProps };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Password = void 0;
|
|
48
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
const react_1 = __importStar(require("react"));
|
|
50
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
51
|
+
const utils_1 = require("../../lib/utils");
|
|
52
|
+
const assets_1 = require("../../assets");
|
|
53
|
+
const Input_1 = require("../Input");
|
|
54
|
+
/**
|
|
55
|
+
* A 24x24 target around the 16x16 eye, for the same reason `Input`'s clear
|
|
56
|
+
* control has one: 24 is the smallest target WCAG 2.5.8 accepts. The negative
|
|
57
|
+
* margin is half the difference between the two, so the target grows around
|
|
58
|
+
* the eye rather than pushing it in from the edge of the field.
|
|
59
|
+
*/
|
|
60
|
+
const toggleMaskVariants = (0, class_variance_authority_1.cva)([
|
|
61
|
+
'flex',
|
|
62
|
+
'h-6',
|
|
63
|
+
'w-6',
|
|
64
|
+
'shrink-0',
|
|
65
|
+
'-mr-1',
|
|
66
|
+
'items-center',
|
|
67
|
+
'justify-center',
|
|
68
|
+
'self-center text-inherit',
|
|
69
|
+
'rounded-xs',
|
|
70
|
+
'focus-visible:outline-2',
|
|
71
|
+
'focus-visible:outline-offset-2',
|
|
72
|
+
'focus-visible:outline-current',
|
|
73
|
+
'[&>svg]:h-4',
|
|
74
|
+
'[&>svg]:w-4'
|
|
75
|
+
]);
|
|
76
|
+
const passwordVariants = (0, class_variance_authority_1.cva)(['flex', 'flex-grow', 'items-center', 'outline-hidden', 'bg-transparent'], {
|
|
77
|
+
variants: {
|
|
78
|
+
variant: {
|
|
79
|
+
primary: ['text-foreground', 'dark:text-foreground-dark'],
|
|
80
|
+
error: ['text-feedback-error', 'dark:text-feedback-error-dark'],
|
|
81
|
+
success: ['text-green-700', 'dark:text-feedback-success-dark']
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
defaultVariants: {
|
|
85
|
+
variant: 'primary'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const Password = react_1.default.forwardRef((_a, ref) => {
|
|
89
|
+
var { id, className, formClassName, variant = 'primary', size, toggleMask = true, labelText, helpText, showLabel = 'Show password', hideLabel = 'Hide password', 'aria-describedby': ariaDescribedby } = _a, props = __rest(_a, ["id", "className", "formClassName", "variant", "size", "toggleMask", "labelText", "helpText", "showLabel", "hideLabel", 'aria-describedby']);
|
|
90
|
+
const [isMaskOn, setIsMaskOn] = (0, react_1.useState)(true);
|
|
91
|
+
const generatedId = react_1.default.useId();
|
|
92
|
+
const inputId = id !== null && id !== void 0 ? id : generatedId;
|
|
93
|
+
const helpTextId = `${inputId}-helptext`;
|
|
94
|
+
const describedBy = [ariaDescribedby, helpText ? helpTextId : undefined]
|
|
95
|
+
.filter(Boolean)
|
|
96
|
+
.join(' ') || undefined;
|
|
97
|
+
const onToggleMask = () => setIsMaskOn(isMaskOn => !isMaskOn);
|
|
98
|
+
const field = ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)((0, Input_1.formVariants)({ variant, size }), formClassName), children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ id: inputId, type: isMaskOn ? 'password' : 'text', className: (0, utils_1.cn)(passwordVariants({ variant }), className), ref: ref, "aria-describedby": describedBy }, props)), toggleMask && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onToggleMask, "aria-label": isMaskOn ? showLabel : hideLabel, "aria-pressed": !isMaskOn, "aria-controls": inputId, className: toggleMaskVariants(), children: isMaskOn ? ((0, jsx_runtime_1.jsx)(assets_1.BsEye, { "aria-hidden": "true" })) : ((0, jsx_runtime_1.jsx)(assets_1.BsEyeSlash, { "aria-hidden": "true" })) }))] }));
|
|
99
|
+
if (!labelText && !helpText) {
|
|
100
|
+
return field;
|
|
101
|
+
}
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [labelText && ((0, jsx_runtime_1.jsx)("label", { htmlFor: inputId, className: "text-m text-foreground dark:text-foreground-dark", children: labelText })), field, helpText && ((0, jsx_runtime_1.jsx)("span", { id: helpTextId, className: "text-sm text-foreground-muted dark:text-foreground-muted-dark", children: helpText }))] }));
|
|
103
|
+
});
|
|
104
|
+
exports.Password = Password;
|
|
105
|
+
Password.displayName = 'Password';
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Password/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AS,EAAC,qBAAqB,aACjC,SAAS,IAAI,CACZ,kCACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,kDAAkD,YAE3D,SAAS,GACJ,CACT,EACA,KAAK,EACL,QAAQ,IAAI,CACX,iCACE,EAAE,EAAE,UAAU,EACd,SAAS,EAAC,+DAA+D,YAExE,QAAQ,GACJ,CACR,IACG,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAIQ,4BAAQ;AAFjB,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
+
declare const popoverVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
7
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export interface PopoverProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>, VariantProps<typeof popoverVariants> {
|
|
10
|
+
}
|
|
11
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
type PopoverScrollAreaProps = React.PropsWithChildren<{
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
declare const PopoverScrollArea: React.FC<PopoverScrollAreaProps>;
|
|
16
|
+
interface PopoverSeparatorProps extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
|
|
17
|
+
fullLength?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const PopoverSeparator: React.ForwardRefExoticComponent<PopoverSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
type PopoverHeaderProps = React.PropsWithChildren<{
|
|
21
|
+
className?: string;
|
|
22
|
+
}>;
|
|
23
|
+
declare const PopoverHeader: React.FC<PopoverHeaderProps>;
|
|
24
|
+
type PopoverFooterProps = React.PropsWithChildren<{
|
|
25
|
+
className?: string;
|
|
26
|
+
}>;
|
|
27
|
+
declare const PopoverFooter: React.FC<PopoverFooterProps>;
|
|
28
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverScrollArea, PopoverHeader, PopoverFooter, PopoverSeparator, PopoverClose };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.PopoverClose = exports.PopoverSeparator = exports.PopoverFooter = exports.PopoverHeader = exports.PopoverScrollArea = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = void 0;
|
|
49
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
|
+
const React = __importStar(require("react"));
|
|
51
|
+
const PopoverPrimitive = __importStar(require("@radix-ui/react-popover"));
|
|
52
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
53
|
+
const SeparatorPrimitive = __importStar(require("@radix-ui/react-separator"));
|
|
54
|
+
const ScrollArea = __importStar(require("@radix-ui/react-scroll-area"));
|
|
55
|
+
const utils_1 = require("../../lib/utils");
|
|
56
|
+
const popoverVariants = (0, class_variance_authority_1.cva)([
|
|
57
|
+
'z-50',
|
|
58
|
+
'border border-2 border-border-subtle dark:border-border-dark',
|
|
59
|
+
'rounded-lg',
|
|
60
|
+
'bg-background-surface dark:bg-background-surface-dark',
|
|
61
|
+
'text-foreground text-sm font-normal dark:text-white',
|
|
62
|
+
'shadow',
|
|
63
|
+
'outline-hidden',
|
|
64
|
+
'min-w-72',
|
|
65
|
+
'pl-2 pr-[20px] py-3'
|
|
66
|
+
]);
|
|
67
|
+
const Popover = PopoverPrimitive.Root;
|
|
68
|
+
exports.Popover = Popover;
|
|
69
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
70
|
+
exports.PopoverTrigger = PopoverTrigger;
|
|
71
|
+
const PopoverClose = PopoverPrimitive.Close;
|
|
72
|
+
exports.PopoverClose = PopoverClose;
|
|
73
|
+
const PopoverContent = React.forwardRef((_a, ref) => {
|
|
74
|
+
var { className, align = 'center', sideOffset = 4, children } = _a, props = __rest(_a, ["className", "align", "sideOffset", "children"]);
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(PopoverPrimitive.Content, Object.assign({ ref: ref, align: align, sideOffset: sideOffset, className: (0, utils_1.cn)(popoverVariants(), className) }, props, { children: children })) }));
|
|
76
|
+
});
|
|
77
|
+
exports.PopoverContent = PopoverContent;
|
|
78
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
79
|
+
const PopoverScrollArea = ({ className, children }) => {
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)(ScrollArea.Root, { className: (0, utils_1.cn)('w-full h-full', className), type: "auto", children: [(0, jsx_runtime_1.jsx)(ScrollArea.Viewport, { className: "w-full h-full", children: children }), (0, jsx_runtime_1.jsx)(ScrollArea.Scrollbar, { orientation: "vertical", className: "w-3 pr-1 py-2 -mr-[20px]", children: (0, jsx_runtime_1.jsx)(ScrollArea.Thumb, { className: "bg-grey-200 w-2 rounded-lg" }) })] }));
|
|
81
|
+
};
|
|
82
|
+
exports.PopoverScrollArea = PopoverScrollArea;
|
|
83
|
+
const PopoverSeparator = React.forwardRef((_a, ref) => {
|
|
84
|
+
var { className, orientation = 'horizontal', fullLength = false } = _a, props = __rest(_a, ["className", "orientation", "fullLength"]);
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsx)(SeparatorPrimitive.Root, Object.assign({ ref: ref, decorative: true, orientation: orientation, className: (0, utils_1.cn)('shrink-0 bg-border-subtle dark:bg-border-dark', orientation === 'horizontal' ? 'h-[1px] w-fill' : 'h-fill w-[1px]', fullLength && orientation === 'horizontal' ? '-ml-2 -mr-[20px]' : '', className) }, props)) }));
|
|
86
|
+
});
|
|
87
|
+
exports.PopoverSeparator = PopoverSeparator;
|
|
88
|
+
PopoverSeparator.displayName = SeparatorPrimitive.Root.displayName;
|
|
89
|
+
const PopoverHeader = ({ className, children }) => {
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('w-full pb-4', className), children: children }), (0, jsx_runtime_1.jsx)(PopoverSeparator, { fullLength: true })] }));
|
|
91
|
+
};
|
|
92
|
+
exports.PopoverHeader = PopoverHeader;
|
|
93
|
+
const PopoverFooter = ({ className, children }) => {
|
|
94
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "w-full -mb-3", children: [(0, jsx_runtime_1.jsx)(PopoverSeparator, { fullLength: true }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('py-2', className), children: children })] }));
|
|
95
|
+
};
|
|
96
|
+
exports.PopoverFooter = PopoverFooter;
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;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gB,IAAC,UAAU,SAAG,IAC9B,CACJ,CAAA;AACH,CAAC,CAAA;AAuBC,sCAAa;AAjBf,MAAM,aAAa,GAAiC,CAAC,EACnD,SAAS,EACT,QAAQ,EACT,EAAE,EAAE;IACH,OAAO,CACL,iCAAK,SAAS,EAAC,cAAc,aAC3B,uBAAC,gBAAgB,IAAC,UAAU,SAAG,EAC/B,gCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,MAAM,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,IACnD,CACP,CAAA;AACH,CAAC,CAAA;AAQC,sCAAa"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
4
|
+
/** The group's name, rendered as its `<legend>`. */
|
|
5
|
+
legend?: React.ReactNode;
|
|
6
|
+
/** Hint under the legend, announced when focus enters the group. */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
/** Validation message under the options, announced the same way. */
|
|
9
|
+
error?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Marks the options invalid independently of `error`, and wins over it in
|
|
12
|
+
* both directions -- the same split `FormGroup` and `CheckboxGroup` draw.
|
|
13
|
+
*/
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
/** Which side of its control each label sits on. */
|
|
16
|
+
labelPosition?: 'left' | 'right';
|
|
17
|
+
/** Classes for the `<fieldset>` the group renders. */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A set of radios that belong to one question, of which exactly one can be
|
|
22
|
+
* chosen.
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <RadioGroup legend="Delivery" defaultValue="standard" name="delivery">
|
|
26
|
+
* <Radio value="standard" label="Standard" description="3-5 working days" />
|
|
27
|
+
* <Radio value="express" label="Express" description="Next working day" />
|
|
28
|
+
* </RadioGroup>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* `orientation` now lays the options out as well as setting which arrow keys
|
|
32
|
+
* move between them -- it used to do only the second, which meant a horizontal
|
|
33
|
+
* group was a column you navigated with the left and right arrows. The two
|
|
34
|
+
* were never independent in practice: a reader arrows in the direction the
|
|
35
|
+
* options are drawn.
|
|
36
|
+
*
|
|
37
|
+
* `className` lands on the `<fieldset>`, which is the group's outermost
|
|
38
|
+
* element and the one to size or space. Spacing between the options is
|
|
39
|
+
* `orientation`'s job.
|
|
40
|
+
*/
|
|
41
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export { RadioGroup, type RadioGroupProps };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.RadioGroup = void 0;
|
|
48
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
const React = __importStar(require("react"));
|
|
50
|
+
const RadioGroupPrimitive = __importStar(require("@radix-ui/react-radio-group"));
|
|
51
|
+
const utils_1 = require("../../lib/utils");
|
|
52
|
+
const choice_group_1 = require("../choice-group");
|
|
53
|
+
/**
|
|
54
|
+
* A set of radios that belong to one question, of which exactly one can be
|
|
55
|
+
* chosen.
|
|
56
|
+
*
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <RadioGroup legend="Delivery" defaultValue="standard" name="delivery">
|
|
59
|
+
* <Radio value="standard" label="Standard" description="3-5 working days" />
|
|
60
|
+
* <Radio value="express" label="Express" description="Next working day" />
|
|
61
|
+
* </RadioGroup>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* `orientation` now lays the options out as well as setting which arrow keys
|
|
65
|
+
* move between them -- it used to do only the second, which meant a horizontal
|
|
66
|
+
* group was a column you navigated with the left and right arrows. The two
|
|
67
|
+
* were never independent in practice: a reader arrows in the direction the
|
|
68
|
+
* options are drawn.
|
|
69
|
+
*
|
|
70
|
+
* `className` lands on the `<fieldset>`, which is the group's outermost
|
|
71
|
+
* element and the one to size or space. Spacing between the options is
|
|
72
|
+
* `orientation`'s job.
|
|
73
|
+
*/
|
|
74
|
+
const RadioGroup = React.forwardRef((_a, ref) => {
|
|
75
|
+
var { legend, description, error, invalid, labelPosition = 'right', orientation = 'vertical', className } = _a, props = __rest(_a, ["legend", "description", "error", "invalid", "labelPosition", "orientation", "className"]);
|
|
76
|
+
const isInvalid = invalid !== null && invalid !== void 0 ? invalid : Boolean(error);
|
|
77
|
+
const groupContext = React.useMemo(() => ({ invalid: isInvalid, labelPosition, disabled: props.disabled }), [isInvalid, labelPosition, props.disabled]);
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(choice_group_1.ChoiceGroupFieldset, { legend: legend, description: description, error: error, disabled: props.disabled, className: className, children: (0, jsx_runtime_1.jsx)(choice_group_1.ChoiceGroupContext.Provider, { value: groupContext, children: (0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Root, Object.assign({ className: (0, utils_1.cn)((0, choice_group_1.choiceGroupItemsVariants)({ orientation, labelPosition })), orientation: orientation }, props, { ref: ref })) }) }));
|
|
79
|
+
});
|
|
80
|
+
exports.RadioGroup = RadioGroup;
|
|
81
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
82
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/components/Radio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W,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
/** Hint for this option alone, announced with the radio it belongs to. */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One radio in a `RadioGroup`, with the label and hint that belong to it.
|
|
10
|
+
*
|
|
11
|
+
* Without a `label` it renders as the bare control it always has, for the
|
|
12
|
+
* `ControlLabel` pairing the stories used to show; with one it brings its own
|
|
13
|
+
* label, and the hint is wired to the control rather than left as text beside
|
|
14
|
+
* it.
|
|
15
|
+
*/
|
|
16
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export { RadioGroupItem as Radio, RadioGroupItemProps };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Radio = void 0;
|
|
48
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
const React = __importStar(require("react"));
|
|
50
|
+
const RadioGroupPrimitive = __importStar(require("@radix-ui/react-radio-group"));
|
|
51
|
+
const utils_1 = require("../../lib/utils");
|
|
52
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
53
|
+
const assets_1 = require("../../assets");
|
|
54
|
+
const choice_group_1 = require("../choice-group");
|
|
55
|
+
/**
|
|
56
|
+
* The border colour is a variant rather than a set of `aria-[invalid=true]:`
|
|
57
|
+
* rules layered over the default one, for the reason `Checkbox` spells out:
|
|
58
|
+
* layered, which rule a selected invalid radio draws would be decided by the
|
|
59
|
+
* order Tailwind emits two equally specific variants in.
|
|
60
|
+
*/
|
|
61
|
+
const radioVariant = (0, class_variance_authority_1.cva)([
|
|
62
|
+
[
|
|
63
|
+
'h-5 w-5',
|
|
64
|
+
'rounded-full',
|
|
65
|
+
'border-[0.533px]',
|
|
66
|
+
'bg-background-alt',
|
|
67
|
+
'disabled:opacity-50',
|
|
68
|
+
'disabled:cursor-not-allowed',
|
|
69
|
+
'text-foreground-inverse',
|
|
70
|
+
'focus-visible:outline-hidden',
|
|
71
|
+
'focus-visible:shadow-brandGreen',
|
|
72
|
+
'dark:focus-visible:shadow-brandGreen10'
|
|
73
|
+
],
|
|
74
|
+
['data-[state=checked]:bg-border'],
|
|
75
|
+
['dark:bg-background-alt-dark', 'dark:data-[state=checked]:bg-border-dark']
|
|
76
|
+
], {
|
|
77
|
+
variants: {
|
|
78
|
+
/** Driven by the radio's own `aria-invalid`. See `Checkbox`. */
|
|
79
|
+
invalid: {
|
|
80
|
+
true: ['border-feedback-error', 'dark:border-red-400'],
|
|
81
|
+
false: [
|
|
82
|
+
'border-border',
|
|
83
|
+
'data-[state=checked]:border-border',
|
|
84
|
+
'dark:border-border-dark'
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
defaultVariants: {
|
|
89
|
+
invalid: false
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* One radio in a `RadioGroup`, with the label and hint that belong to it.
|
|
94
|
+
*
|
|
95
|
+
* Without a `label` it renders as the bare control it always has, for the
|
|
96
|
+
* `ControlLabel` pairing the stories used to show; with one it brings its own
|
|
97
|
+
* label, and the hint is wired to the control rather than left as text beside
|
|
98
|
+
* it.
|
|
99
|
+
*/
|
|
100
|
+
const RadioGroupItem = React.forwardRef((_a, ref) => {
|
|
101
|
+
var _b, _c;
|
|
102
|
+
var { className, label, description, id, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ownAriaInvalid } = _a, props = __rest(_a, ["className", "label", "description", "id", 'aria-describedby', 'aria-invalid']);
|
|
103
|
+
const group = (0, choice_group_1.useChoiceGroup)();
|
|
104
|
+
const generatedId = React.useId();
|
|
105
|
+
const controlId = id !== null && id !== void 0 ? id : generatedId;
|
|
106
|
+
const descriptionId = `${controlId}-description`;
|
|
107
|
+
// One resolved value behind both the attribute and the border, so an
|
|
108
|
+
// option cannot announce one state and render the other.
|
|
109
|
+
const ariaInvalid = (0, choice_group_1.resolveAriaInvalid)(ownAriaInvalid, Boolean(group === null || group === void 0 ? void 0 : group.invalid));
|
|
110
|
+
const describedBy = [ariaDescribedBy, description ? descriptionId : undefined]
|
|
111
|
+
.filter(Boolean)
|
|
112
|
+
.join(' ') || undefined;
|
|
113
|
+
return ((0, jsx_runtime_1.jsx)(choice_group_1.ChoiceItem, { controlId: controlId, descriptionId: descriptionId, label: label, description: description, disabled: (_b = props.disabled) !== null && _b !== void 0 ? _b : group === null || group === void 0 ? void 0 : group.disabled, labelPosition: (_c = group === null || group === void 0 ? void 0 : group.labelPosition) !== null && _c !== void 0 ? _c : 'right', children: (0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Item, Object.assign({ ref: ref, id: controlId, className: (0, utils_1.cn)(radioVariant({ invalid: (0, utils_1.assertsInvalid)(ariaInvalid) }), className), "aria-describedby": describedBy, "aria-invalid": ariaInvalid }, props, { children: (0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(assets_1.BsCircleFill, { size: "8", className: "text-inherit stroke-current stroke-1 fill-current" }) }) })) }));
|
|
114
|
+
});
|
|
115
|
+
exports.Radio = RadioGroupItem;
|
|
116
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
117
|
+
//# sourceMappingURL=RadioGroupItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroupItem.js","sourceRoot":"","sources":["../../../src/components/Radio/RadioGroupItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8B;AAC9B,iFAAkE;AAClE,2CAAoD;AACpD,uEAA8C;AAC9C,yCAA2C;AAC3C,kDAAgF;AAUhF;;;;;GAKG;AACH,MAAM,YAAY,GAAG,IAAA,8BAAG,EACtB;IACE;QACE,SAAS;QACT,cAAc;QACd,kBAAkB;QAClB,mBAAmB;QACnB,qBAAqB;QACrB,6BAA6B;QAC7B,yBAAyB;QACzB,8BAA8B;QAC9B,iCAAiC;QACjC,wCAAwC;KACzC;IACD,CAAC,gCAAgC,CAAC;IAClC,CAAC,6BAA6B,EAAE,0CAA0C,CAAC;CAC5E,EACD;IACE,QAAQ,EAAE;QACR,gEAAgE;QAChE,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;YACtD,KAAK,EAAE;gBACL,eAAe;gBACf,oCAAoC;gBACpC,yBAAyB;aAC1B;SACF;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,KAAK;KACf;CACF,CACF,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAIrC,CACE,EAQC,EACD,GAAG,EACH,EAAE;;QAVF,EACE,SAAS,EACT,KAAK,EACL,WAAW,EACX,EAAE,EACF,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,cAAc,OAE/B,EADI,KAAK,cAPV,+EAQC,CADS;IAIV,MAAM,KAAK,GAAG,IAAA,6BAAc,GAAE,CAAA;IAC9B,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA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,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Radio = exports.RadioGroup = void 0;
|
|
4
|
+
var RadioGroup_1 = require("./RadioGroup");
|
|
5
|
+
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return RadioGroup_1.RadioGroup; } });
|
|
6
|
+
var RadioGroupItem_1 = require("./RadioGroupItem");
|
|
7
|
+
Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return RadioGroupItem_1.Radio; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Radio/index.tsx"],"names":[],"mappings":";;;AAAA,2CAA+D;AAAtD,wGAAA,UAAU,OAAA;AACnB,mDAAkE;AAAzD,uGAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
5
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
declare const SelectPortal: React.FC<SelectPrimitive.SelectPortalProps>;
|
|
8
|
+
declare const triggerVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "success" | "error" | null | undefined;
|
|
10
|
+
size?: "sm" | "lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
|
+
export interface TriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, VariantProps<typeof triggerVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectPortal };
|