freemium-ui 2.0.133 → 2.0.134

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.
Files changed (36) hide show
  1. package/.github/actionlint.yaml +6 -0
  2. package/.github/pr_validation_guide.md +305 -0
  3. package/.github/pull_request_template.md +189 -0
  4. package/.github/workflows/pr-quality.yml +114 -0
  5. package/.github/workflows/pr-template-validation.yml +367 -0
  6. package/.github/workflows/sonarqube-main.yml +106 -0
  7. package/.nvmrc +1 -0
  8. package/README.md +9 -0
  9. package/catalog-info.yaml +33 -0
  10. package/docs/adrs/index.md +11 -0
  11. package/docs/architecture/code-structure.md +109 -0
  12. package/docs/architecture/deep-dive.md +193 -0
  13. package/docs/getting-started.md +103 -0
  14. package/docs/index.md +35 -0
  15. package/docs/operations/alerts-configuration.md +11 -0
  16. package/docs/operations/how-to-debug.md +43 -0
  17. package/docs/operations/monitoring.md +16 -0
  18. package/docs/operations/recent-issues.md +14 -0
  19. package/docs/operations/sop.md +25 -0
  20. package/docs/operations/support.md +15 -0
  21. package/lib/README.md +9 -0
  22. package/lib/index.cjs.js +1041 -1021
  23. package/lib/index.d.ts +2 -0
  24. package/lib/index.js +315 -294
  25. package/lib/package.json +1 -1
  26. package/mkdocs.yml +38 -0
  27. package/package.json +3 -1
  28. package/sonar-project.properties +25 -0
  29. package/tech-docs/docs/architecture/components.md +49 -0
  30. package/tech-docs/docs/architecture/index.md +54 -0
  31. package/tech-docs/docs/development/build-publish.md +42 -0
  32. package/tech-docs/docs/development/storybook.md +37 -0
  33. package/tech-docs/docs/getting-started.md +67 -0
  34. package/tech-docs/docs/index.md +47 -0
  35. package/tech-docs/docs/repositories/index.md +22 -0
  36. package/tech-docs/mkdocs.yml +28 -0
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.133",
3
+ "version": "2.0.134",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/mkdocs.yml ADDED
@@ -0,0 +1,38 @@
1
+ site_name: 'Freemium UI'
2
+ site_description: 'Functionality and Architecture Documentation for Freemium UI'
3
+
4
+ nav:
5
+ - Home: index.md
6
+ - Getting Started: getting-started.md
7
+ - Architecture:
8
+ - Code Structure: architecture/code-structure.md
9
+ - Deep Dive: architecture/deep-dive.md
10
+ - Operations:
11
+ - Monitoring:
12
+ - Overview: operations/monitoring.md
13
+ - Alerts configuration: operations/alerts-configuration.md
14
+ - SOP: operations/sop.md
15
+ - Support:
16
+ - Overview: operations/support.md
17
+ - How to Debug: operations/how-to-debug.md
18
+ - Recent Issues: operations/recent-issues.md
19
+ - ADRs:
20
+ - Overview: adrs/index.md
21
+
22
+ plugins:
23
+ - techdocs-core
24
+ - mermaid2
25
+
26
+ markdown_extensions:
27
+ - admonition
28
+ - pymdownx.details
29
+ - pymdownx.superfences:
30
+ custom_fences:
31
+ - name: mermaid
32
+ class: mermaid
33
+ format: !!python/name:pymdownx.superfences.fence_code_format
34
+ - toc:
35
+ permalink: true
36
+
37
+ extra:
38
+ version: v1alpha1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.133",
3
+ "version": "2.0.134",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.js",
@@ -95,7 +95,9 @@
95
95
  "post:build": "node ./scripts/frankBuild.js",
96
96
  "rollup": "rm -rf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
97
97
  "test": "react-scripts test",
98
+ "test:coverage": "react-scripts test --watchAll=false --coverage --passWithNoTests",
98
99
  "eject": "react-scripts eject",
100
+ "lint:ci": "eslint . --quiet",
99
101
  "check": "prettier --check .",
100
102
  "format": "prettier --write .",
