@cambly/syntax-core 1.0.5 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +27 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +103 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +115 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/dist/index.css
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
/* css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/
|
|
2
|
-
.
|
|
3
|
-
background-
|
|
1
|
+
/* css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/Avatar/Avatar.module.css/#css-module-data */
|
|
2
|
+
._avatar_17elh_1 {
|
|
3
|
+
background-position: "center";
|
|
4
|
+
background-size: "cover";
|
|
5
|
+
background-repeat: "no-repeat";
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
}
|
|
8
|
+
._sm_17elh_8 {
|
|
9
|
+
width: 24px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
}
|
|
12
|
+
._md_17elh_13 {
|
|
13
|
+
width: 40px;
|
|
14
|
+
height: 40px;
|
|
15
|
+
}
|
|
16
|
+
._lg_17elh_18 {
|
|
17
|
+
width: 72px;
|
|
18
|
+
height: 72px;
|
|
19
|
+
}
|
|
20
|
+
._xl_17elh_23 {
|
|
21
|
+
width: 128px;
|
|
22
|
+
height: 128px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/Divider/Divider.module.css/#css-module-data */
|
|
26
|
+
._divider_15e5a_1 {
|
|
27
|
+
background-color: #cbcbcb50;
|
|
4
28
|
border-radius: 50px;
|
|
5
29
|
border: none;
|
|
6
30
|
height: 1px;
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/
|
|
1
|
+
{"version":3,"sources":["css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/Avatar/Avatar.module.css/#css-module-data","css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/Divider/Divider.module.css/#css-module-data"],"sourcesContent":["._avatar_17elh_1 {\n background-position: \"center\";\n background-size: \"cover\";\n background-repeat: \"no-repeat\";\n border-radius: 50%;\n}\n\n._sm_17elh_8 {\n width: 24px;\n height: 24px;\n}\n\n._md_17elh_13 {\n width: 40px;\n height: 40px;\n}\n\n._lg_17elh_18 {\n width: 72px;\n height: 72px;\n}\n\n._xl_17elh_23 {\n width: 128px;\n height: 128px;\n}\n","._divider_15e5a_1 {\n /* gray10 */\n background-color: #cbcbcb50;\n border-radius: 50px;\n border: none;\n height: 1px;\n margin: 0;\n}\n"],"mappings":";AAAA;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;;;ACxBF;AAEE;AACA;AACA;AACA;AACA;AAAA;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar is a circular image that represents a user.
|
|
3
|
+
*/
|
|
4
|
+
declare const Avatar: ({ src, accessibilityLabel, size, }: {
|
|
5
|
+
/**
|
|
6
|
+
* The URL of the image to display as the avatar.
|
|
7
|
+
*/
|
|
8
|
+
src: string;
|
|
9
|
+
/**
|
|
10
|
+
* The alt text to use for the image.
|
|
11
|
+
* This should describe the image to people using screen readers.
|
|
12
|
+
*/
|
|
13
|
+
accessibilityLabel: string;
|
|
14
|
+
/**
|
|
15
|
+
* The size of the avatar.
|
|
16
|
+
* xs: 24px, sm: 32px, md: 48px, lg: 64px, xl: 120px.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue `md`
|
|
19
|
+
*/
|
|
20
|
+
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Divider is a thin horizontal line to group content in lists and layouts.
|
|
25
|
+
*/
|
|
1
26
|
declare function Divider({}: Record<string, never>): JSX.Element;
|
|
2
27
|
declare namespace Divider {
|
|
3
28
|
var displayName: string;
|
|
4
29
|
}
|
|
5
30
|
|
|
6
|
-
export { Divider };
|
|
31
|
+
export { Avatar, Divider };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
6
11
|
var __export = (target, all) => {
|
|
7
12
|
for (var name in all)
|
|
8
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,26 +20,120 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
20
|
}
|
|
16
21
|
return to;
|
|
17
22
|
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
18
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
32
|
|
|
33
|
+
// ../../node_modules/classnames/index.js
|
|
34
|
+
var require_classnames = __commonJS({
|
|
35
|
+
"../../node_modules/classnames/index.js"(exports, module2) {
|
|
36
|
+
(function() {
|
|
37
|
+
"use strict";
|
|
38
|
+
var hasOwn = {}.hasOwnProperty;
|
|
39
|
+
var nativeCodeString = "[native code]";
|
|
40
|
+
function classNames2() {
|
|
41
|
+
var classes = [];
|
|
42
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
43
|
+
var arg = arguments[i];
|
|
44
|
+
if (!arg)
|
|
45
|
+
continue;
|
|
46
|
+
var argType = typeof arg;
|
|
47
|
+
if (argType === "string" || argType === "number") {
|
|
48
|
+
classes.push(arg);
|
|
49
|
+
} else if (Array.isArray(arg)) {
|
|
50
|
+
if (arg.length) {
|
|
51
|
+
var inner = classNames2.apply(null, arg);
|
|
52
|
+
if (inner) {
|
|
53
|
+
classes.push(inner);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} else if (argType === "object") {
|
|
57
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
58
|
+
classes.push(arg.toString());
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
for (var key in arg) {
|
|
62
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
63
|
+
classes.push(key);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return classes.join(" ");
|
|
69
|
+
}
|
|
70
|
+
if (typeof module2 !== "undefined" && module2.exports) {
|
|
71
|
+
classNames2.default = classNames2;
|
|
72
|
+
module2.exports = classNames2;
|
|
73
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
74
|
+
define("classnames", [], function() {
|
|
75
|
+
return classNames2;
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
window.classNames = classNames2;
|
|
79
|
+
}
|
|
80
|
+
})();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
20
84
|
// src/index.tsx
|
|
21
85
|
var src_exports = {};
|
|
22
86
|
__export(src_exports, {
|
|
87
|
+
Avatar: () => Avatar_default,
|
|
23
88
|
Divider: () => Divider
|
|
24
89
|
});
|
|
25
90
|
module.exports = __toCommonJS(src_exports);
|
|
26
91
|
|
|
27
|
-
//
|
|
28
|
-
var
|
|
92
|
+
// src/Avatar/Avatar.tsx
|
|
93
|
+
var import_classnames = __toESM(require_classnames());
|
|
94
|
+
|
|
95
|
+
// css-module:./Avatar.module.css#css-module
|
|
96
|
+
var Avatar_module_default = { "avatar": "_avatar_17elh_1", "sm": "_sm_17elh_8", "md": "_md_17elh_13", "lg": "_lg_17elh_18", "xl": "_xl_17elh_23" };
|
|
29
97
|
|
|
30
|
-
// src/
|
|
98
|
+
// src/Avatar/Avatar.tsx
|
|
31
99
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
100
|
+
var Avatar = ({
|
|
101
|
+
src,
|
|
102
|
+
accessibilityLabel,
|
|
103
|
+
size = "md"
|
|
104
|
+
}) => {
|
|
105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
"img",
|
|
107
|
+
{
|
|
108
|
+
alt: accessibilityLabel,
|
|
109
|
+
src,
|
|
110
|
+
className: (0, import_classnames.default)(Avatar_module_default.avatar, Avatar_module_default[size])
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
var Avatar_default = Avatar;
|
|
115
|
+
|
|
116
|
+
// css-module:./Divider.module.css#css-module
|
|
117
|
+
var Divider_module_default = { "divider": "_divider_15e5a_1" };
|
|
118
|
+
|
|
119
|
+
// src/Divider/Divider.tsx
|
|
120
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
32
121
|
function Divider({}) {
|
|
33
|
-
return /* @__PURE__ */ (0,
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", { className: Divider_module_default.divider });
|
|
34
123
|
}
|
|
35
124
|
Divider.displayName = "Divider";
|
|
36
125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
126
|
0 && (module.exports = {
|
|
127
|
+
Avatar,
|
|
38
128
|
Divider
|
|
39
129
|
});
|
|
130
|
+
/*! Bundled license information:
|
|
131
|
+
|
|
132
|
+
classnames/index.js:
|
|
133
|
+
(*!
|
|
134
|
+
Copyright (c) 2018 Jed Watson.
|
|
135
|
+
Licensed under the MIT License (MIT), see
|
|
136
|
+
http://jedwatson.github.io/classnames
|
|
137
|
+
*)
|
|
138
|
+
*/
|
|
40
139
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx","css-module:./
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/classnames/index.js","../src/index.tsx","../src/Avatar/Avatar.tsx","css-module:./Avatar.module.css#css-module","css-module:./Divider.module.css#css-module","../src/Divider/Divider.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import Avatar from \"./Avatar/Avatar\";\nimport Divider from \"./Divider/Divider\";\n\nexport { Avatar, Divider };\n","import classNames from \"classnames\";\nimport styles from \"./Avatar.module.css\";\n\n/**\n * Avatar is a circular image that represents a user.\n */\nconst Avatar = ({\n src,\n accessibilityLabel,\n size = \"md\",\n}: {\n /**\n * The URL of the image to display as the avatar.\n */\n src: string;\n /**\n * The alt text to use for the image.\n * This should describe the image to people using screen readers.\n */\n accessibilityLabel: string;\n /**\n * The size of the avatar.\n * xs: 24px, sm: 32px, md: 48px, lg: 64px, xl: 120px.\n *\n * @defaultValue `md`\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n}): JSX.Element => {\n return (\n <img\n alt={accessibilityLabel}\n src={src}\n className={classNames(styles.avatar, styles[size])}\n />\n );\n};\n\nexport default Avatar;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Avatar/Avatar.module.css\"; export default {\"avatar\":\"_avatar_17elh_1\",\"sm\":\"_sm_17elh_8\",\"md\":\"_md_17elh_13\",\"lg\":\"_lg_17elh_18\",\"xl\":\"_xl_17elh_23\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Divider/Divider.module.css\"; export default {\"divider\":\"_divider_15e5a_1\"}","import styles from \"./Divider.module.css\";\n\n/**\n * Divider is a thin horizontal line to group content in lists and layouts.\n */\nexport default function Divider({}: Record<string, never>) {\n return <hr className={styles.divider} />;\n}\n\nDivider.displayName = \"Divider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,oDAAAA,SAAA;AAOA,KAAC,WAAY;AACZ;AAEA,UAAI,SAAS,CAAC,EAAE;AAChB,UAAI,mBAAmB;AAEvB,eAASC,cAAa;AACrB,YAAI,UAAU,CAAC;AAEf,iBAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAC1C,cAAI,MAAM,UAAU,CAAC;AACrB,cAAI,CAAC;AAAK;AAEV,cAAI,UAAU,OAAO;AAErB,cAAI,YAAY,YAAY,YAAY,UAAU;AACjD,oBAAQ,KAAK,GAAG;AAAA,UACjB,WAAW,MAAM,QAAQ,GAAG,GAAG;AAC9B,gBAAI,IAAI,QAAQ;AACf,kBAAI,QAAQA,YAAW,MAAM,MAAM,GAAG;AACtC,kBAAI,OAAO;AACV,wBAAQ,KAAK,KAAK;AAAA,cACnB;AAAA,YACD;AAAA,UACD,WAAW,YAAY,UAAU;AAChC,gBAAI,IAAI,aAAa,OAAO,UAAU,YAAY,CAAC,IAAI,SAAS,SAAS,EAAE,SAAS,eAAe,GAAG;AACrG,sBAAQ,KAAK,IAAI,SAAS,CAAC;AAC3B;AAAA,YACD;AAEA,qBAAS,OAAO,KAAK;AACpB,kBAAI,OAAO,KAAK,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG;AACtC,wBAAQ,KAAK,GAAG;AAAA,cACjB;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAEA,eAAO,QAAQ,KAAK,GAAG;AAAA,MACxB;AAEA,UAAI,OAAOD,YAAW,eAAeA,QAAO,SAAS;AACpD,QAAAC,YAAW,UAAUA;AACrB,QAAAD,QAAO,UAAUC;AAAA,MAClB,WAAW,OAAO,WAAW,cAAc,OAAO,OAAO,QAAQ,YAAY,OAAO,KAAK;AAExF,eAAO,cAAc,CAAC,GAAG,WAAY;AACpC,iBAAOA;AAAA,QACR,CAAC;AAAA,MACF,OAAO;AACN,eAAO,aAAaA;AAAA,MACrB;AAAA,IACD,GAAE;AAAA;AAAA;;;AC3DF;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,wBAAuB;;;ACAqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,MAAK,eAAc,MAAK,gBAAe,MAAK,gBAAe,MAAK,eAAc;;;AD6BjN;AAvBJ,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA,OAAO;AACT,MAiBmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,eAAW,kBAAAC,SAAW,sBAAO,QAAQ,sBAAO,IAAI,CAAC;AAAA;AAAA,EACnD;AAEJ;AAEA,IAAO,iBAAQ;;;AErC+E,IAAO,yBAAQ,EAAC,WAAU,mBAAkB;;;ACMjI,IAAAC,sBAAA;AADM,SAAR,QAAyB,CAAC,GAA0B;AACzD,SAAO,6CAAC,QAAG,WAAW,uBAAO,SAAS;AACxC;AAEA,QAAQ,cAAc;","names":["module","classNames","classNames","import_jsx_runtime"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/classnames/index.js
|
|
28
|
+
var require_classnames = __commonJS({
|
|
29
|
+
"../../node_modules/classnames/index.js"(exports, module) {
|
|
30
|
+
(function() {
|
|
31
|
+
"use strict";
|
|
32
|
+
var hasOwn = {}.hasOwnProperty;
|
|
33
|
+
var nativeCodeString = "[native code]";
|
|
34
|
+
function classNames2() {
|
|
35
|
+
var classes = [];
|
|
36
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
37
|
+
var arg = arguments[i];
|
|
38
|
+
if (!arg)
|
|
39
|
+
continue;
|
|
40
|
+
var argType = typeof arg;
|
|
41
|
+
if (argType === "string" || argType === "number") {
|
|
42
|
+
classes.push(arg);
|
|
43
|
+
} else if (Array.isArray(arg)) {
|
|
44
|
+
if (arg.length) {
|
|
45
|
+
var inner = classNames2.apply(null, arg);
|
|
46
|
+
if (inner) {
|
|
47
|
+
classes.push(inner);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} else if (argType === "object") {
|
|
51
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
52
|
+
classes.push(arg.toString());
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
for (var key in arg) {
|
|
56
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
57
|
+
classes.push(key);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return classes.join(" ");
|
|
63
|
+
}
|
|
64
|
+
if (typeof module !== "undefined" && module.exports) {
|
|
65
|
+
classNames2.default = classNames2;
|
|
66
|
+
module.exports = classNames2;
|
|
67
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
68
|
+
define("classnames", [], function() {
|
|
69
|
+
return classNames2;
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
window.classNames = classNames2;
|
|
73
|
+
}
|
|
74
|
+
})();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// src/Avatar/Avatar.tsx
|
|
79
|
+
var import_classnames = __toESM(require_classnames());
|
|
80
|
+
|
|
81
|
+
// css-module:./Avatar.module.css#css-module
|
|
82
|
+
var Avatar_module_default = { "avatar": "_avatar_17elh_1", "sm": "_sm_17elh_8", "md": "_md_17elh_13", "lg": "_lg_17elh_18", "xl": "_xl_17elh_23" };
|
|
3
83
|
|
|
4
|
-
// src/
|
|
84
|
+
// src/Avatar/Avatar.tsx
|
|
5
85
|
import { jsx } from "react/jsx-runtime";
|
|
86
|
+
var Avatar = ({
|
|
87
|
+
src,
|
|
88
|
+
accessibilityLabel,
|
|
89
|
+
size = "md"
|
|
90
|
+
}) => {
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
"img",
|
|
93
|
+
{
|
|
94
|
+
alt: accessibilityLabel,
|
|
95
|
+
src,
|
|
96
|
+
className: (0, import_classnames.default)(Avatar_module_default.avatar, Avatar_module_default[size])
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
var Avatar_default = Avatar;
|
|
101
|
+
|
|
102
|
+
// css-module:./Divider.module.css#css-module
|
|
103
|
+
var Divider_module_default = { "divider": "_divider_15e5a_1" };
|
|
104
|
+
|
|
105
|
+
// src/Divider/Divider.tsx
|
|
106
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
6
107
|
function Divider({}) {
|
|
7
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ jsx2("hr", { className: Divider_module_default.divider });
|
|
8
109
|
}
|
|
9
110
|
Divider.displayName = "Divider";
|
|
10
111
|
export {
|
|
112
|
+
Avatar_default as Avatar,
|
|
11
113
|
Divider
|
|
12
114
|
};
|
|
115
|
+
/*! Bundled license information:
|
|
116
|
+
|
|
117
|
+
classnames/index.js:
|
|
118
|
+
(*!
|
|
119
|
+
Copyright (c) 2018 Jed Watson.
|
|
120
|
+
Licensed under the MIT License (MIT), see
|
|
121
|
+
http://jedwatson.github.io/classnames
|
|
122
|
+
*)
|
|
123
|
+
*/
|
|
13
124
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["css-module:./
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/classnames/index.js","../src/Avatar/Avatar.tsx","css-module:./Avatar.module.css#css-module","css-module:./Divider.module.css#css-module","../src/Divider/Divider.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import classNames from \"classnames\";\nimport styles from \"./Avatar.module.css\";\n\n/**\n * Avatar is a circular image that represents a user.\n */\nconst Avatar = ({\n src,\n accessibilityLabel,\n size = \"md\",\n}: {\n /**\n * The URL of the image to display as the avatar.\n */\n src: string;\n /**\n * The alt text to use for the image.\n * This should describe the image to people using screen readers.\n */\n accessibilityLabel: string;\n /**\n * The size of the avatar.\n * xs: 24px, sm: 32px, md: 48px, lg: 64px, xl: 120px.\n *\n * @defaultValue `md`\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n}): JSX.Element => {\n return (\n <img\n alt={accessibilityLabel}\n src={src}\n className={classNames(styles.avatar, styles[size])}\n />\n );\n};\n\nexport default Avatar;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Avatar/Avatar.module.css\"; export default {\"avatar\":\"_avatar_17elh_1\",\"sm\":\"_sm_17elh_8\",\"md\":\"_md_17elh_13\",\"lg\":\"_lg_17elh_18\",\"xl\":\"_xl_17elh_23\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Divider/Divider.module.css\"; export default {\"divider\":\"_divider_15e5a_1\"}","import styles from \"./Divider.module.css\";\n\n/**\n * Divider is a thin horizontal line to group content in lists and layouts.\n */\nexport default function Divider({}: Record<string, never>) {\n return <hr className={styles.divider} />;\n}\n\nDivider.displayName = \"Divider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,KAAC,WAAY;AACZ;AAEA,UAAI,SAAS,CAAC,EAAE;AAChB,UAAI,mBAAmB;AAEvB,eAASA,cAAa;AACrB,YAAI,UAAU,CAAC;AAEf,iBAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAC1C,cAAI,MAAM,UAAU,CAAC;AACrB,cAAI,CAAC;AAAK;AAEV,cAAI,UAAU,OAAO;AAErB,cAAI,YAAY,YAAY,YAAY,UAAU;AACjD,oBAAQ,KAAK,GAAG;AAAA,UACjB,WAAW,MAAM,QAAQ,GAAG,GAAG;AAC9B,gBAAI,IAAI,QAAQ;AACf,kBAAI,QAAQA,YAAW,MAAM,MAAM,GAAG;AACtC,kBAAI,OAAO;AACV,wBAAQ,KAAK,KAAK;AAAA,cACnB;AAAA,YACD;AAAA,UACD,WAAW,YAAY,UAAU;AAChC,gBAAI,IAAI,aAAa,OAAO,UAAU,YAAY,CAAC,IAAI,SAAS,SAAS,EAAE,SAAS,eAAe,GAAG;AACrG,sBAAQ,KAAK,IAAI,SAAS,CAAC;AAC3B;AAAA,YACD;AAEA,qBAAS,OAAO,KAAK;AACpB,kBAAI,OAAO,KAAK,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG;AACtC,wBAAQ,KAAK,GAAG;AAAA,cACjB;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAEA,eAAO,QAAQ,KAAK,GAAG;AAAA,MACxB;AAEA,UAAI,OAAO,WAAW,eAAe,OAAO,SAAS;AACpD,QAAAA,YAAW,UAAUA;AACrB,eAAO,UAAUA;AAAA,MAClB,WAAW,OAAO,WAAW,cAAc,OAAO,OAAO,QAAQ,YAAY,OAAO,KAAK;AAExF,eAAO,cAAc,CAAC,GAAG,WAAY;AACpC,iBAAOA;AAAA,QACR,CAAC;AAAA,MACF,OAAO;AACN,eAAO,aAAaA;AAAA,MACrB;AAAA,IACD,GAAE;AAAA;AAAA;;;AC3DF,wBAAuB;;;ACAqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,MAAK,eAAc,MAAK,gBAAe,MAAK,gBAAe,MAAK,eAAc;;;AD6BjN;AAvBJ,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA,OAAO;AACT,MAiBmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,eAAW,kBAAAC,SAAW,sBAAO,QAAQ,sBAAO,IAAI,CAAC;AAAA;AAAA,EACnD;AAEJ;AAEA,IAAO,iBAAQ;;;AErC+E,IAAO,yBAAQ,EAAC,WAAU,mBAAkB;;;ACMjI,gBAAAC,YAAA;AADM,SAAR,QAAyB,CAAC,GAA0B;AACzD,SAAO,gBAAAA,KAAC,QAAG,WAAW,uBAAO,SAAS;AACxC;AAEA,QAAQ,cAAc;","names":["classNames","classNames","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cambly/syntax-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"react": "^18.2.0",
|
|
20
20
|
"tsup": "^6.6.3",
|
|
21
21
|
"typescript": "^4.9.5",
|
|
22
|
-
"@cambly/eslint-config-syntax": "1.0
|
|
23
|
-
"@cambly/syntax-tsconfig": "1.0
|
|
22
|
+
"@cambly/eslint-config-syntax": "1.1.0",
|
|
23
|
+
"@cambly/syntax-tsconfig": "1.1.0"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
31
31
|
"dev": "tsup --watch",
|
|
32
32
|
"lint": "TIMING=1 eslint \"src/**/*.ts*\"",
|
|
33
|
+
"stylelint": "stylelint \"**/*.css\"",
|
|
34
|
+
"stylelint:fix": "npm run stylelint --fix",
|
|
33
35
|
"test": "vitest run",
|
|
34
36
|
"test:watch": "vitest"
|
|
35
37
|
}
|