@wso2/oxygen-ui 0.0.1-alpha.6 → 0.1.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.
Files changed (169) hide show
  1. package/.ai/AGENTS.md +78 -0
  2. package/.ai/components.md +798 -0
  3. package/.ai/migration.md +279 -0
  4. package/.ai/patterns.md +1185 -0
  5. package/.ai/theming.md +318 -0
  6. package/.claude/components.md +798 -0
  7. package/.claude/migration.md +279 -0
  8. package/.claude/patterns.md +1185 -0
  9. package/.claude/skills/oxygen-component/SKILL.md +141 -0
  10. package/.claude/skills/oxygen-form/SKILL.md +410 -0
  11. package/.claude/skills/oxygen-layout/SKILL.md +233 -0
  12. package/.claude/skills/oxygen-migrate/SKILL.md +277 -0
  13. package/.claude/theming.md +318 -0
  14. package/README.md +182 -2
  15. package/bin/cli.js +480 -0
  16. package/dist/animations/ParticleBackground/ParticleBackground.d.ts +66 -0
  17. package/dist/animations/ParticleBackground/index.d.ts +19 -0
  18. package/dist/animations/index.d.ts +18 -0
  19. package/dist/components/AppShell/AppShell.d.ts +69 -0
  20. package/dist/components/AppShell/AppShellFooter.d.ts +41 -0
  21. package/dist/components/AppShell/AppShellMain.d.ts +41 -0
  22. package/dist/components/AppShell/AppShellNavbar.d.ts +41 -0
  23. package/dist/components/AppShell/AppShellNotificationPanel.d.ts +41 -0
  24. package/dist/components/AppShell/AppShellSidebar.d.ts +41 -0
  25. package/dist/components/AppShell/index.d.ts +29 -0
  26. package/dist/components/CodeBlock/CodeBlock.d.ts +47 -0
  27. package/dist/components/CodeBlock/index.d.ts +19 -0
  28. package/dist/components/ColorSchemeImage/index.d.ts +19 -0
  29. package/dist/components/ColorSchemeToggle/index.d.ts +18 -0
  30. package/dist/components/ComplexSelect/ComplexSelect.d.ts +25 -0
  31. package/dist/components/ComplexSelect/ComplexSelectDivider.d.ts +4 -0
  32. package/dist/components/ComplexSelect/ComplexSelectListHeader.d.ts +7 -0
  33. package/dist/components/ComplexSelect/ComplexSelectMenuItem.d.ts +16 -0
  34. package/dist/components/ComplexSelect/ComplexSelectMenuItemAvatar.d.ts +7 -0
  35. package/dist/components/ComplexSelect/ComplexSelectMenuItemIcon.d.ts +7 -0
  36. package/dist/components/ComplexSelect/ComplexSelectMenuItemText.d.ts +8 -0
  37. package/dist/components/ComplexSelect/index.d.ts +21 -0
  38. package/dist/components/Footer/Footer.d.ts +71 -0
  39. package/dist/components/Footer/index.d.ts +19 -0
  40. package/dist/components/Form/CardButton.d.ts +30 -0
  41. package/dist/components/Form/ElementWrapper.d.ts +24 -0
  42. package/dist/components/Form/Section.d.ts +21 -0
  43. package/dist/components/Form/Stack.d.ts +19 -0
  44. package/dist/components/Form/Typography.d.ts +21 -0
  45. package/dist/components/Form/Wizard.d.ts +27 -0
  46. package/dist/components/Form/index.d.ts +38 -0
  47. package/dist/components/Header/Header.d.ts +89 -0
  48. package/dist/components/Header/HeaderActions.d.ts +42 -0
  49. package/dist/components/Header/HeaderBrand.d.ts +48 -0
  50. package/dist/components/Header/HeaderBrandLogo.d.ts +45 -0
  51. package/dist/components/Header/HeaderBrandTitle.d.ts +45 -0
  52. package/dist/components/Header/HeaderSwitchers.d.ts +45 -0
  53. package/dist/components/Header/HeaderToggle.d.ts +52 -0
  54. package/dist/components/Header/context.d.ts +34 -0
  55. package/dist/components/Header/index.d.ts +33 -0
  56. package/dist/components/ListingTable/ListingTable/ListingTable.d.ts +54 -0
  57. package/dist/components/ListingTable/ListingTable/ListingTableBody.d.ts +6 -0
  58. package/dist/components/ListingTable/ListingTable/ListingTableCell.d.ts +15 -0
  59. package/dist/components/ListingTable/ListingTable/ListingTableContainer.d.ts +17 -0
  60. package/dist/components/ListingTable/ListingTable/ListingTableFooter.d.ts +6 -0
  61. package/dist/components/ListingTable/ListingTable/ListingTableHead.d.ts +6 -0
  62. package/dist/components/ListingTable/ListingTable/ListingTableRow.d.ts +18 -0
  63. package/dist/components/ListingTable/ListingTable/index.d.ts +21 -0
  64. package/dist/components/ListingTable/ListingTableProvider.d.ts +28 -0
  65. package/dist/components/ListingTable/context.d.ts +78 -0
  66. package/dist/components/ListingTable/index.d.ts +22 -0
  67. package/dist/components/ListingTable/shared/ListingTableCellIcon.d.ts +31 -0
  68. package/dist/components/ListingTable/shared/ListingTableDensityControl.d.ts +26 -0
  69. package/dist/components/ListingTable/shared/ListingTableEmptyState.d.ts +32 -0
  70. package/dist/components/ListingTable/shared/ListingTableRowActions.d.ts +24 -0
  71. package/dist/components/ListingTable/shared/ListingTableSortLabel.d.ts +37 -0
  72. package/dist/components/ListingTable/shared/ListingTableToolbar.d.ts +52 -0
  73. package/dist/components/ListingTable/shared/index.d.ts +14 -0
  74. package/dist/components/ListingTable/shared/types.d.ts +5 -0
  75. package/dist/components/NotificationBanner/NotificationBanner.d.ts +69 -0
  76. package/dist/components/NotificationBanner/index.d.ts +19 -0
  77. package/dist/components/NotificationPanel/NotificationActions.d.ts +44 -0
  78. package/dist/components/NotificationPanel/NotificationEmptyState.d.ts +41 -0
  79. package/dist/components/NotificationPanel/NotificationHeader.d.ts +47 -0
  80. package/dist/components/NotificationPanel/NotificationHeaderBadge.d.ts +46 -0
  81. package/dist/components/NotificationPanel/NotificationHeaderClose.d.ts +46 -0
  82. package/dist/components/NotificationPanel/NotificationHeaderIcon.d.ts +43 -0
  83. package/dist/components/NotificationPanel/NotificationHeaderTitle.d.ts +43 -0
  84. package/dist/components/NotificationPanel/NotificationItem.d.ts +64 -0
  85. package/dist/components/NotificationPanel/NotificationItemAction.d.ts +46 -0
  86. package/dist/components/NotificationPanel/NotificationItemAvatar.d.ts +44 -0
  87. package/dist/components/NotificationPanel/NotificationItemContext.d.ts +52 -0
  88. package/dist/components/NotificationPanel/NotificationItemMessage.d.ts +47 -0
  89. package/dist/components/NotificationPanel/NotificationItemTimestamp.d.ts +46 -0
  90. package/dist/components/NotificationPanel/NotificationItemTitle.d.ts +49 -0
  91. package/dist/components/NotificationPanel/NotificationList.d.ts +37 -0
  92. package/dist/components/NotificationPanel/NotificationPanel.d.ts +122 -0
  93. package/dist/components/NotificationPanel/NotificationTabs.d.ts +51 -0
  94. package/dist/components/NotificationPanel/context.d.ts +34 -0
  95. package/dist/components/NotificationPanel/index.d.ts +55 -0
  96. package/dist/components/NotificationPanel/utils.d.ts +46 -0
  97. package/dist/components/PageContent/PageContent.d.ts +71 -0
  98. package/dist/components/PageContent/index.d.ts +2 -0
  99. package/dist/components/PageTitle/PageTitle.d.ts +34 -0
  100. package/dist/components/PageTitle/PageTitleAvatar.d.ts +16 -0
  101. package/dist/components/PageTitle/PageTitleHeader.d.ts +16 -0
  102. package/dist/components/PageTitle/PageTitleLink.d.ts +20 -0
  103. package/dist/components/PageTitle/PageTitleSubHeader.d.ts +16 -0
  104. package/dist/components/PageTitle/index.d.ts +27 -0
  105. package/dist/components/SearchBar/SearchBar.d.ts +5 -0
  106. package/dist/components/SearchBar/SearchBarWithAdvancedFilter.d.ts +26 -0
  107. package/dist/components/Sidebar/Sidebar.d.ts +120 -0
  108. package/dist/components/Sidebar/SidebarCategory.d.ts +47 -0
  109. package/dist/components/Sidebar/SidebarCategoryLabel.d.ts +47 -0
  110. package/dist/components/Sidebar/SidebarFooter.d.ts +38 -0
  111. package/dist/components/Sidebar/SidebarItem.d.ts +61 -0
  112. package/dist/components/Sidebar/SidebarItemBadge.d.ts +47 -0
  113. package/dist/components/Sidebar/SidebarItemContext.d.ts +49 -0
  114. package/dist/components/Sidebar/SidebarItemIcon.d.ts +47 -0
  115. package/dist/components/Sidebar/SidebarItemLabel.d.ts +44 -0
  116. package/dist/components/Sidebar/SidebarNav.d.ts +42 -0
  117. package/dist/components/Sidebar/SidebarUser.d.ts +57 -0
  118. package/dist/components/Sidebar/SidebarUserAvatar.d.ts +51 -0
  119. package/dist/components/Sidebar/SidebarUserEmail.d.ts +48 -0
  120. package/dist/components/Sidebar/SidebarUserName.d.ts +45 -0
  121. package/dist/components/Sidebar/context.d.ts +42 -0
  122. package/dist/components/Sidebar/index.d.ts +47 -0
  123. package/dist/components/StatCard/StatCard.d.ts +48 -0
  124. package/dist/components/StatCard/index.d.ts +2 -0
  125. package/dist/components/ThemeSwitcher/ThemeSelect.d.ts +37 -0
  126. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +65 -0
  127. package/dist/components/ThemeSwitcher/index.d.ts +4 -0
  128. package/dist/components/UserMenu/UserMenu.d.ts +74 -0
  129. package/dist/components/UserMenu/index.d.ts +19 -0
  130. package/dist/components/index.d.ts +54 -0
  131. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.d.ts +58 -3
  132. package/dist/contexts/OxygenUIThemeProvider/index.d.ts +20 -0
  133. package/dist/contexts/index.d.ts +19 -0
  134. package/dist/hooks/index.d.ts +22 -0
  135. package/dist/hooks/useAppShell/index.d.ts +19 -0
  136. package/dist/hooks/useAppShell/useAppShell.d.ts +81 -0
  137. package/dist/hooks/useNotifications/index.d.ts +19 -0
  138. package/dist/hooks/useNotifications/useNotifications.d.ts +105 -0
  139. package/dist/hooks/useThemeContent/index.d.ts +18 -0
  140. package/dist/hooks/useThemeContent/useThemeContent.d.ts +57 -0
  141. package/dist/index.d.ts +8 -4
  142. package/dist/index.js +5172 -252
  143. package/dist/index.js.map +4 -4
  144. package/dist/layouts/Layout.d.ts +3 -0
  145. package/dist/layouts/LayoutContent.d.ts +3 -0
  146. package/dist/layouts/LayoutHeader.d.ts +3 -0
  147. package/dist/layouts/LayoutNavbar.d.ts +3 -0
  148. package/dist/layouts/LayoutSidebar.d.ts +3 -0
  149. package/dist/styles/Themes/AcrylicBaseTheme.d.ts +25 -0
  150. package/dist/styles/Themes/AcrylicOrangeTheme.d.ts +17 -0
  151. package/dist/styles/Themes/AcrylicPurpleTheme.d.ts +20 -0
  152. package/dist/styles/Themes/ClassicTheme.d.ts +24 -0
  153. package/dist/styles/Themes/HighContrastTheme.d.ts +20 -0
  154. package/dist/styles/Themes/OxygenThemeBase.d.ts +70 -0
  155. package/dist/styles/Themes/index.d.ts +22 -0
  156. package/dist/styles/index.d.ts +18 -0
  157. package/dist/utils/formatRelativeTime.d.ts +34 -0
  158. package/dist/utils/index.d.ts +19 -0
  159. package/dist/utils/pxToRem.d.ts +23 -0
  160. package/package.json +20 -12
  161. package/dist/components/ColorSchemeImage/ColorSchemeImage.js +0 -57
  162. package/dist/components/ColorSchemeImage/ColorSchemeImage.js.map +0 -7
  163. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js +0 -76
  164. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js.map +0 -7
  165. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js +0 -378
  166. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js.map +0 -7
  167. package/dist/styles/OxygenTheme/OxygenTheme.d.ts +0 -38
  168. package/dist/styles/OxygenTheme/OxygenTheme.js +0 -356
  169. package/dist/styles/OxygenTheme/OxygenTheme.js.map +0 -7
