@openproject/primer-view-components 0.80.2 → 0.81.0-rc.0426a0ac2
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 +20 -1
- package/app/assets/javascripts/components/primer/primer.d.ts +1 -0
- package/app/assets/javascripts/lib/primer/forms/character_counter.d.ts +41 -0
- package/app/assets/javascripts/lib/primer/forms/primer_text_area.d.ts +13 -0
- package/app/assets/javascripts/lib/primer/forms/primer_text_field.d.ts +2 -0
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +1 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/select_panel_element.js +1 -1
- package/app/components/primer/alpha/tab_nav.css +1 -1
- package/app/components/primer/alpha/tab_nav.css.json +1 -0
- package/app/components/primer/alpha/tool_tip.js +12 -5
- package/app/components/primer/primer.d.ts +1 -0
- package/app/components/primer/primer.js +1 -0
- package/app/lib/primer/forms/character_counter.d.ts +41 -0
- package/app/lib/primer/forms/character_counter.js +114 -0
- package/app/lib/primer/forms/primer_text_area.d.ts +13 -0
- package/app/lib/primer/forms/primer_text_area.js +53 -0
- package/app/lib/primer/forms/primer_text_field.d.ts +2 -0
- package/app/lib/primer/forms/primer_text_field.js +16 -2
- package/package.json +6 -6
- package/static/arguments.json +13 -1
- package/static/form_previews.json +10 -0
- package/static/info_arch.json +106 -15
- package/static/previews.json +93 -14
package/README.md
CHANGED
|
@@ -2,7 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">Fork of ViewComponents for the Primer Design System used for OpenProject.</p>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> As part of GitHub’s move to React-based interfaces, Primer ViewComponents is in maintenance mode as of February 2026.
|
|
7
|
+
>
|
|
8
|
+
> Maintenance mode means:
|
|
9
|
+
>
|
|
10
|
+
> * this project is **not accepting new features, components, or significant enhancements.**
|
|
11
|
+
> * the Primer team at GitHub will continue providing:
|
|
12
|
+
> * Security updates
|
|
13
|
+
> * Dependency bumps
|
|
14
|
+
> * Critical/P0 bug fixes
|
|
15
|
+
> * issues, PRs, and discussions / community Q&A remain open, but maintainer response is not guaranteed
|
|
16
|
+
The Primer team continues to focus its resources on strategic investments that help GitHub and its customers to be successful, while making developers’ lives easier. The Primer design system remains a part of this vision through [guidance](https://primer.style/product/ui-patterns/), [tooling](https://primer.style/product/getting-started/react/), and ready-to-use [React](https://primer.style/product/components/) and [web components](https://github.com/github/github-elements).
|
|
17
|
+
>
|
|
18
|
+
> We encourage internal GitHub consumers to plan to migrate from Primer ViewComponents to [Primer React](https://github.com/primer/react).
|
|
19
|
+
>
|
|
20
|
+
> Non-GitHub consumers should consider forking and maintaining a copy of this repo.
|
|
21
|
+
>
|
|
22
|
+
> Questions may be posted on the [maintenance mode announcement](https://github.com/primer/view_components/discussions/3908). Thank you for your support and interest!
|
|
6
23
|
|
|
7
24
|
## Contribution
|
|
8
25
|
|
|
@@ -25,6 +42,8 @@ Primer already provides us with a lot of automation and an advanced test setup.
|
|
|
25
42
|
|
|
26
43
|
Visit [https://primer.style/view_components/](https://primer.style/design/components/) to view the documentation of the Primer ViewComponents.
|
|
27
44
|
|
|
45
|
+
_Note: This library is under active pre-1.0 development. Breaking changes are likely in patch releases._
|
|
46
|
+
|
|
28
47
|
## License
|
|
29
48
|
|
|
30
49
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -22,6 +22,7 @@ import './beta/relative_time';
|
|
|
22
22
|
import './alpha/tab_container';
|
|
23
23
|
import '../../lib/primer/forms/primer_multi_input';
|
|
24
24
|
import '../../lib/primer/forms/primer_text_field';
|
|
25
|
+
import '../../lib/primer/forms/primer_text_area';
|
|
25
26
|
import '../../lib/primer/forms/toggle_switch_input';
|
|
26
27
|
import './alpha/action_menu/action_menu_element';
|
|
27
28
|
import './alpha/select_panel_element';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared character counting functionality for text inputs with character limits.
|
|
3
|
+
* Handles real-time character count updates, validation, and aria-live announcements.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CharacterCounter {
|
|
6
|
+
private inputElement;
|
|
7
|
+
private characterLimitElement;
|
|
8
|
+
private characterLimitSrElement;
|
|
9
|
+
private SCREEN_READER_DELAY;
|
|
10
|
+
private announceTimeout;
|
|
11
|
+
private isInitialLoad;
|
|
12
|
+
constructor(inputElement: HTMLInputElement | HTMLTextAreaElement, characterLimitElement: HTMLElement, characterLimitSrElement: HTMLElement);
|
|
13
|
+
/**
|
|
14
|
+
* Initialize character counting by setting up event listener and initial count
|
|
15
|
+
*/
|
|
16
|
+
initialize(signal?: AbortSignal): void;
|
|
17
|
+
/**
|
|
18
|
+
* Clean up any pending timeouts
|
|
19
|
+
*/
|
|
20
|
+
cleanup(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Pluralizes a word based on the count
|
|
23
|
+
*/
|
|
24
|
+
private pluralize;
|
|
25
|
+
/**
|
|
26
|
+
* Update the character count display and validation state
|
|
27
|
+
*/
|
|
28
|
+
private updateCharacterCount;
|
|
29
|
+
/**
|
|
30
|
+
* Announce character count to screen readers with debouncing
|
|
31
|
+
*/
|
|
32
|
+
private announceToScreenReader;
|
|
33
|
+
/**
|
|
34
|
+
* Set error when character limit is exceeded
|
|
35
|
+
*/
|
|
36
|
+
private setError;
|
|
37
|
+
/**
|
|
38
|
+
* Clear error when back under character limit
|
|
39
|
+
*/
|
|
40
|
+
private clearError;
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class PrimerTextAreaElement extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
inputElement: HTMLTextAreaElement;
|
|
4
|
+
characterLimitElement: HTMLElement;
|
|
5
|
+
characterLimitSrElement: HTMLElement;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
PrimerTextAreaElement: typeof PrimerTextAreaElement;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -15,6 +15,8 @@ export declare class PrimerTextFieldElement extends HTMLElement {
|
|
|
15
15
|
validationErrorIcon: HTMLElement;
|
|
16
16
|
leadingVisual: HTMLElement;
|
|
17
17
|
leadingSpinner: HTMLElement;
|
|
18
|
+
characterLimitElement: HTMLElement;
|
|
19
|
+
characterLimitSrElement: HTMLElement;
|
|
18
20
|
connectedCallback(): void;
|
|
19
21
|
disconnectedCallback(): void;
|
|
20
22
|
clearContents(): void;
|