Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
} from '@instructure/ui-buttons/latest'
import { Heading } from '@instructure/ui-heading/latest'
import { Text } from '@instructure/ui-text/latest'
import { InfoInstUIIcon } from '@instructure/ui-icons'
import { useStyleNew } from '@instructure/emotion'

import { DataPermissionLevelsProps } from './props.js'
Expand Down Expand Up @@ -64,7 +65,10 @@ const DataPermissionLevels = ({
return (
<div>
<CondensedButton onClick={() => setOpen(true)} aria-haspopup="dialog">
{triggerText}
<span css={styles?.trigger}>
{triggerText}
<InfoInstUIIcon size="sm" />
</span>
</CondensedButton>
<Modal
size={fullscreen ? 'fullscreen' : 'medium'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type DataPermissionLevelsStyle = ComponentStyle<
| 'currentFeature'
| 'contentContainer'
| 'permissionTitle'
| 'trigger'
> & {
maxWidth?: string
}
Expand Down
19 changes: 16 additions & 3 deletions packages/ui-instructure/src/DataPermissionLevels/v2/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,37 @@
* SOFTWARE.
*/

import type { NewComponentTypes } from '@instructure/ui-themes'
import type { DataPermissionLevelsStyle } from './props'
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
import type {
DataPermissionLevelsProps,
DataPermissionLevelsStyle
} from './props'

/**
* ---
* private: true
* ---
* Generates the style object from the theme and provided additional information
* @param componentTheme The theme variable object.
* @param _props the props of the component, the style is applied to
* @param sharedTokens Shared token object that stores common values for the theme.
* @return The final style object, which will be used in the component
*/
const generateStyle = (
componentTheme: ReturnType<NewComponentTypes['DataPermissionLevels']>
componentTheme: ReturnType<NewComponentTypes['DataPermissionLevels']>,
_props: DataPermissionLevelsProps,
sharedTokens: SharedTokens
): DataPermissionLevelsStyle => {
return {
dataPermissionLevels: {
label: 'data-permission-levels'
},
trigger: {
label: 'data-permission-levels__trigger',
display: 'inline-flex',
alignItems: 'center',
gap: sharedTokens?.spacing.general.spaceXs
},
body: {
label: 'data-permission-levels__body',
display: 'flex',
Expand Down
6 changes: 5 additions & 1 deletion packages/ui-instructure/src/NutritionFacts/v2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
} from '@instructure/ui-buttons/latest'
import { Heading } from '@instructure/ui-heading/latest'
import { Text } from '@instructure/ui-text/latest'
import { InfoInstUIIcon } from '@instructure/ui-icons'
import { useStyleNew } from '@instructure/emotion'

import { NutritionFactsProps } from './props.js'
Expand Down Expand Up @@ -63,7 +64,10 @@ const NutritionFacts = ({
return (
<div>
<CondensedButton onClick={() => setOpen(true)} aria-haspopup="dialog">
{triggerText}
<span css={styles?.trigger}>
{triggerText}
<InfoInstUIIcon size="sm" />
</span>
</CondensedButton>
<Modal
open={open}
Expand Down
1 change: 1 addition & 0 deletions packages/ui-instructure/src/NutritionFacts/v2/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type NutritionFactsStyle = ComponentStyle<
| 'segmentContainer'
| 'blockContainer'
| 'body'
| 'trigger'
> & {
maxWidth?: string
}
Expand Down
16 changes: 13 additions & 3 deletions packages/ui-instructure/src/NutritionFacts/v2/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,31 @@
* SOFTWARE.
*/

import type { NewComponentTypes } from '@instructure/ui-themes'
import type { NutritionFactsStyle } from './props'
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
import type { NutritionFactsProps, NutritionFactsStyle } from './props'

/**
* ---
* private: true
* ---
* Generates the style object from the theme and provided additional information
* @param componentTheme The theme variable object.
* @param _props the props of the component, the style is applied to
* @param sharedTokens Shared token object that stores common values for the theme.
* @return The final style object, which will be used in the component
*/
const generateStyle = (
componentTheme: ReturnType<NewComponentTypes['NutritionFacts']>
componentTheme: ReturnType<NewComponentTypes['NutritionFacts']>,
_props: NutritionFactsProps,
sharedTokens: SharedTokens
): NutritionFactsStyle => {
return {
trigger: {
label: 'nutrition-facts__trigger',
display: 'inline-flex',
alignItems: 'center',
gap: sharedTokens?.spacing.general.spaceXs
},
segmentCard: {
label: 'nutrition-facts__segment-card',
borderStyle: 'solid',
Expand Down
Loading