@@ -18,4 +18,7 @@
18
18
  import { BoxProps } from '@mui/material/Box';
19
19
  import type { PropsWithChildren } from 'react';
20
20
  declare function Layout({ children, sx, ...rest }: PropsWithChildren<BoxProps>): import("react/jsx-runtime").JSX.Element;
21
+ declare namespace Layout {
22
+ var displayName: string;
23
+ }
21
24
  export default Layout;
@@ -18,4 +18,7 @@
18
18
  import { BoxProps } from '@mui/material/Box';
19
19
  import type { PropsWithChildren, ReactNode } from 'react';
20
20
  declare function LayoutContent({ children, ...rest }: PropsWithChildren<BoxProps>): ReactNode;
21
+ declare namespace LayoutContent {
22
+ var displayName: string;
23
+ }
21
24
  export default LayoutContent;
@@ -18,4 +18,7 @@
18
18
  import { BoxProps } from '@mui/material/Box';
19
19
  import type { PropsWithChildren, ReactNode } from 'react';
20
20
  declare function LayoutHeader({ children, sx, ...rest }: PropsWithChildren<BoxProps>): ReactNode;
21
+ declare namespace LayoutHeader {
22
+ var displayName: string;
23
+ }
21
24
  export default LayoutHeader;
@@ -17,4 +17,7 @@
17
17
  */
