@modul/mbui 0.0.19-beta-pv-53151-14635d0d → 0.0.19-beta-pv-53151-a141d744
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.js +1 -1
- package/dist/Button/ButtonWidget.d.ts +17 -0
- package/dist/Button/ButtonWidget.js +42 -0
- package/dist/Button/ButtonWidget.js.map +1 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Button/index.js +3 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Button/Button.tsx +2 -2
- package/src/Button/ButtonWidget.tsx +68 -0
- package/src/Button/index.ts +2 -1
- package/src/index.ts +2 -1
package/dist/Button/Button.js
CHANGED
|
@@ -65,7 +65,7 @@ const buttonClasses = {
|
|
|
65
65
|
focus-visible:text-btn-ghost-focus
|
|
66
66
|
active:text-btn-ghost-active
|
|
67
67
|
disabled:text-btn-ghost-disabled
|
|
68
|
-
|
|
68
|
+
`,
|
|
69
69
|
};
|
|
70
70
|
const getPadings = (icon, variant) => {
|
|
71
71
|
return (0, utils_1.cn)(icon && 'p-[12px] aspect-square', icon && variant === 'outline' && 'p-[13px] aspect-square', !icon && 'px-[24px] py-[12px]', !icon && variant === 'outline' && 'px-[25px] py-[13px]');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Icon: React.FC<IProps>;
|
|
10
|
+
declare const Content: React.FC<IProps>;
|
|
11
|
+
interface IButtonWidgetProps {
|
|
12
|
+
displayName: string;
|
|
13
|
+
Icon: typeof Icon;
|
|
14
|
+
Content: typeof Content;
|
|
15
|
+
}
|
|
16
|
+
declare const ButtonWidget: React.FC<ButtonProps> & IButtonWidgetProps;
|
|
17
|
+
export { ButtonWidget };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonWidget = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
const react_slot_1 = require("@radix-ui/react-slot");
|
|
7
|
+
const utils_1 = require("../@/lib/utils");
|
|
8
|
+
const buttonClasses = `
|
|
9
|
+
inline-flex
|
|
10
|
+
items-center
|
|
11
|
+
shrink-0
|
|
12
|
+
p-[8px]
|
|
13
|
+
rounded-md
|
|
14
|
+
font-medium
|
|
15
|
+
leading-[1]
|
|
16
|
+
focus-visible:ring
|
|
17
|
+
focus-visible:outline-none
|
|
18
|
+
ring-offset-1
|
|
19
|
+
transition-colors
|
|
20
|
+
whitespace-nowrap
|
|
21
|
+
bg-page
|
|
22
|
+
shadow-md
|
|
23
|
+
active:shadow-sm
|
|
24
|
+
disabled:pointer-events-none
|
|
25
|
+
`;
|
|
26
|
+
const Icon = ({ children }) => {
|
|
27
|
+
return React.createElement("span", { className: "flex justify-center items-center bg-primary-light [&+span]:ml-[16px] rounded-full text-primary size-[40px]" }, children);
|
|
28
|
+
};
|
|
29
|
+
const Content = ({ children, className }) => {
|
|
30
|
+
return React.createElement("span", { className: className }, children);
|
|
31
|
+
};
|
|
32
|
+
const ButtonWidget = ({ className, asChild = false, ...props }) => {
|
|
33
|
+
const Comp = asChild ? react_slot_1.Slot : 'button';
|
|
34
|
+
return (React.createElement(Comp, { className: (0, utils_1.cn)(buttonClasses, className), ...props }));
|
|
35
|
+
};
|
|
36
|
+
exports.ButtonWidget = ButtonWidget;
|
|
37
|
+
ButtonWidget.displayName = 'ButtonWidget';
|
|
38
|
+
ButtonWidget.Icon = Icon;
|
|
39
|
+
ButtonWidget.Icon.displayName = 'ButtonWidget.Icon';
|
|
40
|
+
ButtonWidget.Content = Content;
|
|
41
|
+
ButtonWidget.Content.displayName = 'ButtonWidget.Content';
|
|
42
|
+
//# sourceMappingURL=ButtonWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonWidget.js","sourceRoot":"","sources":["../../src/Button/ButtonWidget.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,qDAA2C;AAE3C,0CAAmC;AAEnC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;CAiBrB,CAAA;AAWD,MAAM,IAAI,GAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,OAAO,8BAAM,SAAS,EAAC,4GAA4G,IAAE,QAAQ,CAAQ,CAAA;AACtJ,CAAC,CAAA;AAED,MAAM,OAAO,GAAqB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7D,OAAO,8BAAM,SAAS,EAAE,SAAS,IAAG,QAAQ,CAAQ,CAAA;AACrD,CAAC,CAAA;AAQD,MAAM,YAAY,GAA+C,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC5G,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAEtC,OAAO,CACN,oBAAC,IAAI,IACJ,SAAS,EAAE,IAAA,UAAE,EAAC,aAAa,EAAE,SAAS,CAAC,KACnC,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAA;AAWO,oCAAY;AARrB,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAEzC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAA;AACxB,YAAY,CAAC,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,YAAY,CAAC,OAAO,GAAG,OAAO,CAAA;AAC9B,YAAY,CAAC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA"}
|
package/dist/Button/index.d.ts
CHANGED
package/dist/Button/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttonVariants = exports.Button = void 0;
|
|
3
|
+
exports.ButtonWidget = exports.buttonVariants = exports.Button = void 0;
|
|
4
4
|
var Button_1 = require("./Button");
|
|
5
5
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
6
6
|
Object.defineProperty(exports, "buttonVariants", { enumerable: true, get: function () { return Button_1.buttonVariants; } });
|
|
7
|
+
var ButtonWidget_1 = require("./ButtonWidget");
|
|
8
|
+
Object.defineProperty(exports, "ButtonWidget", { enumerable: true, get: function () { return ButtonWidget_1.ButtonWidget; } });
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/Button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAAxC,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAAxC,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA;AAC/B,+CAA6C;AAApC,4GAAA,YAAY,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { BottomNavigation, BottomNavigationList, BottomNavigationListItem, Botto
|
|
|
8
8
|
import * as Icon from './Icon';
|
|
9
9
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './Collapsible';
|
|
10
10
|
import { AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem } from './Collapsible';
|
|
11
|
-
import { Button } from './Button';
|
|
11
|
+
import { Button, ButtonWidget } from './Button';
|
|
12
12
|
import { Audio } from './Audio';
|
|
13
13
|
import { cn } from './@/lib/utils';
|
|
14
14
|
import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer';
|
|
@@ -29,4 +29,4 @@ import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader,
|
|
|
29
29
|
import { MessageTyping } from "./Chat";
|
|
30
30
|
import { FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses } from './FavoritePyments';
|
|
31
31
|
import { DigitKeyPad } from "./DigitKeyPad";
|
|
32
|
-
export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Progress, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, DatePicker, SelectAsync, InputMask, Select, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, MessageTyping, FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses, DigitKeyPad, };
|
|
32
|
+
export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Progress, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, DatePicker, SelectAsync, InputMask, Select, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, MessageTyping, FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses, DigitKeyPad, ButtonWidget, };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SelectAsync = exports.DatePicker = exports.Calendar = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormItem = exports.FormField = exports.FormLabel = exports.Form = exports.SelectAccountCard = exports.Textarea = exports.Label = exports.Switch = exports.Alert = exports.Progress = exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = exports.Tooltip = void 0;
|
|
4
|
-
exports.DigitKeyPad = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.Select = exports.InputMask = void 0;
|
|
4
|
+
exports.ButtonWidget = exports.DigitKeyPad = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.Select = exports.InputMask = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const Tooltip_1 = require("./Tooltip");
|
|
7
7
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "AccountCollapsibleContent", { enumerable: true,
|
|
|
37
37
|
Object.defineProperty(exports, "AccountCollapsibleContentItem", { enumerable: true, get: function () { return Collapsible_2.AccountCollapsibleContentItem; } });
|
|
38
38
|
const Button_1 = require("./Button");
|
|
39
39
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
40
|
+
Object.defineProperty(exports, "ButtonWidget", { enumerable: true, get: function () { return Button_1.ButtonWidget; } });
|
|
40
41
|
const Audio_1 = require("./Audio");
|
|
41
42
|
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return Audio_1.Audio; } });
|
|
42
43
|
const utils_1 = require("./@/lib/utils");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,uCAAmC;AAuDlC,wFAvDQ,iBAAO,OAuDR;AAtDR,iCAA6B;AAuD5B,qFAvDQ,WAAI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AA8DvG,qFA9DQ,WAAI,OA8DR;AACJ,0FA/Dc,gBAAS,OA+Dd;AACT,0FAhEyB,gBAAS,OAgEzB;AACT,yFAjEoC,eAAQ,OAiEpC;AACR,4FAlE8C,kBAAW,OAkE9C;AACX,gGAnE2D,sBAAe,OAmE3D;AACf,4FApE4E,kBAAW,OAoE5E;AAnEZ,yCAAqC;AAoEpC,yFApEQ,mBAAQ,OAoER;AAnET,6CAAyC;AAoExC,2FApEQ,uBAAU,OAoER;AAnEX,qCAAiC;AAsEhC,uFAtEQ,eAAM,OAsER;AArEP,yCAAqC;AAoDpC,yFApDQ,mBAAQ,OAoDR;AAnDT,+CAUsB;AA2DrB,4FApEA,yBAAW,OAoEA;AACX,mGApEA,gCAAkB,OAoEA;AAClB,mGApEA,gCAAkB,OAoEA;AAClB,kGApEA,+BAAiB,OAoEA;AACjB,kGApEA,+BAAiB,OAoEA;AACjB,iGApEA,8BAAgB,OAoEA;AAChB,uGApEA,oCAAsB,OAoEA;AACtB,kGApEA,+BAAiB,OAoEA;AACjB,kGApEA,+BAAiB,OAoEA;AAlElB,iCAAsC;AAmErC,8FAnEQ,oBAAa,OAmER;AAlEd,uDAAiI;AAmEhI,qGAnEQ,sCAAoB,OAmER;AACpB,qGApE8B,sCAAoB,OAoE9B;AACpB,4GArEoD,6CAA2B,OAqEpD;AAC3B,qGAtEiF,sCAAoB,OAsEjF;AArErB,+CAA2C;AAsE1C,4FAtEQ,yBAAW,OAsER"}
|
package/package.json
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -62,7 +62,7 @@ const buttonClasses = {
|
|
|
62
62
|
focus-visible:text-btn-ghost-focus
|
|
63
63
|
active:text-btn-ghost-active
|
|
64
64
|
disabled:text-btn-ghost-disabled
|
|
65
|
-
|
|
65
|
+
`,
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const getPadings = (icon, variant) => {
|
|
@@ -70,7 +70,7 @@ const getPadings = (icon, variant) => {
|
|
|
70
70
|
icon && 'p-[12px] aspect-square',
|
|
71
71
|
icon && variant === 'outline' && 'p-[13px] aspect-square',
|
|
72
72
|
!icon && 'px-[24px] py-[12px]',
|
|
73
|
-
!icon && variant === 'outline' && 'px-[25px] py-[13px]'
|
|
73
|
+
!icon && variant === 'outline' && 'px-[25px] py-[13px]',
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
interface IVariantProps {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import { cn } from '../@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const buttonClasses = `
|
|
7
|
+
inline-flex
|
|
8
|
+
items-center
|
|
9
|
+
shrink-0
|
|
10
|
+
p-[8px]
|
|
11
|
+
rounded-md
|
|
12
|
+
font-medium
|
|
13
|
+
leading-[1]
|
|
14
|
+
focus-visible:ring
|
|
15
|
+
focus-visible:outline-none
|
|
16
|
+
ring-offset-1
|
|
17
|
+
transition-colors
|
|
18
|
+
whitespace-nowrap
|
|
19
|
+
bg-page
|
|
20
|
+
shadow-md
|
|
21
|
+
active:shadow-sm
|
|
22
|
+
disabled:pointer-events-none
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
interface IProps {
|
|
26
|
+
children?: React.ReactNode
|
|
27
|
+
className?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
31
|
+
asChild?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const Icon: React.FC<IProps> = ({ children }) => {
|
|
35
|
+
return <span className="flex justify-center items-center bg-primary-light [&+span]:ml-[16px] rounded-full text-primary size-[40px]">{children}</span>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Content: React.FC<IProps> = ({ children, className }) => {
|
|
39
|
+
return <span className={className}>{children}</span>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface IButtonWidgetProps {
|
|
43
|
+
displayName: string
|
|
44
|
+
Icon: typeof Icon
|
|
45
|
+
Content: typeof Content
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const ButtonWidget: React.FC<ButtonProps> & IButtonWidgetProps = ({ className, asChild = false, ...props }) => {
|
|
49
|
+
const Comp = asChild ? Slot : 'button'
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Comp
|
|
53
|
+
className={cn(buttonClasses, className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
ButtonWidget.displayName = 'ButtonWidget'
|
|
61
|
+
|
|
62
|
+
ButtonWidget.Icon = Icon
|
|
63
|
+
ButtonWidget.Icon.displayName = 'ButtonWidget.Icon'
|
|
64
|
+
|
|
65
|
+
ButtonWidget.Content = Content
|
|
66
|
+
ButtonWidget.Content.displayName = 'ButtonWidget.Content'
|
|
67
|
+
|
|
68
|
+
export { ButtonWidget }
|
package/src/Button/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Button, buttonVariants } from './Button'
|
|
1
|
+
export { Button, buttonVariants } from './Button'
|
|
2
|
+
export { ButtonWidget } from './ButtonWidget'
|
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
AccountCollapsibleContent,
|
|
20
20
|
AccountCollapsibleContentItem,
|
|
21
21
|
} from './Collapsible'
|
|
22
|
-
import { Button } from './Button'
|
|
22
|
+
import { Button, ButtonWidget } from './Button'
|
|
23
23
|
import { Audio } from './Audio'
|
|
24
24
|
import { cn } from './@/lib/utils'
|
|
25
25
|
import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer'
|
|
@@ -120,4 +120,5 @@ export {
|
|
|
120
120
|
FarvoritePaymentDescription,
|
|
121
121
|
farvoriteLinkClasses,
|
|
122
122
|
DigitKeyPad,
|
|
123
|
+
ButtonWidget,
|
|
123
124
|
}
|