101
103
  "storybook": "storybook dev -p 6006",
@@ -0,0 +1,25 @@
1
+ # SonarQube analysis configuration — https://quality.freshworks.com
2
+ # Project created as part of the FSURVEY-8734 spike. Ask the SonarQube admin to
3
+ # shorten the GUID suffix once other repos' keys have already been cleaned up;
4
+ # update this line if they do.
5
+ sonar.projectKey=freshdesk_freemium-ui_e70667c0-5938-4123-aea0-50f8bb049286
6
+
7
+ sonar.sources=src
8
+ sonar.sourceEncoding=UTF-8
9
+
10
+ # Test files are declared as tests rather than excluded, so they are not counted
11
+ # as production code but still contribute coverage attribution.
12
+ sonar.tests=src
13
+ sonar.test.inclusions=**/*.test.ts,**/*.test.tsx
14
+
15
+ # Do NOT add **/*.ts or **/*.tsx here — that excludes the entire codebase and
16
+ # produces a silent "no lines of code" analysis.
17
+ # lib/ is this library's rollup build output, not source.
18
+ sonar.exclusions=**/node_modules/**,**/lib/**,**/coverage/**,**/*.css,**/*.scss,**/*.stories.tsx,**/.storybook/**,**/storybook-static/**
19
+ sonar.coverage.exclusions=**/*.test.ts,**/*.test.tsx,scripts/**,**/*.stories.tsx
20
+
21
+ sonar.javascript.lcov.reportPaths=coverage/lcov.info
22
+ sonar.typescript.file.suffixes=.ts,.tsx
23
+
24
+ # Styling is handled by prettier; skip CSS analysis to cut noise.
25
+ sonar.css.file.suffixes=-
@@ -0,0 +1,49 @@
1
+ # Component Catalog
2
+
3
+ Exported from `src/components/index.ts` (see Storybook for live examples).
4
+
5
+ ## Form & Input
6
+
7
+ | Component | Purpose |
8
+ | --------------------------------- | --------------------------------- |
9
+ | `Input` | Text input with validation states |
10
+ | `Checkbox`, `Radio`, `BoxedRadio` | Selection controls |
11
+ | `Toggle` | On/off switch |
12
+ | `Dropdown`, `MultiSelectDropdown` | Single/multi select |
13
+ | `AutoComplete` | Search with optional remote `url` |
14
+ | `Pickers.*` | Date, date range, date-time, time |
15
+
16
+ ## Actions & Navigation
17
+
18
+ | Component | Purpose |
19
+ | --------------------------- | ------------------- |
20
+ | `Button`, `ButtonDropdown` | Primary actions |
21
+ | `Menu`, `Tabs`, `Accordion` | Navigation patterns |
22
+
23
+ ## Feedback & Overlay
24
+
25
+ | Component | Purpose |
26
+ | --------------------------------- | --------------- |
27
+ | `Alert`, `Toast` | Notifications |
28
+ | `Modal`, `Drawer`, `Confirmation` | Dialogs |
29
+ | `Popover`, `Tooltip` | Contextual help |
30
+ | `Loader` | Loading states |
31
+
32
+ ## Data Display
33
+
34
+ | Component | Purpose |
35
+ | -------------------------- | ------------- |
36
+ | `Table`, `WorkspaceTable` | Data grids |
37
+ | `Typography` | Text styles |
38
+ | `Tag`, `Icons`, `Calendar` | Supporting UI |
39
+
40
+ ## Layout
41
+
42
+ | Component | Purpose |
43
+ | --------------- | ------------------------------ |
44
+ | `ThemeProvider` | Theme context |
45
+ | `Reorder` | Drag-and-drop lists (@dnd-kit) |
46
+
47
+ ## Internal (not in barrel)
48
+
49
+ `QuillEditor` exists under `components/` but is not re-exported from `src/index.ts`.
@@ -0,0 +1,54 @@
1
+ # Architecture Overview
2
+
3
+ Single-package npm library — no Module Federation, no runtime server.
4
+
5
+ ## Source Layout
6
+
7
+ ```text
8
+ src/
9
+ ├── components/ # ~31 UI components (Button, Table, Modal, …)
10
+ ├── themes/ # light, dark, DewTheme, palette tokens
11
+ ├── styles/ # globalStyles, shared styled primitives
12
+ ├── types/ # FreshworksPalette, context types
13
+ ├── utils/ # request helper, portal, SSR helpers
14
+ ├── hooks/ # usePortalContainer, Shadow DOM scroll fix
15
+ ├── stories/ # Storybook stories + MDX (Colors, Typography)
16
+ └── index.ts # Public exports
17
+ ```
18
+
19
+ ## Build Pipeline
20
+
21
+ ```text
22
+ src/index.ts
23
+ → Rollup (typescript plugin, peer-deps external)
24
+ → lib/index.js (ESM), lib/index.cjs.js (CJS), lib/index.d.ts
25
+ → scripts/frankBuild.js (package.json for lib/, README copy)
26
+ ```
27
+
28
+ Only `react` and `react-dom` are external; Radix, styled-components, axios, etc. are bundled.
29
+
30
+ ## Theming
31
+
32
+ - **ThemeProvider** wraps styled-components theme context
33
+ - Supports **classic** and **dew** design variants
34
+ - `@freshworks/dew-styles` for Dew 2.0 fonts/CSS
35
+ - **StyleSheetManager** exported for shadow DOM / iframe embedding
36
+
37
+ ## Design Stack
38
+
39
+ | Layer | Technology |
40
+ | ---------- | ------------------------------------------------------- |
41
+ | Primitives | Radix UI (accordion, dialog, select, toast, …) |
42
+ | Styling | styled-components 6 |
43
+ | Tables | @tanstack/react-table |
44
+ | DnD | @dnd-kit (Reorder component) |
45
+ | Rich text | react-quill (QuillEditor — not in public barrel export) |
46
+ | Dates | @blueprintjs/datetime2, moment |
47
+
48
+ ## Boundaries
49
+
50
+ | In scope | Out of scope |
51
+ | --------------------------------- | ------------------------- |
52
+ | Admin UI widgets | Survey question rendering |
53
+ | Optional axios `request()` helper | SurveyServ JWT / claims |
54
+ | Storybook design docs | Public respondent pages |
@@ -0,0 +1,42 @@
1
+ # Build & Publish
2
+
3
+ ## Build Library
4
+
5
+ ```bash
6
+ npm run build
7
+ # rollup → lib/ + frankBuild post-step
8
+ ```
9
+
10
+ Outputs:
11
+
12
+ | File | Format |
13
+ | ------------------ | ----------------------- |
14
+ | `lib/index.js` | ESM (`module` field) |
15
+ | `lib/index.cjs.js` | CommonJS (`main` field) |
16
+ | `lib/index.d.ts` | TypeScript declarations |
17
+
18
+ ## Pre-publish
19
+
20
+ `prepublishOnly` runs `npm run build` automatically.
21
+
22
+ ## Beta Releases
23
+
24
+ ```bash
25
+ npm run version:beta
26
+ npm run publish:beta
27
+ ```
28
+
29
+ ## Quality Scripts
30
+
31
+ | Script | Purpose |
32
+ | -------------------------- | ---------------------- |
33
+ | `npm run lint` / `lint:ci` | ESLint |
34
+ | `npm run check` / `format` | Prettier |
35
+ | `npm run typescript` | `tsc` typecheck |
36
+ | `npm test` | Jest via react-scripts |
37
+
38
+ ## Registry
39
+
40
+ Published to **npm** (`registry.npmjs.org`) as `freemium-ui`.
41
+
42
+ Consumers pin major/minor versions in host app `package.json` — coordinate upgrades with `survey-admin-microfrontend` and `freshsurvey-web-admin-app`.
@@ -0,0 +1,37 @@
1
+ # Storybook
2
+
3
+ Component documentation and visual testing UI.
4
+
5
+ ## Run
6
+
7
+ ```bash
8
+ npm run storybook
9
+ # http://localhost:6006
10
+ ```
11
+
12
+ ## Configuration
13
+
14
+ | File | Role |
15
+ | ------------------------ | --------------------------------------- |
16
+ | `.storybook/main.ts` | Webpack 5 + CRA preset, story globs |
17
+ | `.storybook/preview.tsx` | Global ThemeProvider decorator, toolbar |
18
+
19
+ ## Story Locations
20
+
21
+ - `src/**/*.stories.@(js|jsx|mjs|ts|tsx)` — per-component stories
22
+ - `src/**/*.mdx` — Colors, Palette, Typography docs
23
+
24
+ ## Toolbar Controls
25
+
26
+ - Theme variant: classic / dew
27
+ - Color mode: light / dark
28
+ - Direction: LTR / RTL
29
+ - Locale selector
30
+
31
+ ## Build Static Site
32
+
33
+ ```bash
34
+ npm run build-storybook
35
+ ```
36
+
37
+ Output suitable for hosting as design-system reference (not deployed by this repo by default).
@@ -0,0 +1,67 @@
1
+ # Getting Started
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ npm install freemium-ui@2.0.133
7
+ ```
8
+
9
+ Runtime requirements: the host app must provide `react@^17` and
10
+ `react-dom@^17` — Rollup marks both as external, so they resolve from the host.
11
+ `styled-components@^6` is bundled. All three are declared as regular
12
+ `dependencies` in `package.json`, not `peerDependencies`.
13
+
14
+ ## Wrap App with Theme
15
+
16
+ ```tsx
17
+ import { FreemiumUIGlobalStyles, ThemeProvider, Themes } from 'freemium-ui';
18
+
19
+ function App() {
20
+ return (
21
+ <ThemeProvider theme={Themes.light}>
22
+ <FreemiumUIGlobalStyles />
23
+ {/* your routes */}
24
+ </ThemeProvider>
25
+ );
26
+ }
27
+ ```
28
+
29
+ Theme toolbar options in Storybook: **classic/dew**, **light/dark**, **LTR/RTL**.
30
+
31
+ ## Use a Component
32
+
33
+ ```tsx
34
+ import { Button, Input, Modal } from 'freemium-ui';
35
+
36
+ <Button variant="primary" onClick={handleSave}>
37
+ Save
38
+ </Button>;
39
+ ```
40
+
41
+ ## Local Development
42
+
43
+ ```bash
44
+ git clone git@github.com:freshdesk/freemium-ui.git
45
+ cd freemium-ui
46
+ npm install
47
+ npm run storybook # http://localhost:6006
48
+ npm run build # outputs lib/
49
+ ```
50
+
51
+ ## Build CRA Demo (optional)
52
+
53
+ ```bash
54
+ npm start # react-scripts dev app
55
+ npm run build-react-app
56
+ ```
57
+
58
+ ## Consumers
59
+
60
+ | App | npm range | Usage |
61
+ | ---------------------------- | ---------- | ------------------------------------------ |
62
+ | `freshsurvey-web-admin-app` | `^1.0.335` | Admin shell, settings, tables |
63
+ | `survey-admin-microfrontend` | `^1.0.219` | Builder chrome alongside survey components |
64
+
65
+ ## No SurveyServ API
66
+
67
+ `freemium-ui` has no baked-in SurveyServ endpoints. `AutoComplete` accepts an optional `url` prop — the **host app** supplies the API URL.
@@ -0,0 +1,47 @@
1
+ # Freemium UI — Technical Documentation
2
+
3
+ **Freemium UI** is a shared **React 17 + TypeScript** component library for SurveyServ and Freemium admin experiences. It provides form controls, tables, modals, pickers, and theming — published to npm as `freemium-ui`.
4
+
5
+ | Attribute | Value |
6
+ | --------- | ----------------------------------------------------------------- |
7
+ | GitHub | [freshdesk/freemium-ui](https://github.com/freshdesk/freemium-ui) |
8
+ | npm | `freemium-ui@2.0.133` |
9
+ | Build | Rollup → `lib/index.js` (ESM), `lib/index.cjs.js` (CJS) |
10
+ | Styling | styled-components 6 + Radix UI primitives |
11
+ | Storybook | Port 6006 — component catalog and theme playground |
12
+
13
+ ## Role in SurveyServ
14
+
15
+ ```text
16
+ freemium-ui (this repo)
17
+ ↑ consumed by
18
+ survey-admin-microfrontend, freshsurvey-web-admin-app
19
+ ↑ admin chrome only — NOT survey question rendering
20
+ freemium-survey-components (sibling npm package)
21
+ ```
22
+
23
+ This library does **not** render survey questions or call SurveyServ APIs. Survey collection UI lives in **freemium-survey-components**.
24
+
25
+ ## Key Exports
26
+
27
+ - `ThemeProvider`, `FreemiumUIGlobalStyles`, `Themes`
28
+ - Form: `Input`, `Checkbox`, `Radio`, `Dropdown`, `AutoComplete`, `Toggle`
29
+ - Actions: `Button`, `ButtonDropdown`, `Menu`, `Tabs`
30
+ - Overlay: `Modal`, `Drawer`, `Toast`, `Popover`, `Tooltip`
31
+ - Data: `Table`, `WorkspaceTable`, `Typography`, `Calendar`, date/time pickers
32
+
33
+ ## Documentation Map
34
+
35
+ | Section | Contents |
36
+ | ----------------------------------------------- | ----------------------------------------- |
37
+ | [Getting Started](getting-started.md) | Install, ThemeProvider, first component |
38
+ | [Architecture](architecture/index.md) | Package layout, themes, styled-components |
39
+ | [Components](architecture/components.md) | Component categories |
40
+ | [Storybook](development/storybook.md) | Local docs UI |
41
+ | [Build & Publish](development/build-publish.md) | Rollup, npm release |
42
+
43
+ ## Ownership
44
+
45
+ - **Team:** `platforms/plat-maise-surveyserv`
46
+ - **System:** `platforms/surveyserv`
47
+ - **Backstage:** `component:platforms/freemium-ui`
@@ -0,0 +1,22 @@
1
+ # Repository Context
2
+
3
+ ## This Repo
4
+
5
+ | Attribute | Value |
6
+ | --------- | ----------------------------------------------------------------- |
7
+ | GitHub | [freshdesk/freemium-ui](https://github.com/freshdesk/freemium-ui) |
8
+ | Type | npm UI library |
9
+ | System | `platforms/surveyserv` |
10
+
11
+ ## Related Frontend Repos
12
+
13
+ | Repo | Relationship |
14
+ | ------------------------------------------------------------------------------------- | --------------------------------------------------------- |
15
+ | [freemium-survey-components](https://github.com/freshdesk/freemium-survey-components) | Survey **rendering** (sibling, no npm dep on freemium-ui) |
16
+ | [survey-admin-microfrontend](https://github.com/freshdesk/survey-admin-microfrontend) | **Consumer** — admin MFE |
17
+ | [freshsurvey-web-admin-app](https://github.com/freshdesk/freshsurvey-web-admin-app) | **Consumer** — standalone admin |
18
+ | [surveyserv](https://github.com/freshdesk/surveyserv) | Backend APIs (not called from this library) |
19
+
20
+ ## Ownership
21
+
22
+ Team: `platforms/plat-maise-surveyserv`
@@ -0,0 +1,28 @@
1
+ site_name: 'Freemium UI'
2
+ site_description: 'Shared React UI component library for SurveyServ and Freemium admin frontends'
3
+
4
+ nav:
5
+ - Home: index.md
6
+ - Getting Started: getting-started.md
7
+ - Repositories: repositories/index.md
8
+ - Architecture:
9
+ - Overview: architecture/index.md
10
+ - Components: architecture/components.md
11
+ - Development:
12
+ - Storybook: development/storybook.md
13
+ - Build & Publish: development/build-publish.md
14
+
15
+ plugins:
16
+ - techdocs-core
17
+
18
+ markdown_extensions:
19
+ - admonition
20
+ - toc:
21
+ permalink: true
22
+ - tables
23
+ - fenced_code
24
+
25
+ extra:
26
+ version: 2.0.133
27
+ team: platforms/plat-maise-surveyserv
28
+ system: platforms/surveyserv