mosuk-ui 1.0.10 → 1.0.13
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/components/actions/checkbox/component/.partials/components/component.d.ts +3 -0
- package/components/actions/checkbox/component/.partials/components/component.interface.d.ts +3 -0
- package/components/actions/checkbox/component/.partials/components/component.js +34 -0
- package/components/actions/checkbox/component/.partials/components/indicator/component.d.ts +3 -0
- package/components/actions/checkbox/component/.partials/components/indicator/component.interface.d.ts +3 -0
- package/components/actions/checkbox/component/.partials/components/indicator/component.js +33 -0
- package/components/actions/checkbox/component/.partials/styles/component.module.css +56 -0
- package/components/actions/checkbox/component/index.d.ts +13 -0
- package/components/actions/checkbox/component/index.js +5 -0
- package/components/actions/checkbox/skeleton/.partials/components/component.d.ts +3 -0
- package/components/actions/checkbox/skeleton/.partials/components/component.interface.d.ts +3 -0
- package/components/actions/checkbox/skeleton/.partials/components/component.js +30 -0
- package/components/actions/checkbox/skeleton/.partials/components/indicator/component.d.ts +3 -0
- package/components/actions/checkbox/skeleton/.partials/components/indicator/component.interface.d.ts +3 -0
- package/components/actions/checkbox/skeleton/.partials/components/indicator/component.js +29 -0
- package/components/actions/checkbox/skeleton/index.d.ts +13 -0
- package/components/actions/checkbox/skeleton/index.js +5 -0
- package/components/actions/input/(otp)/component/component.d.ts +3 -0
- package/components/actions/input/(otp)/component/component.interface.d.ts +6 -0
- package/components/actions/input/(otp)/component/component.js +33 -0
- package/components/actions/input/(otp)/component/component.module.css +49 -0
- package/components/actions/input/(otp)/component/field/component.d.ts +7 -0
- package/components/actions/input/(otp)/component/field/component.js +30 -0
- package/components/actions/input/(otp)/component/index.d.ts +13 -0
- package/components/actions/input/(otp)/component/index.js +7 -0
- package/components/actions/input/(otp)/component/separator/component.d.ts +7 -0
- package/components/actions/input/(otp)/component/separator/component.js +30 -0
- package/components/actions/input/(otp)/skeleton/component.d.ts +3 -0
- package/components/actions/{toggle/skeleton/component.props.d.ts → input/(otp)/skeleton/component.interface.d.ts} +2 -1
- package/components/actions/{toggle → input/(otp)}/skeleton/component.js +3 -3
- package/components/actions/input/(otp)/skeleton/component.module.css +18 -0
- package/components/actions/input/(otp)/skeleton/index.d.ts +6 -0
- package/components/actions/input/(otp)/skeleton/index.js +2 -0
- package/components/actions/otp/component/.partials/components/component.d.ts +3 -0
- package/components/actions/otp/component/.partials/components/component.interface.d.ts +3 -0
- package/components/actions/otp/component/.partials/components/component.js +32 -0
- package/components/actions/otp/component/.partials/components/input/component.d.ts +3 -0
- package/components/actions/otp/component/.partials/components/input/component.interface.d.ts +3 -0
- package/components/actions/otp/component/.partials/components/input/component.interface.js +1 -0
- package/components/actions/otp/component/.partials/components/input/component.js +30 -0
- package/components/actions/otp/component/.partials/styles/component.module.css +51 -0
- package/components/actions/otp/component/index.d.ts +13 -0
- package/components/actions/otp/component/index.js +5 -0
- package/components/actions/otp/skeleton/.partials/components/component.d.ts +3 -0
- package/components/actions/otp/skeleton/.partials/components/component.interface.d.ts +3 -0
- package/components/actions/otp/skeleton/.partials/components/component.interface.js +1 -0
- package/components/actions/otp/skeleton/.partials/components/component.js +29 -0
- package/components/actions/otp/skeleton/.partials/components/input/component.d.ts +3 -0
- package/components/actions/otp/skeleton/.partials/components/input/component.interface.d.ts +3 -0
- package/components/actions/otp/skeleton/.partials/components/input/component.interface.js +1 -0
- package/components/actions/otp/skeleton/.partials/components/input/component.js +30 -0
- package/components/actions/otp/skeleton/index.d.ts +13 -0
- package/components/actions/otp/skeleton/index.js +5 -0
- package/components/actions/toggle/component/{button → .partials/components/button}/component.js +3 -3
- package/components/actions/toggle/component/.partials/components/button/component.props.js +1 -0
- package/components/actions/toggle/component/{component.d.ts → .partials/components/component.d.ts} +1 -1
- package/components/actions/toggle/component/{component.js → .partials/components/component.js} +14 -14
- package/components/actions/toggle/component/{component.props.d.ts → .partials/components/component.props.d.ts} +3 -1
- package/components/actions/toggle/component/.partials/components/component.props.js +1 -0
- package/components/actions/toggle/component/{indicator → .partials/components/indicator}/component.js +34 -16
- package/components/actions/toggle/component/.partials/components/indicator/component.props.js +1 -0
- package/components/actions/toggle/component/.partials/providers/context/context.interface.d.ts +10 -0
- package/components/actions/toggle/component/.partials/providers/context/context.interface.js +1 -0
- package/components/actions/toggle/component/{providers → .partials/providers}/provider.d.ts +1 -1
- package/components/actions/toggle/component/{providers → .partials/providers}/provider.interface.d.ts +2 -0
- package/components/actions/toggle/component/.partials/providers/provider.interface.js +1 -0
- package/components/actions/toggle/component/.partials/providers/provider.js +92 -0
- package/components/actions/toggle/component/.partials/styles/component.module.css +120 -0
- package/components/actions/toggle/component/.partials/utilities/scroll-toggle-option-into-view.d.ts +8 -0
- package/components/actions/toggle/component/.partials/utilities/scroll-toggle-option-into-view.js +69 -0
- package/components/actions/toggle/component/index.d.ts +6 -6
- package/components/actions/toggle/component/index.js +3 -3
- package/components/actions/toggle/skeleton/{button → .partials/components/button}/component.js +2 -2
- package/components/actions/toggle/skeleton/.partials/components/button/component.props.js +1 -0
- package/components/actions/toggle/skeleton/{component.d.ts → .partials/components/component.d.ts} +1 -1
- package/components/actions/toggle/skeleton/.partials/components/component.js +30 -0
- package/components/actions/toggle/skeleton/.partials/components/component.props.d.ts +6 -0
- package/components/actions/toggle/skeleton/.partials/components/component.props.js +1 -0
- package/components/actions/toggle/skeleton/{component.module.css → .partials/styles/component.module.css} +32 -7
- package/components/actions/toggle/skeleton/index.d.ts +4 -4
- package/components/actions/toggle/skeleton/index.js +2 -2
- package/components/overlays/drawer/component/component.module.css +1 -1
- package/components/overlays/dropdown/component/component.js +1 -2
- package/components/overlays/dropdown/component/component.module.css +2 -2
- package/components/texts/counter/component/component.js +55 -12
- package/package.json +36 -6
- package/styles/components/actions/button/[size]/style.css +11 -265
- package/styles/components/actions/icon/[size]/style.css +12 -290
- package/styles/components/actions/input/[size]/style.css +18 -76
- package/styles/utilities/action/fill/style.css +1 -3
- package/styles/utilities/action/glass/style.css +0 -2
- package/styles/utilities/action/outline/style.css +1 -0
- package/styles/utilities/action/style.css +1 -2
- package/components/actions/toggle/component/component.module.css +0 -80
- package/components/actions/toggle/component/providers/context/context.interface.d.ts +0 -7
- package/components/actions/toggle/component/providers/provider.js +0 -34
- package/styles/utilities/action/transparent/style.css +0 -5
- /package/components/actions/{toggle/component/button/component.props.js → checkbox/component/.partials/components/component.interface.js} +0 -0
- /package/components/actions/{toggle/component/component.props.js → checkbox/component/.partials/components/indicator/component.interface.js} +0 -0
- /package/components/actions/{toggle/component/indicator/component.props.js → checkbox/skeleton/.partials/components/component.interface.js} +0 -0
- /package/components/actions/{toggle/component/providers/context/context.interface.js → checkbox/skeleton/.partials/components/indicator/component.interface.js} +0 -0
- /package/components/actions/{toggle/component/providers/provider.interface.js → input/(otp)/component/component.interface.js} +0 -0
- /package/components/actions/{toggle/skeleton/button/component.props.js → input/(otp)/skeleton/component.interface.js} +0 -0
- /package/components/actions/{toggle/skeleton/component.props.js → otp/component/.partials/components/component.interface.js} +0 -0
- /package/components/actions/toggle/component/{button → .partials/components/button}/component.d.ts +0 -0
- /package/components/actions/toggle/component/{button → .partials/components/button}/component.props.d.ts +0 -0
- /package/components/actions/toggle/component/{indicator → .partials/components/indicator}/component.d.ts +0 -0
- /package/components/actions/toggle/component/{indicator → .partials/components/indicator}/component.props.d.ts +0 -0
- /package/components/actions/toggle/component/{hooks → .partials/hooks}/hook.d.ts +0 -0
- /package/components/actions/toggle/component/{hooks → .partials/hooks}/hook.js +0 -0
- /package/components/actions/toggle/component/{providers → .partials/providers}/context/context.d.ts +0 -0
- /package/components/actions/toggle/component/{providers → .partials/providers}/context/context.js +0 -0
- /package/components/actions/toggle/skeleton/{button → .partials/components/button}/component.d.ts +0 -0
- /package/components/actions/toggle/skeleton/{button → .partials/components/button}/component.props.d.ts +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { Checkbox as BaseCheckbox } from '@base-ui/react';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import React, { useId } from 'react';
|
|
26
|
+
import styles from '../styles/component.module.css';
|
|
27
|
+
export function Checkbox(_a) {
|
|
28
|
+
var _b;
|
|
29
|
+
var ref = _a.ref, rest = __rest(_a, ["ref"]);
|
|
30
|
+
if (!(rest === null || rest === void 0 ? void 0 : rest.id)) {
|
|
31
|
+
rest.id = useId();
|
|
32
|
+
}
|
|
33
|
+
return (React.createElement(BaseCheckbox.Root, __assign({}, rest, { ref: ref, id: rest.id, name: (_b = rest.name) !== null && _b !== void 0 ? _b : rest.id, className: classNames('mosuk-checkbox', styles.checkbox, rest === null || rest === void 0 ? void 0 : rest.className) }), rest === null || rest === void 0 ? void 0 : rest.children));
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { Checkbox } from '@base-ui/react';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import React, { useId } from 'react';
|
|
26
|
+
import styles from '../../styles/component.module.css';
|
|
27
|
+
export function CheckboxIndicator(_a) {
|
|
28
|
+
var ref = _a.ref, rest = __rest(_a, ["ref"]);
|
|
29
|
+
if (!(rest === null || rest === void 0 ? void 0 : rest.id)) {
|
|
30
|
+
rest.id = useId();
|
|
31
|
+
}
|
|
32
|
+
return (React.createElement(Checkbox.Indicator, __assign({}, rest, { className: classNames('mosuk-checkbox-indicator', styles.indicator, rest === null || rest === void 0 ? void 0 : rest.className) }), rest === null || rest === void 0 ? void 0 : rest.children));
|
|
33
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@layer mosuk-ui {
|
|
2
|
+
@layer index-11 {
|
|
3
|
+
.checkbox {
|
|
4
|
+
appearance: none;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
|
|
10
|
+
width: calc(var(--spacing, .25rem) * 4);
|
|
11
|
+
height: calc(var(--spacing, .25rem) * 4);
|
|
12
|
+
min-width: calc(var(--spacing, .25rem) * 4);
|
|
13
|
+
min-height: calc(var(--spacing, .25rem) * 4);
|
|
14
|
+
|
|
15
|
+
border: 1px solid;
|
|
16
|
+
border-color: var(--color-gray-200);
|
|
17
|
+
outline: none;
|
|
18
|
+
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: all 200ms ease-in-out;
|
|
21
|
+
|
|
22
|
+
& :where(svg) {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
min-width: 100%;
|
|
26
|
+
min-height: 100%;
|
|
27
|
+
|
|
28
|
+
color: var(--color-primary-500);
|
|
29
|
+
|
|
30
|
+
opacity: 0;
|
|
31
|
+
transition: all 200ms ease-in-out;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
& :where(svg) {
|
|
36
|
+
opacity: 0.25;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[data-checked],
|
|
41
|
+
&[data-indeterminate] {
|
|
42
|
+
& :where(svg) {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.indicator {
|
|
49
|
+
display: flex;
|
|
50
|
+
|
|
51
|
+
&[data-unchecked] {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkbox as Component } from './.partials/components/component';
|
|
2
|
+
import { CheckboxProps } from './.partials/components/component.interface';
|
|
3
|
+
import { CheckboxIndicator } from './.partials/components/indicator/component';
|
|
4
|
+
import { CheckboxIndicatorProps } from './.partials/components/indicator/component.interface';
|
|
5
|
+
export declare const Checkbox: typeof Component & {
|
|
6
|
+
Indicator: typeof CheckboxIndicator;
|
|
7
|
+
};
|
|
8
|
+
export declare namespace Checkbox {
|
|
9
|
+
type Props = CheckboxProps;
|
|
10
|
+
namespace Indicator {
|
|
11
|
+
type Props = CheckboxIndicatorProps;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { Skeleton } from '../../../../../display/skeleton/component/component';
|
|
26
|
+
import styles from '../../../component/.partials/styles/style.module.css';
|
|
27
|
+
export function CheckboxSkeleton(_a) {
|
|
28
|
+
var rest = __rest(_a, []);
|
|
29
|
+
return (React.createElement(Skeleton, __assign({}, rest, { className: classNames('mosuk-checkbox-skeleton', styles.checkbox, rest === null || rest === void 0 ? void 0 : rest.className) }), rest === null || rest === void 0 ? void 0 : rest.children));
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import styles from '../../../../component/.partials/styles/component.module.css';
|
|
26
|
+
export function CheckboxIndicatorSkeleton(_a) {
|
|
27
|
+
var rest = __rest(_a, []);
|
|
28
|
+
return (React.createElement("div", __assign({}, rest, { className: classNames('mosuk-checkbox-indicator-skeleton', styles.indicator, rest === null || rest === void 0 ? void 0 : rest.className) }), rest === null || rest === void 0 ? void 0 : rest.children));
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CheckboxSkeleton as Component } from './.partials/components/component';
|
|
2
|
+
import type { CheckboxSkeletonProps } from './.partials/components/component.interface';
|
|
3
|
+
import { CheckboxIndicatorSkeleton } from './.partials/components/indicator/component';
|
|
4
|
+
import { CheckboxIndicatorSkeletonProps } from './.partials/components/indicator/component.interface';
|
|
5
|
+
export declare const CheckboxSkeleton: typeof Component & {
|
|
6
|
+
Indicator: typeof CheckboxIndicatorSkeleton;
|
|
7
|
+
};
|
|
8
|
+
export declare namespace CheckboxSkeleton {
|
|
9
|
+
type Props = CheckboxSkeletonProps;
|
|
10
|
+
namespace Indicator {
|
|
11
|
+
type Props = CheckboxIndicatorSkeletonProps;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CheckboxSkeleton as Component } from './.partials/components/component';
|
|
2
|
+
import { CheckboxIndicatorSkeleton } from './.partials/components/indicator/component';
|
|
3
|
+
export var CheckboxSkeleton = Object.assign(Component, {
|
|
4
|
+
Indicator: CheckboxIndicatorSkeleton,
|
|
5
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ElementType, Ref } from 'react';
|
|
2
|
+
import { OTPFieldPreview as BaseOTPField } from '@base-ui/react/otp-field';
|
|
3
|
+
export type InputOtpProps<C extends ElementType = 'div'> = {
|
|
4
|
+
as?: C;
|
|
5
|
+
ref?: Ref<any>;
|
|
6
|
+
} & Omit<ComponentPropsWithoutRef<C>, 'as' | 'ref'> & Omit<BaseOTPField.Root.Props, 'className' | 'style'>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React, { useId } from 'react';
|
|
25
|
+
import { OTPFieldPreview as OTPField } from '@base-ui/react/otp-field';
|
|
26
|
+
import styles from './component.module.css';
|
|
27
|
+
export function InputOtp(_a) {
|
|
28
|
+
var _b;
|
|
29
|
+
var as = _a.as, children = _a.children, length = _a.length, rest = __rest(_a, ["as", "children", "length"]);
|
|
30
|
+
var Component = (as || OTPField.Root);
|
|
31
|
+
var id = (_b = rest === null || rest === void 0 ? void 0 : rest.id) !== null && _b !== void 0 ? _b : useId();
|
|
32
|
+
return (React.createElement(Component, __assign({}, rest, { id: id, length: length, className: classNames(styles.root, 'mosuk-input-otp', rest === null || rest === void 0 ? void 0 : rest.className) }), children));
|
|
33
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@layer mosuk-ui {
|
|
2
|
+
@layer index-11 {
|
|
3
|
+
.root {
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
|
+
gap: var(--spacing-2, calc(var(--spacing, 0.25rem) * 2));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.input {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin: 0;
|
|
12
|
+
height: var(--spacing-11, calc(var(--spacing, 0.25rem) * 11));
|
|
13
|
+
width: var(--spacing-10, calc(var(--spacing, 0.25rem) * 10));
|
|
14
|
+
border-radius: var(--radius-lg, calc(var(--spacing, 0.25rem) * 2));
|
|
15
|
+
border: 1px solid var(--color-gray-300, rgb(209 213 219));
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
text-align: center;
|
|
18
|
+
font-family: inherit;
|
|
19
|
+
font-size: var(--text-xl, calc(var(--spacing, 0.25rem) * 4.5));
|
|
20
|
+
font-weight: var(--font-medium, 500);
|
|
21
|
+
color: var(--color-black, #000);
|
|
22
|
+
outline: none;
|
|
23
|
+
transition: all 200ms ease-in-out;
|
|
24
|
+
|
|
25
|
+
&::placeholder {
|
|
26
|
+
color: var(--color-gray-500, oklch(0.551 0.027 264.364));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
outline: none;
|
|
31
|
+
border-color: var(--color-blue-500, oklch(0.623 0.214 259.815));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:read-only {
|
|
35
|
+
opacity: 50%;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.separator {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
color: var(--color-gray-500, oklch(0.551 0.027 264.364));
|
|
45
|
+
font-size: var(--text-xl, calc(var(--spacing, 0.25rem) * 4.5));
|
|
46
|
+
font-weight: var(--font-medium, 500);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OTPFieldInputProps } from "@base-ui/react";
|
|
3
|
+
export interface InputOtpFieldProps extends OTPFieldInputProps {
|
|
4
|
+
index?: number;
|
|
5
|
+
length?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function InputOtpField({ index, length, className, ...rest }: InputOtpFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { OTPFieldPreview as OTPField } from '@base-ui/react/otp-field';
|
|
26
|
+
import styles from '../component.module.css';
|
|
27
|
+
export function InputOtpField(_a) {
|
|
28
|
+
var index = _a.index, length = _a.length, className = _a.className, rest = __rest(_a, ["index", "length", "className"]);
|
|
29
|
+
return (React.createElement(OTPField.Input, __assign({ className: classNames(styles.input, 'mosuk-input-otp-field', className), "aria-label": "Character ".concat(index !== null && index !== void 0 ? index : 1, " of ").concat(length) }, rest)));
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputOtp as Component } from './component';
|
|
2
|
+
import { InputOtpProps as ComponentProps } from './component.interface';
|
|
3
|
+
import { InputOtpField, InputOtpFieldProps } from './field/component';
|
|
4
|
+
import { InputOtpSeparator, InputOtpSeparatorProps } from './separator/component';
|
|
5
|
+
export declare const InputOtp: typeof Component & {
|
|
6
|
+
Field: typeof InputOtpField;
|
|
7
|
+
Separator: typeof InputOtpSeparator;
|
|
8
|
+
};
|
|
9
|
+
export declare namespace InputOtp {
|
|
10
|
+
type Props = ComponentProps;
|
|
11
|
+
type FieldProps = InputOtpFieldProps;
|
|
12
|
+
type SeparatorProps = InputOtpSeparatorProps;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputOtp as Component } from './component';
|
|
2
|
+
import { InputOtpField } from './field/component';
|
|
3
|
+
import { InputOtpSeparator } from './separator/component';
|
|
4
|
+
export var InputOtp = Object.assign(Component, {
|
|
5
|
+
Field: InputOtpField,
|
|
6
|
+
Separator: InputOtpSeparator,
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SeparatorProps } from "@base-ui/react";
|
|
3
|
+
export interface InputOtpSeparatorProps extends SeparatorProps {
|
|
4
|
+
index?: number;
|
|
5
|
+
length?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function InputOtpSeparator({ index, length, className, ...rest }: InputOtpSeparatorProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { OTPFieldPreview as OTPField } from '@base-ui/react/otp-field';
|
|
26
|
+
import styles from '../component.module.css';
|
|
27
|
+
export function InputOtpSeparator(_a) {
|
|
28
|
+
var index = _a.index, length = _a.length, className = _a.className, rest = __rest(_a, ["index", "length", "className"]);
|
|
29
|
+
return (React.createElement(OTPField.Separator, __assign({ className: classNames(styles.separator, 'mosuk-input-otp-separator', className), "aria-label": "Character ".concat(index !== null && index !== void 0 ? index : 1, " of ").concat(length) }, rest)));
|
|
30
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType, Ref } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type InputOtpSkeletonProps<C extends ElementType = 'div'> = {
|
|
3
3
|
as?: C;
|
|
4
4
|
ref?: Ref<any>;
|
|
5
|
+
slots?: number;
|
|
5
6
|
} & Omit<ComponentPropsWithoutRef<C>, 'as' | 'ref'>;
|
|
@@ -23,8 +23,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import React from 'react';
|
|
25
25
|
import styles from './component.module.css';
|
|
26
|
-
export function
|
|
27
|
-
var as = _a.as, rest = __rest(_a, ["as"]);
|
|
26
|
+
export function InputOtpSkeleton(_a) {
|
|
27
|
+
var as = _a.as, _b = _a.slots, slots = _b === void 0 ? 6 : _b, children = _a.children, rest = __rest(_a, ["as", "slots", "children"]);
|
|
28
28
|
var Component = (as || 'div');
|
|
29
|
-
return (React.createElement(Component, __assign({}, rest, { className: classNames('mosuk-
|
|
29
|
+
return (React.createElement(Component, __assign({}, rest, { className: classNames('mosuk-input-otp-skeleton', styles.otp, rest === null || rest === void 0 ? void 0 : rest.className) }), children));
|
|
30
30
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer mosuk-ui {
|
|
2
|
+
@layer index-11 {
|
|
3
|
+
.otp {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: calc(var(--spacing, .25rem) * 2);
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.slot {
|
|
10
|
+
width: calc(var(--spacing, .25rem) * 10);
|
|
11
|
+
height: calc(var(--spacing, .25rem) * 10);
|
|
12
|
+
min-width: calc(var(--spacing, .25rem) * 10);
|
|
13
|
+
min-height: calc(var(--spacing, .25rem) * 10);
|
|
14
|
+
|
|
15
|
+
border-radius: calc(var(--spacing, .25rem) * 2);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputOtpSkeleton as Component } from './component';
|
|
2
|
+
import { InputOtpSkeletonProps as ComponentProps } from './component.interface';
|
|
3
|
+
export declare const InputOtpSkeleton: typeof Component;
|
|
4
|
+
export declare namespace InputOtpSkeleton {
|
|
5
|
+
type Props = ComponentProps;
|
|
6
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { OTPFieldPreview as OTPField } from '@base-ui/react/otp-field';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import React, { useId } from 'react';
|
|
26
|
+
import styles from '../styles/component.module.css';
|
|
27
|
+
export function OTP(_a) {
|
|
28
|
+
var _b;
|
|
29
|
+
var rest = __rest(_a, []);
|
|
30
|
+
var id = (_b = rest === null || rest === void 0 ? void 0 : rest.id) !== null && _b !== void 0 ? _b : useId();
|
|
31
|
+
return (React.createElement(OTPField.Root, __assign({}, rest, { id: id, className: classNames('mosuk-otp', styles.root, rest === null || rest === void 0 ? void 0 : rest.className) }), rest === null || rest === void 0 ? void 0 : rest.children));
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { OTPFieldPreview as OTPField } from '@base-ui/react/otp-field';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import styles from '../../styles/component.module.css';
|
|
27
|
+
export function OTPInput(_a) {
|
|
28
|
+
var rest = __rest(_a, []);
|
|
29
|
+
return (React.createElement(OTPField.Input, __assign({}, rest, { className: classNames('mosuk-otp-input', styles.input, rest === null || rest === void 0 ? void 0 : rest.className) })));
|
|
30
|
+
}
|