@dbosoft/nextjs-uicore 1.6.1 → 1.7.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.
@@ -0,0 +1,4 @@
1
+
2
+ > @dbosoft/nextjs-uicore@1.6.0 check-types F:\source\repos\dbosoft\web\react-components\packages\nextjs-uicore
3
+ > tsc --noEmit
4
+
@@ -0,0 +1,5 @@
1
+
2
+ > @dbosoft/nextjs-uicore@1.6.0 lint F:\source\repos\dbosoft\web\react-components\packages\nextjs-uicore
3
+ > echo 'DEPRECATED: skipping lint for nextjs-uicore'
4
+
5
+ 'DEPRECATED: skipping lint for nextjs-uicore'
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @dbosoft/nextjs-uicore
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 164d932: Surface system: WCAG-validated surface composition model.
8
+ - New CSS surface classes (`surface-page`, `surface-page-alt`, `surface-brand-wash`, `surface-brand-bold`, `surface-page-recede`) and child surfaces (`child-container`, `child-zone-light`, `child-zone-dark`, `child-emphasis`)
9
+ - New Tailwind utilities: `text-on-primary`, `text-on-secondary`, `text-on-muted`, `text-on-brand`, `text-on-link`, `decoration-on-link`, `border-child`, `bg-on-brand-emph`
10
+ - Text token migration: `text-content-primary` → `text-on-primary`, `text-content-secondary` → `text-on-secondary`, `text-content-muted` → `text-on-muted`, `text-link` → `text-on-link`
11
+ - Dark mode uses dark blue surfaces (hue 215°) with wide lightness steps
12
+ - 18 surfaces, 90 foreground pairings, 73 AAA + 17 AA, 0 FAIL
13
+ - `bg-surface-*` tokens remain valid for interactive states, overlays, dropdowns
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [164d932]
18
+ - @dbosoft/react-uicore@1.5.0
19
+
20
+ ## 1.6.2
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [e1e8cbf]
25
+ - @dbosoft/react-uicore@1.4.2
26
+
3
27
  ## 1.6.1
4
28
 
5
29
  ### Patch Changes
package/eslint.config.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import react from '@dbosoft/eslint-config/react'
2
-
3
- export default [...react]
1
+ import react from '@dbosoft/eslint-config/react'
2
+
3
+ export default [...react]
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "DEPRECATED: Use @dbosoft/react-uicore/tabs for pure React tabs and @dbosoft/nextjs-site-core/ui/tabs for Next.js integration. All other components (head, subnav, themeselector) are replaced by @dbosoft/nextjs-site-core.",
4
4
  "deprecated": true,
5
5
  "author": "dbosoft",
6
- "version": "1.6.1",
6
+ "version": "1.7.0",
7
7
  "sideEffects": false,
8
8
  "license": "MIT",
9
9
  "exports": {
@@ -23,8 +23,8 @@
23
23
  "react": "^19.0.0",
24
24
  "react-dom": "^19.0.0",
25
25
  "typescript": "^5.8.0",
26
- "@dbosoft/eslint-config": "2.0.0",
27
26
  "@dbosoft/typescript-config": "1.1.0",
27
+ "@dbosoft/eslint-config": "2.0.0",
28
28
  "@dbosoft/web-types": "1.0.0"
29
29
  },
30
30
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@heroicons/react": ">=2.1.0",
40
40
  "clsx": ">=2.1.0",
41
41
  "next-themes": ">=0.4.3",
42
- "@dbosoft/react-uicore": "1.4.1"
42
+ "@dbosoft/react-uicore": "1.5.0"
43
43
  },