18
18
  import type { PropsWithChildren, ReactNode } from 'react';
19
19
  declare function LayoutNavbar({ children }: PropsWithChildren): ReactNode;
20
+ declare namespace LayoutNavbar {
21
+ var displayName: string;
22
+ }
20
23
  export default LayoutNavbar;
@@ -18,4 +18,7 @@
18
18
  import { BoxProps } from '@mui/material/Box';
19
19
  import type { PropsWithChildren, ReactNode } from 'react';
20
20
  declare function LayoutSidebar({ children, sx, ...rest }: PropsWithChildren<BoxProps>): ReactNode;
21
+ declare namespace LayoutSidebar {
22
+ var displayName: string;
23
+ }
21
24
  export default LayoutSidebar;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type OxygenTheme } from './OxygenThemeBase';
19
+ declare module '@mui/material/styles' {
20
+ interface TypeBackground {
21
+ acrylic?: string;
22
+ }
23
+ }
24
+ declare const _default: OxygenTheme;
25
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { OxygenTheme } from './OxygenThemeBase';
2
+ /**
3
+ * AcrylicOrange Theme - Oxygen Theme with Radial Background Design
4
+ * This theme extends the base AcrylicBaseTheme and adds radial gradient backgrounds
5
+ * that respond to light/dark color schemes.
6
+ *
7
+ * Usage:
8
+ * ```tsx
9
+ * import { OxygenUIThemeProvider, AcrylicOrangeTheme } from '@wso2/oxygen-ui';
10
+ *
11
+ * <OxygenUIThemeProvider theme={AcrylicOrangeTheme}>
12
+ * <App />
13
+ * </OxygenUIThemeProvider>
14
+ * ```
15
+ */
16
+ declare const AcrylicOrangeTheme: OxygenTheme;
17
+ export default AcrylicOrangeTheme;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import type { OxygenTheme } from './OxygenThemeBase';
19
+ declare const AcrylicPurpleTheme: OxygenTheme;
20
+ export default AcrylicPurpleTheme;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type OxygenTheme } from './OxygenThemeBase';
19
+ /**
20
+ * Classic Theme - MUI default theme with custom orange primary color
21
+ * Features: Orange primary (#ff7300), all other MUI defaults preserved
22
+ */
23
+ declare const ClassicTheme: OxygenTheme;
24
+ export default ClassicTheme;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type OxygenTheme } from './OxygenThemeBase';
19
+ declare const HighContrastTheme: OxygenTheme;
20
+ export default HighContrastTheme;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type Theme } from '@mui/material/styles';
19
+ interface CustomThemeProperties {
20
+ blur: {
21
+ light: string;
22
+ medium: string;
23
+ heavy: string;
24
+ };
25
+ border: {
26
+ width: string;
27
+ style: string;
28
+ };
29
+ gradient: {
30
+ primary: string;
31
+ };
32
+ paperTransparent: {
33
+ light: string;
34
+ dark: string;
35
+ };
36
+ syntax: {
37
+ light: {
38
+ background: string;
39
+ text: string;
40
+ comment: string;
41
+ keyword: string;
42
+ string: string;
43
+ function: string;
44
+ number: string;
45
+ operator: string;
46
+ };
47
+ dark: {
48
+ background: string;
49
+ text: string;
50
+ comment: string;
51
+ keyword: string;
52
+ string: string;
53
+ function: string;
54
+ number: string;
55
+ operator: string;
56
+ };
57
+ };
58
+ }
59
+ declare module '@mui/material/styles' {
60
+ interface Theme extends CustomThemeProperties {
61
+ }
62
+ interface ThemeOptions extends Partial<CustomThemeProperties> {
63
+ }
64
+ interface ThemeVars extends CustomThemeProperties {
65
+ }
66
+ }
67
+ export interface OxygenTheme extends Theme, CustomThemeProperties {
68
+ }
69
+ declare const _default: OxygenTheme;
70
+ export default _default;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export { default as OxygenTheme } from './AcrylicBaseTheme';
19
+ export { default as AcrylicOrangeTheme } from './AcrylicOrangeTheme';
20
+ export { default as AcrylicPurpleTheme } from './AcrylicPurpleTheme';
21
+ export { default as ClassicTheme } from './ClassicTheme';
22
+ export { default as HighContrastTheme } from './HighContrastTheme';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export * from './Themes';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * Format a date as a relative time string (e.g., "5 minutes ago").
20
+ *
21
+ * @param date - The date to format
22
+ * @returns A human-readable relative time string
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * formatRelativeTime(new Date(Date.now() - 1000 * 60 * 5));
27
+ * // Returns: "5 minutes ago"
28
+ *
29
+ * formatRelativeTime(new Date(Date.now() - 1000 * 60 * 60 * 2));
30
+ * // Returns: "2 hours ago"
31
+ * ```
32
+ */
33
+ export declare function formatRelativeTime(date: Date): string;
34
+ export default formatRelativeTime;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export { formatRelativeTime } from './formatRelativeTime';
19
+ export { pxToRem } from './pxToRem';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * Helper function to convert px to rem based on base font size (14px)
20
+ * @param size - The size in pixels
21
+ * @returns The size in rem units
22
+ */
23
+ export declare const pxToRem: (size: number) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wso2/oxygen-ui",
3
- "version": "0.0.1-alpha.6",
3
+ "version": "0.1.0",
4
4
  "description": "WSO2 Oxygen UI | Design System - Powered with Material-UI component library with TypeScript support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,14 +18,20 @@
18
18
  "require": "./dist/*.cjs"
19
19
  }
20
20
  },
21
+ "bin": {
22
+ "oxygen-ui": "./bin/cli.js"
23
+ },
21
24
  "files": [
22
25
  "dist",
23
26
  "package.json",
24
- "README.md"
27
+ "README.md",
28
+ ".claude",
29
+ ".ai",
30
+ "bin"
25
31
  ],
26
32
  "sideEffects": [
27
- "src/styles/OxygenTheme/theme.css",
28
- "dist/styles/OxygenTheme/theme.css"
33
+ "src/styles/Themes/theme.css",
34
+ "dist/styles/Themes/theme.css"
29
35
  ],
30
36
  "keywords": [
31
37
  "wso2",
@@ -49,7 +55,9 @@
49
55
  },
50
56
  "homepage": "https://github.com/wso2/oxygen-ui#readme",
51
57
  "dependencies": {
52
- "@fontsource-variable/inter": "5.2.8"
58
+ "@fontsource-variable/inter": "5.2.8",
59
+ "prismjs": "^1.30.0",
60
+ "@wso2/oxygen-ui-icons-react": "0.1.0"
53
61
  },
54
62
  "peerDependencies": {
55
63
  "@emotion/react": "11.14.0",
@@ -60,26 +68,26 @@
60
68
  "@mui/x-date-pickers": "8.16.0",
61
69
  "@mui/x-tree-view": "8.14.0",
62
70
  "date-fns": "4.1.0",
63
- "react": "19.2.1",
64
- "react-dom": "19.2.1",
65
- "@wso2/oxygen-ui-icons-react": "0.0.1-alpha.5"
71
+ "react": "19.2.3",
72
+ "react-dom": "19.2.3"
66
73
  },
67
74
  "devDependencies": {
68
75
  "@eslint/js": "9.39.0",
76
+ "@types/prismjs": "^1.26.5",
69
77
  "@types/react": "19.2.2",
70
78
  "@types/react-dom": "19.2.2",
71
- "@typescript-eslint/eslint-plugin": "7.0.1",
72
- "@typescript-eslint/parser": "7.0.1",
79
+ "@typescript-eslint/eslint-plugin": "8.45.0",
80
+ "@typescript-eslint/parser": "8.45.0",
73
81
  "@vitest/ui": "4.0.6",
74
82
  "esbuild": "0.25.11",
75
83
  "eslint": "9.12.0",
76
84
  "eslint-plugin-react": "7.37.5",
77
- "eslint-plugin-react-hooks": "4.6.2",
85
+ "eslint-plugin-react-hooks": "5.2.0",
78
86
  "rimraf": "6.1.0",
79
87
  "typescript": "5.9.3",
80
88
  "vite": "7.1.12",
81
89
  "vitest": "4.0.6",
82
- "@wso2/esbuild-plugin-inline-css-fonts": "0.0.1-alpha.5"
90
+ "@wso2/esbuild-plugin-inline-css-fonts": "0.0.1"
83
91
  },
84
92
  "publishConfig": {
85
93
  "access": "public"
@@ -1,57 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
-
30
- // src/components/ColorSchemeImage/ColorSchemeImage.tsx
31
- import Box from "@mui/material/Box";
32
- import { useColorScheme } from "@mui/material/styles";
33
- import useMediaQuery from "@mui/material/useMediaQuery";
34
- import { jsx } from "react/jsx-runtime";
35
- function ColorSchemeImage(_a) {
36
- var _b = _a, { src, alt, width = 16, height = 16 } = _b, rest = __objRest(_b, ["src", "alt", "width", "height"]);
37
- const { mode } = useColorScheme();
38
- const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
39
- let actualMode;
40
- if (mode === "system") {
41
- actualMode = prefersDark ? "dark" : "light";
42
- } else {
43
- actualMode = mode;
44
- }
45
- const imageSrc = actualMode === "dark" ? src.dark : src.light;
46
- let imageAlt;
47
- if (typeof alt === "string") {
48
- imageAlt = alt;
49
- } else {
50
- imageAlt = actualMode === "dark" ? alt.dark : alt.light;
51
- }
52
- return /* @__PURE__ */ jsx(Box, __spreadValues({ component: "img", src: imageSrc, alt: imageAlt, width, height }, rest));
53
- }
54
- export {
55
- ColorSchemeImage as default
56
- };
57
- //# sourceMappingURL=ColorSchemeImage.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ColorSchemeImage/ColorSchemeImage.tsx"],
4
- "sourcesContent": ["/*\n * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport Box, { BoxProps } from '@mui/material/Box';\nimport { useColorScheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport { JSX } from 'react';\n\n/**\n * Represents attributes for different color schemes (light and dark modes).\n */\nexport interface ColorSchemeImageAttribute {\n /** The value for light mode */\n light: string;\n\n /** The value for dark mode */\n dark: string;\n}\n\n/**\n * Props for the ColorSchemeImage component.\n * Extends BoxProps to inherit all Box component properties.\n */\nexport interface ColorSchemeImageProps extends BoxProps {\n /** Source URLs for the icon in different color schemes */\n src: ColorSchemeImageAttribute;\n\n /** Alt text for the icon, can be a string or different text for each color scheme */\n alt: ColorSchemeImageAttribute | string;\n\n /** Width of the icon in pixels or CSS units */\n width?: number | string;\n\n /** Height of the icon in pixels or CSS units */\n height?: number | string;\n}\n\n/**\n * A color scheme image component that automatically switches between light and dark mode variants\n * based on the current color scheme. Supports both automatic system preference detection\n * and manual color scheme selection.\n *\n * @param props - The component props\n * @param props.src - Object containing light and dark mode image sources\n * @param props.alt - Alt text for accessibility, can be a string or object with light/dark variants\n * @param props.width - Icon width, defaults to 16px\n * @param props.height - Icon height, defaults to 16px\n * @param props.rest - Additional props passed to the underlying Box component\n * @returns A color scheme image component that adapts to the current color scheme\n *\n * @example\n * ```tsx\n * <ColorSchemeImage\n * src={{\n * light: '/icons/logo-light.svg',\n * dark: '/icons/logo-dark.svg'\n * }}\n * alt=\"Company Logo\"\n * width={24}\n * height={24}\n * />\n * ```\n *\n * @example\n * ```tsx\n * <ColorSchemeImage\n * src={{\n * light: '/icons/home-light.png',\n * dark: '/icons/home-dark.png'\n * }}\n * alt={{\n * light: 'Home icon (light mode)',\n * dark: 'Home icon (dark mode)'\n * }}\n * />\n * ```\n */\nexport default function ColorSchemeImage({src, alt, width = 16, height = 16, ...rest}: ColorSchemeImageProps): \n JSX.Element {\n\n const {mode} = useColorScheme();\n\n const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');\n\n let actualMode: string | undefined;\n\n if (mode === 'system') {\n actualMode = prefersDark ? 'dark' : 'light';\n } else {\n actualMode = mode;\n }\n\n const imageSrc: string = actualMode === 'dark' ? src.dark : src.light;\n let imageAlt: string;\n\n if (typeof alt === 'string') {\n imageAlt = alt;\n } else {\n imageAlt = actualMode === 'dark' ? alt.dark : alt.light;\n }\n\n return <Box component=\"img\" src={imageSrc} alt={imageAlt} width={width} height={height} {...rest} />;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,OAAO,SAAuB;AAC9B,SAAS,sBAAsB;AAC/B,OAAO,mBAAmB;AAgGjB;AAxBM,SAAR,iBAAkC,IAC3B;AAD2B,eAAC,OAAK,KAAK,QAAQ,IAAI,SAAS,GA5FzE,IA4FyC,IAAuC,iBAAvC,IAAuC,CAAtC,OAAK,OAAK,SAAY;AAG9D,QAAM,EAAC,KAAI,IAAI,eAAe;AAE9B,QAAM,cAAc,cAAc,8BAA8B;AAEhE,MAAI;AAEJ,MAAI,SAAS,UAAU;AACrB,iBAAa,cAAc,SAAS;AAAA,EACtC,OAAO;AACL,iBAAa;AAAA,EACf;AAEA,QAAM,WAAmB,eAAe,SAAS,IAAI,OAAO,IAAI;AAChE,MAAI;AAEJ,MAAI,OAAO,QAAQ,UAAU;AAC3B,eAAW;AAAA,EACb,OAAO;AACL,eAAW,eAAe,SAAS,IAAI,OAAO,IAAI;AAAA,EACpD;AAEA,SAAO,oBAAC,sBAAI,WAAU,OAAM,KAAK,UAAU,KAAK,UAAU,OAAc,UAAoB,KAAM;AACpG;",
6
- "names": []
7
- }
@@ -1,76 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
-
33
- // src/components/ColorSchemeToggle/ColorSchemeToggle.tsx
34
- import { useColorScheme } from "@mui/material/styles";
35
- import IconButton from "@mui/material/IconButton";
36
- import { Moon, Monitor, Sun } from "@wso2/oxygen-ui-icons-react";
37
- import { Tooltip } from "@mui/material";
38
- import { jsx } from "react/jsx-runtime";
39
- var ColorSchemeToggle = (_a) => {
40
- var _b = _a, {
41
- darkModeIcon,
42
- lightModeIcon,
43
- systemModeIcon
44
- } = _b, buttonProps = __objRest(_b, [
45
- "darkModeIcon",
46
- "lightModeIcon",
47
- "systemModeIcon"
48
- ]);
49
- const { mode, setMode } = useColorScheme();
50
- if (!mode) {
51
- return null;
52
- }
53
- const nextMode = (currentMode2) => {
54
- if (currentMode2 === "light") return "dark";
55
- if (currentMode2 === "dark") return "system";
56
- return "light";
57
- };
58
- const currentMode = mode != null ? mode : "system";
59
- const ColorSchemeIcon = () => {
60
- switch (currentMode) {
61
- case "light":
62
- return lightModeIcon != null ? lightModeIcon : /* @__PURE__ */ jsx(Sun, {});
63
- case "dark":
64
- return darkModeIcon != null ? darkModeIcon : /* @__PURE__ */ jsx(Moon, {});
65
- default:
66
- return systemModeIcon != null ? systemModeIcon : /* @__PURE__ */ jsx(Monitor, {});
67
- }
68
- };
69
- return /* @__PURE__ */ jsx(Tooltip, { title: `${currentMode.charAt(0).toUpperCase()}${currentMode.slice(1)} Mode`, children: /* @__PURE__ */ jsx(IconButton, __spreadProps(__spreadValues({}, buttonProps), { onClick: () => setMode(nextMode(currentMode)), children: /* @__PURE__ */ jsx(ColorSchemeIcon, {}) })) });
70
- };
71
- var ColorSchemeToggle_default = ColorSchemeToggle;
72
- export {
73
- ColorSchemeToggle,
74
- ColorSchemeToggle_default as default
75
- };
76
- //# sourceMappingURL=ColorSchemeToggle.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ColorSchemeToggle/ColorSchemeToggle.tsx"],
4
- "sourcesContent": ["/*\n * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { useColorScheme } from '@mui/material/styles';\nimport IconButton, { IconButtonProps } from '@mui/material/IconButton';\nimport { Moon, Monitor, Sun } from '@wso2/oxygen-ui-icons-react';\nimport { Tooltip } from '@mui/material';\n\n/**\n * Props for the ColorSchemeToggle component.\n * @remarks Extends MUI IconButtonProps.\n * @see {@link https://mui.com/material-ui/api/icon-button/#props IconButtonProps}\n */\ninterface ColorSchemeToggleProps extends IconButtonProps {\n darkModeIcon?: React.ReactNode;\n lightModeIcon?: React.ReactNode;\n systemModeIcon?: React.ReactNode;\n}\n\ntype Mode = 'light' | 'dark' | 'system';\n\nexport const ColorSchemeToggle: React.FC<ColorSchemeToggleProps> = ({\n darkModeIcon,\n lightModeIcon,\n systemModeIcon,\n ...buttonProps\n}) => {\n const { mode, setMode } = useColorScheme();\n\n if (!mode) {\n return null;\n }\n\n const nextMode = (currentMode: Mode): Mode => {\n if (currentMode === 'light') return 'dark';\n if (currentMode === 'dark') return 'system';\n return 'light';\n };\n\n const currentMode: Mode = mode ?? 'system';\n\n const ColorSchemeIcon = () => {\n switch (currentMode) {\n case 'light':\n return lightModeIcon ?? <Sun />;\n case 'dark':\n return darkModeIcon ?? <Moon />;\n default:\n return systemModeIcon ?? <Monitor />;\n }\n };\n\n return (\n <Tooltip title={`${currentMode.charAt(0).toUpperCase()}${currentMode.slice(1)} Mode`}>\n <IconButton {...buttonProps} onClick={() => setMode(nextMode(currentMode))}>\n <ColorSchemeIcon />\n </IconButton>\n </Tooltip>\n );\n};\n\nexport default ColorSchemeToggle;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,sBAAsB;AAC/B,OAAO,gBAAqC;AAC5C,SAAS,MAAM,SAAS,WAAW;AACnC,SAAS,eAAe;AAsCQ;AAvBzB,IAAM,oBAAsD,CAAC,OAK9D;AAL8D,eAClE;AAAA;AAAA,IACA;AAAA,IACA;AAAA,EAvCF,IAoCoE,IAI/D,wBAJ+D,IAI/D;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,EAAE,MAAM,QAAQ,IAAI,eAAe;AAEzC,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,CAACA,iBAA4B;AAC5C,QAAIA,iBAAgB,QAAS,QAAO;AACpC,QAAIA,iBAAgB,OAAQ,QAAO;AACnC,WAAO;AAAA,EACT;AAEA,QAAM,cAAoB,sBAAQ;AAElC,QAAM,kBAAkB,MAAM;AAC5B,YAAQ,aAAa;AAAA,MACnB,KAAK;AACH,eAAO,wCAAiB,oBAAC,OAAI;AAAA,MAC/B,KAAK;AACH,eAAO,sCAAgB,oBAAC,QAAK;AAAA,MAC/B;AACE,eAAO,0CAAkB,oBAAC,WAAQ;AAAA,IACtC;AAAA,EACF;AAEA,SACE,oBAAC,WAAQ,OAAO,GAAG,YAAY,OAAO,CAAC,EAAE,YAAY,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC,SAC3E,8BAAC,6CAAe,cAAf,EAA4B,SAAS,MAAM,QAAQ,SAAS,WAAW,CAAC,GACvE,8BAAC,mBAAgB,IACnB,GACF;AAEJ;AAEA,IAAO,4BAAQ;",
6
- "names": ["currentMode"]
7
- }