@papernote/ui 1.10.2 → 1.10.3
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/components/Badge.d.ts +5 -1
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.esm.js +40 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Badge.tsx +12 -4
|
@@ -10,6 +10,10 @@ export interface BadgeProps {
|
|
|
10
10
|
dot?: boolean;
|
|
11
11
|
/** Use pill shape (more rounded, compact padding) for inline use */
|
|
12
12
|
pill?: boolean;
|
|
13
|
+
/** Truncate text with ellipsis if it overflows (requires maxWidth) */
|
|
14
|
+
truncate?: boolean;
|
|
15
|
+
/** Maximum width for the badge (useful with truncate), e.g. '150px' or '10rem' */
|
|
16
|
+
maxWidth?: string;
|
|
13
17
|
}
|
|
14
|
-
export default function Badge({ children, variant, size, icon, onRemove, className, dot, pill, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default function Badge({ children, variant, size, icon, onRemove, className, dot, pill, truncate, maxWidth, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
15
19
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,QAAQ,EACR,OAAmB,EACnB,IAAW,EACX,IAAI,EACJ,QAAQ,EACR,SAAc,EACd,GAAW,EACX,IAAY,EACZ,QAAgB,EAChB,QAAQ,GACT,EAAE,UAAU,2CAmFZ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3251,8 +3251,12 @@ interface BadgeProps {
|
|
|
3251
3251
|
dot?: boolean;
|
|
3252
3252
|
/** Use pill shape (more rounded, compact padding) for inline use */
|
|
3253
3253
|
pill?: boolean;
|
|
3254
|
+
/** Truncate text with ellipsis if it overflows (requires maxWidth) */
|
|
3255
|
+
truncate?: boolean;
|
|
3256
|
+
/** Maximum width for the badge (useful with truncate), e.g. '150px' or '10rem' */
|
|
3257
|
+
maxWidth?: string;
|
|
3254
3258
|
}
|
|
3255
|
-
declare function Badge({ children, variant, size, icon, onRemove, className, dot, pill, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
3259
|
+
declare function Badge({ children, variant, size, icon, onRemove, className, dot, pill, truncate, maxWidth, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
3256
3260
|
|
|
3257
3261
|
interface AvatarProps {
|
|
3258
3262
|
/** User's first name (for initials) */
|
package/dist/index.esm.js
CHANGED
|
@@ -8172,7 +8172,7 @@ function Breadcrumbs({ items, showHome = true }) {
|
|
|
8172
8172
|
})] }));
|
|
8173
8173
|
}
|
|
8174
8174
|
|
|
8175
|
-
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, }) {
|
|
8175
|
+
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, truncate = false, maxWidth, }) {
|
|
8176
8176
|
const variantStyles = {
|
|
8177
8177
|
success: 'bg-success-50 text-success-700 border-success-200',
|
|
8178
8178
|
warning: 'bg-warning-50 text-warning-700 border-warning-200',
|
|
@@ -8219,12 +8219,13 @@ function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, cla
|
|
|
8219
8219
|
}
|
|
8220
8220
|
// Regular badge
|
|
8221
8221
|
return (jsxs("span", { className: `
|
|
8222
|
-
inline-flex items-center border font-medium
|
|
8222
|
+
inline-flex items-center border font-medium whitespace-nowrap
|
|
8223
8223
|
${pill ? 'rounded-full' : 'rounded-full'}
|
|
8224
8224
|
${variantStyles[variant]}
|
|
8225
8225
|
${pill ? pillSizeStyles[size] : sizeStyles[size]}
|
|
8226
|
+
${truncate ? 'max-w-full overflow-hidden' : ''}
|
|
8226
8227
|
${className}
|
|
8227
|
-
`, children: [icon && jsx("span", { className: iconSize[size]
|
|
8228
|
+
`, style: maxWidth ? { maxWidth } : undefined, children: [icon && jsx("span", { className: `${iconSize[size]} flex-shrink-0`, children: icon }), jsx("span", { className: truncate ? 'truncate' : '', children: children }), onRemove && (jsx("button", { onClick: onRemove, className: "ml-1 hover:opacity-70 transition-opacity flex-shrink-0", "aria-label": "Remove badge", children: jsx(X, { className: iconSize[size] }) }))] }));
|
|
8228
8229
|
}
|
|
8229
8230
|
|
|
8230
8231
|
const TabsContext = createContext$1(null);
|
|
@@ -11597,52 +11598,44 @@ function getAugmentedNamespace(n) {
|
|
|
11597
11598
|
* (A1, A1:C5, ...)
|
|
11598
11599
|
*/
|
|
11599
11600
|
|
|
11600
|
-
|
|
11601
|
-
var hasRequiredCollection;
|
|
11602
|
-
|
|
11603
|
-
function requireCollection () {
|
|
11604
|
-
if (hasRequiredCollection) return collection;
|
|
11605
|
-
hasRequiredCollection = 1;
|
|
11606
|
-
class Collection {
|
|
11601
|
+
let Collection$3 = class Collection {
|
|
11607
11602
|
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11603
|
+
constructor(data, refs) {
|
|
11604
|
+
if (data == null && refs == null) {
|
|
11605
|
+
this._data = [];
|
|
11606
|
+
this._refs = [];
|
|
11607
|
+
} else {
|
|
11608
|
+
if (data.length !== refs.length)
|
|
11609
|
+
throw Error('Collection: data length should match references length.');
|
|
11610
|
+
this._data = data;
|
|
11611
|
+
this._refs = refs;
|
|
11612
|
+
}
|
|
11613
|
+
}
|
|
11619
11614
|
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11615
|
+
get data() {
|
|
11616
|
+
return this._data;
|
|
11617
|
+
}
|
|
11623
11618
|
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11619
|
+
get refs() {
|
|
11620
|
+
return this._refs;
|
|
11621
|
+
}
|
|
11627
11622
|
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11623
|
+
get length() {
|
|
11624
|
+
return this._data.length;
|
|
11625
|
+
}
|
|
11631
11626
|
|
|
11632
|
-
|
|
11633
|
-
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11627
|
+
/**
|
|
11628
|
+
* Add data and references to this collection.
|
|
11629
|
+
* @param {{}} obj - data
|
|
11630
|
+
* @param {{}} ref - reference
|
|
11631
|
+
*/
|
|
11632
|
+
add(obj, ref) {
|
|
11633
|
+
this._data.push(obj);
|
|
11634
|
+
this._refs.push(ref);
|
|
11635
|
+
}
|
|
11636
|
+
};
|
|
11642
11637
|
|
|
11643
|
-
|
|
11644
|
-
return collection;
|
|
11645
|
-
}
|
|
11638
|
+
var collection = Collection$3;
|
|
11646
11639
|
|
|
11647
11640
|
var helpers;
|
|
11648
11641
|
var hasRequiredHelpers;
|
|
@@ -11651,7 +11644,7 @@ function requireHelpers () {
|
|
|
11651
11644
|
if (hasRequiredHelpers) return helpers;
|
|
11652
11645
|
hasRequiredHelpers = 1;
|
|
11653
11646
|
const FormulaError = requireError();
|
|
11654
|
-
const Collection =
|
|
11647
|
+
const Collection = collection;
|
|
11655
11648
|
|
|
11656
11649
|
const Types = {
|
|
11657
11650
|
NUMBER: 0,
|
|
@@ -21305,7 +21298,7 @@ var engineering = EngineeringFunctions;
|
|
|
21305
21298
|
|
|
21306
21299
|
const FormulaError$b = requireError();
|
|
21307
21300
|
const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
|
|
21308
|
-
const Collection$2 =
|
|
21301
|
+
const Collection$2 = collection;
|
|
21309
21302
|
const H$5 = FormulaHelpers$8;
|
|
21310
21303
|
|
|
21311
21304
|
const ReferenceFunctions$1 = {
|
|
@@ -32933,7 +32926,7 @@ var parsing = {
|
|
|
32933
32926
|
const FormulaError$4 = requireError();
|
|
32934
32927
|
const {Address: Address$1} = requireHelpers();
|
|
32935
32928
|
const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
|
|
32936
|
-
const Collection$1 =
|
|
32929
|
+
const Collection$1 = collection;
|
|
32937
32930
|
const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
|
|
32938
32931
|
const {NotAllInputParsedException} = require$$4;
|
|
32939
32932
|
|
|
@@ -33695,7 +33688,7 @@ var hooks$1 = {
|
|
|
33695
33688
|
const FormulaError$2 = requireError();
|
|
33696
33689
|
const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
|
|
33697
33690
|
const {Prefix, Postfix, Infix, Operators} = operators;
|
|
33698
|
-
const Collection =
|
|
33691
|
+
const Collection = collection;
|
|
33699
33692
|
const MAX_ROW = 1048576, MAX_COLUMN = 16384;
|
|
33700
33693
|
|
|
33701
33694
|
let Utils$1 = class Utils {
|