@ozen-ui/kit 0.64.0 → 0.65.0
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/ChipGroup/package.json +5 -0
- package/Title/package.json +5 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.css +16 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.d.ts +4 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.js +52 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroupContext.d.ts +10 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroupContext.js +5 -0
- package/__inner__/cjs/components/ChipGroup/constants.d.ts +5 -0
- package/__inner__/cjs/components/ChipGroup/constants.js +6 -0
- package/__inner__/cjs/components/ChipGroup/index.d.ts +2 -0
- package/__inner__/cjs/components/ChipGroup/index.js +5 -0
- package/__inner__/cjs/components/ChipGroup/types.d.ts +33 -0
- package/__inner__/cjs/components/ChipGroup/types.js +2 -0
- package/__inner__/cjs/components/ChipNext/Chip.css +50 -17
- package/__inner__/cjs/components/ChipNext/Chip.js +32 -5
- package/__inner__/cjs/components/ChipNext/types.d.ts +9 -5
- package/__inner__/cjs/components/ChipNext/types.js +9 -2
- package/__inner__/cjs/components/FormGroup/types.d.ts +2 -0
- package/__inner__/cjs/components/FormTitle/FormTitle.d.ts +1 -0
- package/__inner__/cjs/components/IconButtonNext/types.d.ts +4 -1
- package/__inner__/cjs/components/IconButtonNext/utils.d.ts +2 -2
- package/__inner__/cjs/components/InputOTP/constants.d.ts +1 -1
- package/__inner__/cjs/components/TagNext/types.d.ts +1 -1
- package/__inner__/cjs/components/TagNext/types.js +1 -0
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +6 -2
- package/__inner__/cjs/components/Title/Title.d.ts +4 -0
- package/__inner__/cjs/components/Title/Title.js +27 -0
- package/__inner__/cjs/components/Title/TitleContext.d.ts +8 -0
- package/__inner__/cjs/components/Title/TitleContext.js +17 -0
- package/__inner__/cjs/components/Title/components/index.d.ts +1 -0
- package/__inner__/cjs/components/Title/components/index.js +4 -0
- package/__inner__/cjs/components/Title/components/variant/TitleVariant.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/TitleVariant.js +24 -0
- package/__inner__/cjs/components/Title/components/variant/index.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/index.js +7 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.css +38 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.js +35 -0
- package/__inner__/cjs/components/Title/components/variant/main/config.d.ts +3 -0
- package/__inner__/cjs/components/Title/components/variant/main/config.js +7 -0
- package/__inner__/cjs/components/Title/components/variant/main/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/main/index.js +5 -0
- package/__inner__/cjs/components/Title/components/variant/main/types.d.ts +13 -0
- package/__inner__/cjs/components/Title/components/variant/main/types.js +2 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.js +15 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/index.js +5 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/types.d.ts +10 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/types.js +2 -0
- package/__inner__/cjs/components/Title/components/variant/types.d.ts +8 -0
- package/__inner__/cjs/components/Title/components/variant/types.js +2 -0
- package/__inner__/cjs/components/Title/constants.d.ts +4 -0
- package/__inner__/cjs/components/Title/constants.js +6 -0
- package/__inner__/cjs/components/Title/entities/icon.d.ts +3 -0
- package/__inner__/cjs/components/Title/entities/icon.js +2 -0
- package/__inner__/cjs/components/Title/entities/index.d.ts +3 -0
- package/__inner__/cjs/components/Title/entities/index.js +6 -0
- package/__inner__/cjs/components/Title/entities/size.d.ts +2 -0
- package/__inner__/cjs/components/Title/entities/size.js +4 -0
- package/__inner__/cjs/components/Title/entities/variant.d.ts +7 -0
- package/__inner__/cjs/components/Title/entities/variant.js +4 -0
- package/__inner__/cjs/components/Title/index.d.ts +4 -0
- package/__inner__/cjs/components/Title/index.js +7 -0
- package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
- package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.js +16 -0
- package/__inner__/cjs/components/Title/modules/icon-button/constants.d.ts +1 -0
- package/__inner__/cjs/components/Title/modules/icon-button/constants.js +4 -0
- package/__inner__/cjs/components/Title/modules/icon-button/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/icon-button/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/icon-button/types.d.ts +6 -0
- package/__inner__/cjs/components/Title/modules/icon-button/types.js +2 -0
- package/__inner__/cjs/components/Title/modules/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.css +4 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.d.ts +3 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.js +11 -0
- package/__inner__/cjs/components/Title/modules/tag/constants.d.ts +1 -0
- package/__inner__/cjs/components/Title/modules/tag/constants.js +4 -0
- package/__inner__/cjs/components/Title/modules/tag/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/tag/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/tag/types.d.ts +6 -0
- package/__inner__/cjs/components/Title/modules/tag/types.js +2 -0
- package/__inner__/cjs/components/Title/types.d.ts +10 -0
- package/__inner__/cjs/components/Title/types.js +2 -0
- package/__inner__/cjs/constants/environment/index.d.ts +2 -0
- package/__inner__/cjs/constants/environment/index.js +5 -0
- package/__inner__/cjs/constants/environment/isDev.d.ts +1 -0
- package/__inner__/cjs/constants/environment/isDev.js +5 -0
- package/__inner__/cjs/constants/environment/isProduction.d.ts +1 -0
- package/__inner__/cjs/constants/environment/isProduction.js +4 -0
- package/__inner__/cjs/types/object/withPartial.d.ts +3 -0
- package/__inner__/cjs/types/object/withPartial.js +2 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.css +16 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.d.ts +4 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.js +49 -0
- package/__inner__/esm/components/ChipGroup/ChipGroupContext.d.ts +10 -0
- package/__inner__/esm/components/ChipGroup/ChipGroupContext.js +2 -0
- package/__inner__/esm/components/ChipGroup/constants.d.ts +5 -0
- package/__inner__/esm/components/ChipGroup/constants.js +3 -0
- package/__inner__/esm/components/ChipGroup/index.d.ts +2 -0
- package/__inner__/esm/components/ChipGroup/index.js +2 -0
- package/__inner__/esm/components/ChipGroup/types.d.ts +33 -0
- package/__inner__/esm/components/ChipGroup/types.js +1 -0
- package/__inner__/esm/components/ChipNext/Chip.css +50 -17
- package/__inner__/esm/components/ChipNext/Chip.js +32 -5
- package/__inner__/esm/components/ChipNext/types.d.ts +9 -5
- package/__inner__/esm/components/ChipNext/types.js +8 -1
- package/__inner__/esm/components/FormGroup/types.d.ts +2 -0
- package/__inner__/esm/components/FormTitle/FormTitle.d.ts +1 -0
- package/__inner__/esm/components/IconButtonNext/types.d.ts +4 -1
- package/__inner__/esm/components/IconButtonNext/utils.d.ts +2 -2
- package/__inner__/esm/components/InputOTP/constants.d.ts +1 -1
- package/__inner__/esm/components/TagNext/types.d.ts +1 -1
- package/__inner__/esm/components/TagNext/types.js +1 -0
- package/__inner__/esm/components/ThemeProvider/types.d.ts +6 -2
- package/__inner__/esm/components/Title/Title.d.ts +4 -0
- package/__inner__/esm/components/Title/Title.js +24 -0
- package/__inner__/esm/components/Title/TitleContext.d.ts +8 -0
- package/__inner__/esm/components/Title/TitleContext.js +12 -0
- package/__inner__/esm/components/Title/components/index.d.ts +1 -0
- package/__inner__/esm/components/Title/components/index.js +1 -0
- package/__inner__/esm/components/Title/components/variant/TitleVariant.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/TitleVariant.js +21 -0
- package/__inner__/esm/components/Title/components/variant/index.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/index.js +4 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.css +38 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.js +32 -0
- package/__inner__/esm/components/Title/components/variant/main/config.d.ts +3 -0
- package/__inner__/esm/components/Title/components/variant/main/config.js +4 -0
- package/__inner__/esm/components/Title/components/variant/main/index.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/main/index.js +2 -0
- package/__inner__/esm/components/Title/components/variant/main/types.d.ts +13 -0
- package/__inner__/esm/components/Title/components/variant/main/types.js +1 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.js +12 -0
- package/__inner__/esm/components/Title/components/variant/secondary/index.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/secondary/index.js +2 -0
- package/__inner__/esm/components/Title/components/variant/secondary/types.d.ts +10 -0
- package/__inner__/esm/components/Title/components/variant/secondary/types.js +1 -0
- package/__inner__/esm/components/Title/components/variant/types.d.ts +8 -0
- package/__inner__/esm/components/Title/components/variant/types.js +1 -0
- package/__inner__/esm/components/Title/constants.d.ts +4 -0
- package/__inner__/esm/components/Title/constants.js +3 -0
- package/__inner__/esm/components/Title/entities/icon.d.ts +3 -0
- package/__inner__/esm/components/Title/entities/icon.js +1 -0
- package/__inner__/esm/components/Title/entities/index.d.ts +3 -0
- package/__inner__/esm/components/Title/entities/index.js +3 -0
- package/__inner__/esm/components/Title/entities/size.d.ts +2 -0
- package/__inner__/esm/components/Title/entities/size.js +1 -0
- package/__inner__/esm/components/Title/entities/variant.d.ts +7 -0
- package/__inner__/esm/components/Title/entities/variant.js +1 -0
- package/__inner__/esm/components/Title/index.d.ts +4 -0
- package/__inner__/esm/components/Title/index.js +4 -0
- package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
- package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.js +13 -0
- package/__inner__/esm/components/Title/modules/icon-button/constants.d.ts +1 -0
- package/__inner__/esm/components/Title/modules/icon-button/constants.js +1 -0
- package/__inner__/esm/components/Title/modules/icon-button/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/icon-button/index.js +2 -0
- package/__inner__/esm/components/Title/modules/icon-button/types.d.ts +6 -0
- package/__inner__/esm/components/Title/modules/icon-button/types.js +1 -0
- package/__inner__/esm/components/Title/modules/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/index.js +2 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.css +4 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.d.ts +3 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.js +8 -0
- package/__inner__/esm/components/Title/modules/tag/constants.d.ts +1 -0
- package/__inner__/esm/components/Title/modules/tag/constants.js +1 -0
- package/__inner__/esm/components/Title/modules/tag/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/tag/index.js +2 -0
- package/__inner__/esm/components/Title/modules/tag/types.d.ts +6 -0
- package/__inner__/esm/components/Title/modules/tag/types.js +1 -0
- package/__inner__/esm/components/Title/types.d.ts +10 -0
- package/__inner__/esm/components/Title/types.js +1 -0
- package/__inner__/esm/constants/environment/index.d.ts +2 -0
- package/__inner__/esm/constants/environment/index.js +2 -0
- package/__inner__/esm/constants/environment/isDev.d.ts +1 -0
- package/__inner__/esm/constants/environment/isDev.js +2 -0
- package/__inner__/esm/constants/environment/isProduction.d.ts +1 -0
- package/__inner__/esm/constants/environment/isProduction.js +1 -0
- package/__inner__/esm/types/object/withPartial.d.ts +3 -0
- package/__inner__/esm/types/object/withPartial.js +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
.TitleMain {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: var(--space-xs);
|
|
7
|
+
}
|
|
8
|
+
.TitleMain_defaultMargin {
|
|
9
|
+
margin-block: var(--title-main-default-margin-block);
|
|
10
|
+
}
|
|
11
|
+
.TitleMain_defaultMargin .TitleMain-Label {
|
|
12
|
+
block-size: 1em;
|
|
13
|
+
}
|
|
14
|
+
.TitleMain_size_s {
|
|
15
|
+
--title-main-default-margin-block: 12px 16px;
|
|
16
|
+
}
|
|
17
|
+
.TitleMain_size_s .TitleMain-Content {
|
|
18
|
+
font: var(--typography-heading-xl-font);
|
|
19
|
+
letter-spacing: var(--typography-heading-xl-letter_spacing, 0);
|
|
20
|
+
text-transform: var(--typography-heading-xl-text_transform, none);
|
|
21
|
+
}
|
|
22
|
+
.TitleMain_size_m {
|
|
23
|
+
--title-main-default-margin-block: 16px 24px;
|
|
24
|
+
}
|
|
25
|
+
.TitleMain_size_m .TitleMain-Content {
|
|
26
|
+
font: var(--typography-heading-2xl-font);
|
|
27
|
+
letter-spacing: var(--typography-heading-2xl-letter_spacing, 0);
|
|
28
|
+
text-transform: var(--typography-heading-2xl-text_transform, none);
|
|
29
|
+
}
|
|
30
|
+
.TitleMain-ContentContainer {
|
|
31
|
+
color: var(--color-content-tertiary);
|
|
32
|
+
}
|
|
33
|
+
.TitleMain-Content {
|
|
34
|
+
color: var(--color-content-primary);
|
|
35
|
+
}
|
|
36
|
+
.TitleMain-Label {
|
|
37
|
+
cursor: default;
|
|
38
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './TitleMain.css';
|
|
2
|
+
import type { TitleMainBaseProps } from './types';
|
|
3
|
+
export declare const cnTitleMain: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const TitleMain: import("../../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleMainBaseProps, "div">;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TitleMain = exports.cnTitleMain = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./TitleMain.css");
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var classname_1 = require("../../../../../utils/classname");
|
|
8
|
+
var getIconSizeToFormElement_1 = require("../../../../../utils/getIconSizeToFormElement");
|
|
9
|
+
var polymorphicComponentWithRef_1 = require("../../../../../utils/polymorphicComponentWithRef");
|
|
10
|
+
var renderContent_1 = require("../../../../../utils/renderContent");
|
|
11
|
+
var Breadcrumbs_1 = require("../../../../Breadcrumbs");
|
|
12
|
+
var Stack_1 = require("../../../../Stack");
|
|
13
|
+
var constants_1 = require("../../../constants");
|
|
14
|
+
var config_1 = require("./config");
|
|
15
|
+
exports.cnTitleMain = (0, classname_1.cn)('TitleMain');
|
|
16
|
+
exports.TitleMain = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (_a, ref) {
|
|
17
|
+
var size = _a.size, className = _a.className, _b = _a.as, Tag = _b === void 0 ? constants_1.TITLE_DEFAULT_TAG : _b, children = _a.children, renderLeft = _a.renderLeft, renderRight = _a.renderRight, label = _a.label, defaultMarginProp = _a.defaultMargin, other = tslib_1.__rest(_a, ["size", "className", "as", "children", "renderLeft", "renderRight", "label", "defaultMargin"]);
|
|
18
|
+
var defaultMargin = defaultMarginProp === undefined ? !!label : defaultMarginProp;
|
|
19
|
+
var renderIcon = function (content) {
|
|
20
|
+
return (0, renderContent_1.renderContent)({
|
|
21
|
+
content: content,
|
|
22
|
+
props: {
|
|
23
|
+
size: (0, getIconSizeToFormElement_1.getIconSizeToFormElement)(size),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnTitleMain)({ size: size, defaultMargin: defaultMargin }, [className]) }, other, { ref: ref }),
|
|
28
|
+
(label || defaultMargin) && (react_1.default.createElement(Breadcrumbs_1.Breadcrumbs, { size: config_1.TITLE_MAIN_LABEL_SIZE_MAP[size], className: (0, exports.cnTitleMain)('LabelContainer') },
|
|
29
|
+
react_1.default.createElement(Breadcrumbs_1.BreadcrumbItem, { as: "span", className: (0, exports.cnTitleMain)('Label') }, label))),
|
|
30
|
+
react_1.default.createElement(Stack_1.Stack, { gap: "s", align: "center", className: (0, exports.cnTitleMain)('ContentContainer') },
|
|
31
|
+
renderIcon(renderLeft),
|
|
32
|
+
react_1.default.createElement("span", { className: (0, exports.cnTitleMain)('Content') }, children),
|
|
33
|
+
renderIcon(renderRight))));
|
|
34
|
+
});
|
|
35
|
+
exports.TitleMain.displayName = 'TitleMain';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
4
|
+
import type { TitleIcon, TitleSizeVariant } from '../../../entities';
|
|
5
|
+
export type TitleMainBaseProps = {
|
|
6
|
+
size: TitleSizeVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
renderLeft?: TitleIcon;
|
|
9
|
+
renderRight?: TitleIcon;
|
|
10
|
+
defaultMargin?: boolean;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
};
|
|
13
|
+
export type TitleMainProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleMainBaseProps, As>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
.TitleSecondary {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
color: var(--color-content-secondary);
|
|
5
|
+
}
|
|
6
|
+
.TitleSecondary_size_s {
|
|
7
|
+
--title-secondary-default-margin-block: 24px 12px;
|
|
8
|
+
|
|
9
|
+
font: var(--typography-text-s_1-font);
|
|
10
|
+
|
|
11
|
+
letter-spacing: var(--typography-text-s_1-letter_spacing, 0);
|
|
12
|
+
|
|
13
|
+
text-transform: var(--typography-text-s_1-text_transform, none);
|
|
14
|
+
}
|
|
15
|
+
.TitleSecondary_size_m {
|
|
16
|
+
--title-secondary-default-margin-block: 32px 16px;
|
|
17
|
+
|
|
18
|
+
font: var(--typography-text-m_1-font);
|
|
19
|
+
|
|
20
|
+
letter-spacing: var(--typography-text-m_1-letter_spacing, 0);
|
|
21
|
+
|
|
22
|
+
text-transform: var(--typography-text-m_1-text_transform, none);
|
|
23
|
+
}
|
|
24
|
+
.TitleSecondary_defaultMargin {
|
|
25
|
+
margin-block: var(--title-secondary-default-margin-block);
|
|
26
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './TitleSecondary.css';
|
|
2
|
+
import type { TitleSecondaryBaseProps } from './types';
|
|
3
|
+
export declare const cnTitleSecondary: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const TitleSecondary: import("../../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleSecondaryBaseProps, "div">;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TitleSecondary = exports.cnTitleSecondary = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./TitleSecondary.css");
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var classname_1 = require("../../../../../utils/classname");
|
|
8
|
+
var polymorphicComponentWithRef_1 = require("../../../../../utils/polymorphicComponentWithRef");
|
|
9
|
+
var constants_1 = require("../../../constants");
|
|
10
|
+
exports.cnTitleSecondary = (0, classname_1.cn)('TitleSecondary');
|
|
11
|
+
exports.TitleSecondary = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (_a, ref) {
|
|
12
|
+
var size = _a.size, className = _a.className, _b = _a.as, Tag = _b === void 0 ? constants_1.TITLE_DEFAULT_TAG : _b, children = _a.children, defaultMargin = _a.defaultMargin, other = tslib_1.__rest(_a, ["size", "className", "as", "children", "defaultMargin"]);
|
|
13
|
+
return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnTitleSecondary)({ size: size, defaultMargin: defaultMargin }, [className]) }, other, { ref: ref }), children));
|
|
14
|
+
});
|
|
15
|
+
exports.TitleSecondary.displayName = 'TitleSecondary';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
4
|
+
import type { TitleSizeVariant } from '../../../entities';
|
|
5
|
+
export type TitleSecondaryBaseProps = {
|
|
6
|
+
size: TitleSizeVariant;
|
|
7
|
+
defaultMargin?: boolean;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
export type TitleSecondaryProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleSecondaryBaseProps, As>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../constants';
|
|
4
|
+
import type { TitleVariantValue } from '../../entities';
|
|
5
|
+
import type { TitleMainBaseProps } from '../variant/main';
|
|
6
|
+
import type { TitleSecondaryBaseProps } from '../variant/secondary';
|
|
7
|
+
export type TitleVariantBaseProps = TitleVariantValue<'main', TitleMainBaseProps> | TitleVariantValue<'secondary', TitleSecondaryBaseProps> | TitleVariantValue<undefined, TitleMainBaseProps>;
|
|
8
|
+
export type TitleVariantProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleVariantBaseProps, As>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TITLE_DEFAULT_TAG = exports.TITLE_DEFAULT_VARIANT = exports.TITLE_DEFAULT_SIZE = void 0;
|
|
4
|
+
exports.TITLE_DEFAULT_SIZE = 'm';
|
|
5
|
+
exports.TITLE_DEFAULT_VARIANT = 'main';
|
|
6
|
+
exports.TITLE_DEFAULT_TAG = 'div';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./icon"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./variant"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./size"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const titleVariant: readonly ["main", "secondary"];
|
|
2
|
+
export type TitleVariant = (typeof titleVariant)[number];
|
|
3
|
+
export type TitleVariantValue<Variant extends TitleVariant | undefined, Value> = (Variant extends undefined ? {
|
|
4
|
+
variant?: undefined;
|
|
5
|
+
} : {
|
|
6
|
+
variant: Variant;
|
|
7
|
+
}) & Value;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./entities"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./modules"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Title"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TitleIconButtonBaseProps } from './types';
|
|
2
|
+
export declare const cnTitleIconButton: import("@bem-react/classname").ClassNameFormatter;
|
|
3
|
+
export declare const TitleIconButton: import("../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleIconButtonBaseProps, "button">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TitleIconButton = exports.cnTitleIconButton = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var classname_1 = require("../../../../utils/classname");
|
|
7
|
+
var polymorphicComponentWithRef_1 = require("../../../../utils/polymorphicComponentWithRef");
|
|
8
|
+
var IconButtonNext_1 = require("../../../IconButtonNext");
|
|
9
|
+
var TitleContext_1 = require("../../TitleContext");
|
|
10
|
+
var constants_1 = require("./constants");
|
|
11
|
+
exports.cnTitleIconButton = (0, classname_1.cn)('TitleIconButton');
|
|
12
|
+
exports.TitleIconButton = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (props, ref) {
|
|
13
|
+
var size = (0, TitleContext_1.useTitleContext)().size;
|
|
14
|
+
return (react_1.default.createElement(IconButtonNext_1.IconButton, tslib_1.__assign({ compressed: true, as: constants_1.TITLE_ICON_BUTTON_DEFAULT_TAG }, props, { ref: ref, size: size, className: (0, exports.cnTitleIconButton)('', [props.className]) })));
|
|
15
|
+
});
|
|
16
|
+
exports.TitleIconButton.displayName = 'TitleIconButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TITLE_ICON_BUTTON_DEFAULT_TAG = "button";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { IconButtonBaseProps } from '../../../IconButtonNext';
|
|
4
|
+
import type { TITLE_ICON_BUTTON_DEFAULT_TAG } from './constants';
|
|
5
|
+
export type TitleIconButtonBaseProps = Omit<IconButtonBaseProps, 'size'>;
|
|
6
|
+
export type TitleIconButtonProps<As extends ElementType = typeof TITLE_ICON_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleIconButtonBaseProps, As>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TitleTagBaseProps } from '../../../Title/modules/tag/types';
|
|
2
|
+
export declare const cnTitleTag: import("@bem-react/classname").ClassNameFormatter;
|
|
3
|
+
export declare const TitleTag: import("../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleTagBaseProps, "div">;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TitleTag = exports.cnTitleTag = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var classname_1 = require("../../../../utils/classname");
|
|
7
|
+
var polymorphicComponentWithRef_1 = require("../../../../utils/polymorphicComponentWithRef");
|
|
8
|
+
var TagNext_1 = require("../../../TagNext");
|
|
9
|
+
var constants_1 = require("../../../Title/modules/tag/constants");
|
|
10
|
+
exports.cnTitleTag = (0, classname_1.cn)('TitleTag');
|
|
11
|
+
exports.TitleTag = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (props, ref) { return (react_1.default.createElement(TagNext_1.Tag, tslib_1.__assign({ as: constants_1.TITLE_TAG_DEFAULT_TAG }, props, { ref: ref, size: "xs", variant: "primary", color: "uncolored", className: (0, exports.cnTitleTag)('', [props.className]) }))); });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TITLE_TAG_DEFAULT_TAG = "div";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TagBaseProps } from '../../../TagNext';
|
|
4
|
+
import type { TITLE_TAG_DEFAULT_TAG } from './constants';
|
|
5
|
+
export type TitleTagBaseProps = Omit<TagBaseProps, 'size' | 'color' | 'variant'>;
|
|
6
|
+
export type TitleTagProps<As extends ElementType = typeof TITLE_TAG_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleTagBaseProps, As>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { WithPartial } from '../../types/object/withPartial';
|
|
3
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
4
|
+
import type { TitleMainBaseProps, TitleSecondaryBaseProps } from './components';
|
|
5
|
+
import type { TITLE_DEFAULT_TAG } from './constants';
|
|
6
|
+
import type { TitleVariantValue } from './entities';
|
|
7
|
+
export type TitleMainBasePartialProps = WithPartial<TitleMainBaseProps, 'size'>;
|
|
8
|
+
export type TitleSecondaryBasePartialProps = WithPartial<TitleSecondaryBaseProps, 'size'>;
|
|
9
|
+
export type TitleBaseProps = TitleVariantValue<'main', TitleMainBasePartialProps> | TitleVariantValue<'secondary', TitleSecondaryBasePartialProps> | TitleVariantValue<undefined, TitleMainBasePartialProps>;
|
|
10
|
+
export type TitleProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleBaseProps, As>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IS_DEV: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IS_PRODUCTION: boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.ChipGroup {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ChipGroup .FormGroup {
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ChipGroup .FormGroup_size_xs, .ChipGroup .FormGroup_size_s {
|
|
11
|
+
--form-group-gap: var(--spacing-xs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ChipGroup .FormGroup_size_m, .ChipGroup .FormGroup_size_l {
|
|
15
|
+
--form-group-gap: var(--spacing-s);
|
|
16
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './ChipGroup.css';
|
|
2
|
+
import type { ChipGroupBaseProps } from './types';
|
|
3
|
+
export declare const cnChipGroup: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const ChipGroup: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<ChipGroupBaseProps, "div">;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __spreadArray } from "tslib";
|
|
2
|
+
import './ChipGroup.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useControlled } from '../../hooks/useControlled';
|
|
5
|
+
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
|
+
import { cn } from '../../utils/classname';
|
|
7
|
+
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
8
|
+
import { FormGroup } from '../FormGroup';
|
|
9
|
+
import { FormTitle } from '../FormTitle';
|
|
10
|
+
import { ChipGroupContext } from './ChipGroupContext';
|
|
11
|
+
import { CHIP_GROUP_DEFAULT_AS, CHIP_GROUP_DEFAULT_DIRECTION, CHIP_GROUP_DEFAULT_SIZE, } from './constants';
|
|
12
|
+
export var cnChipGroup = cn('ChipGroup');
|
|
13
|
+
export var ChipGroup = polymorphicComponentWithRef(function (inProps, ref) {
|
|
14
|
+
var props = useThemeProps({
|
|
15
|
+
props: inProps,
|
|
16
|
+
name: 'ChipGroup',
|
|
17
|
+
});
|
|
18
|
+
var _a = props.direction, direction = _a === void 0 ? CHIP_GROUP_DEFAULT_DIRECTION : _a, _b = props.size, size = _b === void 0 ? CHIP_GROUP_DEFAULT_SIZE : _b, _c = props.as, Tag = _c === void 0 ? CHIP_GROUP_DEFAULT_AS : _c, color = props.color, title = props.title, className = props.className, children = props.children, valueProp = props.value, _d = props.defaultValue, defaultValue = _d === void 0 ? [] : _d, onChange = props.onChange, disabled = props.disabled, titleProps = props.titleProps, groupProps = props.groupProps, other = __rest(props, ["direction", "size", "as", "color", "title", "className", "children", "value", "defaultValue", "onChange", "disabled", "titleProps", "groupProps"]);
|
|
19
|
+
var _e = __read(useControlled({
|
|
20
|
+
value: valueProp,
|
|
21
|
+
defaultValue: defaultValue,
|
|
22
|
+
name: 'ChipGroup',
|
|
23
|
+
state: 'value',
|
|
24
|
+
}), 2), valueState = _e[0], setValueState = _e[1];
|
|
25
|
+
var onClick = function (event, payload) {
|
|
26
|
+
var itemValue = payload.value;
|
|
27
|
+
if (itemValue === undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
var requiredValueState = valueState !== null && valueState !== void 0 ? valueState : [];
|
|
31
|
+
var isValueAlreadyChecked = requiredValueState.includes(itemValue);
|
|
32
|
+
var value = isValueAlreadyChecked
|
|
33
|
+
? requiredValueState.filter(function (item) { return item !== itemValue; })
|
|
34
|
+
: __spreadArray(__spreadArray([], __read(requiredValueState), false), [itemValue], false);
|
|
35
|
+
setValueState(value);
|
|
36
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value, event);
|
|
37
|
+
};
|
|
38
|
+
return (React.createElement(Tag, __assign({ className: cnChipGroup({ size: size }, [className]), role: "group" }, other, { ref: ref }),
|
|
39
|
+
React.createElement(ChipGroupContext.Provider, { value: {
|
|
40
|
+
value: valueState,
|
|
41
|
+
onClick: onClick,
|
|
42
|
+
size: size,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
color: color,
|
|
45
|
+
} },
|
|
46
|
+
title && (React.createElement(FormTitle, __assign({ size: size }, titleProps), title)),
|
|
47
|
+
React.createElement(FormGroup, __assign({ direction: direction, size: size }, groupProps), children))));
|
|
48
|
+
});
|
|
49
|
+
ChipGroup.displayName = 'ChipGroup';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChipColorVariant, ChipOnClick, ChipSizeVariant } from '../ChipNext';
|
|
2
|
+
import type { ChipGroupValue } from './types';
|
|
3
|
+
export type ChipGroupContextValue = {
|
|
4
|
+
onClick: ChipOnClick;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
value?: ChipGroupValue;
|
|
7
|
+
size?: ChipSizeVariant;
|
|
8
|
+
color?: ChipColorVariant;
|
|
9
|
+
};
|
|
10
|
+
export declare const ChipGroupContext: import("react").Context<ChipGroupContextValue | undefined>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChipSizeVariant } from '../ChipNext';
|
|
2
|
+
import type { FormGroupDirectionVariant } from '../FormGroup';
|
|
3
|
+
export declare const CHIP_GROUP_DEFAULT_DIRECTION: FormGroupDirectionVariant;
|
|
4
|
+
export declare const CHIP_GROUP_DEFAULT_SIZE: ChipSizeVariant;
|
|
5
|
+
export declare const CHIP_GROUP_DEFAULT_AS = "div";
|