44
44
  "scripts": {
45
45
  "check-types": "tsc --noEmit",
@@ -1,25 +1,25 @@
1
- import formatStarCount from './index.js'
2
-
3
- describe('<Subnav /> - formatStarCount', () => {
4
- it('should return zero for an undefined, null, or zero count', () => {
5
- expect(formatStarCount(undefined)).toBe(false)
6
- expect(formatStarCount(null)).toBe(false)
7
- expect(formatStarCount(0)).toBe(false)
8
- })
9
-
10
- it('should return numbers 1 to 999 without formatting', () => {
11
- expect(formatStarCount(1)).toBe('1')
12
- expect(formatStarCount(999)).toBe('999')
13
- })
14
-
15
- it('should abbreviate numbers in the tens of thousands with "k" and a single decimal point', () => {
16
- expect(formatStarCount(1003)).toBe('1.0k')
17
- expect(formatStarCount(1280)).toBe('1.2k')
18
- expect(formatStarCount(15630)).toBe('15.6k')
19
- })
20
-
21
- it('should abbreviate numbers in the hundreds of thousands with "k" and no decimal point', () => {
22
- expect(formatStarCount(100000)).toBe('100k')
23
- expect(formatStarCount(156783)).toBe('156k')
24
- })
25
- })
1
+ import formatStarCount from './index.js'
2
+
3
+ describe('<Subnav /> - formatStarCount', () => {
4
+ it('should return zero for an undefined, null, or zero count', () => {
5
+ expect(formatStarCount(undefined)).toBe(false)
6
+ expect(formatStarCount(null)).toBe(false)
7
+ expect(formatStarCount(0)).toBe(false)
8
+ })
9
+
10
+ it('should return numbers 1 to 999 without formatting', () => {
11
+ expect(formatStarCount(1)).toBe('1')
12
+ expect(formatStarCount(999)).toBe('999')
13
+ })
14
+
15
+ it('should abbreviate numbers in the tens of thousands with "k" and a single decimal point', () => {
16
+ expect(formatStarCount(1003)).toBe('1.0k')
17
+ expect(formatStarCount(1280)).toBe('1.2k')
18
+ expect(formatStarCount(15630)).toBe('15.6k')
19
+ })
20
+
21
+ it('should abbreviate numbers in the hundreds of thousands with "k" and no decimal point', () => {
22
+ expect(formatStarCount(100000)).toBe('100k')
23
+ expect(formatStarCount(156783)).toBe('156k')
24
+ })
25
+ })
@@ -1,25 +1,25 @@
1
- import parseGithubUrl from './index.js'
2
-
3
- describe('<Subnav /> - parseGithubUrl', () => {
4
- it('should gracefully handle an invalid URL', () => {
5
- // Suppress console.warn for this test, we expect warnings
6
- jest.spyOn(console, 'warn')
7
- global.console.warn.mockImplementation(() => {})
8
- expect(parseGithubUrl(undefined)).toBe(false)
9
- expect(parseGithubUrl('blah-blah')).toBe(false)
10
- // Restore console.warn for further tests
11
- global.console.warn.mockRestore()
12
- })
13
-
14
- it('should handle a non-GitHub URL', () => {
15
- expect(parseGithubUrl('https://www.example.com/dbosoft/maxback')).toBe(
16
- false
17
- )
18
- })
19
-
20
- it('should parse the org and repo from a GitHub URL', () => {
21
- const testInput = 'https://www.github.com/dbosoft/maxback'
22
- expect(parseGithubUrl(testInput).repo).toBe('maxback')
23
- expect(parseGithubUrl(testInput).org).toBe('dbosoft')
24
- })
25
- })
1
+ import parseGithubUrl from './index.js'
2
+
3
+ describe('<Subnav /> - parseGithubUrl', () => {
4
+ it('should gracefully handle an invalid URL', () => {
5
+ // Suppress console.warn for this test, we expect warnings
6
+ jest.spyOn(console, 'warn')
7
+ global.console.warn.mockImplementation(() => {})
8
+ expect(parseGithubUrl(undefined)).toBe(false)
9
+ expect(parseGithubUrl('blah-blah')).toBe(false)
10
+ // Restore console.warn for further tests
11
+ global.console.warn.mockRestore()
12
+ })
13
+
14
+ it('should handle a non-GitHub URL', () => {
15
+ expect(parseGithubUrl('https://www.example.com/dbosoft/maxback')).toBe(
16
+ false
17
+ )
18
+ })
19
+
20
+ it('should parse the org and repo from a GitHub URL', () => {
21
+ const testInput = 'https://www.github.com/dbosoft/maxback'
22
+ expect(parseGithubUrl(testInput).repo).toBe('maxback')
23
+ expect(parseGithubUrl(testInput).org).toBe('dbosoft')
24
+ })
25
+ })
@@ -1,4 +1,4 @@
1
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
- <title>GitHub</title>
3
- <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
1
+ <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
+ <title>GitHub</title>
3
+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
4
4
  </svg>
@@ -1,71 +1,71 @@
1
- .root {
2
- display: flex;
3
- padding: 0 32px;
4
- margin: 0 auto;
5
- align-items: center;
6
- list-style: none;
7
-
8
- &.alignRight {
9
- margin-right: 0;
10
- padding-right: 16px;
11
- }
12
- }
13
-
14
- .listItem {
15
- position: relative;
16
- white-space: nowrap;
17
- margin: 0;
18
- padding: 0;
19
- }
20
-
21
- .navLink {
22
- composes: g-type-body-small-strong from global;
23
- position: relative;
24
- padding: 0 16px;
25
- line-height: 2.5rem;
26
- display: flex;
27
- align-items: center;
28
- white-space: nowrap;
29
- }
30
-
31
- .submenuItem {
32
- composes: g-type-body-small-strong from global;
33
- color: var(--black);
34
- }
35
-
36
- .submenuModal {
37
- border-radius: 4px;
38
- box-shadow: 0 8px 12px rgba(37, 38, 45, 0.08);
39
- background: var(--white);
40
- z-index: 1;
41
- display: block;
42
- position: absolute;
43
- top: 100%;
44
- margin: 8px 0 0 0;
45
- padding: 24px;
46
- left: 50%;
47
- transform: translateX(-50%);
48
- list-style: none;
49
-
50
- & li {
51
- & a:hover .text {
52
- text-decoration: underline;
53
- }
54
-
55
- & + li {
56
- margin-top: 6px;
57
- }
58
- }
59
-
60
- &.isCollapsed {
61
- display: none;
62
- }
63
- }
64
-
65
- .verticalDivider {
66
- background: var(--gray-5);
67
- height: 1.75rem;
68
- width: 1px;
69
- margin: 0 8px;
70
- display: block;
71
- }
1
+ .root {
2
+ display: flex;
3
+ padding: 0 32px;
4
+ margin: 0 auto;
5
+ align-items: center;
6
+ list-style: none;
7
+
8
+ &.alignRight {
9
+ margin-right: 0;
10
+ padding-right: 16px;
11
+ }
12
+ }
13
+
14
+ .listItem {
15
+ position: relative;
16
+ white-space: nowrap;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .navLink {
22
+ composes: g-type-body-small-strong from global;
23
+ position: relative;
24
+ padding: 0 16px;
25
+ line-height: 2.5rem;
26
+ display: flex;
27
+ align-items: center;
28
+ white-space: nowrap;
29
+ }
30
+
31
+ .submenuItem {
32
+ composes: g-type-body-small-strong from global;
33
+ color: var(--black);
34
+ }
35
+
36
+ .submenuModal {
37
+ border-radius: 4px;
38
+ box-shadow: 0 8px 12px rgba(37, 38, 45, 0.08);
39
+ background: var(--white);
40
+ z-index: 1;
41
+ display: block;
42
+ position: absolute;
43
+ top: 100%;
44
+ margin: 8px 0 0 0;
45
+ padding: 24px;
46
+ left: 50%;
47
+ transform: translateX(-50%);
48
+ list-style: none;
49
+
50
+ & li {
51
+ & a:hover .text {
52
+ text-decoration: underline;
53
+ }
54
+
55
+ & + li {
56
+ margin-top: 6px;
57
+ }
58
+ }
59
+
60
+ &.isCollapsed {
61
+ display: none;
62
+ }
63
+ }
64
+
65
+ .verticalDivider {
66
+ background: var(--gray-5);
67
+ height: 1.75rem;
68
+ width: 1px;
69
+ margin: 0 8px;
70
+ display: block;
71
+ }
@@ -1,51 +1,51 @@
1
- .root {
2
- position: relative;
3
- margin-left: auto;
4
- }
5
-
6
- .dropdown {
7
- background: var(--white);
8
- border-radius: 4px;
9
- box-shadow: 0 8px 12px rgba(37, 38, 45, 0.08);
10
- margin-top: 8px;
11
- max-height: calc(100vh - 300%);
12
- overflow-y: auto;
13
- padding: 12px 24px 0 24px;
14
- position: absolute;
15
- right: 0;
16
- top: 100%;
17
- width: 256px;
18
- z-index: 1;
19
-
20
- &.isCollapsed {
21
- display: none;
22
- }
23
- }
24
-
25
- .ulElem {
26
- padding: 0;
27
- margin: 0;
28
- list-style: none;
29
- }
30
-
31
- .submenuTitle {
32
- composes: g-type-label from global;
33
- margin: 12px 0 8px 0;
34
- color: var(--gray-3);
35
- }
36
-
37
- .divider {
38
- margin: 12px 0;
39
- border: 0;
40
- padding: 0;
41
- height: 1px;
42
- background: var(--gray-5);
43
- }
44
-
45
- .submenuItem {
46
- composes: g-type-body-small-strong from global;
47
- display: block;
48
- padding: 4px 0;
49
- line-height: 1.6em;
50
- color: var(--black);
51
- }
1
+ .root {
2
+ position: relative;
3
+ margin-left: auto;
4
+ }
5
+
6
+ .dropdown {
7
+ background: var(--white);
8
+ border-radius: 4px;
9
+ box-shadow: 0 8px 12px rgba(37, 38, 45, 0.08);
10
+ margin-top: 8px;
11
+ max-height: calc(100vh - 300%);
12
+ overflow-y: auto;
13
+ padding: 12px 24px 0 24px;
14
+ position: absolute;
15
+ right: 0;
16
+ top: 100%;
17
+ width: 256px;
18
+ z-index: 1;
19
+
20
+ &.isCollapsed {
21
+ display: none;
22
+ }
23
+ }
24
+
25
+ .ulElem {
26
+ padding: 0;
27
+ margin: 0;
28
+ list-style: none;
29
+ }
30
+
31
+ .submenuTitle {
32
+ composes: g-type-label from global;
33
+ margin: 12px 0 8px 0;
34
+ color: var(--gray-3);
35
+ }
36
+
37
+ .divider {
38
+ margin: 12px 0;
39
+ border: 0;
40
+ padding: 0;
41
+ height: 1px;
42
+ background: var(--gray-5);
43
+ }
44
+
45
+ .submenuItem {
46
+ composes: g-type-body-small-strong from global;
47
+ display: block;
48
+ padding: 4px 0;
49
+ line-height: 1.6em;
50
+ color: var(--black);
51
+ }
@@ -1,19 +1,19 @@
1
- .root {
2
- color: var(--black);
3
- position: relative;
4
-
5
- &::after {
6
- content: '';
7
- position: absolute;
8
- left: 0;
9
- right: 0;
10
- bottom: 0;
11
- height: 2px;
12
- background: var(--black);
13
- opacity: 0;
14
- }
15
-
16
- &.isActive::after {
17
- opacity: 1;
18
- }
19
- }
1
+ .root {
2
+ color: var(--black);
3
+ position: relative;
4
+
5
+ &::after {
6
+ content: '';
7
+ position: absolute;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ height: 2px;
12
+ background: var(--black);
13
+ opacity: 0;
14
+ }
15
+
16
+ &.isActive::after {
17
+ opacity: 1;
18
+ }
19
+ }
@@ -1,13 +1,13 @@
1
- .root {
2
- --gray-6-transparent: rgba(174, 176, 183, 0.45);
3
- position: sticky;
4
- top: -1px;
5
- z-index: 800;
6
- border-top: 1px solid var(--gray-6-transparent);
7
- border-bottom: 1px solid transparent;
8
- transition: border-bottom-color 0.8s;
9
-
10
- &.isSticky {
11
- border-bottom-color: var(--gray-6-transparent);
12
- }
13
- }
1
+ .root {
2
+ --gray-6-transparent: rgba(174, 176, 183, 0.45);
3
+ position: sticky;
4
+ top: -1px;
5
+ z-index: 800;
6
+ border-top: 1px solid var(--gray-6-transparent);
7
+ border-bottom: 1px solid transparent;
8
+ transition: border-bottom-color 0.8s;
9
+
10
+ &.isSticky {
11
+ border-bottom-color: var(--gray-6-transparent);
12
+ }
13
+ }
@@ -40,7 +40,7 @@ export const TabLink = forwardRef<HTMLAnchorElement, React.PropsWithChildren<{
40
40
  const searchParams = useSearchParams()
41
41
 
42
42
  return <Link prefetch={false} role="tab" {...props} className={clsx(`data-[selected]:border-secondary data-[selected]:text-link-light dark:data-[selected]:text-sky-300`,
43
- `border-transparent text-content-secondary hover:border-secondary hover:text-sky-600 dark:hover:text-sky-200 `,
43
+ `border-transparent text-on-secondary hover:border-secondary hover:text-sky-600 dark:hover:text-sky-200 `,
44
44
  `whitespace-nowrap border-b-2 mx-3 px-2 py-2 text-base font-semibold`)} ref={ref} href={createNavUrl(props.index, props.tabs, pathname, searchParams)}
45
45
  >
46
46
  {props.children}
@@ -63,7 +63,7 @@ const TabsClient: FC<{
63
63
  const searchParams = useSearchParams();
64
64
  const [selectedTab, setSelectedTab] = useState(initialTab);
65
65
 
66
- return <TabGroup className="text-content-primary" manual selectedIndex={selectedTab}
66
+ return <TabGroup className="text-on-primary" manual selectedIndex={selectedTab}
67
67
  defaultIndex={initialTab} onChange={(index) => {
68
68
  router.push(createNavUrl(index, tabs, pathname, searchParams));
69
69
  setSelectedTab(index);
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
- {
2
- "extends": "@dbosoft/typescript-config/nextjs.json",
3
- "compilerOptions": {
4
- "outDir": "dist"
5
- },
6
- "include": ["src"],
7
- "exclude": ["node_modules", "dist"]
1
+ {
2
+ "extends": "@dbosoft/typescript-config/nextjs.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist"
5
+ },
6
+ "include": ["src"],
7
+ "exclude": ["node_modules", "dist"]
8
8
  }