@aragon/gov-ui-kit 1.21.0 → 1.23.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/README.md +31 -1
- package/build.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/types/.storybook/theme.d.ts +1 -1
- package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/model/index.d.ts +1 -0
- package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/state/index.d.ts +1 -0
- package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/transform/index.d.ts +1 -0
- package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/view/index.d.ts +1 -0
- package/dist/types/src/core/components/cards/cardCollapsible/cardCollapsible.d.ts +7 -1
- package/dist/types/src/core/components/collapsible/collapsibleUtils.d.ts +47 -0
- package/dist/types/src/core/utils/index.d.ts +1 -0
- package/dist/types/src/core/utils/urlUtils/index.d.ts +1 -0
- package/dist/types/src/core/utils/urlUtils/urlUtils.d.ts +12 -0
- package/package.json +28 -23
- package/CHANGELOG.md +0 -1401
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("storybook/theming").ThemeVars;
|
|
1
|
+
declare const _default: import("storybook/internal/theming").ThemeVars;
|
|
2
2
|
export default _default;
|
package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/model/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-model';
|
package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/state/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-state';
|
package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/transform/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-transform';
|
package/dist/types/node_modules/.pnpm/@tiptap+pm@3.7.2/node_modules/@tiptap/pm/view/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-view';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { type ICollapsibleProps } from '../../collapsible';
|
|
2
|
-
export interface ICardCollapsibleProps extends Omit<ICollapsibleProps, 'buttonVariant' | 'className'> {
|
|
2
|
+
export interface ICardCollapsibleProps extends Omit<ICollapsibleProps, 'buttonVariant' | 'className' | 'showOverlay' | 'collapsedLines'> {
|
|
3
3
|
/**
|
|
4
4
|
* Additional class names to apply to the card.
|
|
5
5
|
*/
|
|
6
6
|
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The collapsed height in pixels. CardCollapsible always uses overlay mode (showOverlay=true),
|
|
9
|
+
* which requires pixel-based height measurement instead of line-based counting.
|
|
10
|
+
* @default 180
|
|
11
|
+
*/
|
|
12
|
+
collapsedPixels?: number;
|
|
7
13
|
}
|
|
8
14
|
export declare const CardCollapsible: React.FC<ICardCollapsibleProps>;
|
|
@@ -46,3 +46,50 @@ export interface OverlayHeightParams {
|
|
|
46
46
|
fallbackLineHeight?: number;
|
|
47
47
|
}
|
|
48
48
|
export declare const computeOverlayHeightPx: (params: OverlayHeightParams) => number;
|
|
49
|
+
/**
|
|
50
|
+
* Result of element height measurements for collapsible calculations.
|
|
51
|
+
*/
|
|
52
|
+
export interface MeasureHeightsResult {
|
|
53
|
+
/**
|
|
54
|
+
* The current rendered height of the element in the DOM (with clamp/max-height applied).
|
|
55
|
+
*/
|
|
56
|
+
clampedClientHeight: number;
|
|
57
|
+
/**
|
|
58
|
+
* The full content height with no clamping and no max-height applied.
|
|
59
|
+
*/
|
|
60
|
+
fullHeight: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Measures the current (clamped) clientHeight and the full content height by
|
|
64
|
+
* creating a hidden clone without clamping and without max-height.
|
|
65
|
+
*
|
|
66
|
+
* This allows overflow detection and overlay sizing for mixed-content
|
|
67
|
+
* rich text (e.g. combinations of h1, ul/li, p, code) where a single
|
|
68
|
+
* line-height is not representative.
|
|
69
|
+
*/
|
|
70
|
+
export declare const measureElementHeights: (element: HTMLElement | null) => MeasureHeightsResult;
|
|
71
|
+
export interface OverlayRatioParams {
|
|
72
|
+
/** Number of lines visible when collapsed (requested). */
|
|
73
|
+
collapsedLines: number;
|
|
74
|
+
/** Number of lines used for overlay sizing (requested). */
|
|
75
|
+
overlayLines: number;
|
|
76
|
+
/** Actual rendered height of the collapsed block (in pixels). */
|
|
77
|
+
clampedClientHeight: number;
|
|
78
|
+
/** Minimum visible pixels of content above overlay to avoid full cover. */
|
|
79
|
+
minVisiblePx?: number;
|
|
80
|
+
/** Minimum overlay thickness in pixels (after clamping). */
|
|
81
|
+
minOverlayPx?: number;
|
|
82
|
+
/** Maximum overlay thickness in pixels (after clamping). */
|
|
83
|
+
maxOverlayPx?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Computes overlay height as a ratio of the actual visible collapsed height
|
|
87
|
+
* instead of relying on a single line-height. This makes the overlay robust
|
|
88
|
+
* for mixed content where each line may have different heights.
|
|
89
|
+
*
|
|
90
|
+
* Constraints:
|
|
91
|
+
* - overlayLines is clamped to [0, collapsedLines - 1]
|
|
92
|
+
* - overlay cannot cover all visible content; we keep at least `minVisiblePx`
|
|
93
|
+
* - final result is clamped within [minOverlayPx, maxOverlayPx]
|
|
94
|
+
*/
|
|
95
|
+
export declare const computeOverlayHeightByRatio: (params: OverlayRatioParams) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './urlUtils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare class UrlUtils {
|
|
2
|
+
private hasProtocol;
|
|
3
|
+
private isLikelyHost;
|
|
4
|
+
/**
|
|
5
|
+
* Normalizes external URLs by adding appropriate protocols.
|
|
6
|
+
* @param value - The URL string to normalize
|
|
7
|
+
* @returns Normalized URL string or undefined if input is invalid
|
|
8
|
+
*/
|
|
9
|
+
normalizeExternalHref: (value: string | null | undefined) => string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare const urlUtils: UrlUtils;
|
|
12
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aragon/gov-ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "Implementation of the Aragon's Governance UI Kit",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -12,21 +12,6 @@
|
|
|
12
12
|
"src/**/*.css",
|
|
13
13
|
"src/theme/fonts/*"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"setup": "husky",
|
|
17
|
-
"storybook": "storybook dev -p 6006",
|
|
18
|
-
"build": "rollup -c",
|
|
19
|
-
"build:watch": "rollup -c --watch",
|
|
20
|
-
"build:analyze": "cross-env ANALYZE=true rollup -c",
|
|
21
|
-
"build:storybook": "storybook build",
|
|
22
|
-
"test": "jest --watch",
|
|
23
|
-
"test:coverage": "jest --coverage",
|
|
24
|
-
"lint": "eslint . --max-warnings=0",
|
|
25
|
-
"lint:fix": "eslint . --fix",
|
|
26
|
-
"prettify": "prettier . --check",
|
|
27
|
-
"prettify:fix": "prettier . --write",
|
|
28
|
-
"type-check": "tsc --noemit"
|
|
29
|
-
},
|
|
30
15
|
"repository": {
|
|
31
16
|
"type": "git",
|
|
32
17
|
"url": "git+https://github.com/aragon/gov-ui-kit.git"
|
|
@@ -63,6 +48,7 @@
|
|
|
63
48
|
"blockies-ts": "^1.0.0",
|
|
64
49
|
"classnames": "^2.5.0",
|
|
65
50
|
"framer-motion": "^12.23.0",
|
|
51
|
+
"imask": "7.6.1",
|
|
66
52
|
"luxon": "^3.7.0",
|
|
67
53
|
"react-dropzone": "^14.3.0",
|
|
68
54
|
"react-imask": "^7.6.0",
|
|
@@ -104,8 +90,9 @@
|
|
|
104
90
|
"@testing-library/user-event": "^14.6.1",
|
|
105
91
|
"@types/jest": "^30.0.0",
|
|
106
92
|
"@types/luxon": "^3.7.1",
|
|
107
|
-
"@types/
|
|
108
|
-
"@types/react
|
|
93
|
+
"@types/node": "^22.12.0",
|
|
94
|
+
"@types/react": "^18",
|
|
95
|
+
"@types/react-dom": "^18",
|
|
109
96
|
"@types/sanitize-html": "^2.16.0",
|
|
110
97
|
"cross-env": "^10.0.0",
|
|
111
98
|
"eslint": "^9.36.0",
|
|
@@ -125,8 +112,8 @@
|
|
|
125
112
|
"prettier": "^3.6.2",
|
|
126
113
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
127
114
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
128
|
-
"react": "^
|
|
129
|
-
"react-dom": "^
|
|
115
|
+
"react": "^18.2.0",
|
|
116
|
+
"react-dom": "^18.2.0",
|
|
130
117
|
"react-hook-form": "^7.63.0",
|
|
131
118
|
"rollup": "^4.52.1",
|
|
132
119
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
@@ -135,6 +122,7 @@
|
|
|
135
122
|
"storybook": "^9.1.7",
|
|
136
123
|
"tailwindcss": "^4.1.13",
|
|
137
124
|
"ts-jest": "^29.4.4",
|
|
125
|
+
"tslib": "2.8.1",
|
|
138
126
|
"typescript": "^5.9.2",
|
|
139
127
|
"typescript-eslint": "^8.44.1",
|
|
140
128
|
"vercel": "^48.1.1",
|
|
@@ -143,14 +131,16 @@
|
|
|
143
131
|
"vite-plugin-node-polyfills": "^0.24.0",
|
|
144
132
|
"vite-plugin-static-copy": "^3.1.2",
|
|
145
133
|
"vite-plugin-svgr": "^4.5.0",
|
|
146
|
-
"wagmi": "^2.17.2"
|
|
134
|
+
"wagmi": "^2.17.2",
|
|
135
|
+
"zod": "^3.23.8"
|
|
147
136
|
},
|
|
148
137
|
"bugs": {
|
|
149
138
|
"url": "https://github.com/aragon/gov-ui-kit/issues"
|
|
150
139
|
},
|
|
151
140
|
"homepage": "https://github.com/aragon/gov-ui-kit#readme",
|
|
152
141
|
"engines": {
|
|
153
|
-
"node": ">=22.0.0"
|
|
142
|
+
"node": ">=22.0.0",
|
|
143
|
+
"pnpm": ">=10.0.0"
|
|
154
144
|
},
|
|
155
145
|
"exports": {
|
|
156
146
|
".": {
|
|
@@ -160,5 +150,20 @@
|
|
|
160
150
|
"./index.css": "./index.css",
|
|
161
151
|
"./build.css": "./build.css"
|
|
162
152
|
},
|
|
163
|
-
"
|
|
153
|
+
"scripts": {
|
|
154
|
+
"setup": "husky",
|
|
155
|
+
"storybook": "storybook dev -p 6006",
|
|
156
|
+
"build": "rollup -c",
|
|
157
|
+
"build:watch": "rollup -c --watch",
|
|
158
|
+
"build:analyze": "cross-env ANALYZE=true rollup -c",
|
|
159
|
+
"build:storybook": "storybook build",
|
|
160
|
+
"test": "jest",
|
|
161
|
+
"test:watch": "jest --watch",
|
|
162
|
+
"test:coverage": "jest --coverage",
|
|
163
|
+
"lint": "eslint . --max-warnings=0",
|
|
164
|
+
"lint:fix": "eslint . --fix",
|
|
165
|
+
"prettify": "prettier . --check",
|
|
166
|
+
"prettify:fix": "prettier . --write",
|
|
167
|
+
"type-check": "tsc --noemit"
|
|
168
|
+
}
|
|
164
169
|
}
|