@wireapp/react-ui-kit 9.57.0 → 9.58.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/lib/Icon/OptionsIcon.d.ts.map +1 -1
- package/lib/Icon/OptionsIcon.js +1 -1
- package/lib/Misc/Accordion/Accordion.d.ts +54 -0
- package/lib/Misc/Accordion/Accordion.d.ts.map +1 -0
- package/lib/Misc/Accordion/Accordion.js +87 -0
- package/lib/Misc/Accordion/Accordion.stories.d.ts +10 -0
- package/lib/Misc/Accordion/Accordion.stories.d.ts.map +1 -0
- package/lib/Misc/Accordion/Accordion.stories.js +30 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.d.ts +9 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.d.ts.map +1 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.js +51 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.styles.d.ts +9 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.styles.d.ts.map +1 -0
- package/lib/Misc/Accordion/AccordionItem/AccordionItem.styles.js +92 -0
- package/lib/Misc/Accordion/index.d.ts +2 -0
- package/lib/Misc/Accordion/index.d.ts.map +1 -0
- package/lib/Misc/Accordion/index.js +35 -0
- package/lib/Misc/index.d.ts +1 -0
- package/lib/Misc/index.d.ts.map +1 -1
- package/lib/Misc/index.js +1 -0
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsIcon.d.ts","sourceRoot":"","sources":["../../src/Icon/OptionsIcon.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAU,YAAY,EAAC,MAAM,WAAW,CAAC;AAEhD,eAAO,MAAM,WAAW,UAAW,YAAY,
|
|
1
|
+
{"version":3,"file":"OptionsIcon.d.ts","sourceRoot":"","sources":["../../src/Icon/OptionsIcon.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAU,YAAY,EAAC,MAAM,WAAW,CAAC;AAEhD,eAAO,MAAM,WAAW,UAAW,YAAY,qDAK9C,CAAC"}
|
package/lib/Icon/OptionsIcon.js
CHANGED
|
@@ -21,5 +21,5 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
23
|
const SVGIcon_1 = require("./SVGIcon");
|
|
24
|
-
const OptionsIcon = (props) => ((0, jsx_runtime_1.
|
|
24
|
+
const OptionsIcon = (props) => ((0, jsx_runtime_1.jsxs)(SVGIcon_1.SVGIcon, { realWidth: 16, realHeight: 16, ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M11.25.252c1.166 0 2.16.726 2.56 1.75H15a1 1 0 1 1 0 2h-1.19a2.748 2.748 0 0 1-5.12 0H1a1 1 0 1 1 0-2H8.69a2.748 2.748 0 0 1 2.56-1.75Zm0 1.5a1.26 1.26 0 0 0-1.243 1.115 1.276 1.276 0 0 0 .137.717 1.259 1.259 0 0 0 1.106.668 1.258 1.258 0 0 0 1.25-1.25 1.25 1.25 0 0 0-.14-.575 1.259 1.259 0 0 0-1.11-.675ZM5.25 5.25c1.166 0 2.16.726 2.56 1.75H15a1 1 0 1 1 0 2H7.81a2.748 2.748 0 0 1-5.12 0H1a1 1 0 0 1 0-2H2.69a2.748 2.748 0 0 1 2.56-1.75Zm0 1.5a1.26 1.26 0 0 0-1.243 1.115A1.258 1.258 0 0 0 4.502 9a1.243 1.243 0 0 0 1.496 0A1.26 1.26 0 0 0 6.5 8a1.257 1.257 0 0 0-1.25-1.25Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.25 10.258c1.166 0 2.16.726 2.56 1.75H15a1 1 0 1 1 0 2h-2.19a2.748 2.748 0 0 1-5.12 0H1a1 1 0 1 1 0-2H7.69a2.748 2.748 0 0 1 2.56-1.75Zm0 1.5a1.26 1.26 0 0 0-1.243 1.115 1.26 1.26 0 0 0 .495 1.135 1.243 1.243 0 0 0 1.496 0 1.259 1.259 0 0 0 .502-1 1.25 1.25 0 0 0-.14-.575 1.259 1.259 0 0 0-1.11-.675Z" })] }));
|
|
25
25
|
exports.OptionsIcon = OptionsIcon;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import { AccordionItem } from './AccordionItem/AccordionItem';
|
|
3
|
+
interface AccordionSingleProps {
|
|
4
|
+
type?: 'single';
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
collapsible?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface AccordionMultipleProps {
|
|
11
|
+
type: 'multiple';
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
value?: string[];
|
|
14
|
+
onValueChange?: (value: string[]) => void;
|
|
15
|
+
}
|
|
16
|
+
type AccordionProps = {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
} & (AccordionSingleProps | AccordionMultipleProps);
|
|
19
|
+
interface AccordionComponent extends ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>> {
|
|
20
|
+
Item: typeof AccordionItem;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A vertically stacked set of interactive headings that each reveal an associated section of content.
|
|
24
|
+
* The Accordion component can be used to create expandable/collapsible sections of content.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* Single open accordion (default)
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Accordion>
|
|
30
|
+
* <Accordion.Item title="What is Wire?" value="item-1">
|
|
31
|
+
* <Text>Wire is a secure messaging platform...</Text>
|
|
32
|
+
* </Accordion.Item>
|
|
33
|
+
* <Accordion.Item title="Is Wire secure?" value="item-2">
|
|
34
|
+
* <Text>Yes, Wire uses end-to-end encryption...</Text>
|
|
35
|
+
* </Accordion.Item>
|
|
36
|
+
* </Accordion>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* Multiple open accordion:
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <Accordion type="multiple">
|
|
43
|
+
* <Accordion.Item title="What is Wire?" value="item-1">
|
|
44
|
+
* <Text>Wire is a secure messaging platform...</Text>
|
|
45
|
+
* </Accordion.Item>
|
|
46
|
+
* <Accordion.Item title="Is Wire secure?" value="item-2">
|
|
47
|
+
* <Text>Yes, Wire uses end-to-end encryption...</Text>
|
|
48
|
+
* </Accordion.Item>
|
|
49
|
+
* </Accordion>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const Accordion: AccordionComponent;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/Misc/Accordion/Accordion.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAyB,yBAAyB,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,OAAO,CAAC;AAIlG,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAG5D,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C;AAED,KAAK,cAAc,GAAG;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,GAAG,CAAC,oBAAoB,GAAG,sBAAsB,CAAC,CAAC;AAE9F,UAAU,kBAAmB,SAAQ,yBAAyB,CAAC,cAAc,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5G,IAAI,EAAE,OAAO,aAAa,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,SAAS,EA8BhB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Accordion = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
/*
|
|
29
|
+
* Wire
|
|
30
|
+
* Copyright (C) 2024 Wire Swiss GmbH
|
|
31
|
+
*
|
|
32
|
+
* This program is free software: you can redistribute it and/or modify
|
|
33
|
+
* it under the terms of the GNU General Public License as published by
|
|
34
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
35
|
+
* (at your option) any later version.
|
|
36
|
+
*
|
|
37
|
+
* This program is distributed in the hope that it will be useful,
|
|
38
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
39
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
40
|
+
* GNU General Public License for more details.
|
|
41
|
+
*
|
|
42
|
+
* You should have received a copy of the GNU General Public License
|
|
43
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
const react_1 = require("react");
|
|
47
|
+
const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
|
|
48
|
+
const AccordionItem_1 = require("./AccordionItem/AccordionItem");
|
|
49
|
+
const AccordionItem_styles_1 = require("./AccordionItem/AccordionItem.styles");
|
|
50
|
+
/**
|
|
51
|
+
* A vertically stacked set of interactive headings that each reveal an associated section of content.
|
|
52
|
+
* The Accordion component can be used to create expandable/collapsible sections of content.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* Single open accordion (default)
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <Accordion>
|
|
58
|
+
* <Accordion.Item title="What is Wire?" value="item-1">
|
|
59
|
+
* <Text>Wire is a secure messaging platform...</Text>
|
|
60
|
+
* </Accordion.Item>
|
|
61
|
+
* <Accordion.Item title="Is Wire secure?" value="item-2">
|
|
62
|
+
* <Text>Yes, Wire uses end-to-end encryption...</Text>
|
|
63
|
+
* </Accordion.Item>
|
|
64
|
+
* </Accordion>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* Multiple open accordion:
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <Accordion type="multiple">
|
|
71
|
+
* <Accordion.Item title="What is Wire?" value="item-1">
|
|
72
|
+
* <Text>Wire is a secure messaging platform...</Text>
|
|
73
|
+
* </Accordion.Item>
|
|
74
|
+
* <Accordion.Item title="Is Wire secure?" value="item-2">
|
|
75
|
+
* <Text>Yes, Wire uses end-to-end encryption...</Text>
|
|
76
|
+
* </Accordion.Item>
|
|
77
|
+
* </Accordion>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
exports.Accordion = (0, react_1.forwardRef)((props, ref) => {
|
|
81
|
+
if (props.type === 'multiple') {
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Root, { type: "multiple", defaultValue: props.defaultValue, value: props.value, onValueChange: props.onValueChange, ref: ref, css: AccordionItem_styles_1.wrapperStyles, children: props.children }));
|
|
83
|
+
}
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Root, { type: "single", defaultValue: props.defaultValue, value: props.value, onValueChange: props.onValueChange, collapsible: true, ref: ref, css: AccordionItem_styles_1.wrapperStyles, ...props, children: props.children }));
|
|
85
|
+
});
|
|
86
|
+
exports.Accordion.displayName = 'Accordion';
|
|
87
|
+
exports.Accordion.Item = AccordionItem_1.AccordionItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Accordion } from './Accordion';
|
|
3
|
+
declare const meta: Meta<typeof Accordion>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Accordion>;
|
|
6
|
+
export declare const SingleOpen: Story;
|
|
7
|
+
export declare const MultipleOpen: Story;
|
|
8
|
+
export declare const WithDefaultOpen: Story;
|
|
9
|
+
export declare const TooLongTitle: Story;
|
|
10
|
+
//# sourceMappingURL=Accordion.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.stories.d.ts","sourceRoot":"","sources":["../../../src/Misc/Accordion/Accordion.stories.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAKtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAahC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAuB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TooLongTitle = exports.WithDefaultOpen = exports.MultipleOpen = exports.SingleOpen = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const Accordion_1 = require("./Accordion");
|
|
6
|
+
const colors_v2_1 = require("../../Identity/colors-v2");
|
|
7
|
+
const Text_1 = require("../../Text");
|
|
8
|
+
const meta = {
|
|
9
|
+
component: Accordion_1.Accordion,
|
|
10
|
+
title: 'Misc/Accordion',
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
Story => ((0, jsx_runtime_1.jsx)("div", { style: { width: '500px', margin: '0 auto', backgroundColor: 'white', padding: '20px' }, children: (0, jsx_runtime_1.jsx)(Story, {}) })),
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
exports.default = meta;
|
|
19
|
+
exports.SingleOpen = {
|
|
20
|
+
render: () => ((0, jsx_runtime_1.jsxs)(Accordion_1.Accordion, { children: [(0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "What is Wire?", value: "item-1", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Wire is a secure messaging and collaboration platform that helps teams communicate effectively while maintaining the highest standards of security and privacy." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Is Wire secure?", value: "item-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire uses end-to-end encryption for all messages, calls, and files. This means that only the participants in a conversation can read the messages." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Can I use Wire on multiple devices?", value: "item-3", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire is available on multiple platforms including desktop (Windows, macOS, Linux), mobile (iOS, Android), and web browsers." }) })] })),
|
|
21
|
+
};
|
|
22
|
+
exports.MultipleOpen = {
|
|
23
|
+
render: () => ((0, jsx_runtime_1.jsxs)(Accordion_1.Accordion, { type: "multiple", children: [(0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "What is Wire?", value: "item-1", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Wire is a secure messaging and collaboration platform that helps teams communicate effectively while maintaining the highest standards of security and privacy." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Is Wire secure?", value: "item-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire uses end-to-end encryption for all messages, calls, and files. This means that only the participants in a conversation can read the messages." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Can I use Wire on multiple devices?", value: "item-3", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire is available on multiple platforms including desktop (Windows, macOS, Linux), mobile (iOS, Android), and web browsers." }) })] })),
|
|
24
|
+
};
|
|
25
|
+
exports.WithDefaultOpen = {
|
|
26
|
+
render: () => ((0, jsx_runtime_1.jsxs)(Accordion_1.Accordion, { defaultValue: "item-2", children: [(0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "What is Wire?", value: "item-1", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Wire is a secure messaging and collaboration platform that helps teams communicate effectively while maintaining the highest standards of security and privacy." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Is Wire secure?", value: "item-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire uses end-to-end encryption for all messages, calls, and files. This means that only the participants in a conversation can read the messages." }) }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Can I use Wire on multiple devices?", value: "item-3", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Yes, Wire is available on multiple platforms including desktop (Windows, macOS, Linux), mobile (iOS, Android), and web browsers." }) })] })),
|
|
27
|
+
};
|
|
28
|
+
exports.TooLongTitle = {
|
|
29
|
+
render: () => ((0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { children: (0, jsx_runtime_1.jsx)(Accordion_1.Accordion.Item, { title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", value: "item-1", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, color: colors_v2_1.COLOR_V2.GRAY_80, children: "Wire is a secure messaging and collaboration platform that helps teams communicate effectively while maintaining the highest standards of security and privacy." }) }) })),
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface AccordionItemProps {
|
|
3
|
+
title: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const AccordionItem: import("react").ForwardRefExoticComponent<AccordionItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/Misc/Accordion/AccordionItem/AccordionItem.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAyB,SAAS,EAAC,MAAM,OAAO,CAAC;AAexD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,+GAYzB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AccordionItem = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
/*
|
|
29
|
+
* Wire
|
|
30
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
31
|
+
*
|
|
32
|
+
* This program is free software: you can redistribute it and/or modify
|
|
33
|
+
* it under the terms of the GNU General Public License as published by
|
|
34
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
35
|
+
* (at your option) any later version.
|
|
36
|
+
*
|
|
37
|
+
* This program is distributed in the hope that it will be useful,
|
|
38
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
39
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
40
|
+
* GNU General Public License for more details.
|
|
41
|
+
*
|
|
42
|
+
* You should have received a copy of the GNU General Public License
|
|
43
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
const react_1 = require("react");
|
|
47
|
+
const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
|
|
48
|
+
const AccordionItem_styles_1 = require("./AccordionItem.styles");
|
|
49
|
+
const Icon_1 = require("../../../Icon");
|
|
50
|
+
exports.AccordionItem = (0, react_1.forwardRef)(({ title, children, value }, ref) => ((0, jsx_runtime_1.jsxs)(AccordionPrimitive.Item, { value: value, ref: ref, css: AccordionItem_styles_1.itemStyles, children: [(0, jsx_runtime_1.jsxs)(AccordionPrimitive.Trigger, { css: AccordionItem_styles_1.triggerStyles, children: [(0, jsx_runtime_1.jsx)("span", { css: AccordionItem_styles_1.triggerTextStyles, children: title }), (0, jsx_runtime_1.jsx)(Icon_1.ChevronDownIcon, { css: AccordionItem_styles_1.chevronStyles })] }), (0, jsx_runtime_1.jsx)(AccordionPrimitive.Content, { css: AccordionItem_styles_1.contentStyles, children: (0, jsx_runtime_1.jsx)("div", { css: AccordionItem_styles_1.contentTextStyles, children: children }) })] })));
|
|
51
|
+
exports.AccordionItem.displayName = 'AccordionItem';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/react';
|
|
2
|
+
export declare const wrapperStyles: CSSObject;
|
|
3
|
+
export declare const itemStyles: CSSObject;
|
|
4
|
+
export declare const triggerStyles: CSSObject;
|
|
5
|
+
export declare const triggerTextStyles: CSSObject;
|
|
6
|
+
export declare const contentStyles: CSSObject;
|
|
7
|
+
export declare const contentTextStyles: CSSObject;
|
|
8
|
+
export declare const chevronStyles: CSSObject;
|
|
9
|
+
//# sourceMappingURL=AccordionItem.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.styles.d.ts","sourceRoot":"","sources":["../../../../src/Misc/Accordion/AccordionItem/AccordionItem.styles.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAY,MAAM,gBAAgB,CAAC;AA0BpD,eAAO,MAAM,aAAa,EAAE,SAG3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAMxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAW3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,SAI/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAQ3B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2024 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.chevronStyles = exports.contentTextStyles = exports.contentStyles = exports.triggerTextStyles = exports.triggerStyles = exports.itemStyles = exports.wrapperStyles = void 0;
|
|
22
|
+
const react_1 = require("@emotion/react");
|
|
23
|
+
const colors_v2_1 = require("../../../Identity/colors-v2");
|
|
24
|
+
const util_1 = require("../../../util");
|
|
25
|
+
const ANIMATION_TIMING = '300ms';
|
|
26
|
+
const ANIMATION_EASING = 'cubic-bezier(0.87, 0, 0.13, 1)';
|
|
27
|
+
const slideDown = (0, react_1.keyframes) `
|
|
28
|
+
from {
|
|
29
|
+
height: 0;
|
|
30
|
+
}
|
|
31
|
+
to {
|
|
32
|
+
height: var(--radix-accordion-content-height);
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const slideUp = (0, react_1.keyframes) `
|
|
36
|
+
from {
|
|
37
|
+
height: var(--radix-accordion-content-height);
|
|
38
|
+
}
|
|
39
|
+
to {
|
|
40
|
+
height: 0;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
exports.wrapperStyles = {
|
|
44
|
+
width: '100%',
|
|
45
|
+
overflow: 'hidden',
|
|
46
|
+
};
|
|
47
|
+
exports.itemStyles = {
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
borderBottom: `1px solid var(--text-input-border)`,
|
|
50
|
+
'&:last-child': {
|
|
51
|
+
borderBottom: 'none',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
exports.triggerStyles = {
|
|
55
|
+
width: '100%',
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
background: 'none',
|
|
60
|
+
padding: '16px',
|
|
61
|
+
border: 'none',
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
transition: 'background-color 0.2s ease',
|
|
64
|
+
height: '48px',
|
|
65
|
+
};
|
|
66
|
+
exports.triggerTextStyles = {
|
|
67
|
+
...(0, util_1.ellipsis)(),
|
|
68
|
+
fontSize: '16px',
|
|
69
|
+
marginRight: '16px',
|
|
70
|
+
};
|
|
71
|
+
exports.contentStyles = {
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
'&[data-state="open"]': {
|
|
74
|
+
animation: `${slideDown} ${ANIMATION_TIMING} ${ANIMATION_EASING}`,
|
|
75
|
+
},
|
|
76
|
+
'&[data-state="closed"]': {
|
|
77
|
+
animation: `${slideUp} ${ANIMATION_TIMING} ${ANIMATION_EASING}`,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
exports.contentTextStyles = {
|
|
81
|
+
width: '100%',
|
|
82
|
+
padding: '0 16px 16px',
|
|
83
|
+
};
|
|
84
|
+
exports.chevronStyles = {
|
|
85
|
+
width: '16px',
|
|
86
|
+
height: '16px',
|
|
87
|
+
color: colors_v2_1.COLOR_V2.GRAY_70,
|
|
88
|
+
transition: `transform ${ANIMATION_TIMING} ${ANIMATION_EASING}`,
|
|
89
|
+
'[data-state="open"] &': {
|
|
90
|
+
transform: 'rotate(180deg)',
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Misc/Accordion/index.ts"],"names":[],"mappings":"AAmBA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2024 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
__exportStar(require("./Accordion"), exports);
|
package/lib/Misc/index.d.ts
CHANGED
package/lib/Misc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Misc/index.ts"],"names":[],"mappings":"AAmBA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Misc/index.ts"],"names":[],"mappings":"AAmBA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
package/lib/Misc/index.js
CHANGED
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"main": "lib/index",
|
|
9
9
|
"homepage": "https://wire-react-ui-kit.netlify.app/",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@radix-ui/react-accordion": "1.2.11",
|
|
11
12
|
"@radix-ui/react-dropdown-menu": "2.1.14",
|
|
12
13
|
"@types/color": "3.0.6",
|
|
13
14
|
"color": "4.2.3",
|
|
@@ -78,6 +79,6 @@
|
|
|
78
79
|
"test:watch": "jest --watch",
|
|
79
80
|
"test:update": "jest --updateSnapshot"
|
|
80
81
|
},
|
|
81
|
-
"version": "9.
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"version": "9.58.0",
|
|
83
|
+
"gitHead": "9b86d389a625af640e18caa2371c57f18d6c2e58"
|
|
83
84
|
}
|